You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by wasim bhatti <mw...@yahoo.com> on 2005/12/08 08:07:38 UTC

Problem with two input fields in a custom textbox.

Greetings
  i have developed a custom component with two input fields but it is not working properly. The problem is that, in decode method when we use to call setSubmittedValue(), we can only pass one argument in it. Then it updates only one value in the manage bean. The question is how can i update two values in decode method.
  is it a limitation of custom components that we can use only one input field in one custom component?
   
  Regards
  Wasim Bhatti

			
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 

Re: Problem with two input fields in a custom textbox.

Posted by Simon Kitching <sk...@obsidium.com>.
Hi Wasim,

wasim bhatti wrote:
> i have developed a custom component with two input fields but it is not 
> working properly. The problem is that, in *decode *method when we use to 
> call setSubmittedValue(), we can only pass one argument in it. Then it 
> updates only one value in the manage bean. The question is how can i 
> update two values in decode method.
> is it a limitation of custom components that we can use only one input 
> field in one custom component?


Yes, each UIComponent is expected to have only one "value". Of course 
the "value" can be an object with multiple fields.

The single "value" object can be rendered as multiple fields in the 
generated page. And the decode phase can look for multiple submitted 
request parameters and combine them to form a single "value" object to 
be stored as the component's submitted value. But a component can't have 
"multiple values".

Regards,

Simon