Refresh page using custom button without ajax and stay on it.
Refresh page using custom button without ajax and stay on it.

I am using a custom button which sends data to a server and then i have to manually refresh my page to show the change.
I want to to be automatic.Is there a way to refresh the page on button click without using ajax
This discussion has been closed.
Answers
Since you didn't post any code or details of what you are doing I'll give a generic answer. In the
success
function of your custom button's ajax request you can update the table data. You can useajax.reload()
or have the server return the updated data and userow().data()
to update the row orrow.add()
to add the row.If you still have questions please provide more details of what you are doing and expect.
Kevin
ok so this is my button which send data to my servlet and i update the table .
I want to know if there is any method or any such thing which will allow me to refresh the page(if possible the datatable) after the button has been clicked.
How are you initially loading the table data? If using
ajax
option you can useajax.reload()
.Kevin
Another option is to have the server return the updated rows then use
rows().remove()
to remove the selected rows followed byrows.add()
to add the returned rows. Something like this:Where
jsonData
is the returned rows. Usedraw()
to update the client table withfalse
to stay on the same page.Kevin
I am loading the table using JDBC. I created a list of orders and used that to get my table in jsp.
There i linked my js file where i implemented the data-table
I am doing my backend in java
Ok, so my second suggestion is the one I would go with.
Kevin
ok.
I will look into it. Thank you