Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ui:repeat + AJAX  RSS feed

Shashi vardhan reddy
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We create have a list - to be displayed under a panel of the screen where all the code in which the fields are repeatable are kept under a different xhtml file and while i am trying to render an image based on the listener's action for an ajax event i am getting some problem to update the image with id as JSF is generate an id with the index in the middle due to the use of ui:repeat. "repeatForm:repeat:2:redimage"

Now: to use it in a page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns=""
<title>Repeat Test Demo</title>

<h:form id="repeatForm">
<ui:repeat id ="repeat" value="#{listBean.xyzList}" var="repeatListVar">
<p:panel id="genLiabPanelRender">
<ui:include src="MyScreen.xhtml" />
<html xmlns=""

<h:body class="body">

<h:panelGrid columns="4" border="0" width="90%">

<h:panelGroup style="display:block;text-align:left;width: 320px">
<h:selectBooleanCheckbox value="#{repeatListVar.primaryPolicyInd}" />
<hutputText value="#{label.primaryCov}" />

<h:panelGroup style="display:block;text-align:left;width: 240px">
<h:selectBooleanCheckbox value="#{repeatListVar.abcInd1}" />
<hutputText value="#{label.commGenLiab}" />

<h:panelGroup style="display:block;text-align:left;width: 180px">
<hutputText value=" #{label.eachOccur}" style="text-align:left" />

<h:panelGroup style="display:block;text-align:left;width: 130px">
<p:inputMask mask="#{label.limitAmtMask}" id="genLiabEachOccAmt"
value="#{repeatListVar.a25GLEOAmt}" required="true"
style="width: 90px">
<f:ajax event="blur" render="redimage" listener="#{repeatListVar.testA25GLEOAmt}"/>
<h:graphicImage id="redimage" url="/images/icons/redIcon.png" rendered="#{repeatListVar.testA25GLEOAmtInd}" />

This ends up generating ids for the outputText field that look like: repeatForm:repeat:2:redimage. But because we're using the f:ajax tag, we only need to specify "redimage" - the tag takes care of the work of finding out what the real id is.

we are calling a method in the listener and set the value of boolean indicator to either true or false which is false by default.
and the indicator is used to render the image.

but when we are using this f:ajax to render the image based on the indicator value I am getting the error as "malformedXMLuring update repeatForm:repeat:2:redimage not found".

Please let me know why i am getting this error.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!