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 highlight row in table ( no radio or check boxes)? 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 highlight row in table ( no radio or check boxes)?" Watch "how to highlight row in table ( no radio or check boxes)?" New topic
Author

how to highlight row in table ( no radio or check boxes)?

krishna tokala
Greenhorn

Joined: Dec 26, 2005
Posts: 4
Does anyone know, how to highlight row background by clicking on a row (onclick or commandLink)? I am using adf jsf table (oracle).
Anoop V. Kumar
Greenhorn

Joined: Jan 21, 2006
Posts: 18
That can easily be done using Javascript - check out this code at equinox.dev.java.net:

<%-- Step 2. Create a dummy actionLink, w/ no value --%>
<h:commandLink action="#{userForm.edit}" id="editUserLink">
<f aram name="id"/>
</h:commandLink>
<%-- Step 3. Write your own JavaScript function that's easy to call --%>
<script type="text/javascript">
function viewUser(id) {
var f = document.forms['editUser'];
f.elements['editUser:_link_hidden_'].value='editUser:editUserLink';
f.elements['id'].value=id;
f.submit();
}
highlightTableRows("userList");
</script>

Hope that helps,
Anoop Kumar V.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to highlight row in table ( no radio or check boxes)?
 
Similar Threads
table row selected issue
JTable focus
AbstractTableModel - how to highlight a particular row
How to set focus on JTable
Highlight corresponding row after Return button press