You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joe Andolina <jo...@andomation.com> on 2004/07/18 03:06:05 UTC

parameters vs properties syntax issue

Hello,

I am unable to access my page parameters from my html ognl statements. Can
you please help me with the syntax? 

 

My page has the following declaration on it:

<parameter name="navList" required="yes" type="com.andomation.nav.NavMenu"/>

 

The "navList" is working fine for the "forEach" component on my page. There
is a "docBase" field in my "navList" that I would like to access in order to
generate image URLs. I am unable to access the "navList" or the
"navList.docBase" from ognl, where am I going wrong?

 

      <span jwcid="i">

            <td align=center>

                <a jwcid="link">

                        <img jwcid="@Any" src="ognl:(navList.docBase +
navObj.imgName)" border="0"/>

                </a>

            </td>

 </span>

 

Tapestry complains and says that navList is unknown.

 

Thanks in advance,

Joe


RE: parameters vs properties syntax issue

Posted by Joe Andolina <jo...@andomation.com>.
Robert,
	Thank you for your response. The file is a .jwc you are correct. The
component-specification class has a parameter called docDoot, but I can't
access it from my html. I have tried adding a parameter and
parameter-specification. The html it keeps coming up null. I am setting this
value in the constructor. 
	How can I set the value? I have the value in navList.docRoot, but I
cant access it. 

Any more help would be much appreciated. If you would like to see my files I
would be happy to send them to you.

Joe

-----Original Message-----
From: Robert Zeigler [mailto:rdzeigle@u.arizona.edu] 
Sent: Saturday, July 17, 2004 7:37 PM
To: Tapestry users
Subject: Re: parameters vs properties syntax issue

This is a /page/? Or a component? If it's a page, page specifications 
don't allow parameters. Use <property-specification> instead.

Robert

Joe Andolina wrote:
> Hello,
> 
> I am unable to access my page parameters from my html ognl statements. Can
> you please help me with the syntax? 
> 
>  
> 
> My page has the following declaration on it:
> 
> <parameter name="navList" required="yes"
type="com.andomation.nav.NavMenu"/>
> 
>  
> 
> The "navList" is working fine for the "forEach" component on my page.
There
> is a "docBase" field in my "navList" that I would like to access in order
to
> generate image URLs. I am unable to access the "navList" or the
> "navList.docBase" from ognl, where am I going wrong?
> 
>  
> 
>       <span jwcid="i">
> 
>             <td align=center>
> 
>                 <a jwcid="link">
> 
>                         <img jwcid="@Any" src="ognl:(navList.docBase +
> navObj.imgName)" border="0"/>
> 
>                 </a>
> 
>             </td>
> 
>  </span>
> 
>  
> 
> Tapestry complains and says that navList is unknown.
> 
>  
> 
> Thanks in advance,
> 
> Joe
> 
> 


---------------------------------------------------------------------
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: parameters vs properties syntax issue

Posted by Robert Zeigler <rd...@u.arizona.edu>.
This is a /page/? Or a component? If it's a page, page specifications 
don't allow parameters. Use <property-specification> instead.

Robert

Joe Andolina wrote:
> Hello,
> 
> I am unable to access my page parameters from my html ognl statements. Can
> you please help me with the syntax? 
> 
>  
> 
> My page has the following declaration on it:
> 
> <parameter name="navList" required="yes" type="com.andomation.nav.NavMenu"/>
> 
>  
> 
> The "navList" is working fine for the "forEach" component on my page. There
> is a "docBase" field in my "navList" that I would like to access in order to
> generate image URLs. I am unable to access the "navList" or the
> "navList.docBase" from ognl, where am I going wrong?
> 
>  
> 
>       <span jwcid="i">
> 
>             <td align=center>
> 
>                 <a jwcid="link">
> 
>                         <img jwcid="@Any" src="ognl:(navList.docBase +
> navObj.imgName)" border="0"/>
> 
>                 </a>
> 
>             </td>
> 
>  </span>
> 
>  
> 
> Tapestry complains and says that navList is unknown.
> 
>  
> 
> Thanks in advance,
> 
> Joe
> 
> 


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


Re: parameters vs properties syntax issue

