Hii everyone
I need to have my gird's first row selected by default on load. is there any attribute to do this.
ig:columnSelectRow is not useful for me because it has a check box and also it will not select a row by default. when i tried to take the view soruce(HTML) of the page i didn't found any code related to ig:column. As i am new to this i dont have much knowledge. please help me
Hello Vijayada,
Using the ig:columnSelectRow, it may not possible to select only one row on pageload. The thing which you can do is to use h:selectBooleanCheckbox in the first column and bind its value attribute in your bean methd returning boolen.
If you want to make first row selected then you just need to set the "true" in your backing bean for the fild returning the boolean.
Following is the code snippets for your reference:
<ig:gridView binding="#{bean.grid}" dataSource="#{bean.gridData}" pageSize="5"> <ig:column resizable="true"> <h:selectBooleanCheckbox value="#{DATA_ROW.selected}"> </h:selectBooleanCheckbox>
<f:facet name="header"> <h:outputText value="Select"></h:outputText> </f:facet>
</ig:column>..</ig:gridView>
Note: Here " value="#{DATA_ROW.selected}" is the key part to make the check box selected for the row (selected is the ). Just use boolean value according to your need to make row selected.
Roshan
You can refer the following smaple to get better implementation use of this.
http://www.componentsforjsf.com/WebGridExamples/faces/examplePages/RowSelectionWithPersistence.jsp