How to select all rows in table automatically after refreshing?

Hi,AllAfter refreshing the table,I want to select all rows,like MultipleButton's function.How can I do?ThanksSmile.
[151 byte] By [nsqsmilea] at [2007-11-27 9:02:28]
# 1

Hi!

For selecting all rows You can add JavaScript function:

function selectAllRows(selected) {

var table = document.getElementById("formHistory:tableHistory");

table.selectGroupRows(selected);

}

And then call this method from onLoad JavaScript property.

Thanks,

Roman.

-Grif-a at 2007-7-12 21:33:15 > top of Java-index,Development Tools,Java Tools...
# 2
Hi,-Grif- Thank you,but I don't find the onLoad method.It belongs to table or tableRowGroup?On the side,Can I call the javaScript's method in java codes(e.g. in a button's clicked method)?ThanksSmile
nsqsmilea at 2007-7-12 21:33:15 > top of Java-index,Development Tools,Java Tools...
# 3

Hi!

First of all I want to say that instead formHistory:tableHistory You should write yourFormName:yourTableName.

And second You can find onLoad property in 'Properties' window in JavaScript part.

You should click your form (probably better do it in 'Outline' window) and then look at 'Properties' window.

Thanks,

Roman.

-Grif-a at 2007-7-12 21:33:15 > top of Java-index,Development Tools,Java Tools...
# 4
Hi,-Grif- Yes,I has found the onLoad() method.It's a property of the body1.Infinitely grateful !Thanks.Smile
nsqsmilea at 2007-7-12 21:33:15 > top of Java-index,Development Tools,Java Tools...
# 5

Hi,-Grif-

/*

* Set the selected state for the given row groups

* displayed in the table. This functionality requires

* the 'selectId' of the tableColumn to be set.

*

* @param rowGroupId HTML element id of the tableRowGroup component

* @param selected Flag indicating whether components should be selected

*/

function selectGroupRows(rowGroupId, selected) {

var table = document.getElementById("form1:table1");

table.selectGroupRows(rowGroupId, selected);

}

I don't know that the parameter selected is a boolean,or the checkbox(radio button) id?

Thanks

Smile

nsqsmilea at 2007-7-12 21:33:15 > top of Java-index,Development Tools,Java Tools...
# 6
Hi!Parameter 'selected' is boolean.Thanks,Roman.
-Grif-a at 2007-7-12 21:33:15 > top of Java-index,Development Tools,Java Tools...
# 7

Hi,-Grif-

I has try <ui:body binding="#{payFeeCash.body1}" focus="form1:usercomparidText" id="body1" style="-rave-layout: grid" onLoad="selectGroupRows(tableRowGroup1,Boolean.TRUE)">

and <ui:body binding="#{payFeeCash.body1}" focus="form1:usercomparidText" id="body1" style="-rave-layout: grid" onLoad="selectGroupRows(tableRowGroup1,true)">

.

All were rong.Why?

Thanks

Smile

nsqsmilea at 2007-7-12 21:33:15 > top of Java-index,Development Tools,Java Tools...
# 8
Hi,AllHow to simulate clicked checkboxs in table?I want to show all rows be selected after click the find button,and like click checkbox,save RowId into a Set of sessionbean.So,In prerender method,calculate result and put into a textfield.ThanksSmile
nsqsmilea at 2007-7-12 21:33:15 > top of Java-index,Development Tools,Java Tools...