Tried .forgetPage() didn't it work either.

I ended up making the page an IExternalPage and doing a callback to itself, passing the error message as one of the parameters. Then I record the message on the delegate in the .activateExternalPage() method. Still not sure if this is the best way, but it works.

Filip S. Adamsen wrote:
How about using IRequestCycle#forgetPage?

http://jakarta.apache.org/tapestry/tapestry/apidocs/org/apache/tapestry/IRequestCycle.html#forgetPage(java.lang.String)

-Filip

Mark Reynolds skrev:
I tried .clear(), but that didn't work.

I tried injecting another instance of the same page, initializing it, and returning it from the listener method as if I were coming to it from another page, but that did not work either.

Right now my solution is to go to another page to display the message and give a link to "try again" to return to the editing page.

I feel like I am missing some straightforward way to reload the page from scratch. If it was an external page I throw an exception to redirect to it, but that would be another round trip to the browser.

-- Mark R

Filip S. Adamsen wrote:
Perhaps using IValidationDelegate#setFormComponent and ValidationDelegate#recordFieldInputValue to store the new values would work? It feels like a hack to me, but that doesn't mean it won't work.

http://jakarta.apache.org/tapestry/tapestry/apidocs/org/apache/tapestry/valid/IValidationDelegate.html#setFormComponent(org.apache.tapestry.form.IFormComponent) http://jakarta.apache.org/tapestry/tapestry/apidocs/org/apache/tapestry/valid/IValidationDelegate.html#recordFieldInputValue(java.lang.String)

Or else you might get away with calling IValidationDelegate#clear and then recording your error. That might work as well.

http://jakarta.apache.org/tapestry/tapestry/apidocs/org/apache/tapestry/valid/IValidationDelegate.html#clear()

If none of it works, well, then I blame it on lack of coffee - it's well beyond midnight here. ; )

-Filip

Mark Reynolds skrev:
I have a page with a form for editing an object. I am using optimistic locking. I catch the optimistic lock exception in the listener method and add a message to the validation delegate indicating that another user changed the record. In this case, I want to have the form show the current values rather than the values just submitted by the user. Any tips for doing this?

Thanks.

-- Mark R

---------------------------------------------------------------------
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]


---------------------------------------------------------------------
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]

Reply via email to