You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kevin Menard <ni...@negativetwenty.net> on 2005/03/07 05:36:16 UTC

Another Form Question

Looks like I'm striking out big time with this form I'm working on.  
Sorry for all the traffic.  Apparently, my understanding of the form 
processing cycle is a bit off, because I can't get the following 
scenario to work.

I have something like:

<form jwcid="@Form" listener="ognl:listeners.create" 
delegate="ognl:beans.delegate">
	<tr jwcid="@BillingInfo" customer="ognl:customer"/>
	<tr jwcid="@ShippingInfo" customer="ognl:customer"/>
    . . . .
    . . . .
</form>

And ShippingInfo.jwc has something like the following:

     <parameter name="customer" type="com.servprise.www.models.Customer" 
direction="auto" required="yes"/>

     <bean name="required" 
class="org.apache.tapestry.valid.StringValidator" lifecycle="page">
         <set-property name="required" expression="true"/>
     </bean>

     <component id="shippingName" type="ValidField">
         <static-binding name="displayName" value="Shipping Name"/>
         <binding name="validator" expression="beans.required"/>
         <binding name="value" expression="customer.shippingName"/>
     </component>


Now the problem is, in the create() listener, I assign some values to 
the shipping fields in the customer object.  Then I return from the 
form, causing the page to be redisplayed.  When it redisplays however, 
the items in the ShippingInfo component are not updated.  Well, 
anything that uses validation isn't updated -- "regular" components 
seems to update fine.  This obviously isn't what I would like, but I 
haven't been able to come up with much of a solution.

Any thoughts?

Thanks,
Kevin


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Another Form Question

Posted by Kevin Menard <ni...@negativetwenty.net>.
On Mar 6, 2005, at 11:53 PM, Derick Fernando wrote:

> Hi,
>
> Is the customer property of the page persistent?

Yes, so the values aren't overwritten when the page renders.

-- 
Kevin


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Another Form Question

Posted by Derick Fernando <de...@thelabllc.com>.
Quoting Kevin Menard <ni...@negativetwenty.net>:

> Looks like I'm striking out big time with this form I'm working on.
> Sorry for all the traffic.  Apparently, my understanding of the form
> processing cycle is a bit off, because I can't get the following
> scenario to work.
>
> I have something like:
>
> <form jwcid="@Form" listener="ognl:listeners.create"
> delegate="ognl:beans.delegate">
> 	<tr jwcid="@BillingInfo" customer="ognl:customer"/>
> 	<tr jwcid="@ShippingInfo" customer="ognl:customer"/>
>     . . . .
>     . . . .
> </form>
>
> And ShippingInfo.jwc has something like the following:
>
>      <parameter name="customer" type="com.servprise.www.models.Customer"
> direction="auto" required="yes"/>
>
>      <bean name="required"
> class="org.apache.tapestry.valid.StringValidator" lifecycle="page">
>          <set-property name="required" expression="true"/>
>      </bean>
>
>      <component id="shippingName" type="ValidField">
>          <static-binding name="displayName" value="Shipping Name"/>
>          <binding name="validator" expression="beans.required"/>
>          <binding name="value" expression="customer.shippingName"/>
>      </component>
>
>
> Now the problem is, in the create() listener, I assign some values to
> the shipping fields in the customer object.  Then I return from the
> form, causing the page to be redisplayed.  When it redisplays however,
> the items in the ShippingInfo component are not updated.  Well,
> anything that uses validation isn't updated -- "regular" components
> seems to update fine.  This obviously isn't what I would like, but I
> haven't been able to come up with much of a solution.
>
> Any thoughts?
>
> Thanks,
> Kevin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Hi,

Is the customer property of the page persistent?

........................
Derick Fernando
Lead Architect
TheLab, LLC
http://www.thelabllc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Another Form Question

Posted by Kevin Menard <ni...@negativetwenty.net>.
On 3/6/05 11:36 PM, "Kevin Menard" <ni...@negativetwenty.net> wrote:

> Now the problem is, in the create() listener, I assign some values to
> the shipping fields in the customer object.  Then I return from the
> form, causing the page to be redisplayed.  When it redisplays however,
> the items in the ShippingInfo component are not updated.  Well,
> anything that uses validation isn't updated -- "regular" components
> seems to update fine.  This obviously isn't what I would like, but I
> haven't been able to come up with much of a solution.

Replying to myself on this.  Apparently if a valid component is in error,
its bound value can't be changed.  Clearing the delegate errors before
returning from the listener did the trick.

-- 
Kevin



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org