You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ken in nashua <nh...@hotmail.com> on 2008/01/31 19:42:24 UTC

dom quiz question...

Folks,
 
I am using tapestry as follows...
 
<div jwcid="image@Any">
    <img jwcid="imageWidget@TransparentTextImage"
        model="ognl:currentObject"
        image="ognl:photoAsset"
        alt="ognl:currentObject.photo.fileName"
        title="ognl:currentObject.photo.fileName" width="160"         
        height="120"
        transparentText="currentObject.transparentText"
        listSize="ognl:collection.size" 
    />
</div> 
 
In my @Script I have...
 
var imageDom = 
    document.forms[0].document.getElementById("Image_" + i); 
 
all this works...
 
But How do I access transparentText within the DOM?
 
3 *** stars for perso who gets this right
 
imageDom.transparentText.valueOf();  ??? failsBest regards 
Ken in nashua
_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008

Re: dom quiz question...

Posted by Kevin Menard <km...@servprise.com>.
I think you probably want to use getAttribute().

I'd also recommend using something like jQuery to simplify your code (and
help ensure cross-browser compatibility).

-- 
Kevin


On 1/31/08 1:42 PM, in article BAY120-W836C842FDC6151EB4D184C9370@phx.gbl,
"Ken in nashua" <nh...@hotmail.com> wrote:

> 
> Folks,
>  
> I am using tapestry as follows...
>  
> <div jwcid="image@Any">
>     <img jwcid="imageWidget@TransparentTextImage"
>         model="ognl:currentObject"
>         image="ognl:photoAsset"
>         alt="ognl:currentObject.photo.fileName"
>         title="ognl:currentObject.photo.fileName" width="160"
>         height="120"
>         transparentText="currentObject.transparentText"
>         listSize="ognl:collection.size"
>     />
> </div> 
>  
> In my @Script I have...
>  
> var imageDom = 
>     document.forms[0].document.getElementById("Image_" + i);
>  
> all this works...
>  
> But How do I access transparentText within the DOM?
>  
> 3 *** stars for perso who gets this right
>  
> imageDom.transparentText.valueOf();  ??? failsBest regards
> Ken in nashua
> _________________________________________________________________
> Connect and share in new ways with Windows Live.
> http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008



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


Re: dom quiz question...

Posted by Josh Canfield <jo...@thedailytube.com>.
>
> var imageDom =
>    document.forms[0].document.getElementById("Image_" + i);

Why are you doing this instead of just using
document.getElementByIddirectly? I can't imagine a case where
document.forms[0].document != document

In general these problems are easier to solve if you just take a look at the
HTML generated by your component, then it should be clear how to access the
DOM objects using javascript.

Josh

On Jan 31, 2008 10:42 AM, Ken in nashua <nh...@hotmail.com> wrote:

>
> Folks,
>
> I am using tapestry as follows...
>
> <div jwcid="image@Any">
>    <img jwcid="imageWidget@TransparentTextImage"
>        model="ognl:currentObject"
>        image="ognl:photoAsset"
>        alt="ognl:currentObject.photo.fileName"
>        title="ognl:currentObject.photo.fileName" width="160"
>        height="120"
>        transparentText="currentObject.transparentText"
>        listSize="ognl:collection.size"
>    />
> </div>
>
> In my @Script I have...
>
> var imageDom =
>    document.forms[0].document.getElementById("Image_" + i);
>
> all this works...
>
> But How do I access transparentText within the DOM?
>
> 3 *** stars for perso who gets this right
>
> imageDom.transparentText.valueOf();  ??? failsBest regards
> Ken in nashua
> _________________________________________________________________
> Connect and share in new ways with Windows Live.
>
> http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008




-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.