You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by monkeyden <mo...@gmail.com> on 2006/11/06 18:07:30 UTC

SelectManyListBox mover box impl

I have been trying to implement two SelectManyListboxs.  The first is to
select from, the second, to submit selected values (also referred to as a
"mover box").  The first is a list of unselected items.  The second list is
initially populated with values selected previously.  Because the second
list doesn't have the complete list of items, when I add one of the
unselected items, I get the validation error:

Validation Error "userLocations": Value is not a valid option.

I have figured out that this is because the newly selected item is not a
member of the original list used in <f:selectItems/>, for the second
SelectManyListbox.

What I'm wondering is:
1.  Is there a way to avoid the validation?
2.  What tenet of the JSF doctrine requires the existence of this
restriction?
-- 
View this message in context: http://www.nabble.com/SelectManyListBox-mover-box-impl-tf2583667.html#a7202710
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: SelectManyListBox mover box impl

Posted by Jeff Bischoff <jb...@klkurz.com>.
Monkeyden,

monkeyden wrote:
 > I happen to be using Tomahawk ATM.  I did see the sandbox component, but
 > wasn't sure if it was compatible with my current version of MyFaces 
(1.1.1).
 > Would I have to go to 1.1.4?

Well you will need your sandbox version to match your tomahawk version. 
So yes, I believe an upgrade would be required.

 > Haven't player around with it yet, so I'm not sure if it's supported (I
 > suspect that it is), but I would also have to set the initial values 
of the
 > "receiving listbox."  The example only shows a default empty receiver.

I am using this component from sandbox myself, and I load the values for 
each box from separate database fields. So yes, you can set both boxes 
initial contents when desired, rather than leaving one of them empty. :)

Basically, you have a regular selectItems list and also an array for the 
selected box. Anything not selected will show up in the other box.

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.


monkeyden wrote:
> I happen to be using Tomahawk ATM.  I did see the sandbox component, but
> wasn't sure if it was compatible with my current version of MyFaces (1.1.1). 
> Would I have to go to 1.1.4?
> 
> Haven't player around with it yet, so I'm not sure if it's supported (I
> suspect that it is), but I would also have to set the initial values of the
> "receiving listbox."  The example only shows a default empty receiver.
> 
> 
> Jeff Bischoff wrote:
>> Monkeyden,
>>
>> There is a component that implements this functionality, currently in 
>> the Sandbox - s:selectManyPicklist. I believe there is also something 
>> like this in Trinidad.
>>
>> Regards,
>>
>> Jeff Bischoff
>> Kenneth L Kurz & Associates, Inc.
>>
>> monkeyden wrote:
>>> I have been trying to implement two SelectManyListboxs.  The first is to
>>> select from, the second, to submit selected values (also referred to as a
>>> "mover box").  The first is a list of unselected items.  The second list
>>> is
>>> initially populated with values selected previously.  Because the second
>>> list doesn't have the complete list of items, when I add one of the
>>> unselected items, I get the validation error:
>>>
>>> Validation Error "userLocations": Value is not a valid option.
>>>
>>> I have figured out that this is because the newly selected item is not a
>>> member of the original list used in <f:selectItems/>, for the second
>>> SelectManyListbox.
>>>
>>> What I'm wondering is:
>>> 1.  Is there a way to avoid the validation?
>>> 2.  What tenet of the JSF doctrine requires the existence of this
>>> restriction?
>>
>>
>>
> 



Re: SelectManyListBox mover box impl

Posted by monkeyden <mo...@gmail.com>.
I happen to be using Tomahawk ATM.  I did see the sandbox component, but
wasn't sure if it was compatible with my current version of MyFaces (1.1.1). 
Would I have to go to 1.1.4?

Haven't player around with it yet, so I'm not sure if it's supported (I
suspect that it is), but I would also have to set the initial values of the
"receiving listbox."  The example only shows a default empty receiver.


Jeff Bischoff wrote:
> 
> Monkeyden,
> 
> There is a component that implements this functionality, currently in 
> the Sandbox - s:selectManyPicklist. I believe there is also something 
> like this in Trinidad.
> 
> Regards,
> 
> Jeff Bischoff
> Kenneth L Kurz & Associates, Inc.
> 
> monkeyden wrote:
>> I have been trying to implement two SelectManyListboxs.  The first is to
>> select from, the second, to submit selected values (also referred to as a
>> "mover box").  The first is a list of unselected items.  The second list
>> is
>> initially populated with values selected previously.  Because the second
>> list doesn't have the complete list of items, when I add one of the
>> unselected items, I get the validation error:
>> 
>> Validation Error "userLocations": Value is not a valid option.
>> 
>> I have figured out that this is because the newly selected item is not a
>> member of the original list used in <f:selectItems/>, for the second
>> SelectManyListbox.
>> 
>> What I'm wondering is:
>> 1.  Is there a way to avoid the validation?
>> 2.  What tenet of the JSF doctrine requires the existence of this
>> restriction?
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/SelectManyListBox-mover-box-impl-tf2583667.html#a7204317
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: SelectManyListBox mover box impl

Posted by Jeff Bischoff <jb...@klkurz.com>.
Monkeyden,

There is a component that implements this functionality, currently in 
the Sandbox - s:selectManyPicklist. I believe there is also something 
like this in Trinidad.

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

monkeyden wrote:
> I have been trying to implement two SelectManyListboxs.  The first is to
> select from, the second, to submit selected values (also referred to as a
> "mover box").  The first is a list of unselected items.  The second list is
> initially populated with values selected previously.  Because the second
> list doesn't have the complete list of items, when I add one of the
> unselected items, I get the validation error:
> 
> Validation Error "userLocations": Value is not a valid option.
> 
> I have figured out that this is because the newly selected item is not a
> member of the original list used in <f:selectItems/>, for the second
> SelectManyListbox.
> 
> What I'm wondering is:
> 1.  Is there a way to avoid the validation?
> 2.  What tenet of the JSF doctrine requires the existence of this
> restriction?