[prev in list] [next in list] [prev in thread] [next in thread] 

List:       myfaces-user
Subject:    Re: Render items of selectOneRadio in multiple columns
From:       "Jan Bols" <jan () ivpv ! ugent ! be>
Date:       2005-05-31 12:36:42
Message-ID: op.srm3zgpgoqi37p () smtp ! ugent ! be
[Download RAW message or body]

Thanks Bruno and Martin for the tip. I tried to implement this but got the  
following error:

java.lang.IllegalStateException: Could not find component 'interests'  
(calling findComponent on component 'content:_id4:_id50_0:_id52')

The jsp part looks like this:

<x:selectManyCheckbox id="interests"  
value="#{contactHolder.person.interestsList}" layout="spread">
	<f:selectItems value="#{myLists.interests}" />
</x:selectManyCheckbox>

<x:dataList value="#{myLists.interestsIndexes}" var="interestIndex">
	<h:column>
		<x:checkbox for="interests" index="#{interestIndex}" />
	</h:column>
</x:dataList>

It looks like the x:checkbox cannot find the interests component defined  
above it because it's inside a dataList. I found another reference to this  
on the forum but no solution  
(http://www.mail-archive.com/users@myfaces.apache.org/msg03956.html)

Greetings
Jan


On Tue, 31 May 2005 12:09:45 +0200, Bruno Aranda <brunoaranda@gmail.com>  
wrote:

> Or a newspaperTable, where you can put your elements in columns like in a
> newspaper,
>
> Bruno
>
> 2005/5/31, Martin Marinschek <martin.marinschek@gmail.com>:
>>
>> How about putting the x:radio items into a dataList or a dataTable?
>>
>> regards,
>>
>> Martin
>>
>> On 5/31/05, Jan Bols <jan@ivpv.ugent.be> wrote:
>> > Even then, I still don't know how many <x:radio> tags I should provide
>> > because I don't know in advance how many selectItem objects would be  
>> in
>> > the selectItems object of my x:selectOneRadion tag.
>> >
>> > Greetings
>> > Jan
>> >
>> > On Tue, 31 May 2005 11:12:53 +0200, Martin Marinschek
>> > <martin.marinschek@gmail.com> wrote:
>> >
>> > > why don't you set the index with a value binding?
>> > >
>> > > regards,
>> > >
>> > > Martin
>> > >
>> > > On 5/31/05, Jan Bols <jan@ivpv.ugent.be> wrote:
>> > >> Thanks for the reply Martin,
>> > >>
>> > >> the problem is that x:selectOneRadio contains selectItems, not
>> seperate
>> > >> selectItem objects. The selectItems contains a variable amount of
>> > >> selectItem objects so I don't know the index's in advance. This  
>> means
>> I
>> > >> can't set the index attribute in the <x:radio index="???"> tags.
>> > >>
>> > >>
>> > >> Jan
>> > >>
>> > >> On Tue, 31 May 2005 10:32:56 +0200, Martin Marinschek
>> > >> <martin.marinschek@gmail.com> wrote:
>> > >>
>> > >> > You just put the x:selectOneRadio somewhere, and then you can put
>> the
>> > >> > x:radio component wherever you want - it should be as easy as  
>> that.
>> > >> >
>> > >> > Isn't there an example for that in the examples?
>> > >> >
>> > >> > if not, I post my usage of this component in one of my projects
>> below.
>> > >> >
>> > >> > regards,
>> > >> >
>> > >> > Martin
>> > >> >
>> > >> > <x:selectOneRadio id="rangeOrDate"
>> > >> > value="#{eventsFilter.range}" layout="spread">
>> > >> > <f:selectItem itemValue="date" itemLabel="" />
>> > >> > <f:selectItem itemValue="range" itemLabel="" />
>> > >> > </x:selectOneRadio>
>> > >> >
>> > >> > <f:verbatim><td></f:verbatim>
>> > >> > <x:radio for="rangeOrDate" index="0" />
>> > >> > <f:verbatim></td><td
>> > >> > id="inputDateFilterSingleDateEntry"></f:verbatim>
>> > >> > <h:inputText id="singleDate"
>> > >> > value="#{eventsFilter.singleDate}">
>> > >> > <f:convertDateTime pattern="dd.MM.yyyy"/>
>> > >> > </h:inputText>
>> > >> > <f:verbatim><br/></td><td></f:verbatim>
>> > >> > <h:outputText value="Datumsbereich"/>
>> > >> > <f:verbatim></td><td></f:verbatim>
>> > >> > <x:radio for="rangeOrDate" index="1" />
>> > >> > <f:verbatim></td><td
>> > >> > id="labelDateFilterStartDate"></f:verbatim>
>> > >> > <h:outputLabel for="rangeStartDate" value="von" />
>> > >> > <f:verbatim></td><td
>> > >> > id="inputDateFilterStartDateEntry"></f:verbatim>
>> > >> > <h:inputText id="rangeStartDate"
>> > >> > value="#{eventsFilter.rangeStartDate}">
>> > >> > <f:convertDateTime pattern="dd.MM.yyyy"/>
>> > >> > </h:inputText>
>> > >> > <f:verbatim><br/></td><td
>> > >> > id="labelDateFilterEndDate"></f:verbatim>
>> > >> > <h:outputLabel for="rangeEndDate" value="bis" />
>> > >> > <f:verbatim></td><td
>> > >> > id="inputDateFilterEndDateEntry"></f:verbatim>
>> > >> > <h:inputText id="rangeEndDate"
>> > >> > value="#{eventsFilter.rangeEndDate}">
>> > >> > <f:convertDateTime pattern="dd.MM.yyyy"/>
>> > >> > </h:inputText>
>> > >> > <f:verbatim><br></td><td
>> > >> id="inputGroupEntry"></f:verbatim>
>> > >> > <h:selectOneMenu id="currentGroup"
>> > >> > value="#{groupScheduleList.currentScheduleIndex}">
>> > >> > <f:selectItems
>> > >> > value="#{groupScheduleList.groupSchedulesAsSelectItems}"/>
>> > >> > </h:selectOneMenu>
>> > >> > <f:verbatim>
>> > >> > </td>
>> > >> >
>> > >> > On 5/31/05, Jan Bols <jan@ivpv.ugent.be> wrote:
>> > >> >> I'm using an x:selectOneRadio component. I want the different
>> items
>> > >> to
>> > >> >> be
>> > >> >> rendered in 2 columns instead of 1 row or 1 column. The layout
>> > >> attribute
>> > >> >> of this component only allows for the values "pageDirection" and
>> > >> >> "lineDirection" which deosn't allow displaying items in 2  
>> columns.
>> Is
>> > >> >> there another solution or do I have to code my own custom
>> component?
>> > >> >>
>> > >> >> Jan
>> > >> >>
>> > >>
>> > >>
>> > >>
>> >
>> >
>>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic