sorry, one typo

@OnEvent(component = "*selectField*", value = "change")
public void onChange(String value)
{
  System.err.println(value)
}

2008/5/13 Sven Homburg <[EMAIL PROTECTED]>:

> your page class:
>
>     @Property
>     private ValueEnum _selectedItem;
>
>     @Component(parameters = {"model=testModel", "value=selectedItem",
> "event=change", "onCompleteCallback=onSelectCompleteFunction"})
>     @Mixins(value = "t5components/OnEvent")
>     private Select _selectField;
>
>     public SelectModel getTestModel()
>     {
>         return new EnumSelectModel(ValueEnum.class, _messages);
>     }
>
>     @OnEvent(component = "select", value = "change")
>     public void onChange(String value)
>     {
>         System.err.println(value)
>     }
>
> your page template
>
>                 <select t:id="selectField" size="1">
>                     <option value="1">Value 1</option>
>                 </select>
>
> 2008/5/13 Leon Derks <[EMAIL PROTECTED]>:
>
> Hi Chris,
> >
> > Thanks for your answer,
> >
> > this is the other part:
> > <t:select t:id="productSelect" value="productCategory"
> > blankLabel="${message:text-all}" t:mixins="t5components/OnEvent"
> > event="change" />
> >
> > The System.out.println("Value: " + value) in my java code always prints
> > the first selected value. After that always the first value is printed, no
> > matter what value I select.
> >
> > What am I doing wrong?
> >
> > Leon
> >
> >
> > Chris Lewis wrote:
> >
> > > Leon,
> > >
> > > I can't tell from that code where/how you've used the OnEvent mixin. I
> > > see the @OnEvent annotation, but that's unrelated (as you probably
> > > realize). This exact use case was discussed recently - see:
> > >
> > >
> > > http://markmail.org/search/?q=ajax-based+data+retrieval+list%3Aorg.apache.tapestry.users#query:ajax-based%20data%20retrieval%20list%3Aorg.apache.tapestry.users+page:1+mid:5srufbsi5jsrdmu2+state:results
> > >
> > > chris
> > >
> > > Leon Derks wrote:
> > >
> > >
> > > > I want to update a select, based on a value from another select.
> > > >
> > > > I have tried the OnEvent mixin from the t5components, but only the
> > > > first selected value is printed to the screen.
> > > > When I select another value after that, it always prints the first
> > > > selected value.
> > > >
> > > > How can I do this with Tapestry 5 at the moment?
> > > >
> > > > Here is a part of the java page code:
> > > >
> > > > @OnEvent(component = "productSelect", value = "change")
> > > >   Object onProductSelectChanged(String value)
> > > >   {
> > > >    System.out.println("Value: " + value);
> > > >   return null;
> > > > }
> > > >
> > > > Leon
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> with regards
> Sven Homburg
> http://tapestry5-components.googlecode.com




-- 
with regards
Sven Homburg
http://tapestry5-components.googlecode.com

Reply via email to