Punya
Posts: 2
|
Posted: 09/09/2005, 9:34 AM |
|
Hi,
Here is an exmple of a list box:
<select name="s1">
<option value="4">four</option>
</select>
I can retireve the option's value as
e.getGrid().getControl("s1").getValue();
I looked at ListBox. It has something called getTextColumn() which returns Text column NAME. Anyone knows how to retrieve the text value displayed?
Thanks,
Punya
|
|
|
matheus
Posts: 386
|
Posted: 09/09/2005, 12:19 PM |
|
I didn't test, but I think is getBoundColumn() in ListBox object. (Maybe need cast object control to ListBox)
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
|
|
matheus
Posts: 386
|
Posted: 09/09/2005, 12:24 PM |
|
getBoundColumn() get bd field name.
Must look in ListBox and List class any tip.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
|
|
Punya
Posts: 2
|
Posted: 09/09/2005, 1:01 PM |
|
getBoundCoulm() just returns the name of the bound column defined for the list box while creating the grid. But don't see any direct method that retrieves the selected option's text. Looks like there is a workaround by getting getOptions() method. Will try that if nothing works
Thanks,
Punya
|
|
|
matheus
Posts: 386
|
Posted: 09/09/2005, 1:49 PM |
|
Enumeration enumeration =
((ListBox)e.getControl()).getFormattedOptions();
while ( enumeration.hasMoreElements() ) {
String[] option = (String[]) enumeration.nextElement();
if (option[List.SELECTED] != null) {
System.out.println(option[List.TEXT_COLUMN]);
}
}
Something like this.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
|
|
sheetal
|
Posted: 11/30/2005, 4:23 AM |
|
Quote :The same can be done in the jsp page where the form action is by:
String s1 = request.getParameter("listbox_name");
|
|
|
sheetal
|
Posted: 11/30/2005, 4:24 AM |
|
Quote :The same can be done in the jsp page where the form action is by:
String s1 = request.getParameter("listbox_name");
|
|
|
sheetal
|
Posted: 11/30/2005, 4:26 AM |
|
Quote :The same can be done in the jsp page where the form action is by:
String s1 = request.getParameter("listbox_name");
|
|
|
matheus
Posts: 386
|
Posted: 11/30/2005, 8:02 AM |
|
It's wrong.
Parameter was value not text.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
|
|