This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes How to control JSF to stop prefix value with UI Component Identifer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to control JSF to stop prefix value with UI Component Identifer" Watch "How to control JSF to stop prefix value with UI Component Identifer" New topic
Author

How to control JSF to stop prefix value with UI Component Identifer

Saravanan Vijayappan
Ranch Hand

Joined: Jan 02, 2007
Posts: 47
Hi.

This is a snippet from my JSF code

<hutputText id="ItemIdLabel" value="#{content.itemId}"></hutputText>
<h:inputText id="itemId" value="#{dataEntryBean.itemId}" disabled="true"></h:inputText>

When we look at Html source code of the above JSF UI components in browser, they appears as below

<span id="j_id_jsp_1291078540_2:ItemIdLabel">Item ID :</span></td>
<input id="j_id_jsp_1291078540_2:itemId" type="text" name="j_id_jsp_1291078540_2:itemId" value="0" disabled="disabled" />

My problem is, I have given UI components ID for those UI components such as id="ItemIdLabel", id="itemId" in my JSf file..But they come as id="j_id_jsp_1291078540_2:ItemIdLabel" and id="j_id_jsp_1291078540_2:itemId" in view source

I want to stop JSF to prefixing this j_id_jsp_1291078540_2 with user declared component ID because this prefix value seems to be generated at runtime and I am not able to locate these UI components in java script DOM tree while searching by programmer declared UI component ID

Could anyone help me to solve my issue ?

Thanks
Sarav.


Cheers,<br />Sarav
Raminder Singh
Ranch Hand

Joined: Mar 01, 2002
Posts: 72
Check by providing each <form> and <subview> tag as unique id name. Idea is to provide each component an id value.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

It's good practice to use an explicit id attribute on any JSF tag that might throw any sort of error - for exactly the reason you said!


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to control JSF to stop prefix value with UI Component Identifer
 
Similar Threads
Empty text Field Validation in JSF data Table
Facelets: enable and disable attributes of a component inside a facelets component
Integrating AJAX and JSF
JSF 1.2 doesn't display in IE 8
Richfaces Scrollable Datatable with filtermethod not working