You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by nhhockeyplayer nashua <nh...@hotmail.com> on 2012/12/17 21:25:02 UTC
how to get parameters from component to javascript
Hi Folks,
I have this component... TransparentTextImage
BlahBlah.tml
<img t:type="transparentTextImage" t:id="transparentTextImageComponentId" id="transparentTextImageComponentId"
src="${photoLink}" alt="${currentObject}" width="200" height="160"
title="${currentObject.photo.fileName}"
model="currentObject"
image="${photoLink}"
topLeftText="${currentObject}.transparentText"
topRightText="topRightText"
bottomLeftText="bottomLeftText"
bottomRightText="bottomRightText"
centerText="centerText"
/>
I am attempting to operate some integrated JAVASCRIPT and inside the javascript I want to setup local var for these...
topLeftText
topRightText
bottomLeftText
bottomRightText
centerText
Does anyone know how to get these from within the javascript?
Thanks
Re: how to get parameters from component to javascript
Posted by Howard Lewis Ship <hl...@gmail.com>.
The client side only knows what the server side tells it. You must pass
this down to the client in some way. Modern thinking is to write data-
attributes into the element.
On Monday, December 17, 2012, nhhockeyplayer nashua wrote:
>
> Hi Folks,
>
> I have this component... TransparentTextImage
>
> BlahBlah.tml
> <img t:type="transparentTextImage" t:id="transparentTextImageComponentId"
> id="transparentTextImageComponentId"
> src="${photoLink}" alt="${currentObject}" width="200" height="160"
> title="${currentObject.photo.fileName}"
> model="currentObject"
> image="${photoLink}"
> topLeftText="${currentObject}.transparentText"
> topRightText="topRightText"
> bottomLeftText="bottomLeftText"
> bottomRightText="bottomRightText"
> centerText="centerText"
> />
>
> I am attempting to operate some integrated JAVASCRIPT and inside the
> javascript I want to setup local var for these...
> topLeftText
> topRightText
> bottomLeftText
> bottomRightText
> centerText
>
> Does anyone know how to get these from within the javascript?
>
> Thanks
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
RE: how to get parameters from component to javascript
Posted by nhhockeyplayer nashua <nh...@hotmail.com>.
Alright, I am up to speed on your suggestion.
I faired well with the T4 style... and was able to get fairly granular by indexing appended loop indices onto the and of function names at render time in order to customize specific javascript to items on each individual iteration within loops.
Not sure if I can do that now. But I will try.
keepin rolling with the punches
Best regards
and thanks... KEN
From: nhhockeyplayer@hotmail.com
To: users@tapestry.apache.org
Subject: RE: how to get parameters from component to javascript
Date: Mon, 17 Dec 2012 17:29:38 -0500
Thanks Howard,
Would you be referring to JSon ?
I might be happy to hear that... just looking for a confirmation.
Best regards
and thanks... KEN
From: nhhockeyplayer@hotmail.com
To: users@tapestry.apache.org
Subject: how to get parameters from component to javascript
Date: Mon, 17 Dec 2012 15:25:02 -0500
Hi Folks,
I have this component... TransparentTextImage
BlahBlah.tml
<img t:type="transparentTextImage" t:id="transparentTextImageComponentId" id="transparentTextImageComponentId"
src="${photoLink}" alt="${currentObject}" width="200" height="160"
title="${currentObject.photo.fileName}"
model="currentObject"
image="${photoLink}"
topLeftText="${currentObject}.transparentText"
topRightText="topRightText"
bottomLeftText="bottomLeftText"
bottomRightText="bottomRightText"
centerText="centerText"
/>
I am attempting to operate some integrated JAVASCRIPT and inside the javascript I want to setup local var for these...
topLeftText
topRightText
bottomLeftText
bottomRightText
centerText
Does anyone know how to get these from within the javascript?
Thanks
RE: how to get parameters from component to javascript
Posted by nhhockeyplayer nashua <nh...@hotmail.com>.
Thanks Howard,
Would you be referring to JSon ?
I might be happy to hear that... just looking for a confirmation.
Best regards
and thanks... KEN
From: nhhockeyplayer@hotmail.com
To: users@tapestry.apache.org
Subject: how to get parameters from component to javascript
Date: Mon, 17 Dec 2012 15:25:02 -0500
Hi Folks,
I have this component... TransparentTextImage
BlahBlah.tml
<img t:type="transparentTextImage" t:id="transparentTextImageComponentId" id="transparentTextImageComponentId"
src="${photoLink}" alt="${currentObject}" width="200" height="160"
title="${currentObject.photo.fileName}"
model="currentObject"
image="${photoLink}"
topLeftText="${currentObject}.transparentText"
topRightText="topRightText"
bottomLeftText="bottomLeftText"
bottomRightText="bottomRightText"
centerText="centerText"
/>
I am attempting to operate some integrated JAVASCRIPT and inside the javascript I want to setup local var for these...
topLeftText
topRightText
bottomLeftText
bottomRightText
centerText
Does anyone know how to get these from within the javascript?
Thanks