You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Denis Ponomarev <oz...@romsat.ua> on 2003/05/12 09:03:57 UTC

Form submitting: Page recorder is locked after a commit()

Hello Tapestry users!

I'm developing custom component which contains Form component.
Outer component has some persistent properties.

I want to change them on inner-form submitting. But _sometimes_ during submit
process exception occures "Page recorder is locked after a
commit()", when I call fireObservedChange for my persistent
properties.

I tried both - to call fireObservedChange from Form-field setters and
from Form listener method. I tried to change all formal
Form-parameters. Nothing helps.

Where is my mistake?

Thanks.

-- 
Denis


Re: Form submitting: Page recorder is locked after a commit()

Posted by Bill Lear <ra...@zopyra.com>.
On Monday, May 12, 2003 at 10:03:57 (+0300) Denis Ponomarev writes:
>Hello Tapestry users!
>
>I'm developing custom component which contains Form component.
>Outer component has some persistent properties.
>
>I want to change them on inner-form submitting. But _sometimes_ during submit
>process exception occures "Page recorder is locked after a
>commit()", when I call fireObservedChange for my persistent
>properties.
>
>I tried both - to call fireObservedChange from Form-field setters and
>from Form listener method. I tried to change all formal
>Form-parameters. Nothing helps.
>
>Where is my mistake?

Howard (or someone else) will need to comment on the whys of this, but
I ran into this last night.  The parameter in question was
accessed/set from a Foreach and I got the same error.  So, I just went
ahead and declared the variable in my Java class and added get/set
methods (removing declaration from .page file).  It worked and I
didn't have time to delve into why.


Bill

Re[5]: Form submitting: Page recorder is locked after a commit()

Posted by Denis Ponomarev <oz...@romsat.ua>.
HMLS>> You must be creating an application with frames; that creates a race condition (another good reason
HMLS>> to relax the constraint on when fireObservedChange() may be invoked).

DP> No, I didn't using a frames.

The problem was in my buggy JavaScript which submits my form twice :)
Sorry.


Re[4]: Form submitting: Page recorder is locked after a commit()

Posted by Denis Ponomarev <oz...@romsat.ua>.
HMLS> You must be creating an application with frames; that creates a race condition (another good reason
HMLS> to relax the constraint on when fireObservedChange() may be invoked).

No, I didn't using a frames.

Thanks. May be I'll find another approach with my buggy component :)


RE: Re[2]: Form submitting: Page recorder is locked after a commit()

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
You must be creating an application with frames; that creates a race condition (another good reason
to relax the constraint on when fireObservedChange() may be invoked).

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Denis Ponomarev [mailto:oz@romsat.ua] 
> Sent: Monday, May 12, 2003 9:13 AM
> To: Tapestry users
> Subject: Re[2]: Form submitting: Page recorder is locked 
> after a commit()
> 
> 
> HMLS> Currently, you may not modify a page's persistent 
> properties once 
> HMLS> rendering begins.  Your last chance to make such 
> modifications is 
> HMLS> in the pageBeginRender() event method.
> 
> I have used this chance. It's good, but not enough: exception 
> still thrown, though not such frequently as it was later.
> 
> Please, look at this:
> 
> 
> ===================================================================
> Page recorder for page Home is locked after a commit(), but 
> received a change to property selectedKey of component 
> Home/locales. Stack Trace:
>  
> org.apache.tapestry.record.PageRecorder.observeChange(PageReco
> rder.java:161) 
> org.apache.tapestry.AbstractComponent.fireObservedChange(Abstr
> actComponent.java:328) 
> myPackage.MyComponent.setSelectedKey(MyComponent.java:111)
> myPackage.myComponent.pageBeginRender(PersistentTable.java:175)
> org.apache.tapestry.AbstractPage.firePageBeginRender(AbstractP
> age.java:487) 
> org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:322)
> org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycl
> e.java:411) 
> org.apache.tapestry.engine.AbstractEngine.renderResponse(Abstr
> actEngine.java:740) 
> org.apache.tapestry.engine.DirectService.service(DirectService
> .java:216) 
> org.apache.tapestry.engine.AbstractEngine.service(AbstractEngi
> ne.java:878) 
> org.apache.tapestry.ApplicationServlet.doService(ApplicationSe
> rvlet.java:238) 
> org.apache.tapestry.ApplicationServlet.doPost(ApplicationServl
> et.java:367)  
> ===================================================================
> 
> I'm using Tapestry version 2.4-alpha-5.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


Re[2]: Form submitting: Page recorder is locked after a commit()

Posted by Denis Ponomarev <oz...@romsat.ua>.
HMLS> Currently, you may not modify a page's persistent properties once rendering begins.  Your last
HMLS> chance to make such modifications is in the pageBeginRender() event method.

I have used this chance. It's good, but not enough: exception still thrown, though not such
frequently as it was later.

Please, look at this:


===================================================================
Page recorder for page Home is locked after a commit(), but received a change to property selectedKey
of component Home/locales.
Stack Trace:
 
org.apache.tapestry.record.PageRecorder.observeChange(PageRecorder.java:161) 
org.apache.tapestry.AbstractComponent.fireObservedChange(AbstractComponent.java:328) 
myPackage.MyComponent.setSelectedKey(MyComponent.java:111)
myPackage.myComponent.pageBeginRender(PersistentTable.java:175)
org.apache.tapestry.AbstractPage.firePageBeginRender(AbstractPage.java:487) 
org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:322)
org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:411) 
org.apache.tapestry.engine.AbstractEngine.renderResponse(AbstractEngine.java:740) 
org.apache.tapestry.engine.DirectService.service(DirectService.java:216) 
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:878) 
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:238) 
org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:367)  
===================================================================

I'm using Tapestry version 2.4-alpha-5.


RE: Form submitting: Page recorder is locked after a commit()

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
Currently, you may not modify a page's persistent properties once rendering begins.  Your last
chance to make such modifications is in the pageBeginRender() event method.

It is possible that this will be relaxed in 3.0 or 3.1.  The reason for this limitation is to allow
persistent page properties to be stored as HTTP cookies instead of as HttpSession attributes.
However, that's looking increasingly impractical, because of typical limitations on the size and
number of cookies that may be stored in a client web browser or passed through a firewall.


--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Denis Ponomarev [mailto:oz@romsat.ua] 
> Sent: Monday, May 12, 2003 3:04 AM
> To: Tapestry users
> Subject: Form submitting: Page recorder is locked after a commit()
> 
> 
> Hello Tapestry users!
> 
> I'm developing custom component which contains Form 
> component. Outer component has some persistent properties.
> 
> I want to change them on inner-form submitting. But 
> _sometimes_ during submit process exception occures "Page 
> recorder is locked after a commit()", when I call 
> fireObservedChange for my persistent properties.
> 
> I tried both - to call fireObservedChange from Form-field 
> setters and from Form listener method. I tried to change all 
> formal Form-parameters. Nothing helps.
> 
> Where is my mistake?
> 
> Thanks.
> 
> -- 
> Denis
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>