Hi Frauke,
radio buttons can be used in a FIXGRID but only within one line. Please note: one group of radio buttons is maintaining one property. In case of a grid each row belongs to a different object, so radio buttons are not applicable here.
Of course you can use radio buttons inside a grid line - see the screen shot. The only thing you need to pay attention to is to dynamically derive the group name (for the same reason: only one object-property per group).
Björn
XML of the screenshot:
Code:
<t:rowbodypane id="g_3" >
<t:row id="g_4" >
<t:fixgrid id="g_5" objectbinding="#{wp.demoGridwithrb.rows}" sbvisibleamount="10" width="100%" >
<t:gridcol id="g_6" text="A" width="50" >
<t:radiobutton id="g_7" flush="true" group=".{group}" refvalue="A" value=".{prio}" />
</t:gridcol>
<t:gridcol id="g_8" text="B" width="50" >
<t:radiobutton id="g_9" flush="true" group=".{group}" refvalue="B" value=".{prio}" />
</t:gridcol>
<t:gridcol id="g_10" text="C" width="50" >
<t:radiobutton id="g_11" flush="true" group=".{group}" refvalue="C" value=".{prio}" />
</t:gridcol>
<t:gridcol id="g_12" text="Text" width="100%" >
<t:field id="g_13" text=".{text}" />
</t:gridcol>
<t:gridcol id="g_14" text="Prio" width="50" >
<t:field id="g_15" background="#F0F0F0" enabled="false" flush="true" text=".{prio}" />
</t:gridcol>
</t:fixgrid>
</t:row>
</t:rowbodypane>
Java
Code:
package workplace;
import org.eclnt.jsfserver.elements.impl.FIXGRIDItem;
import org.eclnt.jsfserver.elements.impl.FIXGRIDListBinding;
public class DemoGridwithrb extends DemoBase
{
// ------------------------------------------------------------------------
// inner classes
// ------------------------------------------------------------------------
public class MyRow extends FIXGRIDItem
{
String m_prio;
String m_text;
String m_group;
public void setPrio(String value) { m_prio = value; }
public String getPrio() { return m_prio; }
public void setText(String value) { m_text = value; }
public String getText() { return m_text; }
public void setGroup(String value) { m_group = value; }
public String getGroup() { return m_group; }
}
// ------------------------------------------------------------------------
// members
// ------------------------------------------------------------------------
FIXGRIDListBinding<MyRow> m_rows = new FIXGRIDListBinding<MyRow>();
// ------------------------------------------------------------------------
// constructors
// ------------------------------------------------------------------------
public DemoGridwithrb()
{
for (int i=0; i<20; i++)
{
MyRow mr = new MyRow();
mr.setPrio("A");
mr.setText("Text " + i);
mr.setGroup("GROUP"+i);
m_rows.getItems().add(mr);
}
}
// ------------------------------------------------------------------------
// public usage
// ------------------------------------------------------------------------
public FIXGRIDListBinding<MyRow> getRows() { return m_rows; }
// ------------------------------------------------------------------------
// private usage
// ------------------------------------------------------------------------
}