Skip to Content
author's profile photo Former Member
Former Member

problem with dropdownListBox

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2005 at 08:07 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.