You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "F.R. Da Costa Gomez" <dc...@fixed.com> on 2003/03/15 16:31:29 UTC

Implicit notation 4 contrib components & static fields

Hi All,

In order to get myself up to speed with 2.4 I'm compiling a cheat sheet 
(Linking is the current subject)
Before I continue I wondered whether someone can enlighten me on the 
following two Qs:

1st Q.
    <a jwcid="@PopUpLink" href="http://www.tapestry.org" 
expression='"resizable,scrollbars,top=100,left=100,height=400,width=300"'>Tapestry</a>
is NOT equal to
    <component id="helpLink" type="contrib:PopupLink">
       <binding name="features" 
expression='"resizable,scrollbars,top=100,left=100,height=400,width=300"'/>
    </component>
What is the correct notation (if it exists?)


2nd Q

package org.bla.bla;
Class Xyz {
 public static String S1="whatever1";
 public static final String S2="whatever2";
}

How do I get to S1 or S2.
The following statements do not work despite the fact the ognl manual 
reads "... using the syntax @class@field. The class must be fully 
qualified."
<span jwcid="@Insert" value="ognl:@fully.qualified.Xyz@S1">2b 
replaced</span>
<span jwcid="@Insert" value="ognl:@fully.qualified.Xyz@S2">2b 
replaced</span>
What am I missing here?

Thx in advance,
Fermin DCG


Re: Implicit notation 4 contrib components & static fields

Posted by "F.R. Da Costa Gomez" <dc...@fixed.com>.
Thx Drew,

As you reckoned it works just like you suggested.
Still don't know what was going wrong but I'd rather concern myself with 
stuff going right.

Thx & cheers
Fermin DCG

Drew Davidson wrote:

>
> @org.bla.bla.Xyz@S1 should work assuming that (1) the class is public 
> and (2) the field is public.  If not then you should be getting an 
> OgnlException.  If you get an exception that would be helpful to see 
> in order to diagnose the problem.
>
> - Drew
>



Re: Implicit notation 4 contrib components & static fields

Posted by Drew Davidson <dr...@ognl.org>.
F.R. Da Costa Gomez wrote:

> package org.bla.bla;
> Class Xyz {
> public static String S1="whatever1";
> public static final String S2="whatever2";
> }
>
> How do I get to S1 or S2.
> The following statements do not work despite the fact the ognl manual 
> reads "... using the syntax @class@field. The class must be fully 
> qualified."
> <span jwcid="@Insert" value="ognl:@fully.qualified.Xyz@S1">2b 
> replaced</span>
> <span jwcid="@Insert" value="ognl:@fully.qualified.Xyz@S2">2b 
> replaced</span>
> What am I missing here?

@org.bla.bla.Xyz@S1 should work assuming that (1) the class is public 
and (2) the field is public.  If not then you should be getting an 
OgnlException.  If you get an exception that would be helpful to see in 
order to diagnose the problem.

- Drew

-- 
+---------------------------------+
< Drew Davidson | OGNL Technology >
+---------------------------------+
|  Email: drew@ognl.org          /
|    Web: http://www.ognl.org   /
|    Vox: (520) 531-1966       <
|    Fax: (520) 531-1965        \
| Mobile: (520) 405-2967         \
+---------------------------------+




Re: Implicit notation 4 contrib components & static fields

Posted by Andreas Bolka <an...@gmx.net>.
Saturday, March 15, 2003, 10:32:14 PM, F. wrote:

> Without the two line the whole thing starts up no worries. However, with 
> the two additions I get the following exception (where does the script 
> thing come in?)

> org.apache.tapestry.RequestCycleException
> Script components must be contained within a Body component.
> component: 
> org.apache.tapestry.html.Script$Enhance_3@ecd92c[Home/$PopupLink.popoutScript]

add a jwcid="@Body" attribute to your html body element. i.e:

<html>
<head> ... </head>
<body jwcid="@Body>
...
    <a jwcid="@Contrib:PopupLink"
            href="http://tapestry-tutorial.cloudnine.net.nz/html/Tutorial2.html">
        Tapestry tutorial
    </a>
...
</body>
</html>

see also:
http://jakarta.apache.org/proposals/tapestry/doc/ComponentReference/Body.html

-- 
Best regards,
 Andreas                            mailto:andreas.bolka@gmx.net


Re: Implicit notation 4 contrib components & static fields

Posted by "F. Da Costa Gomez" <dc...@fixed.com>.
Hi mb,

Noop, I'm afraid not:
Here are some details:
Added 2 .application
    <library id="Contrib" 
specification-path="/org/apache/tapestry/contrib/Contrib.library"/>
Line in the Home.html file
This is a popup to <a jwcid="@Contrib:PopupLink" 
href="http://tapestry-tutorial.cloudnine.net.nz/html/Tutorial2.html">Tapestry 
tutorial</a>

Without the two line the whole thing starts up no worries. However, with 
the two additions I get the following exception (where does the script 
thing come in?)

org.apache.tapestry.RequestCycleException
Script components must be contained within a Body component.
component: 
org.apache.tapestry.html.Script$Enhance_3@ecd92c[Home/$PopupLink.popoutScript] 



Any help is still appreciated.
Thx & Cheers,
Fermin DCG

Mindbridge wrote:

