Highlighting a selected row in table

I have seen how to highlight a row using a check box or radiobox. However, my table is filled with hyper links in each column. If you click a hyperlink in any column of the row it should select the row. Anyone know how to do this?- Mark
[250 byte] By [CandideEC] at [2007-11-26 9:14:19]
# 1
check this out, this might help you: http://blogs.sun.com/roller/page/winston?entry=single_selectable_row_table_comp onent-Sakthi
sakthivelgopal at 2007-7-6 23:38:13 > top of Java-index,Development Tools,Java Tools...
# 2
It works great in a page, but not on a page fragment. http://forum.sun.com/jive/thread.jspa?threadID=100248&tstart=0
Sabir at 2007-7-6 23:38:13 > top of Java-index,Development Tools,Java Tools...
# 3

Looks like the generated javascript does not use the correct name. It should show:

function initAllRows() {

var table = document.getElementById("f:subview:Fragment1:table1");

table.initAllRows();

}

It should match your subview id:

<f:subview id="Fragment1">

I've logged a bug for this 6490603.

Hope it helps,

Lark

Creator Team

Lark at 2007-7-6 23:38:13 > top of Java-index,Development Tools,Java Tools...
# 4
That's right. I have been manually changint the JavaScript code to make it work with page fragment.
Sabir at 2007-7-6 23:38:13 > top of Java-index,Development Tools,Java Tools...
# 5
I have a similar problem when the table is in a TabSet. what Id should I use?
vcollak at 2007-7-6 23:38:13 > top of Java-index,Development Tools,Java Tools...
# 6

I allways try to avoid problems with the algorythm for generating the client IDs. My app creates all javascript, that contains client IDs, dynamically in page bean.

JSP

<ui:.. id="myComponent" onClick="#{MyBean.myComponentOnClick}">

Page Bean

public String getMyComponentOnClick()

{

StringBuilder script = new StringBuilder();

...

script.append(this.otherComponent.getClientId(getFacesContext()));

...

return script.toString();

}

If the algorythm changes, there is no need to change the code. Maybe there is a way more elegant.

Ingmar at 2007-7-6 23:38:13 > top of Java-index,Development Tools,Java Tools...