This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Using f:ajax in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Using f:ajax in JSF" Watch "Using f:ajax in JSF" New topic
Author

Using f:ajax in JSF

Lav Bull
Greenhorn

Joined: May 25, 2013
Posts: 3
Hello guys,
I am badly in need of using f:ajax functionality for my application. I have a form in which I have to use ajax to submit that form and then update another component with this form data that got submitted. The component that is to be updated in my case is a fragment tag.
My code is as follows:

<h:form id="formid">
<h:inputHidden id="" value="#" />
<h:inputHidden id="" value="#" />
<br/>
<h:panelGrid columns="2">
<h:inputText id="someid" value="#{}">
<f:convertDateTime pattern="HH:mm" type="time" />
</h:inputText>
<h:inputText id="someid" value="#{}">
<f:convertDateTime pattern="HH:mm" type="time" />
</h:inputText>
<h:inputText id="someid" value="#{}"/>
</h:panelGrid>
<br/>
<h:commandButton value="Submit" action="#{someaction}" />
<h:commandButton value="Quick search" action="#{}">
<f:ajax execute="formid" render="fragmentid"/>
</h:commandButton>
</h:form>
</h:form>
<ui:fragment rendered="some conditon" id="fragmentid">
<ui:repeat value="some collection" var="individual item" id="someid">
</ui:repeat>
</ui:fragment>


Here the render attribute of f:ajax says id with "fragmentid" not found.
Really I stuck. Need help asap!!

Thanks in advance!! :)
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

Hint: use the Code button to create tags that can be wrapped around your XML and make it easier to read.

I can't see anything wrong with your outline there, so the things I'd look for would be possible mis-spellings or mis-capitalizations of "fragmentid". Also, check to see if ui:fragment is an actual UI element. A good indication is to check its documentation and verify that the "rendered" attribute is indeed allowed for that element type.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
 
subject: Using f:ajax in JSF
 
Similar Threads
Display a Popup instead of an error-message at conversionError
ui:repeat, c:foreach in JSF 2.0
Number of <h:form > tags on a page
dynamic div gets reset
Ajax listener method is not fire for other(except first) component