We have a button with a listener. When that button is pressed, first it
should get the values from the 2 fields which are binded to a persisting
property attributes, and then send the value from the date_field as
parameter to annother page .
The problem is that when we modify the 2 fields in the innitial page, when
we cal getParameters() in the listener, we obtain the values from the page
when it was last displayed (the old values).
We are using tapestry 3.

The .html file
 <input jwcid="afterdate_field"/>
 <input jwcid="date_field"/>

<input jwcid="[EMAIL PROTECTED]"
 value="message:button.sendAll"
 listener="ognl:listeners.sendAll"/>

The .page file
 <property-specification name="parameters"
type="DeclarationSelectParameters" persistent="yes"/>

 <component id="date_field" type="DatePicker">
  <binding name="value" expression="parameters.date"/>
  <static-binding name="format" value="dd.MM.yyyy"/>
 </component>

 <component id="afterdate_field" type="Checkbox">
  <binding name="selected" expression="parameters.after"/>
 </component>

The listener
 public void sendAll( IRequestCycle cycle )
    {
        IValidationDelegate delegate = (IValidationDelegate)
getBeans().getBean( "delegate" );

        if ( delegate.getHasErrors() )
        {
            setError(
delegate.getFieldTracking().iterator().next().toString() );
            return;
        }

        Date date = new Date();
        Boolean after = getParameters().isAfter();
        if (!after)
        {
             date = getParameters().getDate();
        }

        cycle.getRequestContext().getRequest().setAttribute( "date", date );

        cycle.activate( "NewPage" );
    }




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

Reply via email to