on 05-19-2006 7:37 AM
Hi,everyone.
I write a dropdownListBox.
<hbj:dropdownListBox
id="Class1Select"
selection="No"
onSelect="Class1_Selection"
>
<hbj:listBoxItem key="No" value="No" />
<hbj:listBoxItem key="NB" value="NB" />
<hbj:listBoxItem key="Mp3 "value="MP3" />
<hbj:listBoxItem key="LCD" value="LCD" />
</hbj:dropdownListBox>
I want to get the value when event onSelect is triggered.
So i write some codes in doProcessAfterInput()
DropdownListBox mySelect=(DropdownListBox) getComponentByName("Class1Select");
But i always get nothing.
Is it something wrong?
Thx
HI,
Your Jsp is OK.
JspDynpage Code
=================
package com.cts.anand;
import com.sapportals.htmlb.DropdownListBox;
import com.sapportals.htmlb.RadioButtonGroup;
import com.sapportals.htmlb.event.Event;
import com.sapportals.htmlb.page.DynPage;
import com.sapportals.htmlb.page.PageException;
import com.sapportals.portal.htmlb.page.JSPDynPage;
import com.sapportals.portal.htmlb.page.PageProcessorComponent;
import com.sapportals.portal.prt.component.IPortalComponentResponse;
public class SDN11 extends PageProcessorComponent {
public DynPage getPage(){
return new SDN11DynPage();
}
public static class SDN11DynPage extends JSPDynPage{
public void doInitialization(){
}
public void Class1_Selection(Event e) {
}
public void doProcessAfterInput() throws PageException {
DropdownListBox mySelect=(DropdownListBox)this.getComponentByName("Class1Select");
String s =mySelect.getSelection();
IPortalComponentResponse resp = (IPortalComponentResponse)this.getResponse();
resp.write(s);
}
public void doProcessBeforeOutput() throws PageException {
this.setJspName("SDN11.jsp");
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Louis,
Try to get the value in the event handler Class1_Selection method. Try this.
DropdownListBox mySelect=(DropdownListBox) getComponentByName("Class1Select");
String sel = mySelect.getTextForKey(mySelect.getSelection());
Regards,
Harini S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.