Hi, I need help with this pages, I had proved with several combinations but i can't get make to work as desired.
I have a page in Web-Content/admin/unidad/default.xhtml:
the content of /admin/unidad/list.xhtml:
the action of the btInsert buttom navigate to /admin/unidad/admin.xhtml:
the content of /admin/templates/admin.xhtml:
This is the situation:
When I'm in the list(/admin/unidad/list/xhtml) and select an item of the "cmbEmpresa" selectOneMenu, the"cmbUnidad" and "cmbCentroCosto" selectOneMenus are rerendered with the new list of SelectItems, thaks ok, but when I click in the "btInsert", the grid is rerendered with filtered values, and when I click it again (the btInsert commandButtom) is when navigate to /admin//unidad/admin.xhtml. The navigation rule have not the redirect directive thus i always see http://localhost:8080/webrctel/admin/unidad/default.html.
Something similar in the /admin/unidad/admin.xhtml page, when the "cmbEmpresa" selectOneMenu changes, the"cmbUnidad" and "cmbCentroCosto" selectOneMenus are rerendered with the new list of SelectItems, but if the "btBack" is clicked, again the same problem, first rerender the seleconemenus ignoring the immediate=true and then, in the second click navigate.
How I can Solve this problem and make them work correctly?
The app is running in Tomcat 6.20, with JSF 1.2_07-b03-FCS.
immediate - for input components, will execute Process Validations phase for this component during Apply Request Values phase. For action components, will execute Invoke Application phase during Apply Request Values phase.
Well. sorry for the bunch of code, i've posted all the code in case the error is in other component.
I'll explain the problen with minimal code...
In a page are severals selectOneMenu, wich are used to filter a data in a rich:dataTable.
When the first (selectOneMenu) is changed, the others selectOneMenu must be rerendered with new data filtred by the first selectOneMenu, but cant rerender the dataTable. That works fine.
When the first selectOneMenu is unchanged, the commandButton do the navigation, but if the selectOneMenu is changed, the commandButton in the first click rerenders the dataTable, and in the second click, is when navigate.
What I whant is when the button is clicked, go ahead with the navigation rather than rerender the grid.
Joined: Aug 03, 2009
a4j:commandButton shouldn't be used for navigation, it fires an Ajax request and does a partial page update. To force a4j:commandButton to navigate you need to set <redirect/> in navigation rules. It's better to use standard h:commandButton for navigation.
Hey, see the problem you are facing is that when you click for the first time on the button to navigate, then what happens is the current page gets loaded first , so you do not go to the desired navigation page. On the second click as the page is already loaded then you can go to the desired navigation page.
Solution : The list and menu list where you facing such problem, there in the reRender property add the current page Form ID , so everytime you use the list/menulist the page gets loaded so when the button pressed for the first time you will navigate to the desired page