Hi Bernd

i placed <tc:form> around <tx:selectOneChoice/> but still able to see the 
Validation Error

My JSP code after placing <tc:form/> is as below

<tc:panel>
                                <tc:form>
                                <tx:selectOneChoice label="#{bundle.select}" 
                                                    
value="#{checkout.selectedBillingAddress}" 
                                                    id="selectedBillingAddress" 
                                                    
rendered="#{checkout.billToSiteSize > 1}"
                                                    >
                                    <f:selectItem itemValue="0"  itemLabel=" 
--- Select Billing Address --- "/>    
                                    <f:selectItems 
value="#{checkout.billToSites}"/> 
                                    <f:facet name="change">
                                        <tc:command 
actionListener="#{checkout.billingAddressValueChanged}"/>
                                    </f:facet>
                                </tx:selectOneChoice> 
                                </tc:form>
                                <tc:messages></tc:messages>
                            </tc:panel>

ValueChangeListener is never called when i place it in <tx:selectoneChoice/>.

So i placed an actionListener in <tc:command/>.

But when i select any item in the list, the bean is instansiated but the 
setters for this listbox is not called, so thus the value is not set.

So was trying to get the parameter from the request object, but this is not the 
right way, as it will be done by the framework to set the values.

can u send me the java code or else the war file for the example so that i can 
run on my sys to check that out.

thnx

Madan

----- Original Message ----
From: Bernd Bohmann <[EMAIL PROTECTED]>
To: MyFaces Discussion <[email protected]>
Sent: Sunday, 4 February, 2007 5:29:02 PM
Subject: Re: [ Tobago ] Help regarding valueChangelistener

Hello Madan,

I extend the selectOneChoice example with a selectOneChoice that depend 
on an other selectOneChoice.

http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/gendoc/src/main/webapp/screenshot/selectOneChoice.jsp?revision=503396&view=markup

To avoid validation or required messages please surround the 
selectOneChoice with a tc:form. See comment in example page.
The immediate="true" should be removed,

I would suggest to switch the selectItem in the action of the command or 
  in the getter of the getSelectItem method of the depend selectOneChoice.

Bernd

madan chowdary wrote:
> Hi all,
> 
> i am using valueChangeListener with <tx:selectOneChoice/>.
> 
> this part of code
>     <f:facet name="change">
>         <tc:command immediate="true"/>
>     </f:facet>
> is used to submit the page when a item is the listbox selected which alters 
> another <tx:selectOneChoice/> component.
> 
> the JSP code snippet is as below
> 
> <tx:selectOneChoice label="#{bundle.select}"
>     value="#{checkout.selectedBillingAddress}"
>     id="selectedBillingAddress"
>     rendered="#{checkout.billToSiteSize > 1}"
>     valueChangeListener="#{checkout.billingAddressValueChanged}"
>     >
>     <f:selectItems value="#{checkout.billToSites}"/>
>         <f:facet name="change">
>             <tc:command immediate="true"/>
>         </f:facet>
> </tx:selectOneChoice>  
> 
> and the method called for valueChangeListener is as below
> 
> public void billingAddressValueChanged(ValueChangeEvent e){
>     log.debug(" *** billingAddressValueChanged is called *** ");
> }
> 
> When i select a particular method the bean constructor is called, but the 
> method binding to valueChangeListener is never called.
> 
> am using Tobago 1.0.9 .
> 
> Regards,
> Madan
> 
> 
> 
> 
> 
> 
> 
>         
> __________________________________________________________
> Yahoo! India Answers: Share what you know. Learn something new
> http://in.answers.yahoo.com/







                
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/

Reply via email to