You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by James Hays <ja...@mac.com> on 2003/09/02 20:50:33 UTC

Unable to Update error on Foreach components

I'm hoping somebody can explain this.  I have a page with a Foreach 
component in it.  When I move from that page, via a Submit component, 
and back, via a PageLink component, I get a BindingException:
Unable to update expression 'ipAddress' for 
RouterPage$Enhance_985@15f3ad[Router] to 199.154.41.126.

The ApplicationRuntimeException is:
Page recorder for page Router is locked after a commit(), but received a 
change to property ipAddress of component Router.

ipAddress is a Foreach component contained within the form.
    <property-specification name="ipAddress" type="blah.blah.IpAddress" 
persistent="yes" />

    <component id="IpAddresses" type="Foreach">
        <binding name="source" 
expression="components.PortInterfaces.value.IpAddresses"/>
        <binding name="value" expression="ipAddress"/>
        <binding name="index" expression="ipAddressIndex"/>
    </component>

if I change the persistence to no, I get the error that ipAddress is 
null when I submit the initial form.

Any thoughts why I get this error when I try to reload the page?


Thanks,

James


Re: Unable to Update error on Foreach components

Posted by James Hays <ja...@mac.com>.
I got it working just by removing this from my property-specification 
list and implementing the getters and setters manually.  Any explanation 
as to why this is needed would be appreciated.

Howard M. Lewis Ship wrote:

>You are not allowed to change a persistent property once the render begins.  The Foreach attempts to
>update ipAddress while it renders, causing the fault.
>
>Did the full stack trace not show this?
>
>We are considering relaxing this constraint in release 3.1.
>
>--
>Howard M. Lewis Ship
>Creator, Tapestry: Java Web Components
>http://jakarta.apache.org/tapestry
>http://jakarta.apache.org/commons/sandbox/hivemind/
>http://javatapestry.blogspot.com
>
>  
>
>>-----Original Message-----
>>From: James Hays [mailto:james_hays@mac.com] 
>>Sent: Tuesday, September 02, 2003 2:51 PM
>>To: Tapestry users
>>Subject: Unable to Update error on Foreach components
>>
>>
>>I'm hoping somebody can explain this.  I have a page with a Foreach 
>>component in it.  When I move from that page, via a Submit component, 
>>and back, via a PageLink component, I get a BindingException: 
>>Unable to update expression 'ipAddress' for 
>>RouterPage$Enhance_985@15f3ad[Router] to 199.154.41.126.
>>
>>The ApplicationRuntimeException is:
>>Page recorder for page Router is locked after a commit(), but 
>>received a 
>>change to property ipAddress of component Router.
>>
>>ipAddress is a Foreach component contained within the form.
>>    <property-specification name="ipAddress" 
>>type="blah.blah.IpAddress" 
>>persistent="yes" />
>>
>>    <component id="IpAddresses" type="Foreach">
>>        <binding name="source" 
>>expression="components.PortInterfaces.value.IpAddresses"/>
>>        <binding name="value" expression="ipAddress"/>
>>        <binding name="index" expression="ipAddressIndex"/>
>>    </component>
>>
>>if I change the persistence to no, I get the error that ipAddress is 
>>null when I submit the initial form.
>>
>>Any thoughts why I get this error when I try to reload the page?
>>
>>
>>Thanks,
>>
>>James
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


Re: Unable to Update error on Foreach components

Posted by James Hays <ja...@mac.com>.
Also, why is it trying to do anything when I submit my form other than 
run the listener?  I don't have anything in this form except a bunch of 
Inserts, conditionals, and 3 hidden fields?  The three hidden fields 
should be set and I should get into my listener shouldn't I?

Howard M. Lewis Ship wrote:

