myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Werner Punz <we...@gmx.at>
Subject Re: DHTML scripting and JSF apps
Date Mon, 12 Dec 2005 19:00:02 GMT
Steve Ivy wrote:
> Hello,
> 
> I'm working on the front end for a JSF app, and I'm trying to add some
> interactivitiy to the interface via javascript. Typically you do a lot
> of:
> 
> document.getElementById ('someId').etc ()
> 
> But I find that setting the id in JSF usually results in something
> like id="content:_id35:nameHelp". I'm not sure how these ids are
> assigned, and I'm not sure how I can predict what id an element will
> have in order to acess it via javascript (or css for that matter, but
> that's another rant). Are there accepted methods of getting around
> this?
> 

the ids usually are assigned by nesting hierarchy, if you use the ids 
explicitely you basically get the nested elements divided by :
ie.:
view id="viewid"
form id="myform"
element id="element"

results in an id for the element of viewid:myform:element

however myfaces has something much easier in the tomahawk components, 
you can use the forceid attribute then with following
element id="element" forceid="true" you get an exact form id of element 
for your element


Mime
View raw message