Posted by Howard Lewis Ship <hl...@gmail.com>.
In Tapestry 3.0, it is necessary to specify a direction for a
parameter in order for a property to be created.  Typically,
direction="in" is the correct thing.  Alternately, use the OGNL
expression bindings.navList.value to get the value bound to the
navList parameter.

On Sat, 17 Jul 2004 20:21:20 -0700, Vladimir Drndarski <vl...@cox.net> wrote:
> Hi Joe,
> 
> Is <parameter name="navList" required="yes"
> type="com.andomation.nav.NavMenu"/>
> 
> in a .page file or a .jwc? I think parameters are only allowed in .jwc
> files.
> 
> Either way, Here's what I'd do instead:
> 
> in the .page file:
>      <property-specification name="navMenu"
> type="com.andomation.nav.NavMenu"/>
> 
> then in your .java file either specify NavMenu as abstract (tapestry will
> create it for you in an enhanced class) or fill in the stuff yourself.
> 
>         public abstract NavMenu getNavMenu();
>         public abstract void setNavMenu(NavMenu menu);
> 
> and don't forget to create it:
> 
>         public void pageBeginRender(PageEvent event) {
>                 if (getNavMenu() == null)
>                         setNavMenu(new NavMenu());
> 
> 
>         }
> 
> -----Original Message-----
> From: Joe Andolina [mailto:joe@andomation.com]
> Sent: Saturday, July 17, 2004 6:06 PM
> To: tapestry-user@jakarta.apache.org
> Subject: parameters vs properties syntax issue
> 
> Hello,
> 
> I am unable to access my page parameters from my html ognl statements. Can
> you please help me with the syntax?
> 
> My page has the following declaration on it:
> 
> <parameter name="navList" required="yes" type="com.andomation.nav.NavMenu"/>
> 
> The "navList" is working fine for the "forEach" component on my page. There
> is a "docBase" field in my "navList" that I would like to access in order to
> generate image URLs. I am unable to access the "navList" or the
> "navList.docBase" from ognl, where am I going wrong?
> 
>       <span jwcid="i">
> 
>             <td align=center>
> 
>                 <a jwcid="link">
> 
>                         <img jwcid="@Any" src="ognl:(navList.docBase +
> navObj.imgName)" border="0"/>
> 
>                 </a>
> 
>             </td>
> 
>  </span>
> 
> Tapestry complains and says that navList is unknown.
> 
> Thanks in advance,
> 
> Joe
> 
> ---------------------------------------------------------------------
> 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
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: parameters vs properties syntax issue

Posted by Vladimir Drndarski <vl...@cox.net>.
Hi Joe,

Is <parameter name="navList" required="yes"
type="com.andomation.nav.NavMenu"/>

in a .page file or a .jwc? I think parameters are only allowed in .jwc
files.

Either way, Here's what I'd do instead:

in the .page file:
     <property-specification name="navMenu"
type="com.andomation.nav.NavMenu"/>

then in your .java file either specify NavMenu as abstract (tapestry will
create it for you in an enhanced class) or fill in the stuff yourself.

	public abstract NavMenu getNavMenu();
	public abstract void setNavMenu(NavMenu menu);

and don't forget to create it:

	public void pageBeginRender(PageEvent event) {
		if (getNavMenu() == null)
			setNavMenu(new NavMenu());
	}

-----Original Message-----
From: Joe Andolina [mailto:joe@andomation.com]
Sent: Saturday, July 17, 2004 6:06 PM
To: tapestry-user@jakarta.apache.org
Subject: parameters vs properties syntax issue


Hello,

I am unable to access my page parameters from my html ognl statements. Can
you please help me with the syntax?



My page has the following declaration on it:

<parameter name="navList" required="yes" type="com.andomation.nav.NavMenu"/>



The "navList" is working fine for the "forEach" component on my page. There
is a "docBase" field in my "navList" that I would like to access in order to
generate image URLs. I am unable to access the "navList" or the
"navList.docBase" from ognl, where am I going wrong?



      <span jwcid="i">

            <td align=center>

                <a jwcid="link">

                        <img jwcid="@Any" src="ognl:(navList.docBase +
navObj.imgName)" border="0"/>

                </a>

            </td>

 </span>



Tapestry complains and says that navList is unknown.



Thanks in advance,

Joe



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