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

Similar Messages

  • 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

  • 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.

  • Adding Root Element

    Hi
    I have an existing structure in XML
    <article>
    <text>
    </text>
    </article>
    Here the element article is holding the content and is associated with the text frame.
    I would like to modify the structure to
    <Root>
    <article>
    <text>
    </text>
    </article>
    </Root>
    But still the article element should only be holding the content and shud be associated with text frame is it possible to do that either manually or through scripting in ID CS3
    Thanks

    Hi Priya,
    assume you have an Xml File imported
    <?xml version="1.0" encoding="UTF-8"?>
    <article>
    <text>myText</text>
    </article>
    and you have dragged <article> from the InDesign xml structure onto a textframe on the layout.
    Now, run this script to apply the Root-Tag to your article.
    myDoc = app.activeDocument;
    myArticleXmlElement = myDoc.xmlElements.item(0);
    myArticleXmlTag = myDoc.xmlTags.item("article");
    myTextXmlElement = myArticleXmlElement.xmlElements.item("text");
    try{
    myRootXmlTag = myDoc.xmlTags.add("Root");
    catch(e){
    myRootXmlTag = myDoc.xmlTags.item("Root");
    myArticleXmlElement.markupTag = myRootXmlTag;
    myNewArticleXmlElement = myDoc.xmlElements.item(0).xmlElements.add(myArticleXmlTag);
    myTextXmlElement.move(LocationOptions.AT_BEGINNING, myNewArticleXmlElement);
    Hope this is what you were looking for. You can do all of this manuallly as well. In fact this is how I began before writing the script.
    Just for curiosity, what is that for ? And can you not just import an Xml that already contains the root element ?
    Stefan

  • 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

  • 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 How to assign a static UI element to a static tray

    Hi There,
    We are enhancing a standard WDA application and we have a few static UI element created on the view. And now we want to rearrange these element to look like this.
    Current:
    Root
    -> Transparent container1
    -> ZTray
    -> Transparent container2
    target
    Root
    -> ZTray
         -> Transparent container1
        -> Transparent container2
    Can you help me to find out me how can i perform this 'move" assignment using dynamic programming.
    Thanks for your inputs.
    Rgds

    Hi Sudhir,
    You can start trying something like this in WDDOMODIFYVIEW.
      DATA:
         lo_element       type ref to cl_wd_uielement,
         LO_CONTAINER    TYPE REF TO CL_WD_UIELEMENT_CONTAINER.
      IF first_time = abap_true.
        LO_CONTAINER ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
        lo_element = LO_CONTAINER->REMOVE_CHILD( ID = 'ZTRAY' ).
        LO_CONTAINER->ADD_CHILD( INDEX = 1
                                 THE_CHILD = LO_ELEMENT ).
      ENDIF.
    I never did something like that. I guess that depending on the layout type of the view this code will need some changes (e.g matrix layout). I tried a simple test with flow layout and worked fine here.

  • InContext editing error: This region contains content with dynamic behavior added..

    We just set up a web site with InContext editing following the procedures in Business Catalyst documentation to do that. But now when we go to the administration section of the site, and turn on InContext editing, it won't let us update the text. We receive an error message:
    "This region contains content with dynamic behavior added..."
    Does anyone know what causes this problem, and how to fix it?

    Hi,
    InContext Editable (ICE) regions can only contains static areas like text and static  assets, it cannot wrap around javascript – populated areas or dynamic content like slideshows. (most likely causing the error)
    ICE can edit only static page content such as regular HTML content. It cannot edit any element that is dynamically updated for example a div (or another element) which is manipulated (created or its contents are modified) by JS– populated areas or dynamic content like slideshows. It cannot edit menus, content holders or content outputted by system modules or tags either.
    By default, on a page that has no ICE editable regions defined the editor attempts to find any regions you might want to edit and if possible make them editable. If it does not find the correct regions you want to edit you will need to explicitly define some editable regions.
    Refer to this article on Defining InContext Editing editable regions - http://kb.worldsecuresystems.com/838/cpsid_83855.html?bc-partner
    Hope this helps!
    -Sidney

  • Root element added in existing mapping PI 7.1

    Hi Experts,
    I got existing mapping with around 500 fields, the source structure is external defination, they added the root element to existing xsd, when i try to import the external definition into the mapping it is giving following error.
    Function model undefined (FUNCMODEL_UNDEF)
    MESSAGE ID: com.sap.aii.mappingtool.mf.mapping.rb_Mapping.FUNCMODEL_UNDEF
    Parameter AMappingTool has the invalid value null
    Is anyone faced this problem before, i am working on PI 7.1, but when i create the new mapping then i can successfully imported the external definition into mapping, but how can i get my existing mapping into new mapping??
    Thanks

    > Is anyone faced this problem before, i am working on PI 7.1,
    Yes, indeed. Report this to SAP.

  • 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 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

  • Add dynamic namespace declaration into xml root element

    Hello all,
    i've have two scenarios (mail to mail and file to file) with the same issue : no namespace in my XML file and i have to create one 'dynamically' from XML values.
    Example :
    <root>
    <name>test</name>
    <email>test</email>
    <schema>schemaID</schema>
    </root>
    Now I want to add infos into the root element for namespace declaration and so on, without expansion of the xsd. I've must use the value from the field schemaID.
    Example:
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns: namespace="http://test.de/schemaID">
    <name>test</name>
    <email>test</email>
    </root>
    I've already done it before through XSLT but it wasn't dynamic !! I don't know how to do it in XSL and i am not a java expert.
    Someone got an idea ?
    Thanks,
    Jean-Philippe.

    Hi,
      If you want to add name space at mapping level two options
    1)Using XSLT Mapping ,its very easy,google it to get sample XSLT code ,it will solve your problem.
    2)Using java mapping,in java mapping use regular expression code ,using regex(Regulkar expresion)we can add any content in message at any level.
    Regards,
    Raj

  • Adding namespace prefix to the XMLa root element

    I am facing a problem in our application. I am assigning an XML content to a XSD variable. While assignment operation is performed the prefix of the XML root element alone is getting replaced with default namespace, though the source XML has the prefix. Please let me know if any patch or workaround is available to address this issue.
    Thanks!

    Hi All,
    we are also facing the same issue, Please provide the solution if anyone knows. We are also using the SOA Suite 11g Version.

Maybe you are looking for

  • The billing doc is not showing in the order  documnet flow in SAP CRM 7.0

    Hi CRM Experts, Our CRM system has been upgraded from 4.0 to 7.0 recently. We have come across with one strange issue; for some orders  which are billed in ECC6.0 are not showing as next document in the CRM order under document flow in SAP GUI. Only

  • How do I increase the text size on my Apple TV?

    I have a nearly new Apple TV with up-to-date software.  I am enormously pleased with the product, for the most part.  Unfortunately, though I am not 'officially' visually impaired, I am quite nearsighted.  Alas, even with my 32 inch 1080P Toshiba LCD

  • My iPod screen is black and won't respond.

    When I hold the home button, Siri responds to what I ask, but nothing else works, there is no screen activity.

  • Weblogic sql injection...

    Hello! I would like to pentest weblogic application using sql injection, Dos, XSS. Can anyone help me what should I do to start testing it? Which tools should I use (I have to use open source tools). I would be very grateful for your help.

  • Evony Memory Leak in Flash Player

    Is there a work-around of any sort for the massive memory leak in the Evony flash player based game?   When you play this game actively, opening dialogs, and submitting attack, the game can easily leak 250MB/hour until the browser grows in size to we