How use checkbox in table ?

Hi All,

I can't get the Set of rows by checkbox selecting when table has a retrieve argument and the checkbox setting auto-submit, whether setting table's retrieve argument to static variable or not.

privatestatic String tabsubstaid;

publicvoid prerender(){

if (tabsubstaid !=null){

dyxxSessGetLineBySubstaid1.setSubstaid(tabsubstaid);

}

}

privatestatic Set selectedLineRows =new HashSet();

publicboolean isSelectedLine(){

TableRowDataProvider trdp = (TableRowDataProvider)getBean("currentRow");

if (trdp ==null){

returnfalse;

}

RowKey rowKey = trdp.getTableRow();

boolean exists =false ;

for(Iterator i = selectedLineRows.iterator(); i.hasNext();){

RowKey rk = (RowKey)i.next() ;

if ( rk.equals(rowKey)){

exists =true ;

break ;

}

}

return exists;

}

publicvoid setSelectedLine(boolean selectedLine){

TableRowDataProvider trdp = (TableRowDataProvider)getBean("currentRow");

RowKey rowKey = trdp.getTableRow();

if (checkbox1.isChecked()){

selectedLineRows.add(rowKey);

}else{

selectedLineRows.remove(rowKey);

}

}

[2647 byte] By [nsqsmilea] at [2007-11-27 4:16:00]
# 1
In setSelectedLine change if (checkbox1.isChecked())for if (selectedLine == true)Best regards.
antoniovla at 2007-7-12 9:22:27 > top of Java-index,Development Tools,Java Tools...
# 2
Hi,antoniovl I has tested by your method,but not be ok.ThanksSmile.
nsqsmilea at 2007-7-12 9:22:27 > top of Java-index,Development Tools,Java Tools...
# 3
Hi,I resolve this problem by putting property of checkbox into session bean.Smile.
nsqsmilea at 2007-7-12 9:22:27 > top of Java-index,Development Tools,Java Tools...