Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

A problem about dropdownListBox

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

Former Member
Former Member replied

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");

}

}

}

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question