Skip to Content

Dynamic Tray- events

Hi All,

I have two trays and with few UI elements in Each.

I want to handle dynamically, if one tray is selected  i want to collapse the other tray,similarly vice versa.

The Trays i have created in the layout and there is no binding done.

regards,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Feb 06, 2014 at 11:50 AM

    Create a node with 2 attribute.. bind the Expanded property of tray with attribute..

    OnToggle, change the value of attribute accordingly.


    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      Are you looking for the below code snippet!

      DATA lr_tray TYPE REF TO cl_wd_tray.

        lr_tray ?= view->get_element( 'MY_TRAY' ). " Name of your tray

            CALL METHOD lr_tray->set_expanded

              EXPORTING

                value = abap_false.

      Regards,

      Kiran

  • Feb 06, 2014 at 12:33 PM

    Hi Naren,

    As Chandra told, create two attributes of property WDY_BOOLEAN and bind those attributes

    to each tray accordingly.

    Now change the values of those attributes in OnToggle method.

    lets say

    if tray1 u want to expand, write attr1 = 'X' and attr2 = ' '

    if tray2 u want to expand, write attr1 = ' ' and attr2 = 'X'.

    Hope it is helpful.

    Best regards,

    Rao.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 06, 2014 at 11:41 AM

    I think you'll need to bind those trays if you want them to be dynamic...

    May I ask why you've chosen not to do this?

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 06, 2014 at 12:48 PM

    Thanks all for your replies, will try the logic mentioned.

    Regards,

    Add comment
    10|10000 characters needed characters exceeded