Skip to Content
avatar image
Former Member

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Sep 29, 2008 at 04:58 PM

    For this the context of the fields is binded to a context that is based upon the database structure.

    So I assume you meant to say that your node (which has an attribute/field among others, which should have a dropdown) has the same structure as a database table.

    In that case it will be easier to use DropDownByKey. You just have to set the possible attribute values to that field. For DropDownByIndex you would have to modify your context node structure instead, creating a subnode for the field.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 30, 2008 at 12:07 PM

    Hi,

    please refer to this standard example

    WDR_TEST_UI_ELEMENTS

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 28, 2008 at 10:35 PM

    Maximilian,

    check this link it will give you some sample example names.

    Thanks

    Bala Duvvuri

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • avatar image
    Former Member
    Sep 29, 2008 at 05:30 PM

    Maximilian,

    It's always recommended to create a separate context variable for the dropdown fields which will host your key data.

    This variable will hold your key fields used for your dropdown. You need to write code to refer to the selected element and store value accordingly i main context node.

    Incase, you want to use the existing context node, there can be issues as the key fields of data might get rrepeated in the dropdown.

    Also, dropdown by key is mostly used in scenario's where you need to fill data explicitly based on some condition at runtime. If you are sure your dropwodn wouldn't change, i would recommend go with dropdpwn by index method.

    Regards,

    SV

    Add comment
    10|10000 characters needed characters exceeded