on 2005 Aug 01 11:15 PM
Hello Friends:
I am working on a JSPDynPage which displays a grid of
information, using TableView tag of HTMLB for Java.
One of the columns has user defined type, RadioGroup
with 3 radio buttons in it. For this cell rendering I
implemented custom cell renderer class.
In this custom cell renderer class, I have row,column,
values and TableView object. From these how I can
read/retrieve the value selected from the group of
radio buttons ?
I am looking for the reference of the 'component' object
rendered in one of the cell of the tableviewmodel.
Thank you very much for you help,
Prasad Nutalapati
Hi Prasad,
The code should look following.
//get the first and last visible row
int firstrow = table.getVisibleFirstRow();
int lastrow = table.getVisibleLastRow();
for (int i = firstrow; i <=lastrow; i++) {
IPageContext context = this.getPageContext();
//myTableView is the id of your tableview
AbstractDataType r1 = context.getDataForComponentId("myTableView", "radio1", i);
String val_rad1 = r1.toString();
AbstractDataType r2 = context.getDataForComponentId("myTableView", "radio2", i)
String val_rad2 = r2.toString();;
AbstractDataType r3 = context.getDataForComponentId("myTableView", "radio3", i);
String val_rad3 = r3.toString();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prakash:
Thank you very much for your answer.
It solved my problem. I didn't thought about pagecontext
in a cell renderer class, 'cause I keep thinking that it
is useful either for rendering or only after page has
been submitted.
I could not have thought about this scenario.
Thanks again,
Prasad Nutalapati
User | Count |
---|---|
73 | |
10 | |
9 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.