Programatically hide a transparent container

Hi Experts,
i am using select options in my application.
i have made two block for the selec options (transparent container 1 and transparent container 2) by using add_block method of select option.So i cant do the normal context binding as containers are created programatically.
Now i have a requirement to hide one of the block on click of an event so that the select options inside is also hidden.
DATA lo_ui_element      type ref to CL_WD_UIELEMENT.
      DATA lo_container       TYPE REF TO cl_wd_uielement_container.
      DATA lo_transc           TYPE REF TO cl_wd_view_element.
" get root container
     lo_container ?= view->get_root_element( ).
*" get button reference
     lo_transc ?= lo_container->get_child() // Get the tray which container the view container of select options.
then inside this i have the transparent container which has the selec options.
Please help
Tashi

Hi Tashi,
1. Add your Select-Options screen elements(Your blocks) to UI View Container element and bind the context to WDUI_VISIBILITY. Set the visibility depends on your requirement.
2. You have REMOVE_SELECTION_SCREEN_ITEM method from Interface IF_WD_SELECT_OPTIONS to remove the fields at runtime.
Please follow the below link
Creation and Deletion of selection screen elements based on user action
Hope it helps you
BR,
RAM.

Similar Messages

  • How to hide a transparent container and its fields in webdynpro abap

    Hello Friends,
    I am trying to create a view where i want to show some fields based on some other field.
    What i exactly need is When i enter some data in 1 input field .
    Corresponding to that input field few text fields wud be opened automatically in the same view.
    No Pop-ups allowed.
    What i am doing is !!
    i have created another Transparent container for my  text view fields.
    But i  am unable to hide this fields..
    Kindly help..
    At the runtime..
    After entering the value in the input field..
    This transparent container should become visible with the textview fields...
    Gaur Mayank

    Hi,
    Create A Context Attribute (Say  Visible_Hide )of Type WDUI_VISIBILITY with initial value as 01.
    Goto your Container, Bind the Visible Property with Above Created Attribute(Visible_Hide).
    In the Input Field,Use the OnEnter Event and Set the Value to Visible_Hide as 02.
    Then the Container will be Visible.
    Thaks.
    Uma

  • Short dump while creating transparent container dynamically

    Hi experts!
    I want to create a transparent container dynamically, but I get a Short Dump (
    Note
    The following error text was processed in the system NSP : Access via 'NULL' object reference not possible.
    The error occurred on the application server Datatrain_NSP_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: CREATE_BY_VIEW_ELEMENT of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP)
    while doing so. Below my code...
    Can somebody please advise I don't know what I did wrong....
    Thanks in advance!
    Points will be rewarded
    METHOD wddomodifyview .
    DATA: lr_container TYPE REF TO cl_wd_uielement_container,
            lr_matrix_head TYPE REF TO cl_wd_matrix_data,
            lv_hlp_str TYPE string VALUE 'DYNCONT_1',
            lr_trans_cont TYPE REF TO cl_wd_transparent_container.
        lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    CALL METHOD cl_wd_transparent_container=>new_transparent_container
      EXPORTING
        enabled                  = ABAP_TRUE
        id                       = lv_hlp_str
        is_layout_container      = ABAP_TRUE
      receiving
        control                  = lr_trans_cont
        lr_matrix_head = cl_wd_matrix_head_data=>new_matrix_head_data(
                            element = lr_trans_cont ).
        lr_trans_cont->set_layout_data( lr_matrix_head ).
        lr_container->add_child( lr_trans_cont ).

    Hi Felix,
    You need to set the layout first and then set the layout data. Use the method cl_wd_matrix_layout=>new_matrix_layout. Do a set_layout on the container and then do set_layout_data. That should solve your problem.
    Regards
    Nithya

  • Add a Transparent Container dynamically in wddomodifyview

    Hi All,
    I have added UI Elements to views before. Now, I am trying to add a Transparent Container to a Group, which does not work. I am using the same procedure as I have used it for other UI Elements before, but I keep receiving the dump:
    The following error text was processed in the system JIL : Access via 'NULL' object reference not possible.
    The error occurred on the application server SV-SAP-2_JIL_01 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: CREATE_NW7_BY_VIEW_ELEMENT of program CL_NW7_VIEW_ELEMENT_ADAPTER===CP
    My code is as follows:
    lo_group ?= view->get_element( 'GROUP' ).
        lo_tc = cl_wd_transparent_container=>new_transparent_container( id = 'TC_SECOND_ELEMENT' ).
        cl_wd_matrix_head_data=>new_matrix_head_data( element = lo_tc ).
        lo_group->add_child( the_child = lo_tc ).
    Why does the coding above not work?? How is the proper coding to add a Transparent Container to my group?
    THANKS, Johannes

    Hi,
    Your coding seems to me fine. Though i am not sure if this line causes the error.
    cl_wd_matrix_head_data=>new_matrix_head_data( element = lo_tc ).
    I normally get this error when the UI element property is not binded correctly. How sure are you that this error is coming  because of this TransparentContainer ?.
    You can comment out the whole and check if this is working.
    Then enable one by one and see if you get it worked.

  • Dynamic Programming: Adding Transparent Container to Root Element

    Hi,
    I simply am adding a Transparent Container to the Root Element dynamically and I am getting the error "The ASSERT condition was violated".
    Does anyone have an idea what the problem is.
    Below is my VERY MUCH simplified code:
    method WDDOMODIFYVIEW .
      DATA:
        LR_ROOT TYPE REF TO CL_WD_UIELEMENT_CONTAINER,
        LR_TCONTAINER TYPE REF TO CL_WD_TRANSPARENT_CONTAINER,
        LR_FLOW_DATA TYPE REF TO CL_WD_FLOW_DATA.
      LR_ROOT ?= VIEW->GET_ROOT_ELEMENT( ).
      LR_TCONTAINER = CL_WD_TRANSPARENT_CONTAINER=>NEW_TRANSPARENT_CONTAINER(
        id = 'TCONTAINER_01' ).
      LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( LR_TCONTAINER ).
      LR_TCONTAINER->SET_LAYOUT_DATA( LR_FLOW_DATA ).
      LR_ROOT->ADD_CHILD( LR_TCONTAINER ).
    endmethod.

    Found the answer on this link:
    Creating dynamic tranparent container

  • Dynamic programming: Add transparent container to root container

    Hi all,
    I'm trying to add a transparent container to the root container,
    but I´m getting this error: 'ASSERT condition was violated'
    METHOD WDDOMODIFYVIEW .
      DATA: LR_ROOT       TYPE REF TO CL_WD_UIELEMENT_CONTAINER,
            LR_TCONTAINER TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
      LR_ROOT ?= VIEW->GET_ROOT_ELEMENT( ).
      LR_TCONTAINER = CL_WD_TRANSPARENT_CONTAINER=>NEW_TRANSPARENT_CONTAINER( ).
      CL_WD_FLOW_DATA=>NEW_FLOW_DATA( LR_TCONTAINER ).
      LR_ROOT->ADD_CHILD( LR_TCONTAINER ).
    ENDMETHOD.
    Is something wrong with this code?
    Thank you.
    Regards,
    Thomas

    >
    Giscard Rous wrote:
    > I have the same problem.
    > I am getting the error "The ASSERT condition was violated".
    >
    > I have reduced my code to just simply add a transparent container to the rootuielement and I am getting the error.
    >
    > I could not figure out why.  Does anyone have info on this?  Thanks.
    >
    > Giscard
    My problem was the layout, after I added it, the problem was solved.
    METHOD WDDOMODIFYVIEW .
      DATA: LR_ROOT       TYPE REF TO CL_WD_UIELEMENT_CONTAINER,
                 LR_TCONTAINER TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
      LR_ROOT ?= VIEW->GET_ROOT_ELEMENT( ).
      LR_TCONTAINER = CL_WD_TRANSPARENT_CONTAINER=>NEW_TRANSPARENT_CONTAINER( ).
      CL_WD_FLOW_DATA=>NEW_FLOW_DATA( LR_TCONTAINER ).
      CL_WD_FLOW_LAYOUT=>NEW_FLOW_LAYOUT( LR_TCONTAINER ).
      LR_ROOT->ADD_CHILD( LR_TCONTAINER ).
    ENDMETHOD.
    Hope it helps you.
    Regards,
    Thomas

  • Generate a dynamic Transparent container in WD

    Hi all,
    i' ve created a Transparent conatiner in where i will write my text, i also created a Button (ADD)
    what i want now is, after clicking on the (Add) Button, a new Transparent container will appear, 
    how can' I do this dynamically??  i dont want to create 10 or 20 transparent container in my main view, i want to create  only one, and after clicking on the Add Button, an other one will appears,
    is there a way or any method to do this?
    thank you all for your help

    Hello Thomas,
    You could refer the below thread. [thread|Re: How to dynamically generate a transparent container ?]
    all the code required to do things dynamically has to be inside wddomodifyview method of that particular view.
    Since you want that on a click of a button you would like to add a new transparent container, you could create a varible of type wdy_boolean under attributes tab of the view and onaction associated with the button you change that value and you write the code for transparent container in wddomodifyview, and before that could you could have a if statement if variable value is true you would run the below code.
    Regards
    Anurag Chopra

  • ABAP: Dynamic creation of transparent container

    Hello,
    I have this code and it fails (null pointer exception):
    transparent_container = cl_wd_transparent_container=>new_transparent_container( ).
      cl_wd_grid_data=>new_grid_data( element = transparent_container ).
      ui_container->add_child( transparent_container ).
    What is the problem? Do I need to create transparent container and pass some parameters?
    Thank you.

    Hello Armin,
    yes it is.
    I have some code like this:
      "create a transparent container
      transparent_container = cl_wd_transparent_container=>new_transparent_container( ).
      cl_wd_grid_data=>new_grid_data( element = transparent_container ).
      ui_container->add_child( transparent_container ).
      "create a dropDown with figures
      drop_down_figure = cl_wd_dropdown_by_key=>new_dropdown_by_key( bind_selected_key = 'REPOSITORY.FIGURES' on_select = 'GET_OPERATOR' ).
      cl_wd_grid_data=>new_grid_data( element = drop_down_figure ).
      ui_container->add_child( drop_down_figure ).
    If I comment out code where I create transparent container it works fine and creates dropDown.
    However, as soon as I add transparent container I get NullPointer exception.
    Thank you.

  • Dynamic Transparent Container

    Hi,
    I am new to Web Dynpro. I have the following problem.
    How to set Streched horizontal property in Transparent Container dynamically?
    Thanks,
    Peter,

    hi
    hope it will be very helpful
    IWDTransparentContainer transNew=(IWDTransparentContainer)view.createElement(IWDTransparentContainer.class,"TranName");
    transNew.createLayout(IWDMatrixLayout.class);
    transNew.destroyAllChildren();
    IWDMatrixLayout gl=(IWDMatrixLayout)transNew.createLayout(IWDMatrixLayout.class);
    gl.setStretchedHorizontally(false);
    gl.setStretchedVertcally(false);
    if you give gl.setStretchedVertcally(false);
    it will be very compact structure in your view
    Regards
    Dhinakar J

  • Transparent Container Cell Background design

    Hi All,
    I have a scenario where in on click of a link, I'm needed to highlight a transparent container. In Webdynpro JAVA i used to achieve this using Transparent Container -> cellBackGroundDesign -> WDCellBackgroundDesign.BORDER
    What is the equivalent of this in WD ABAP. I do not find any such attribute in particular.
    Any pointers on this will be of great help.
    Thanks & Regards,
    Gayathri Shanbhag

    Hi All
    On switching from flow to matrix layout I found the property cellBackGroundDesign, but it is not bindable to an attribute, in my scenario I'm needed to set the border/highlight dynamically. Please suggest if there is an alternative.
    Thanks & Regards,
    Gayathri Shanbhag

  • Transparent Container UI Element

    Hi
    I am new to Web Dynpro for ABAP and have been tasked with the creation of a complex input screen with a tabbed strip of 12 tabs with 7 columns on each tab.  Each column also has multiple input fields on it. 
    My question is in the design of the screen.  I am currently equating the Transparent Container as an (X)HTML DIV tag for my screen formatting.
    Would this be a fair assumption?
    Are there any documents on screen design?
    Regards
    Ian

    Ian,
    For HTML client TransparentContainer is in fact rendered as DIV element. Though, it may be changed.
    Anyway, this is quite safe analogy.
    For your task you may use either:
    1. Matrix/Grid layout of Tab content and no Transparent containers at all. You may get columns effect using layout only.
    2. Matrix layout with 7 columns (one row) and transparent container in every cell. Use this only if [1] is not suitable, i.e. when layout in every column differs too much.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • On-Enter action/ event on UI Elements Transparent Container/ Tray

    Dear Experts,
    Is there any way to implement the On-Enter action/ event on the UI Elements Transparent Container/ Tray?
    Thanks.
    Tee

    Hi Tee,
    As such there is no OnEnter event for either tray or transparent container but tray has some other events like onToggle associated with it.
    Refer this online help: http://help.sap.com/saphelp_nw70ehp1/helpdata/en/42/b6836382323122e10000000a1553f7/content.htm
    I hope it helps.
    Regards
    Arjun

  • Scroll Container/ scrollable Transparent Container

    Hi,
    I have a table with many columns (14), which can't be shown all on the screen.
    That's why there appears a scrollbar on the bottom of the whole page. But as there
    are also some other elements on the screen, which should be also visible, when scrolling
    to the side to see the last columns of the table, I tried to use a scroll container for the table.
    But when I turn on the scroll mode to "both", the table is not visible anymore... just a very small
    line-like object is shown on the screen...
    Can anybody tell me how to use a scroll container / transparent container to scroll the table horizontally,
    without scrolling the whole screen?
    Thank you very much!

    HI,
    Try to set some columns as fixed and use scorllable col count property in the TABLE UI element.
    Regards
    Lekha.

  • Sizing of transparent container

    Hi All,
    I have the following problem. I have a business graphic inside a transparent container. The business graphic can get quite wide. I would like to limit the width of the container to the witdth of the broser window. If the graphic is wider that the container
    a scroll bar should appear in the container.
    Now how to set the size of the container to be at most the window size. I do not want to set a fixed width as the width should depend on the window. If I set it to 100% the grafic will  determine the container width, and it will become larger than the window causing an horizontal scroll bar in the browser that i don't want. If I set the scroll mode of the container to auto or both, without setting a fixed height or width, I get a zero size container.
    Any Ideas?
    Thanks,
    Reinhold

    Hi Chris,
    Yes that is exatly my problem. The grahic is larger than the screen width, causing a horizontal scroll bar for the whole application.  I would like to encase the graphic in an area that has its own scroll bar, and covers 100% of the screen width, but ot more.
    Unfortunately it does not work for me. I have created the two transparent containers around my graphic . The outer one has a grd layout and its width set to 100%. The inner one also has a width of 100% .
    The scrolling attribute of the outer is set to auto. 
    -> Size of outer container is as large as the graphic, no scroll bars in container
    Scroll bars only appear if I set a fixed hight or width for the outer container, which I want to avoid. Or is there any way to determine the browser window width? In that case I could set the container width to the window width..
    Thanks for your help,
    Reinhold
    Edited by: Reinhold Konnerth on Apr 22, 2010 12:27 PM

  • Move transparent container from tab to new view

    Hi
    I have a scenario where I wish to move the whole layout structure from a tab to a new view.
    Essentially I want to move from a tabstrip to a roadmap type of development.  My issue is that if I copy the transparent container that houses the whole structure, when I paste the structure all my elements have _CP. Is there any way to paste without have this suffix?
    Cheers
    Ian

    >
    Thomas Jung wrote:
    > I can't think of any offical way of doing this. 
    >
    > I have one suggestion - but it is totally not supported by SAP and if anyone asks you didn't get it from me.
    > You could use SAPLink to export the component to XML.  Once in XML on your desktop, use a text editor to do a mass find and replace.  Then reimport the same object back into your system via SAPLink.
    > [http://code.google.com/p/saplink/|http://code.google.com/p/saplink/]
    >
    > Just curious however - why worry about the _CP on the UI elements at all?  It is just that you don't like the prefix?  I agree it makes things look messy, but if you are correcting binding UI to your context instead of directly coding against the UI elements (with the rare exception of really dynamic stuff) the IDs of the element shouldn't break anything in your application.
    PS:  Obviously monkeying around with the component using find and replace on the XML and importing via SAPLink could be dangerous. I just thought after I posted I should stress the warning a little more.  You probably want to copy your entire component before attempting this - just incase it completely screws things up.

Maybe you are looking for

  • Need connector from firewire 400 to USB 2 port

    got a new i-book and want to use my old ext hardrive firewire 400 for backup. Is there a cable that connects the new i-book USB port to the firewire 400 ext hard drive so I can use the old external hard drive as backup? Or am I screwed?

  • Cannot uninstall Adobe Flash Player 11 Active X

    hi. i am using avast free antivirus. they have a software updater and all was fine until last week when my flashplayer activex got stuck 'preparing' to update (it seems 'stuck') and never fully updates. i was in touch with avast community (http://for

  • Table for  Open items of the customer

    Hi all , In whch table can the open items of the customer are stored. thanks

  • Distribution List Question

    Good Morning: In Distribution List, I am unsubscribing some email address, and then the List's owner and the subscriber does receive a email with the notification. Can I set any properties for avoid the notification when the subscriber is un-subscrib

  • Make index entries hot links in Word version?

    I'm using RoboHelp 9 (yes, we're behind the times here). I have a question about something that's never worked, but it's been a low priority, so I just kept ignoring it. When I generate a Word version of my project, it has an index, but none of the i