You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nick Stuart <ba...@gmail.com> on 2005/06/16 01:07:42 UTC

[tap 4] Parameter inside render

Hi all, I seem to be having a prolem getting a value from a parameter
from inside a PageBeginRender listener. The parameters is set, as I
can use the same value fine inside the html template. 
object.whaterver) works just fine. But my getObject() is always
returning null. I have cache set to true, and default-binding set to
ognl, anything I'm doing wrong here?

Thanks for the hepl!
-Nick

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


Re: [tap 4] Parameter inside render

Posted by Nick Stuart <ba...@gmail.com>.
Well I am trying to use the property. Here's the type of code I'm using:

<!--- jwc -->
<parameter name="myObject" default-binding="ognl" required="true"/>

<!--- class -->
public abstract MyObject getMyObject();

public void pageBeginRender(PageEvent event){
  if(getMyObject() == null){
     addError("MyObject is null");   //ALWAYS goes here
     return;
  }
}

<!-- html  -->
<span jwcid="@Insert" value="myObject.title">This works!</span>


The reason I'm trying to access it is because some of the values need
to be formatted and stuck goether in the display. I could do all of
this through ognl expressions, but its a little bit easier to
understand conditionals and such right in the code (at least for me).

-Nick



On 6/15/05, Howard Lewis Ship <hl...@gmail.com> wrote:
> That should work fine.  What is the OGNL expression?  Why are you
> accessing the binding directly, instead of using the property?
> 
> On 6/15/05, Nick Stuart <ba...@gmail.com> wrote:
> > Hi all, I seem to be having a prolem getting a value from a parameter
> > from inside a PageBeginRender listener. The parameters is set, as I
> > can use the same value fine inside the html template.
> > object.whaterver) works just fine. But my getObject() is always
> > returning null. I have cache set to true, and default-binding set to
> > ognl, anything I'm doing wrong here?
> >
> > Thanks for the hepl!
> > -Nick
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-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-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: [tap 4] Parameter inside render

Posted by Howard Lewis Ship <hl...@gmail.com>.
That should work fine.  What is the OGNL expression?  Why are you
accessing the binding directly, instead of using the property?

On 6/15/05, Nick Stuart <ba...@gmail.com> wrote:
> Hi all, I seem to be having a prolem getting a value from a parameter
> from inside a PageBeginRender listener. The parameters is set, as I
> can use the same value fine inside the html template.
> object.whaterver) works just fine. But my getObject() is always
> returning null. I have cache set to true, and default-binding set to
> ognl, anything I'm doing wrong here?
> 
> Thanks for the hepl!
> -Nick
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-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-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org