File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Using f:ajax in JSF" Watch "Using f:ajax in JSF" New topic

Using f:ajax in JSF

Lav Bull

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

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: 16909

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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Using f:ajax in JSF
It's not a secret anymore!