I have two pages, one page has a command button (page 1)with a backed action event that update the database. The other page has a data table that display the value of that database.(page 2)
When I trigger that command on page 1 and navigate to page two the data table is not updating. I am using primeface (jsf) and ejb.
So I was wondering if Requestcontext.update(":page2:datatable") will update the data table on page two or is there a better way of updating the datatable.
Related
This is a more conceptual question, so I'm not initially submitting any code for it unless someone requests it.
On a current website of mine, I am using a Kendo UI grid to display a table of multiple pages. I also have a (Kendo UI) drop down list, allowing the user to filter rows by class (it reloads the page and makes the necessary edits through the controller).
My problem is this: when the user pages through the Kendo UI grid, it loads a new page and the filtering preferences do not persist. How can I make it either not reload the page(and do everything on the same page instead), or make the drop down box's value persist? Thanks, and tell me if there's any information that would be helpful for me to add!
CLARIFICATION: The functionality is all fine, the only issue is that the dropdownlist does not visually persist.
Actually you can bind both dropdownlist and grid to a single external datasource. This datasource will actually place a ajax call and get the records when the value in drop down changes. As the new records appear in datasource the grid can be refreshed or will automatically refresh without the page reload. Page reload doesn't look like a clean way to filter the grid.
I have a primefaces datatable which has a list of values being displayed. And every row has a Open button which navigates to other page for details and on the same page i have a back button which takes me page to the previous visited page. so it comes to the datatable page which gets refreshed to the original state...it does not maintain the records which the user had searched. My Managed Bean is in viewscope. I want to the records to be maintained even if the user navigates to other pages and comes back to the same page. I tried making the managed bean Session scoped that solves the issue but on page refresh the datatable does not get refreshed .even if we do a Control+refresh it still maintains the same records
I am a newbie with JSF. Currently I have the problem with keeping the state of data-table list pagination.
The problem is when a user edits a row of a list which is not in the first page of data-table, after completing his action, page navigation returns to the first initial page of the list while we need to return to the previous page that user has been editing.
A complete Scenario:
In the list page there are 100 rows of records, and each page shows 20 rows,
User navigates to the 3th page, and selects one of the rows in order to edit the record.
Backing ListBean calls the EditBean that navigate the page to edit page.
User update the record information and backing Editbean calls back the ListBean.
ListBean refresh the Datamodel and navigate back to the list page, but the state of the pagination that user initially had edited is lost.
What is the best approach to return back the page to the previous page that user has been editing?
Myface 1.2.7 and Tomahawk taglib 1.0 has been used in the project. Pages consist of t:dataTable.
Thanks.
I have a JSF page to submit form values to a database. When clicking a button, values are submitted to my ManagedBeans and written to a database via JPA. Then the updated values from the database should be displayed in a dataTable at the same page.
The problem is: The database is too slow, so JSF seems to render the page before those are in the database (thus only rendering the older ones already there). How can I make JSF wait for the database to finish writing the values? I can figure out how to get the current phase of a lifecylce, but not how to stop it...
The problem is: The database is too slow, so JSF seems to render the page before those are in the database (thus only rendering the older ones already there). How can I make JSF wait for the database to finish writing the values?
This makes honestly no sense. JSF just does the job you told it to do in the bean's action method. Apparently you are not reloading the list from the DB after the persist. Perhaps you are referring to that the updated item is only visible when you refresh the page so that a new GET request is fired which reloads the data from the DB.
The canonical approach is to just reload the data from the DB immediately after the save.
public void save() {
someService.save(some); // Save item in DB.
list = someService.list(); // Reload list from DB.
}
I'm trying to get some data from a datatable in rich:modal panel
The whole flow is as follows
When clicking on search button on main page, a modal panel pops up with appropriate data & check box
Till this point the application is working fine
After clicking on ok button, selected data should be populated into main page. This is where the code fails
I tried stuff like getRowData, getValues, etc. but in vain. This could be done by keeping the bean in session scope but I have to keep this bean in request scope using Apache MyFaces JSF 1.2
Two ways comes to mind:
Pass an extra request parameter (the search string and the page number?) so that the bean knows which data to preload.
Make use of MyFaces Orchestra to create a conversation scope which lies in between request and session scope and is exactly the scope you're looking for this particular functional requirement.