>You are not allowed to change a persistent property once the render begins.  The Foreach attempts to
>update ipAddress while it renders, causing the fault.
>
>Did the full stack trace not show this?
>
>We are considering relaxing this constraint in release 3.1.
>
>--
>Howard M. Lewis Ship
>Creator, Tapestry: Java Web Components
>http://jakarta.apache.org/tapestry
>http://jakarta.apache.org/commons/sandbox/hivemind/
>http://javatapestry.blogspot.com
>
>  
>
>>-----Original Message-----
>>From: James Hays [mailto:james_hays@mac.com] 
>>Sent: Tuesday, September 02, 2003 2:51 PM
>>To: Tapestry users
>>Subject: Unable to Update error on Foreach components
>>
>>
>>I'm hoping somebody can explain this.  I have a page with a Foreach 
>>component in it.  When I move from that page, via a Submit component, 
>>and back, via a PageLink component, I get a BindingException: 
>>Unable to update expression 'ipAddress' for 
>>RouterPage$Enhance_985@15f3ad[Router] to 199.154.41.126.
>>
>>The ApplicationRuntimeException is:
>>Page recorder for page Router is locked after a commit(), but 
>>received a 
>>change to property ipAddress of component Router.
>>
>>ipAddress is a Foreach component contained within the form.
>>    <property-specification name="ipAddress" 
>>type="blah.blah.IpAddress" 
>>persistent="yes" />
>>
>>    <component id="IpAddresses" type="Foreach">
>>        <binding name="source" 
>>expression="components.PortInterfaces.value.IpAddresses"/>
>>        <binding name="value" expression="ipAddress"/>
>>        <binding name="index" expression="ipAddressIndex"/>
>>    </component>
>>
>>if I change the persistence to no, I get the error that ipAddress is 
>>null when I submit the initial form.
>>
>>Any thoughts why I get this error when I try to reload the page?
>>
>>
>>Thanks,
>>
>>James
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


RE: Unable to Update error on Foreach components

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
This is where the Hidden component is useful; you can effectively persist the ipAddress property
(give or take) into the form as a hidden field.

You may actually want to replace the Foreach with a ListEdit component (and a ListEditMap helper
instance).

This is more efficient in terms of minimizing server-side state, and also behaves better when the
user hits the browser back button, since there's no server-side state to get out of synch with the
displayed form.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: James Hays [mailto:james_hays@mac.com] 
> Sent: Tuesday, September 02, 2003 4:45 PM
> To: Tapestry users
> Subject: Re: Unable to Update error on Foreach components
> 
> 
> Why does the page render on the initial load of the page?  It 
> only dies 
> when I try and reload the page.
> So what do I need to do to get this to work with no 
> persistence?  Here 
> are the components in question:
>     <component id="IpAddresses" type="Foreach">
>         <binding name="source" 
> expression="components.PortInterfaces.value.IpAddresses"/>
>         <binding name="value" expression="ipAddress"/>
>         <binding name="index" expression="ipAddressIndex"/>
>     </component>
>     <component id="IsPrimaryIp" type="Conditional">
>         <binding name="condition" 
> expression="ipAddress.primaryAddress"/>
>     </component>
>     <component id="IpAddress" type="Insert">
>         <binding name="value" expression="ipAddress.ip"/>
>     </component>
>     <component id="HasPartnerIpAddress" type="Conditional">
>         <binding name="condition" 
> expression="ipAddress.partnerRouter != 
> null"/>
>     </component>
>     <component id="PartnerIpAddress" type="Insert">
>         <binding name="value" 
> expression="ipAddress.partnerIpAddress.ip"/>
>     </component>
>     <component id="PartnerType" type="Insert">
>         <binding name="value" 
> expression="ipAddress.partnerIpAddress.portInterface.routerPor
> t.portType"/>
>     </component>
>     <component id="PartnerPortName" type="Insert">
>         <binding name="value" 
> expression="ipAddress.partnerIpAddress.portInterface.routerPor
> t.portName"/>
>     </component>
>     <component id="PartnerRouterGroup" type="Insert">
>         <binding name="value" 
> expression="ipAddress.partnerIpAddress.portInterface.routerPor
> t.router.headEndGroupNumber"/>
>     </component>
>     <component id="PartnerRouterName" type="Insert">
>         <binding name="value" 
> expression="ipAddress.partnerIpAddress.portInterface.routerPor
> t.router.routerName"/>
>     </component>
>     <component id="PartnerNetLinkCost" type="Insert">
>         <binding name="value" expression="ipAddress.netlink.cost"/>
>     </component>
>     <component id="NetlinkForm" type="Form">
>         <binding name="listener" 
> expression="listeners.runEditNetlink"/>
>     </component>
>     <!--    The next 3 hidden components are for submitting the list 
> indexes needed to get to the netlink-->
>     <component id="HiddenRouterPortIndex" type="Hidden">
>         <binding name="value" expression="routerPortIndex"/>
>     </component>
>     <component id="HiddenPortInterfaceIndex" type="Hidden">
>         <binding name="value" expression="portInterfaceIndex"/>
>     </component>
>     <component id="HiddenIpAddressIndex" type="Hidden">
>         <binding name="value" expression="ipAddressIndex"/>
>     </component>
> 
> When I submit this, I need to get the index values of the 
> three hidden 
> fields.  It works with ipAddress being persisted, but gives 
> me an error 
> stating that ipAddress is null when it is not.
> 
> Howard M. Lewis Ship wrote:
> 
> >You are not allowed to change a persistent property once the render 
> >begins.  The Foreach attempts to update ipAddress while it renders, 
> >causing the fault.
> >
> >Did the full stack trace not show this?
> >
> >We are considering relaxing this constraint in release 3.1.
> >
> >--
> >Howard M. Lewis Ship
> >Creator, Tapestry: Java Web Components 
> >http://jakarta.apache.org/tapestry
> >http://jakarta.apache.org/commons/sandbox/hivemind/
> >http://javatapestry.blogspot.com
> >
> >  
> >
> >>-----Original Message-----
> >>From: James Hays [mailto:james_hays@mac.com]
> >>Sent: Tuesday, September 02, 2003 2:51 PM
> >>To: Tapestry users
> >>Subject: Unable to Update error on Foreach components
> >>
> >>
> >>I'm hoping somebody can explain this.  I have a page with a Foreach
> >>component in it.  When I move from that page, via a Submit 
> component, 
> >>and back, via a PageLink component, I get a BindingException: 
> >>Unable to update expression 'ipAddress' for 
> >>RouterPage$Enhance_985@15f3ad[Router] to 199.154.41.126.
> >>
> >>The ApplicationRuntimeException is:
> >>Page recorder for page Router is locked after a commit(), but
> >>received a 
> >>change to property ipAddress of component Router.
> >>
> >>ipAddress is a Foreach component contained within the form.
> >>    <property-specification name="ipAddress"
> >>type="blah.blah.IpAddress" 
> >>persistent="yes" />
> >>
> >>    <component id="IpAddresses" type="Foreach">
> >>        <binding name="source"
> >>expression="components.PortInterfaces.value.IpAddresses"/>
> >>        <binding name="value" expression="ipAddress"/>
> >>        <binding name="index" expression="ipAddressIndex"/>
> >>    </component>
> >>
> >>if I change the persistence to no, I get the error that ipAddress is
> >>null when I submit the initial form.
> >>
> >>Any thoughts why I get this error when I try to reload the page?
> >>
> >>
> >>Thanks,
> >>
> >>James
> >>
> >>
> >>------------------------------------------------------------
> ---------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> >>
> >>    
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> >
> >  
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


