FAQ
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

Search Discussions

  • Martin Marinschek at May 31, 2005 at 8:33 am
    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 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
  • Jan Bols at May 31, 2005 at 9:03 am
    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
    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 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
  • Martin Marinschek at May 31, 2005 at 9:19 am
    why don't you set the index with a value binding?

    regards,

    Martin
    On 5/31/05, Jan Bols 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
    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 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
  • Jan Bols at May 31, 2005 at 9:33 am
    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
    wrote:
    why don't you set the index with a value binding?

    regards,

    Martin
    On 5/31/05, Jan Bols 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
    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 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
  • Martin Marinschek at May 31, 2005 at 10:00 am
    How about putting the x:radio items into a dataList or a dataTable?

    regards,

    Martin
    On 5/31/05, Jan Bols 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
    wrote:
    why don't you set the index with a value binding?

    regards,

    Martin
    On 5/31/05, Jan Bols 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
    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 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
  • Bruno Aranda at May 31, 2005 at 10:10 am
    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 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
    wrote:
    why don't you set the index with a value binding?

    regards,

    Martin
    On 5/31/05, Jan Bols 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
    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 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
  • Jan Bols at May 31, 2005 at 1:06 pm
    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 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 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
    wrote:
    why don't you set the index with a value binding?

    regards,

    Martin
    On 5/31/05, Jan Bols 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
    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 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
  • Jan Bols at Jun 8, 2005 at 11:36 am
    This was solved by putting the selectManyCheckbox inside a facet tag
    inside the column tag of the dataList.

    Greetings
    Jan
    On Tue, 31 May 2005 14:36:42 +0200, Jan Bols wrote:

    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 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 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
    wrote:
    why don't you set the index with a value binding?

    regards,

    Martin
    On 5/31/05, Jan Bols 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
    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 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriesmyfaces
postedMay 31, '05 at 8:08a
activeJun 8, '05 at 11:36a
posts9
users3
websitemyfaces.apache.org

People

Translate

site design / logo © 2019 Grokbase