You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andreas Pardeike <an...@pardeike.net> on 2004/10/15 10:37:10 UTC
@Image + extra dynamic parameter?
Sorry for another newbie q,
but how do I create an image from an asset and at the same time add
a param="val" to it dynamically? I.e.
<img jwcid="@Image" image='ognl:getAsset("textedit")' id="text-001"
src="textedit.gif" style="display:none" onClick="textedit_click(this)"
width="15" height="15"/>
I defined an asset 'textedit' and it works great. Now I want to replace
'text-001' with a value from a component parameter. Is this possible?
Andreas Pardeike
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: @Image + extra dynamic parameter? SOLVED
Posted by Howard Lewis Ship <hl...@gmail.com>.
If you have
<parameter name="snippet" .... direction="in"/>
then:
<img jwcid="@Image" image='ognl:assets.textedit' id="ognl:snippet"
src="textedit.gif" style="display:none" onClick="textedit_click(this)"
width="15" height="15"/>
should work. Note the easier reference to the asset, using the assets
map propery on component.
On Fri, 15 Oct 2004 12:07:13 +0200, Andreas Pardeike
<an...@pardeike.net> wrote:
>
> On 15 okt 2004, at 10.37, Andreas Pardeike wrote:
>
> > but how do I create an image from an asset and at the same time add
> > a param="val" to it dynamically? I.e.
> >
> > <img jwcid="@Image" image='ognl:getAsset("textedit")' id="text-001"
> > src="textedit.gif" style="display:none" onClick="textedit_click(this)"
> > width="15" height="15"/>
> >
> > I defined an asset 'textedit' and it works great. Now I want to replace
> > 'text-001' with a value from a component parameter. Is this possible?
>
> :-) Solved it myself.
>
> I was just a bit puzzled with the usage of 'Any'. I tried to use
> jwcid="@Any"
> but of course this does not work when you already have jwcid="@Image".
> The key
> here is to change the above to
>
> <img jwcid="image" src="textedit.gif" style="display:none"
> onClick="textedit_click(this)" width="15" height="15"/>
>
> and add this to the .jwc file:
>
> <component id="image" type="Any">
> <inherited-binding name="id" parameter-name="snippet"/>
> <binding name="image" expression='getAsset("textedit")'/>
> </component>
>
> <component id="content" type="DBTextSnippet">
> <inherited-binding name="textid" parameter-name="snippet"/>
> </component>
>
> Works like a charm!
> Andreas Pardeike
>
> ---------------------------------------------------------------------
> 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: @Image + extra dynamic parameter? SOLVED
Posted by Andreas Pardeike <an...@pardeike.net>.
On 15 okt 2004, at 10.37, Andreas Pardeike wrote:
> but how do I create an image from an asset and at the same time add
> a param="val" to it dynamically? I.e.
>
> <img jwcid="@Image" image='ognl:getAsset("textedit")' id="text-001"
> src="textedit.gif" style="display:none" onClick="textedit_click(this)"
> width="15" height="15"/>
>
> I defined an asset 'textedit' and it works great. Now I want to replace
> 'text-001' with a value from a component parameter. Is this possible?
:-) Solved it myself.
I was just a bit puzzled with the usage of 'Any'. I tried to use
jwcid="@Any"
but of course this does not work when you already have jwcid="@Image".
The key
here is to change the above to
<img jwcid="image" src="textedit.gif" style="display:none"
onClick="textedit_click(this)" width="15" height="15"/>
and add this to the .jwc file:
<component id="image" type="Any">
<inherited-binding name="id" parameter-name="snippet"/>
<binding name="image" expression='getAsset("textedit")'/>
</component>
<component id="content" type="DBTextSnippet">
<inherited-binding name="textid" parameter-name="snippet"/>
</component>
Works like a charm!
Andreas Pardeike
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org