• 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

f:ajax not working inside c:forEach

 
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 want to use f:ajax inside c:forEach Tag. But it is not working .



How can I make it workable ? If i place the h:inputText outside c:forEach then it works perfectly.
But my textbox are dynamic and they will be generated inside the c:forEach tag block.

 
Saloon Keeper
Posts: 27808
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As a general rule, you should shun JSTL in JSF View definitions. They cause many problems and there are ways to do the same thing in native JSF with less trouble.

When attempting to present a collection of objects in a JSF View, I recommand that you first consider using the h:dataTable tag. For cases where the tabular layout that dataTable provides isn't suitable, the fallback would be the ui:repeat JSF tag.
 
Ifta Khirul
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks for your reply.

I have removed c:forEach and used ui:repeat but still it is not working.



after rendering the view completely if i take the code of the component using firebug or view source - then i get the following code



that means it generated the onkeyup events but it is not executing the backend method.

Any clue ?
 
Tim Holloway
Saloon Keeper
Posts: 27808
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When a backing method won't fire, it's one of the following:

1. The control(s) are not contained in an h:form (yours is, according to your source HTML)

2. Values in one or more of the form controls are invalid (h:messages element will display validation errors)

3. The name of the bean or method is misspelled or miscapitalized (if the method cannot be located, it isn't called and no error is generated).
3a. Same thing applies to the View attribute name (action=, listener= or whatever) that binds the method to the view.

4. The signature of the method is incorrect. In the case of an AJAX action, it should either be "public void saveFactValue()" or "public void saveFactValue(AjaxListenerEvent event)". Or whatever "AjaxListenerEvent" is actually called. I don't remember.
 
Ifta Khirul
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understood the case. But in the current scenario the backend bean method is being called when the textbox is outside ui:repeat tag. Which means that the backend bean configuration are ok.
Anyway thanks for your quick and helpful responses. I will try to investigate more.

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic