Context binding with dropdownbykey

Hello,
I am programming my first little application and would like to use the dropdownbyindex or dropdownbykey field.
The programm is writing some data to the database. For this the context of the fields is binded to a context that is based upon the database structure.
Without using the dropdown fields everything is working fine.
When I now want to use the dropdown field I have the "problem" that I think that I should bind the context to node that supplies the options/choices  for the dropdown field. But how can I bind this dropdown field to the context that I want to write to the database also? Or can I only bind to the context with the options and have to read the choice and put it in the context to save while saving the record?
Hoping not to write to confused,
  Maximilian

Hi,
Please see the beow link.
[Reg Dropdownbyindex|Reg Dropdownbyindex]
This will give a general idea of Dropdown by Index.
Actually u only need to do this:
1) Bind ur dropdown with a context attribute.
2)Get access to the node_info of the node in which the attribute resides.
3)Populate the dropdown values as shown in the thread.
4) In the OnSelect fn of drop down.
Get vals  selected by user and use them ne where.
I hope it helps.
Revert back with issues.
Regards,
Sumit

Similar Messages

  • Error with the context binding

    hi friends,
    i am binding input_feild with the attribute vkorg
    it was giving error
    The following error text was processed in the system ECC : Adapter error in &VIEW_ELEMENT_TYPE& "IP" of view "ZZZ_TEST13.MAIN": Context binding of property VALUE cannot be resolved: Node MAIN.1.SALES does not contain any elements
    The error occurred on the application server csslecc_ECC_01 and in the work process 0 .
    The termination type was: RABAX_STATE
    but i am giving the cardinality 1 to 1  for the node it was giving solution..
    why we are giving 1to1 here...?
    i am in confusion what is cardinality & what is selection..?
    can anyone explain me in detail,,,,,
    regards,
    karunakar

    Hi Karunakar,
    Collection Cardinality or Node Cardinality is a set of two values that define the minimum and maximum number of elements that a node may hold at run-time and is represented as 0..1, 1..1, 0..n, 1..n.
    The value on left denotes the minimum number of elements that a node must have at runtime and the value at right denotes the maximum number of elements that a node may have.
    Selection Cardinality is again a set of two values like node cardinality but denotes the number of elements that may be selected at run-time. Selection cardinality must not violate Node collection cardinality i.e. if node cardinality is 0..1 0r 1..1, it is invalid to specify 0..n or 1..n as selection cardinality.
    Pleae check this...
    http://help.sap.com/saphelp_erp2005/helpdata/en/7a/787e40417c6d1de10000000a1550b0/content.htm
    Cheers,
    Kris.

  • Dynamic context binding in web dynpro alv

    I use dynamic context binding (see code below to show and edit the ALV table.
    'DB_TABLE' is a tranparent table. It works fine.
    But now this table should be expanded with additional fields which are only known at runtime and could be different from case to case.
    How can I get these fields in the context dynamically?
      DATA:
            rootnode_info TYPE REF TO if_wd_context_node_info,
            dyn_node      TYPE REF TO if_wd_context_node,
            tablename   TYPE string.
      rootnode_info = wd_context->get_node_info( ).
      tablename = 'DB_TABLE'.
      cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
        parent_info = rootnode_info
        node_name = tablename
        structure_name = tablename
        is_multiple = abap_true ).
      DATA:
            stru_tab TYPE REF TO data.
      FIELD-SYMBOLS: <tab> TYPE table.
      CREATE DATA stru_tab TYPE TABLE OF (tablename).
      ASSIGN stru_tab->* TO <tab>.
      SELECT * FROM (tablename) INTO CORRESPONDING FIELDS OF TABLE <tab>.
      dyn_node = wd_context->get_child_node( name = tablename ).
      dyn_node->bind_table( <tab> ).

    You should create a structure dynamically and use this as the context structure. See the coding below, where a structure is created, which contains CARRID and CONNID.
    DATA: node_info type ref to if_wd_context_node_info,
          struct_type TYPE REF TO cl_abap_structdescr,
          table_type  type ref to cl_abap_tabledescr,
          comp_tab    TYPE cl_abap_structdescr=>component_table,
          comp        LIKE LINE OF comp_tab,
          my_table    type ref to data,
          my_row      type ref to data.
      field-symbols: <table> type table,
                     <row> type data,
                     <flight> type sflight.
    * build a structure description from the list of single fields
      comp-name = 'CARRID'.
      comp-type ?= cl_abap_datadescr=>describe_by_name( 'S_CARR_ID' ).
      APPEND comp TO comp_tab.
      comp-name = 'CONNID'.
      comp-type ?= cl_abap_datadescr=>describe_by_name( 'S_CONN_ID' ).
      APPEND comp TO comp_tab.
    * note this structure contains the fields "CONNID" and "CARRID"
      struct_type = cl_abap_structdescr=>create( comp_tab ).
    * now the nodeinfo is created
      node_info = wd_context->get_node_info( ).
      node_info = node_info->add_new_child_node(
        name                         = 'MY_NODE'
        IS_MANDATORY                 = ABAP_true
        IS_MULTIPLE                  = ABAP_true
        STATIC_ELEMENT_RTTI          = struct_type
        IS_STATIC                    = ABAP_false
    * fill new node;
      data: l_node type ref to if_wd_context_node,
            l_flight type STANDARD TABLE OF sflight.
      l_node = wd_context->get_child_node( 'MY_NODE' ).
      l_flight = wd_assist->get_flights( ).
    *  if you could create a local data type, would be fine, but if you have to do it dynamically ...
      struct_type = node_info->GET_STATIC_ATTRIBUTES_TYPE( ).
    * create tabledescriptor from structdescription (standard table, no keys)
      table_type = cl_abap_tabledescr=>create( p_line_type = struct_type ).
      create data my_table type handle table_type.
      assign my_table->* to <table>.
      loop at l_flight assigning <flight>.
        create data my_row type handle struct_type.
        assign my_row->* to <row>.
        move-corresponding <flight> to <row>.
        append <row> to <table>.
      endloop.
      l_node->bind_table( <table> ).

  • Context binding error in Dynamic UI element creation

    Hi,
    I am new to Webdynpro. I am trying to build an app for dynamic table data in an ALV,so creating an input field for table name dynamically.
    I am facing a issue while binding the dynamic input field to the dynamically created context node attribute. The error description is: ERROR: Error in INPUT_FIELD "IF" of view "ZVK_DYNAMIC1.MAIN": Context binding of property VALUE cannot be resolved: The MAIN.1.INPUT node does not contain any elements (termination: RABAX_STATE).
    Following is the code written in wdinit( ) method and wdmodifyview( ) method of the view controller.
    METHOD wddoinit .
       DATA: lr_root_node_info  TYPE REF TO if_wd_context_node_info.
       DATA: lr_input_node_info TYPE REF TO if_wd_context_node_info.
       DATA: ls_attribute_info  TYPE wdr_context_attribute_info.
       lr_root_node_info = wd_context->get_node_info( ).  " get the root node
       CALL METHOD lr_root_node_info->add_new_child_node
         EXPORTING
           name                         = 'INPUT'
           is_multiple                  = abap_false
           is_multiple_selection        = abap_false
    *      is_initialize_lead_selection = abap_false
         RECEIVING
           child_node_info              = lr_input_node_info.
       CLEAR ls_attribute_info.
       ls_attribute_info-name          = 'TABLE_NAME'.
       ls_attribute_info-type_name     = 'STRING'.
       CALL METHOD lr_input_node_info->add_attribute
         EXPORTING
           attribute_info = ls_attribute_info.
    ENDMETHOD.
    METHOD wddomodifyview .
       DATA: lr_ui_root     TYPE REF TO if_wd_view_element.
       DATA: lr_container   TYPE REF TO cl_wd_uielement_container.
       DATA: lr_input_field TYPE REF TO cl_wd_input_field.
       DATA: lr_flow_data   TYPE REF TO cl_wd_flow_data.
       IF first_time EQ 'X'.
         lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
         CALL METHOD cl_wd_input_field=>new_input_field
           EXPORTING
    *       activate_access_key        =
    *       alignment  = E_ALIGNMENT-AUTO
    *       bind_alignment             =
    *       bind_display_as_text       =
    *       bind_display_only          =
    *       bind_enabled               =
    *       bind_ime_mode              =
    *       bind_input_prompt          =
    *       bind_length                =
    *       bind_password_field        =
    *       bind_read_only             =
    *       bind_state =
    *       bind_style_class_name      =
    *       bind_suggest_filter_method =
    *       bind_suggest_values        =
    *       bind_suppress_value_help   =
    *       bind_text_direction        =
    *       bind_tooltip               =
             bind_value = 'INPUT.TABLE_NAME'
    *       bind_visible               =
    *       bind_width =
    *       context_menu_behaviour     = E_CONTEXT_MENU_BEHAVIOUR-INHERIT
    *       context_menu_id            =
    *       date_picker_reference_id   =
    *       display_as_text            =
    *       display_only               =
    *       enabled    = 'X'
    *       explanation                =
             id         = 'IF'
    *       ime_mode   = E_IME_MODE-AUTO
    *       input_prompt               =
    *       length     = '20'
    *       multi_field_suggest        =
    *       no_history =
    *       on_enter   =
    *       on_table_paste             =
    *       password_field             =
    *       read_only  =
    *       state      = E_STATE-NORMAL
    *       style_class_name           =
    *       suggest_filter_method      =
    *       suggest_values             =
    *       suppress_value_help        =
    *       text_direction             = E_TEXT_DIRECTION-INHERIT
    *       tooltip    =
    *       view       =
    *       visible    = E_VISIBLE-VISIBLE
    *       width      =
           RECEIVING
             control    = lr_input_field.
         CALL METHOD cl_wd_flow_data=>new_flow_data
           EXPORTING
    *       cell_design = E_CELL_DESIGN-PADLESS
             element = lr_input_field
    *       id      =
    *       v_gutter    = E_V_GUTTER-NONE
           RECEIVING
             control = lr_flow_data.
         CALL METHOD lr_input_field->set_layout_data
           EXPORTING
             the_layout_data = lr_flow_data.
         CALL METHOD lr_container->add_child
           EXPORTING
    *       index     =
             the_child = lr_input_field.
       ENDIF.
    ENDMETHOD.
    Please help.

    Hi Vishal,
    Actually, for an input field the node should be with cardinality either 1...1 / 1...n. i.e. at least one element should exist. So you need to pass "is_mandatory = abap_true" while creating node.
    Please modify your code as below
    CALL METHOD lr_root_node_info->add_new_child_node
         EXPORTING
           name                         = 'INPUT'
           is_mandatory = abap_true
           is_multiple                  = abap_false
           is_multiple_selection        = abap_false
    *      is_initialize_lead_selection = abap_false
         RECEIVING
           child_node_info              = lr_input_node_info.
    Hope this helps you.
    Regards,
    Rama

  • Binding with ApplicationID

    Hi all,
    Is it possible to bind an ApplicationID with a LDAP server (Active Directory).
    Well the situation is something like this before actually binding with the userDN and password, the AD is actually first bound with the AppID (which is picked from the properties file).
    Also to which parameter shud i put this AppId with, in the Properties(environment)...like for example for the password we have:
    props.put(Context.SECURITY_CREDENTIALS,pwd);
    Please advice,
    Thanx in advance,
    Regards
    Hari

    Thanx it is solved.
    Regards
    Hari

  • Help - WDJ can't read the context bind to adobe form after upgrade version

    Dear all,
        previously i have the webdynpro java application with adobe form, it works fine when i use Adobe Reader 7.0 but after i upgrade my Adobe Reader to 8.1... all the context bind to the adobe form cannot be read anymore.. any idea?? please advice. thank you..I am using Adobe live cycle designer 7.1 thanks

    Hi Joan,
    You have to go in the following sequence:
    Uninstall Adobe Reader 7 & ACF -> Install Adobe Reader 8 -> Install ACF
    Hopefully it will work.
    Cheers
    Arafat

  • Context binding of property value cannot be resolved. not contain any eleme

    I have a binding of a inputelment to a context element. the context can be empty. when it is empty it throws the error only when i have that binding. I thougt its not interesting for an inputfield to have a value or? 
    Following error occurs: The following error text was processed in the system DBW : Adapter error in &VIEW_ELEMENT_TYPE& "ZPM_PROJ" of view "ZPM_MD_PMON.STARTVIEW": Context binding of property VALUE cannot be resolved: Node STARTVIEW.1.PROJ does not contain any elements

    Hi,
    The thing is that you're trying to access node which might be from 0 to 1 or n records (cardinality). And at runtime point you have 0 records with 0 elements. That's why you have problem.
    There might be something wrong with logic how you trying to display some data in your text fields.
    At runtime there is no context element from which system could take values.
    Or you have to change parent node cardinality to 1..1 if that meets logic or review your logic.

  • TREE --Context binding of property TEXT cannot be resolved:

    I have the following Error
    Adapter error in &VIEW_ELEMENT_TYPE& "OBJID" of view "YFIDOA_YEAR_EVAL.MAIN": Context binding of property TEXT cannot be resolved: Node MAIN.1.TREE_NODE.1.MAIN_ORGEH.1.ORGEH.1.PERNR does not contain any elements
    Requirement
    I have two group ( TREE section , Detailed Section )
    Tree Section  have a 4 Top Org Units loaded initially when clicking on each Top org, it expands as a Tree and goes deep strucure. No trouble in populating Tree, 
    when I bind the Text element in the Detailed section  with the PERNR, I get the Above Error.
    Configuration & Code
    All cardinalities are 0..N, initailization Lead selection is set for all the NODES.
    TREE_NODE > MAIN_ORGEH > ORGEH > PERNR > OBJEC
    Main_ORGEH has ORGEH,  the attribute TOP_ORG and the SUpply function GET_MAIN_ORGEH
    ORGEH has PERNR, attribute OBJID and the Supply function GET_ORGEH.
    PERNR has OBJEC structure , attributes PERNR, CALC_AMT, ENAME and supply Function GET_PERNR
    OBJEC has the structure objec strucutre
    Question
    I dont understand why PERNR > Pernr is not being read ? why is it telling me it is empty?
    Any suggestions ?

    The testing Org unit does not have any pernrs , as a result it was not allowing NULL values at the NODE PERNR level ( though NULL VALUE for the PERNR attribute is set).
    On passing some dummy values, the Error is cleared.
    I was even populating the Chief of the Org values as default to avoid NULL Values.

  • Installing context bundle with services != deploying bundle

    Hi! We ran into some problems with deployment of context packages with bundles in them to CQ 5.6. It seems like the bundles that are in the package get activated and the services registered... but the binding of the @Reference variables is not happening ( i.e. bindSomeVariable() is not getting invoked). This is somewhat weird since while deploying the bundle standalone or refrehing it in the admin console i can see bind methods beind called right after the service registration events happen. I tried adding immediate=true to my components, and while it solves the problem i would like to know if it is the right approach and why there is a difference.
    Cheers

    Services are activated lazy (unless you specify "immediate=true" to the @Component annotation). Are you sure, that your service code is/should be actually used in the very moment you deploy your package?
    Jörg

  • How to insert a null value to combobox which is bind with datasource

    Hi,
    i am working on c# winforms application. I have 2 comboboxes one is CustomerCbBox and another is OrderCbBox. CustomerCbBox is bind with data source.
    on CustomerCbBox SelectedIndexChanged event data is populated in OrderCbBox from data source. 
    i want to add a null or empty field in CustomerCbBox. all I want is that when the user don't Select Customer Name and OrderNo null or empty data enter in database. but when i click Insert Button it generate error "Object reference is not "object
    reference not set to an instance of an object".
    here is my code.
      private void MainForm_Load(object sender, EventArgs e)
    production pd = new production();
    CustomerCbBox.DataSource = pd.Customer();
    CustomerCbBox.DisplayMember = "Cust";
    CustomerCbBox.ValueMember = "CustId";
     private void CustomerCbBox_SelectedIndexChanged(object sender, EventArgs e)
                      try
                          string PartyName = CustomerCbBox.SelectedIndex.ToString();
                           PONum1.DataSource = pd.GetPOnumActive(PartyName1);
                              PONum1.DisplayMember = "PONum";
                              PONum1.ValueMember = "PONum";
                      catch (Exception ex)
                          MessageBox.Show(ex.Message);
         Please help me to solve this problem thanks.      

    Hello,
    We could check whether the user has selected any items before adding that to database.
    if (CustomerCbBox.SelectedIndex > -1)
    // do something
    }else{//add dbnull to database}
    And for adding null to databse, we could pass DBNull.Value instead.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Performance of context index with sorting

    Dear All,
    I've got a problem and don't know how to solve this.
    there has a table which have a XMLTYPE field to store the unstructred xml, and created with context index.
    When I try to select a record from it by using contains (res, '[searchingfield]')>0, the response time is quick, but when I try to order by another field which in the same table, the response time is drop down slightly. (ex. select id, path, res, update_date from testingtbl where contains(res, 'shopper')>0 order by update_date desc.
    Actually there is a context index build for field 'res', any other index build for field 'update_date', when sql without 'order by update_date', the context index will use, but the update_date index will not be used even have ordering criteria.
    Is there any expect can tell how to solve this? how to keep the performance even doing the sorting process?
    Thanks and Regards
    Raymond

    Thanks for your quick reply.
    The mentions information provide after back to office, actually I just want to know if there is any method(s) which can use the context index (with contains keyword) and sorting without slow down the performance.
    Thanks and Regards
    Raymond

  • Customizing wad context item with BI 7.0

    Hello,
    we want to add standard command SAVE_AS in context menu. How is it possible to add specific item to context menu with WAD 7.0 ?
    Thank's
    Thierry

    The following links might help
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/43/1776b8fa923614e10000000a422035/content.htm
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/44/624da0e6444ddee10000000a1553f7/content.htm

  • How to create a page  to bind with spreadsheet

    Hi ,
    Am using jdev 11.1.2.2.0. I need to create the custom spreadsheet to integrate with fusion application. currently am referring one document which i got in google. find the link below:
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/jdev/obe11jdev/ps3/tutorial_adfdi/adfdinewtutorial/jdtut_11r1_59_1.html
    In this example they have taken the workspace ADFdi_BC.jws . But i need the process for developing this ADFdi_BC application. And then it is very clear in the document to bind with excel.
    Can you pls share this document to create ADFdi_BC application.
    Thanks in advance!!!!!

    Hi,
    I guess, this application is a simple Employee-Department application using the HR schema.You can search for a simple ADF BC application in google to get step-by-step tutorial for that.
    -Arun

  • Is that possible to add a listener to a class that bind with a image?

    Hello, I am trying to add listener to a class that binds with image.  For example, I want to add listener to customDividerSkin(see example below, i bold and underline the text), so when user click the customdividerSkin image haloGreen box will be hided. Thanks,
    <?xml version="1.0" encoding="utf-8"?>
    <!-- http://blog.flexexamples.com/2008/09/18/customizing-the-divider-skin-on-a-dividedbox-conta iner-in-flex/ -->
    <mx:Application name="HDividedBox_dividerSkin_test"
    xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="vertical"
    verticalAlign="middle"
    backgroundColor="white"
    initialize="init();">
    <mx:Script>
    <![CDATA[
    [Embed("arrowLeft.png")]
    private const customDividerSkin:Class;
    private function init():void
    dividedBox.setStyle("dividerSkin", customDividerSkin);
    ]]>
    </mx:Script>
    <mx:HDividedBox id="dividedBox"
    horizontalGap="24"
    width="100%"
    height="100%">
    <mx:ViewStack id="AddFormViewStack"
      width="100%"
      height="100%">
    <mx:Box id="box1"
    backgroundColor="haloGreen"
    width="100%"
    height="100%"
    minWidth="100"/>
    <mx:Box id="box2"
    backgroundColor="haloBlue"
    width="100%"
    height="100%"
    minWidth="100"/>
    </mx:ViewStack>
    </mx:HDividedBox>
    </mx:Application>

    Set the class as the source for an mx:Image and set the listener to the  Image

  • Open Flash Player context menu with keyboard?

    Is there a way to open the Flash Player (9 or 10) context menu with the keyboard?
    We are building applications that require full keyboard support, and it is desrable to add some custom items to the Flash Player context menu. However, if keyboard-only users cannot access the menu, we will have to find a different solution.
    thx

    Thanks. That's just what I needed to know.
    The Mouse Keys method worked fine. I couldn't get the VoiceOver approach to work, but I was just looking for one method.
    Too bad none of this is enabled by default. I find Apple's strong dependency on the mouse to be a pain, but I guess they're targeting a market of less experienced users.

Maybe you are looking for