Wouldn't it be simpler to just create SelectItems from the submitted values,
in the VCL, and set the backing bean property so they match?  Who needs a
phase listener and why add ALL the values from the picklist, when I have
everything I need in UIInput.getSubmittedValues().  This seems so logical to
me that I'm shocked it isn't widely used in JSF, let alone that JSF takes
the liberty of telling me that my submitted values MUST be members of  the
original List<Selectitem> (the latter I find to be a tremendous gaffe in the
spec).


Mike Kienenberger wrote:
> 
> I guess another possibility would be to add a
> before-validation-phase-listener that temporarily adds the List A
> values to the List B component's allowed choices, then removes them in
> the after phase.
> 
> I think trying to handle this after validation is going to cause too
> many other problems.
> 
> On 4/11/07, monkeyden <[EMAIL PROTECTED]> wrote:
>>
>> I'm implementing a "mover box control", which consists of two select
>> boxes
>> and two mover buttons (Add/Remove).
>> In the valueChangeListener method,  I need to programmatically take the
>> submitted values and create SelectItems out of them.  In order to trick
>> JSF
>> into thinking that they are valid, I'd like to update the model.  This is
>> done to get around the problem of submitted values not being valid when
>> they
>> are not a subset of the original list.  I've tried several of the methods
>> on
>> UIInput and UIViewRoot but none seem to be working correctly.  I know
>> Tomahawk has something like this in the sandbox.  We're using ICEFaces
>> but I
>> think this is a standard JSF question.
>>
>> Thanks for the guidance
>> --
>> View this message in context:
>> http://www.nabble.com/Programatically-updating-the-model-tf3562422.html#a9949895
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Programatically-updating-the-model-tf3562422.html#a10028876
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to