Re: Unable to Update error on Foreach components

Posted by James Hays <ja...@mac.com>.
Why does the page render on the initial load of the page?  It only dies 
when I try and reload the page.
So what do I need to do to get this to work with no persistence?  Here 
are the components in question:
    <component id="IpAddresses" type="Foreach">
        <binding name="source" 
expression="components.PortInterfaces.value.IpAddresses"/>
        <binding name="value" expression="ipAddress"/>
        <binding name="index" expression="ipAddressIndex"/>
    </component>
    <component id="IsPrimaryIp" type="Conditional">
        <binding name="condition" expression="ipAddress.primaryAddress"/>
    </component>
    <component id="IpAddress" type="Insert">
        <binding name="value" expression="ipAddress.ip"/>
    </component>
    <component id="HasPartnerIpAddress" type="Conditional">
        <binding name="condition" expression="ipAddress.partnerRouter != 
null"/>
    </component>
    <component id="PartnerIpAddress" type="Insert">
        <binding name="value" expression="ipAddress.partnerIpAddress.ip"/>
    </component>
    <component id="PartnerType" type="Insert">
        <binding name="value" 
expression="ipAddress.partnerIpAddress.portInterface.routerPort.portType"/>
    </component>
    <component id="PartnerPortName" type="Insert">
        <binding name="value" 
expression="ipAddress.partnerIpAddress.portInterface.routerPort.portName"/>
    </component>
    <component id="PartnerRouterGroup" type="Insert">
        <binding name="value" 
expression="ipAddress.partnerIpAddress.portInterface.routerPort.router.headEndGroupNumber"/>
    </component>
    <component id="PartnerRouterName" type="Insert">
        <binding name="value" 