>The component can then be used in the pages/components like this
>
>jwcid="@Contrib:PopupLink"
>
>(i.e. PopupLink is a component in Contrib, rather than a default one)
>
>Does it help?
>
>Best regards
>-mb
>  
>
>  
>

Re: Implicit notation 4 contrib components & static fields

Posted by Mindbridge <mi...@yahoo.com>.
Hi,

The PopupLink is not a standard Tapestry component. As a contributed add-on
(by some of the people on the list, I believe) it is located in the Contrib
library, rather than in the default namespace (where all the standard
components are).

This means that in order to use it, one has to import the library in the
.application file like this:

<library id="Contrib"
specification-path="/net/sf/tapestry/contrib/Contrib.library" />

(or
<library id="Contrib"
specification-path="/org/apache/tapestry/contrib/Contrib.library" />
if the newest 2.4 release with converted to Apache paths is used)

The component can then be used in the pages/components like this

jwcid="@Contrib:PopupLink"

(i.e. PopupLink is a component in Contrib, rather than a default one)

Does it help?

Best regards
-mb




----- Original Message -----
From: "F.R. Da Costa Gomez" <dc...@fixed.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Saturday, March 15, 2003 7:30 PM
Subject: Re: Implicit notation 4 contrib components & static fields


> The jwcid="@PopupLink" generates a ".. not found in application
> namespace .." despite the fact the the contrib jar is warred in the lib
> dir og the WEB-INF (as well as being available in the Tomcat environment
> itself).
> So it does not even arrive at the features point yet.
>
> Hmm.
>
> Andreas Bolka wrote:
>
> >I guess this should better be
> >
> >  features='ognl:"..."'
> >
> >To quote on of Howard's earlier posts:
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>




Re: Implicit notation 4 contrib components & static fields

Posted by "F.R. Da Costa Gomez" <dc...@fixed.com>.
The jwcid="@PopupLink" generates a ".. not found in application 
namespace .." despite the fact the the contrib jar is warred in the lib 
dir og the WEB-INF (as well as being available in the Tomcat environment 
itself).
So it does not even arrive at the features point yet.

Hmm.

Andreas Bolka wrote:

>I guess this should better be
>
>  features='ognl:"..."'
>
>To quote on of Howard's earlier posts:
>
>  
>


Re: Implicit notation 4 contrib components & static fields

Posted by Andreas Bolka <an...@gmx.net>.
argh, sorry for replying to myself, but ...

Saturday, March 15, 2003, 5:06:20 PM, Andreas wrote:

>> <a jwcid="@PopUpLink"
>>       href="http://www.tapestry.org"
>>       expression='"resizable,scrollbars,top=100,left=100,height=400,width=300"'>
>>    Tapestry
>> </a>

>> is NOT equal to

>> <component id="helpLink" type="contrib:PopupLink">
>> <binding name="features"
>>   expression='"resizable,scrollbars,top=100,left=100,height=400,width=300"' />
>> </component>

>> What is the correct notation (if it exists?)

> I'm quite new to tapestry myself, but afaik the correct notation would
> be:

> <a jwcid="@PopUpLink" href="http://www.tapestry.org"
>       features='"..."'>
>    ...
> </a>

I guess this should better be

  features='ognl:"..."'

To quote on of Howard's earlier posts:

--- "Howard M. Lewis Ship" <hl...@attbi.com> wrote:
> You are on the right track.
> 
> There's one syntax used in HTML templates. That's where you see
> "ognl:expression" or "string:key".
> 
> Here's a cheat sheet:
> 
> <span jwcid="@Foo" batman="ognl:robin"
>   fred="string:barney"
>   abbott="costello"/>
> 
> Is the same as:
> 
> <span jwcid="foo"/>
> 
> PLUS
> 
> <component id="foo" type="Foo">
>   <binding name="batman" expression="robin"/>
>   <string-binding name="fred" key="barney"/>
>   <static-binding name="abbott" value="costello"/>
> </component>
> 
> In the HTML template, you need prefixes to identify the type of the
> attribute. In the specification file, the XML element determines the
> type, no prefix necessary.

-- 
Best regards,
 Andreas                            mailto:andreas.bolka@gmx.net


Re: Implicit notation 4 contrib components & static fields

Posted by Andreas Bolka <an...@gmx.net>.
Saturday, March 15, 2003, 3:31:29 PM, F.R. wrote:

> In order to get myself up to speed with 2.4 I'm compiling a cheat
> sheet (Linking is the current subject) Before I continue I wondered
> whether someone can enlighten me on the following two Qs:

> 1st Q.

> <a jwcid="@PopUpLink"
>       href="http://www.tapestry.org"
>       expression='"resizable,scrollbars,top=100,left=100,height=400,width=300"'>
>    Tapestry
> </a>

> is NOT equal to
> <component id="helpLink" type="contrib:PopupLink">
> <binding name="features"
>   expression='"resizable,scrollbars,top=100,left=100,height=400,width=300"' />
> </component>

> What is the correct notation (if it exists?)

I'm quite new to tapestry myself, but afaik the correct notation would
be:

<a jwcid="@PopUpLink" href="http://www.tapestry.org"
      features='"..."'>
   ...
</a>

-- 
Best regards,
 Andreas                            mailto:andreas.bolka@gmx.net