I solve the problem.

My select is in the component that i update, and this is the problem.
I put mySelection and myForm outside the [EMAIL PROTECTED], and it works.

With this solution i can easily get the value selected.


remarks : on my side, when i use targets instead of elements, it doesn't
work.



Igor Drobiazko wrote:
> 
> Hi, try this
> 
> @EventListener(events="onChange", targets="mySelection")
> 
> You don't need to submit the form. So, submitForm is redundant.
> I would rather update the component "myComponent" within the method
> interceptChangeView()
> by calling ResponseBuilder#updateComponent("myComponent");
> 
> Regards
> 
> 
> On 10/9/07, lolowok <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi,
>>
>> I tried to update a component when a value changes in a Select, but i
>> didn't
>> succeed.
>>
>> How can i do that ?
>>
>> what i tested :
>>
>> <div jwcid="[EMAIL PROTECTED]" renderTag="false">
>> <!-- display some values depends on the selected value in the select -->
>> ...
>>
>> <form jwcid="[EMAIL PROTECTED]" listener="listener:changeView"
>> updateComponents="ognl:{components.myComponent.clientId}">
>> <select jwcid="[EMAIL PROTECTED]" multiple="ognl:false" >
>>        <option jwcid="@Option" selected="ognl:selected[0]" label="0" />
>>        <option jwcid="@Option" selected="ognl:selected[1]" label="1 />
>>        <option jwcid="@Option" selected="ognl:selected[2]" label="2" />
>>        <option jwcid="@Option" selected="ognl:selected[3]" label="3" />
>> </select>
>> </form>
>>
>>
>> My java code :
>>
>>    public void changeView()
>>    {
>>        // initialize new values do display in the component
>>    }
>>
>>    @EventListener(elements = "mySelection", events = "onchange",
>> submitForm="myForm")
>>    public void interceptChangeView()
>>    {
>>    }
>>
>> This solution works only the first time i change the value in the select.
>> But, it doesn't work the next times i change the value.
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-4.1.3--How-to---update-a-component-with-Select-onchange-tf4593877.html#a13114539
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-4.1.3--How-to---update-a-component-with-Select-onchange-tf4593877.html#a13132129
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to