expression="ipAddress.partnerIpAddress.portInterface.routerPort.router.routerName"/>
    </component>
    <component id="PartnerNetLinkCost" type="Insert">
        <binding name="value" expression="ipAddress.netlink.cost"/>
    </component>
    <component id="NetlinkForm" type="Form">
        <binding name="listener" expression="listeners.runEditNetlink"/>
    </component>
    <!--    The next 3 hidden components are for submitting the list 
indexes needed to get to the netlink-->
    <component id="HiddenRouterPortIndex" type="Hidden">
        <binding name="value" expression="routerPortIndex"/>
    </component>
    <component id="HiddenPortInterfaceIndex" type="Hidden">
        <binding name="value" expression="portInterfaceIndex"/>
    </component>
    <component id="HiddenIpAddressIndex" type="Hidden">
        <binding name="value" expression="ipAddressIndex"/>
    </component>

When I submit this, I need to get the index values of the three hidden 
fields.  It works with ipAddress being persisted, but gives me an error 
stating that ipAddress is null when it is not.

Howard M. Lewis Ship wrote:

>You are not allowed to change a persistent property once the render begins.  The Foreach attempts to
>update ipAddress while it renders, causing the fault.
>
>Did the full stack trace not show this?
>
>We are considering relaxing this constraint in release 3.1.
>
>--
>Howard M. Lewis Ship
>Creator, Tapestry: Java Web Components
>http://jakarta.apache.org/tapestry
>http://jakarta.apache.org/commons/sandbox/hivemind/
>http://javatapestry.blogspot.com
>
>  
>
>>-----Original Message-----
>>From: James Hays [mailto:james_hays@mac.com] 
>>Sent: Tuesday, September 02, 2003 2:51 PM
>>To: Tapestry users
>>Subject: Unable to Update error on Foreach components
>>
>>
>>I'm hoping somebody can explain this.  I have a page with a Foreach 
>>component in it.  When I move from that page, via a Submit component, 
>>and back, via a PageLink component, I get a BindingException: 
>>Unable to update expression 'ipAddress' for 
>>RouterPage$Enhance_985@15f3ad[Router] to 199.154.41.126.
>>
>>The ApplicationRuntimeException is:
>>Page recorder for page Router is locked after a commit(), but 
>>received a 
>>change to property ipAddress of component Router.
>>
>>ipAddress is a Foreach component contained within the form.
>>    <property-specification name="ipAddress" 
>>type="blah.blah.IpAddress" 
>>persistent="yes" />
>>
>>    <component id="IpAddresses" type="Foreach">
>>        <binding name="source" 
>>expression="components.PortInterfaces.value.IpAddresses"/>
>>        <binding name="value" expression="ipAddress"/>
>>        <binding name="index" expression="ipAddressIndex"/>
>>    </component>
>>
>>if I change the persistence to no, I get the error that ipAddress is 
>>null when I submit the initial form.
>>
>>Any thoughts why I get this error when I try to reload the page?
>>
>>
>>Thanks,
>>
>>James
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


RE: Unable to Update error on Foreach components

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
You are not allowed to change a persistent property once the render begins.  The Foreach attempts to
update ipAddress while it renders, causing the fault.

Did the full stack trace not show this?

We are considering relaxing this constraint in release 3.1.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: James Hays [mailto:james_hays@mac.com] 
> Sent: Tuesday, September 02, 2003 2:51 PM
> To: Tapestry users
> Subject: Unable to Update error on Foreach components
> 
> 
> I'm hoping somebody can explain this.  I have a page with a Foreach 
> component in it.  When I move from that page, via a Submit component, 
> and back, via a PageLink component, I get a BindingException: 
> Unable to update expression 'ipAddress' for 
> RouterPage$Enhance_985@15f3ad[Router] to 199.154.41.126.
> 
> The ApplicationRuntimeException is:
> Page recorder for page Router is locked after a commit(), but 
> received a 
> change to property ipAddress of component Router.
> 
> ipAddress is a Foreach component contained within the form.
>     <property-specification name="ipAddress" 
> type="blah.blah.IpAddress" 
> persistent="yes" />
> 
>     <component id="IpAddresses" type="Foreach">
>         <binding name="source" 
> expression="components.PortInterfaces.value.IpAddresses"/>
>         <binding name="value" expression="ipAddress"/>
>         <binding name="index" expression="ipAddressIndex"/>
>     </component>
> 
> if I change the persistence to no, I get the error that ipAddress is 
> null when I submit the initial form.
> 
> Any thoughts why I get this error when I try to reload the page?
> 
> 
> Thanks,
> 
> James
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>