• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

c:forEach builds s:selectMany

 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have a problem:
I build this
<blockquote>code:
<pre name="code" class="core"><h:column>
<h:selectManyCheckbox id="n" value="#{bean.selectedItems}" layout="pageDirection">
<c:forEach items="#{bean.list}" var="i" >
<f:selectItem itemLabel="#{i.name}" itemValue="#{i.id}"/>
</c:forEach>
</h:selectManyCheckbox>
</h:column>
</pre>
</blockquote>

but after selecting, only the Items of the LAST column are collected into the list "selectedItems". Is there any possibility to store the selected values elsewhere? My Client-HTML shows individual ID's for every f:selectItem-Tag. When I insert a id:

<blockquote>code:
<pre name="code" class="core"><f:selectItem id="static" itemLabel="#{i.name}" itemValue="#{i.id}"/></pre>
</blockquote>

then the error "duplicate Id for a component.." occurs.

Any ideas? I need to insert the selectItems into the column!
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I mean, "...are collected into the list "selectedItems", when I choose Items. When I choose Items, which are in the other rows, then these does not appear in my list "selectedItems". I use facelets..is there a tag, which ensures me the association between h:selectManyCheckbox and f:selectItem ??
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there an alternative way,
to collect data from the selected checkboxes?

I am not sure bout the many tags,
such as f:attribute, f:param, f:facet or the binding-attribute.

Exists (a best-practice) way
to collect the data independently
from the the component selectManyCheckbox?
 
Saloon Keeper
Posts: 28663
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. Don't use JSTL. JSTL and JSF don't mix well.

Instead of coding logic on your display page, define the display as a JSF datatable.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic