cancel
Showing results for 
Search instead for 
Did you mean: 

problem with dropdownListBox

Former Member
0 Kudos

Hi,

I could able to bring data in dropdownListBox using JCO architecture, but when I am selecting the data and clicking on the button, nothing has been displayed.

I am using the attribute getSingleSelection to retreive the data, I want to know whether it works or not. If not, what attribute I need to choose??

Thanks in advance,

Sriram.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi sree,

SingleSelection is a boolean attribute which states if more then one entry can be selected at a time.

In a DropdownListBox IListModel it must be true.

You need to use getSelection().

Hope that helps,

Yoav.

Former Member
0 Kudos

Hi Yoav Gur

Thank for ur help

but i could not find getSelection(). in JCOListModel

Plz Suggest me by giving me some code

Thanks in advance.

With lot of hope for some help.

Sree ram.D

Former Member
0 Kudos

Hi,

Yoav means that you should use the getSelection() method on your DropdownListBox Object, not on your list model.

Regards,

Patrick.

Former Member
0 Kudos

Hi Patrick,

Thank's for the help.

when i use ddlb.getSelection(); it is giving me an error

where ddlb is an DropdownListBox Object.

Plz Suggest me.

It's Urgent.

Thanks .

Sree Ram

Former Member
0 Kudos

Hi Sree,

What error are you getting excactly?

Are you sure that your ddlb Object isn't null when you call the getSelection() method? Has something been selected in the ddlb before you call getSelection()?

Let me know more about the error and I'll try to help.

Regards,

Patrick.

Former Member
0 Kudos

Hi Patrick,

Im getting the error that there in no object like getSelection() method.

i m not able to get the item im selecting in DDLB.

my intension is to get the item selected in DDlB and display in TABLE VIEW.

I m not able to get the display the item i select in DDLB.

Plz suggest me i giving some code.

Thanks in advance

Former Member
0 Kudos

Hi Sree,

Here's some very simple code as an example of how a DropdownLisBox can be used in an iView.

Make an iView out of this and have a look at what it does, read through the code and see what's going on.

import com.sapportals.htmlb.DropdownListBox;
import com.sapportals.htmlb.Form;
import com.sapportals.htmlb.GridLayout;
import com.sapportals.htmlb.Label;
import com.sapportals.htmlb.event.Event;
import com.sapportals.htmlb.page.DynPage;
import com.sapportals.htmlb.page.PageException;
import com.sapportals.portal.htmlb.page.PageProcessorComponent;

public class DDLBTest extends PageProcessorComponent{
	private String selection = "";
	
	public DynPage getPage(){
		return new OutputDynPage();
	}
	
	public class OutputDynPage extends DynPage{
		public void doInitialization(){
		}// End doInitialization

		public void doProcessAfterInput() throws PageException{
		}// End doProcessAfterInput

		public void doProcessBeforeOutput() throws PageException{
			Form myForm = this.getForm();
			GridLayout gl = new GridLayout();
			myForm.addComponent(gl);
			
			DropdownListBox dd = new DropdownListBox("myDropdown");
			dd.addItem("00", "Please Select");
			dd.addItem("01", "Line One");
			dd.addItem("02", "Line Two");
			dd.addItem("03", "Line Three");
			dd.setOnSelect("onSelect");
			
			Label lb = new Label("myLabel");
			lb.setText(selection);
			
			gl.addComponent(1, 1, dd);
			gl.addComponent(2, 1, lb);
		}// End doProcessBeforeOutput
		
		public void onSelect(Event evt){
			Form myForm = this.getForm();
			DropdownListBox dd = (DropdownListBox)this.getComponentByName("myDropdown");
			selection = <b>dd.getSelection()</b>;
		}// End method onSearch
	}
}// End class DDLBTest

I hope that it helps you, if you have any questions, just ask.

Patrick.