This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes how to retrieve all the elements created by ui repeat in backing bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "how to retrieve all the elements created by ui repeat in backing bean" Watch "how to retrieve all the elements created by ui repeat in backing bean" New topic
Author

how to retrieve all the elements created by ui repeat in backing bean

alex dethose
Greenhorn

Joined: May 01, 2009
Posts: 1
hi
I have a list which mantains information for the ui repeat to create either drop down or text box

i would like to retieve all the components created by ui:repeat tag in the backing bean
does any one has a solution for this
This is my jsf code
<div id="homeQuoteCvg">

<ui:repeat value="#{quoteBean.homeCoverageContainer.homePolicyCoverageInfo.basicCvgInfoList}" var="cvgInfo"> <p id="personalliabilityTRbasic">
<LABEL> <SPAN style="WIDTH: 150px" class="Inline">
<hutputText style="cursor: pointer; color: #4aa6ef;" value="#{cvgInfo.cvgDescAbbrv}"/>
</SPAN> <div id="#{cvgInfo.coverageTypeCode}" > <h:selectOneMenu title="#{cvgInfo.coverageTypeCode}" style="backgroundColor : white" value="#{cvgInfo.selectedSeqNum}"
onchange="alert();tabValueChange();"
rendered="#{cvgInfo.cvgAmtUnitCd=='05'}" >
<f:selectItems value="#{cvgInfo.coverageItemList}" />
</h:selectOneMenu>
<hutputText name="cvgCode"
value="#{cvgInfo.selectedAmount}" rendered="#{cvgInfo.cvgAmtUnitCd=='06'}" >
</hutputText>
</div>
</LABEL>
</p>
</ui:repeat> <p>
thanks
alex.
suresh dasari
Ranch Hand

Joined: Oct 05, 2009
Posts: 121

Hi,

now I am facing the same problem, if any one has the solution that would be more helpfull.


Sun Certified Java Programmer with 93 percent
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

Welcome to the JavaRanch, Alex!

There's a "Code" button in the message editor that helps make stuff like what you did more readable.

Rather than use ui:repeat, it looks like you should use a dataTable:


The less raw HTML in a JSF View, the better. I usually use either a 1-column panelGrid or something like RichFaces panel control where you used div, BTW. Or, since the dataTable is itself a block element, I could have just attached the "id=" attribute to the dataTable directly.

Note also that I moved all the style info into column classes. That makes it easier to "skin" the View


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to retrieve all the elements created by ui repeat in backing bean
 
Similar Threads
Problem with selectOneMenu and valueChangedListener
Passing a Parameter via Ajax
problem on saving inputText values
Multipart request problem
How can I dynamically choose which component to use at render-time?