Hi,

by adding a button to submit the value (which did work as expected !) I found 
out, that the button uses a different JScript function to submit.
Adding this to the choice tag produces the following jsp code (see below in 
earlier posts for full jsp and bean code):

  <tc:selectOneChoice valueChangeListener="#{myBean.processValueChange}" 
                            value="#{myBean.choiceValue}" 
                id="combo1" onchange="Tobago.submitAction('combo1');">
       <f:selectItems  value="#{myBean.featureValue_1}" />
  </tc:selectOneChoice>

This code works as expected, i.e. I click on the box, change the value, and 
receive the appropriate event.

Why do I as a Tobago user have to manually add the onchange JavaScript code?
Is this the way it is supposed to work ? I don't have to do it with the buttton 
!

My idea of Tobago was to free me of JavaScript issues, I would have thought 
that Tobago generates the 
appropriate onchange tag as soon as a ChangeListener is set ...

Thanks for your patience with me, but I'd appreciate any comments on this.

Yours,

  Peter
      


> Please post your jsp with the value setted to the bean and the
> corresponding bean code.
> 
> If the former choosen value is resetted to the first entry in the
> list, the binding of the value to the model doesn`t work.
> 
> On 10/6/06, Peter Rabing <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I do get a response, the page is rendered again with the same combo, any 
> > values I selected are resetted to the first entry in the list.
> >
> > I tried setting an initial value, but this doesn't make any difference.
> >
> > I've added a Phase Listener and debugged through it to see in which order 
> > the phases occur:
> >
> > 1. RESTORE_VIEW
> > 2. APPLY_REQUEST_VALUES
> > 3. RENDER_RESPONSE
> >
> > I don't know how that is possible, I would have expected a "Process 
> > Validation" phase after which me listener should be called.
> >
> > Any ideas ?
> >
> > Thanks,
> >
> > Peter
> >
> > > Hi,
> > >
> > > have you put any message/messages-tag into the page, to see if there
> > > comes some message from the jsf environment?
> > >
> > > Also set the "value" attribute of selectOneChoice to a value in the
> > > managed bean., like "Nabe_Name" or "Kette_Name". Maybe thats the
> > > problem.
> > >
> > > cheers,
> > >
> > > Gerald
> > >
> > > > Hi,
> > > >
> > > > "submit() " or "submit();" makes no difference, the form is submitted 
> > > > when a value in the combo is
> > > > selected, sorry that I wasn't clear on this in my first post.
> > > >
> > > > My Bean does implement
> > > >
> > > > public void processValueChange(javax.faces.event.ValueChangeEvent 
> > > > valueChangeEvent) {
> > > >
> > > >     log.fine("*************\n**********\nreceived value change event 
> > > > "+valueChangeEvent);
> > > >
> > > >     throw new IllegalStateException("************ This can't be true 
> > > > **********");
> > > > }
> > > >
> > > > And the form is rendered in the HTML, too.
> > > >
> > > > The bean is called to retrieve the values of the combo:
> > > >
> > > > public SelectItem[] getFeatureValue_1() {
> > > >         SelectItem [] items = new SelectItem [2];
> > > >
> > > >         items[0] = new SelectItem( "Nabe_Name",     "Nabenschaltung", 
> > > > "a desc");
> > > >         items[1] = new SelectItem( "Kette_Name",    "Kettenschaltung", 
> > > > "a desc");
> > > >
> > > >         return items;
> > > > }
> > > >
> > > > The whole page is fairly stripped down now, but it still doesn' work:
> > > >
> > > > <f:view >
> > > >   <tc:page label="Page Title" id="page"  >
> > > >     <tc:panel>
> > > >       <f:facet name="layout">
> > > >         <tc:gridLayout border="0" rows="20px;fixed;*" />
> > > >       </f:facet>
> > > >
> > > >       <tc:out escape="false" value="Statisch" />
> > > >
> > > >       <tc:selectOneChoice 
> > > > valueChangeListener="#{mybean.processValueChange}" onchange="submit();" 
> > > > value="">
> > > >             <f:selectItems value="#{mybean.featureValue_1}" />
> > > >       </tc:selectOneChoice>
> > > >
> > > >      </tc:panel>
> > > >   </tc:page>
> > > > </f:view>
> > > >
> > > >
> > > > Any other ideas ?
> > > >
> > > > Thank you very much,
> > > >
> > > > Peter
> > > >
> > > > >
> > > > > Does your bean implement the method   public void
> > > > > processValueChange(javax.faces.event.ValueChangeEvent event) {...} ?
> > > > >
> > > > > and
> > > > >
> > > > > Is the form rendered in the HTML output ? May be missing <h:form> ?
> > > > >
> > > > > regards
> > > > >
> > > > > Marco
> > > > >
> > > > > --
> > > > > http://www.lenses-price-comparison.com
> > > > > http://www.perfume-price-comparison.com
> > > > >
> > > > >
> > > > >
> > > > > Peter Rabing schrieb:
> > > > > > Hi,
> > > > > >
> > > > > > I am trying to install a changelistener on a combo box. But 
> > > > > > unfortunately, nothing happens, no listener is called.
> > > > > > The box is rendered correctly, and has the correct values on click 
> > > > > > it is submitted, but the listener is never called and no exception 
> > > > > > occurs:
> > > > > >
> > > > > >  <tc:selectOneChoice 
> > > > > > valueChangeListener="#{mybean.processValueChange}" 
> > > > > > onchange="submit() ">
> > > > > >     <f:selectItems value="#{mybean.featureValue_1}" />
> > > > > >  </tc:selectOneChoice>
> > > > > >
> > > > > > My Bean implements the ValueChangeListener interface.
> > > > > >
> > > > > > I guess I am missing something essential here ..
> > > > > >
> > > > > > Thanks for your help.
> > > > > >
> > > > > > Peter
> > > > > >
> >
> > --
> > GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist!
> > NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl
> >
> 
> 
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

Reply via email to