You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Maniuc <ma...@gmail.com> on 2007/02/20 12:57:36 UTC
Re: [Solved] selectManyCheckbox issue
Hello,
I have the same problem, I think the problem is that you have to take the
value of the selectitem for a valid option
but you only can mark select the item if you put the label, so I create a
SelectItem array with the label
'new SelectItem(mySelectItem.getLabel(), mySelectItem.getLabel())'
and I pass this new SelectItem to the selectManyCheckBox, it works but you
have to use only the labels
ivan_mckin wrote:
>
> hello all,
>
> i'm wondering can anybody else help me with this issue.(please say it’s a
> common problem and easily fixable)
> i have a selectManyCheckbox within a datatable , heres the snippet
>
> <t:column id="checkboxCOL">
> <f:facet name="header">
> <t:selectManyCheckbox id="items" layout="spread"
>
> value="#{supplierProductPortSetEditTab.checkedPortItems}"
> immediate="true">
> <f:selectItems
> value="#{supplierProductPortSetEditTab.availablePortSetSelectItems}"/>
> </t:selectManyCheckbox>
> </f:facet>
> <t:checkbox for="items" index="#{index}"/>
> </t:column>
>
> where checkedPortItems is of type Long[] .
> i get what seems to be the common error of “Value is not a valid option.”
> when I make a submit (commandButton not shown as its irrelevant );
> also the Type in the SelectItems is of Type Long.
> I have tried different Types (Long ,String, int, long) and still no
> success.
> Also when I use a List for checkedPortItems instead of an array of objects
> it still doesn’t help.
>
> removing the selectManyCheckbox from the dataTable and constructing it
> normally also doesn’t help.
> The said datatable is sitting within <t: panelTab>
> I’m using myfaces-api-1.1.3 and myfaces-impl-1.1.3
> With tomahawk tomahawk-1.1.3 (recently upgraded from version 1.1.2 hoping
> the issue would disappear)
>
> Also with tomahawk 1.3 most links appear to break!(such as
> collapsiblePanel link and table sort header links)
>
> Also this isn’t one of those lazy post (normally don’t post as I normally
> resolve issues is good time, am also relatively new to JSF), and I have
> genuinely tried every possible scenario to get this working, but this
> honestly has me perplexed.
>
> Thanks in advance
> Ivan
>
>
--
View this message in context: http://www.nabble.com/selectManyCheckbox-issue-tf1809976.html#a9060467
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: [Solved] selectManyCheckbox issue
Posted by Maniuc <ma...@gmail.com>.
Hi,
you're all right, the returning type is Long[] in my case, is the type of
getValue of the SelectItem
it's my fault
Thank you very much
Gerald Müllan-2 wrote:
>
> Hi,
>
> why do you need immediate="true" on the selectManyCheckbox input
> component?
>
> Normally, returning a Long[] as value of the selectManyCheckbox and
> giving a List of SelectItems (where the value is a Long) should do the
> thing.
>
> Please post the corresponding code of the selectManyCheckbox value and
> the SelectItems list in order to see if something went wrong.
>
> You can also step into the LongConverter to see what is happening.
>
> cheers,
>
> Gerald
>
> On 2/20/07, Maniuc <ma...@gmail.com> wrote:
>>
>> Hello,
>>
>> I have the same problem, I think the problem is that you have to take
>> the
>> value of the selectitem for a valid option
>> but you only can mark select the item if you put the label, so I create a
>> SelectItem array with the label
>> 'new SelectItem(mySelectItem.getLabel(), mySelectItem.getLabel())'
>> and I pass this new SelectItem to the selectManyCheckBox, it works but
>> you
>> have to use only the labels
>>
>>
>> ivan_mckin wrote:
>> >
>> > hello all,
>> >
>> > i'm wondering can anybody else help me with this issue.(please say it's
>> a
>> > common problem and easily fixable)
>> > i have a selectManyCheckbox within a datatable , heres the snippet
>> >
>> > <t:column id="checkboxCOL">
>> > <f:facet name="header">
>> > <t:selectManyCheckbox id="items" layout="spread"
>> >
>> > value="#{supplierProductPortSetEditTab.checkedPortItems}"
>> > immediate="true">
>> > <f:selectItems
>> > value="#{supplierProductPortSetEditTab.availablePortSetSelectItems}"/>
>> > </t:selectManyCheckbox>
>> > </f:facet>
>> > <t:checkbox for="items" index="#{index}"/>
>> > </t:column>
>> >
>> > where checkedPortItems is of type Long[] .
>> > i get what seems to be the common error of "Value is not a valid
>> option."
>> > when I make a submit (commandButton not shown as its irrelevant );
>> > also the Type in the SelectItems is of Type Long.
>> > I have tried different Types (Long ,String, int, long) and still no
>> > success.
>> > Also when I use a List for checkedPortItems instead of an array of
>> objects
>> > it still doesn't help.
>> >
>> > removing the selectManyCheckbox from the dataTable and constructing it
>> > normally also doesn't help.
>> > The said datatable is sitting within <t: panelTab>
>> > I'm using myfaces-api-1.1.3 and myfaces-impl-1.1.3
>> > With tomahawk tomahawk-1.1.3 (recently upgraded from version 1.1.2
>> hoping
>> > the issue would disappear)
>> >
>> > Also with tomahawk 1.3 most links appear to break!(such as
>> > collapsiblePanel link and table sort header links)
>> >
>> > Also this isn't one of those lazy post (normally don't post as I
>> normally
>> > resolve issues is good time, am also relatively new to JSF), and I have
>> > genuinely tried every possible scenario to get this working, but this
>> > honestly has me perplexed.
>> >
>> > Thanks in advance
>> > Ivan
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/selectManyCheckbox-issue-tf1809976.html#a9060467
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
>
>
> --
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
--
View this message in context: http://www.nabble.com/selectManyCheckbox-issue-tf1809976.html#a9069053
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: [Solved] selectManyCheckbox issue
Posted by Gerald Müllan <gm...@apache.org>.
Hi,
why do you need immediate="true" on the selectManyCheckbox input component?
Normally, returning a Long[] as value of the selectManyCheckbox and
giving a List of SelectItems (where the value is a Long) should do the
thing.
Please post the corresponding code of the selectManyCheckbox value and
the SelectItems list in order to see if something went wrong.
You can also step into the LongConverter to see what is happening.
cheers,
Gerald
On 2/20/07, Maniuc <ma...@gmail.com> wrote:
>
> Hello,
>
> I have the same problem, I think the problem is that you have to take the
> value of the selectitem for a valid option
> but you only can mark select the item if you put the label, so I create a
> SelectItem array with the label
> 'new SelectItem(mySelectItem.getLabel(), mySelectItem.getLabel())'
> and I pass this new SelectItem to the selectManyCheckBox, it works but you
> have to use only the labels
>
>
> ivan_mckin wrote:
> >
> > hello all,
> >
> > i'm wondering can anybody else help me with this issue.(please say it's a
> > common problem and easily fixable)
> > i have a selectManyCheckbox within a datatable , heres the snippet
> >
> > <t:column id="checkboxCOL">
> > <f:facet name="header">
> > <t:selectManyCheckbox id="items" layout="spread"
> >
> > value="#{supplierProductPortSetEditTab.checkedPortItems}"
> > immediate="true">
> > <f:selectItems
> > value="#{supplierProductPortSetEditTab.availablePortSetSelectItems}"/>
> > </t:selectManyCheckbox>
> > </f:facet>
> > <t:checkbox for="items" index="#{index}"/>
> > </t:column>
> >
> > where checkedPortItems is of type Long[] .
> > i get what seems to be the common error of "Value is not a valid option."
> > when I make a submit (commandButton not shown as its irrelevant );
> > also the Type in the SelectItems is of Type Long.
> > I have tried different Types (Long ,String, int, long) and still no
> > success.
> > Also when I use a List for checkedPortItems instead of an array of objects
> > it still doesn't help.
> >
> > removing the selectManyCheckbox from the dataTable and constructing it
> > normally also doesn't help.
> > The said datatable is sitting within <t: panelTab>
> > I'm using myfaces-api-1.1.3 and myfaces-impl-1.1.3
> > With tomahawk tomahawk-1.1.3 (recently upgraded from version 1.1.2 hoping
> > the issue would disappear)
> >
> > Also with tomahawk 1.3 most links appear to break!(such as
> > collapsiblePanel link and table sort header links)
> >
> > Also this isn't one of those lazy post (normally don't post as I normally
> > resolve issues is good time, am also relatively new to JSF), and I have
> > genuinely tried every possible scenario to get this working, but this
> > honestly has me perplexed.
> >
> > Thanks in advance
> > Ivan
> >
> >
>
> --
> View this message in context: http://www.nabble.com/selectManyCheckbox-issue-tf1809976.html#a9060467
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>
--
http://www.irian.at
Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German
Professional Support for Apache MyFaces