You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Alexander Kundirenko <ak...@gmail.com> on 2005/08/15 12:54:39 UTC
Setting injected page as initial-value for another property
Hi All,
I want my FormPage to have customizable return page.
Here is the simplified code:
==== FORM PAGE CLASS =====
**
* @return page instance
* We redirect here after form saving
*/
public abstract IPage getReturnPage();
public abstract void setReturnPage(IPage page);
public abstract IPage getDefaultReturnPage();
==========================
===== FORM PAGE SPEC ======
<inject property="defaultReturnPage" type="page"
object="StudentForm"/>
<property name="returnPage" persist="session"
initial-value="defaultReturnPage"/>
===========================
But I get next error:
===========================
org.apache.tapestry.BindingException
Unable to read OGNL expression '<parsed OGNL expression>' of
$FormPage_1240@b24098[TestResultForm]: defaultReturnPage
...
ognl.OgnlException
defaultReturnPage
...
java.lang.NullPointerException
Stack Trace:
* $FormPage_1240.getDefaultReturnPage($FormPage_1240.java)
* sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
* sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
* sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
* java.lang.reflect.Method.invoke(Method.java:585)
* ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:491)
* ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:904)
===========================
When I remove "initial-value" attribute - all works fine. Also I can
reference to that injected page in runtime, so I think that the
problem is in "initial-value" attribute processing.
Or I can't use injected page as initial-value for another property?
You can find full trace in attachment.
Thank you,
Alex
Re: Setting injected page as initial-value for another property
Posted by Howard Lewis Ship <hl...@gmail.com>.
Tapestry does not support this. This would be considered a permanent
reference between pages, which doesn't work with Tapestry page pooling
mechanism.
You should store page names and resolve them dynamically using the
IRequestCycle.
On 8/15/05, Alexander Kundirenko <ak...@gmail.com> wrote:
> Hi All,
> I want my FormPage to have customizable return page.
> Here is the simplified code:
>
> ==== FORM PAGE CLASS =====
> **
> * @return page instance
> * We redirect here after form saving
> */
> public abstract IPage getReturnPage();
> public abstract void setReturnPage(IPage page);
>
> public abstract IPage getDefaultReturnPage();
> ==========================
>
> ===== FORM PAGE SPEC ======
> <inject property="defaultReturnPage" type="page"
> object="StudentForm"/>
> <property name="returnPage" persist="session"
> initial-value="defaultReturnPage"/>
> ===========================
>
> But I get next error:
> ===========================
> org.apache.tapestry.BindingException
> Unable to read OGNL expression '<parsed OGNL expression>' of
> $FormPage_1240@b24098[TestResultForm]: defaultReturnPage
> ...
> ognl.OgnlException
> defaultReturnPage
> ...
> java.lang.NullPointerException
> Stack Trace:
>
> * $FormPage_1240.getDefaultReturnPage($FormPage_1240.java)
> * sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> * sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> * sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> * java.lang.reflect.Method.invoke(Method.java:585)
> * ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:491)
> * ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:904)
> ===========================
>
> When I remove "initial-value" attribute - all works fine. Also I can
> reference to that injected page in runtime, so I think that the
> problem is in "initial-value" attribute processing.
> Or I can't use injected page as initial-value for another property?
> You can find full trace in attachment.
>
> Thank you,
> Alex
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
Professional Tapestry training, mentoring, support
and project work. http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org