• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using f:ajax in JSF

 
Lav Bull
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic