• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I need help with ajaxSingle, reRender and immediate.

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Thanks in advance.>
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should post a simpler example.. to much code.

reRender - points to component id's you want to render (after an Ajax request).

For example:
reRender="id"
or
reRender="id1, id2, id3"
or
reRender="#{bean.renderComponents}"

ajaxSingle - processes only the current component when you fire an Ajax request. No other components on the page will be processed (go thru the life cycle). This article will help you more with ajaxSingle: http://mkblog.exadel.com/ria/richfaces-region-partial-jsf-tree-processing/

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.

Hope this helps...

Max
http://mkblog.exadel.com
 
Fernando Soto Martorell
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Max Katz
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Max
http://mkblog.exadel.com
 
Greenhorn
Posts: 1
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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


Hope this helps.

Cheers,
Rahul Basu
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
do you wrote valuechange listner in backinbean for changing the value when ever you select value from selectonemenu.?
 
reply
    Bookmark Topic Watch Topic
  • New Topic