Webdynpro Dynamic layout manipulation: error attaching elements to Group

Hi Experts,
I am trying to create dynamic layout during run time. Itu2019s working partially, but as soon as I add new u201CGroup elementu201D or new u201CTransparent elementu201D I am getting a null error. If I just use buttons, input field or text dynamically layout create it works fine. I want to group this fields in a groups or transparent container so that I can manipulate layout place containers where I need. As soon as I add other element (inputfield/button/text) to transparent element it errors. I have attached code below for more detail. Does anyone have similar issue? Lot of demo and example code show how to create elements (inputfield/button/text) none show how attach those element back to u201DGroupu201D or u201CTransparentu201D element.
I am creating dynamic elements in u201CViewu201D method u201CWDDOMODIFYVIEWu201D. Any idea or clue much appreciated. Thanks in advance.
Kind Regards,
Trim
method WDDOMODIFYVIEW .
  DATA lr_container  TYPE REF TO cl_wd_uielement_container.
  DATA lr_trans_cont TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
  DATA lr_input      TYPE REF TO cl_wd_input_field.
  DATA lr_table      TYPE REF TO cl_wd_table.
  DATA lo_nd_sflight TYPE REF TO if_wd_context_node.
  DATA lr_button     TYPE REF TO cl_wd_button.
  DATA lr_o_group     TYPE REF TO cl_wd_group.
  data: lr_text TYPE REF TO CL_WD_TEXT_VIEW.
  constants : gc_trs_cont type string value 'Trscont',
              gc_text1 type string value 'ePDA goals and activity of the team',
              gc_text2 type string value 'Complete all box and submit to manager'.
  DATA lo_el_context TYPE ref to if_wd_context_element.
navigate from <CONTEXT> to <SFLIGHT> via lead selection
  lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ).
  IF first_time = abap_true.
    lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    DATA lr_grid_data TYPE REF TO cl_wd_grid_data.
    DATA lr_flow_data TYPE REF TO cl_wd_flow_data.
    DATA lr_matrix    TYPE REF TO cl_wd_matrix_head_data.
    DATA lr_matrix_l    TYPE REF TO cl_wd_matrix_layout.
    DATA lr_matrix2    TYPE REF TO cl_wd_matrix_data.
   CALL METHOD CL_WD_TRANSPARENT_CONTAINER=>NEW_TRANSPARENT_CONTAINER
     EXPORTING
       ID      = '/0CUST/123'
       VIEW    = view
       WIDTH   = '100%'
     RECEIVING
       CONTROL = lr_trans_cont.
   lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_trans_cont ).
   lr_container->set_layout_data( lr_matrix ).
    data: lr_o_caption type ref to cl_wd_caption.
    CALL METHOD CL_WD_GROUP=>NEW_GROUP
      EXPORTING
        ID      = 'GRP1'
        design  = '03'
      RECEIVING
        CONTROL = lr_o_group.
   lr_o_caption = cl_wd_caption=>new_caption( text = 'Group1' ).
   lr_o_group->set_header( the_header = lr_o_caption ).
   cl_wd_flow_data=>new_flow_data( element = lr_o_group ).
   cl_wd_flow_layout=>new_flow_layout( container = lr_o_group ).
    lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_o_group ).
    lr_o_group->set_layout_data( lr_matrix ).
    CALL METHOD lr_container->add_child
      EXPORTING
        index     = 1
        the_child = lr_o_group.
    CALL METHOD cl_wd_button=>new_button
      EXPORTING
        enabled   = 'X'
        id        = 'B1'
        on_action = 'GET_FLIGHT'
        text      = 'Get Flight Data'
      RECEIVING
        control   = lr_button.
    lr_matrix2 = cl_wd_matrix_data=>new_matrix_data( lr_button ).
    lr_button->set_layout_data( lr_matrix2 ).
    CALL METHOD lr_o_group->add_child
      EXPORTING
       index     = 1
        the_child = lr_button.
    CALL METHOD cl_wd_input_field=>new_input_field
      EXPORTING
        bind_value = 'SFLIGHT.CARRID'
        id         = 'INPUT1'
      RECEIVING
        control    = lr_input.
    lr_matrix2 = cl_wd_matrix_data=>new_matrix_data( lr_input ).
   lr_input->set_layout_data( lr_matrix2 ).
    CALL METHOD lr_o_group->add_child
      EXPORTING
       index     = 2
        the_child = lr_input.
endmethod.
Edited by: Trim Chakrapani on Nov 15, 2011 5:01 PM

Hi
I suggest you  create a transparent container at design time and then use the below code in wddomodify to get a reference to the transparent container.
  DATA: lv_container TYPE string,
              lo_container TYPE REF TO cl_wd_transparent_container.
        lv_container = 'TransparentContainer'.
        lo_container ?= view->get_element( lv_container ).
        lo_container->add_child( lo_button ).
Hope this helps.

Similar Messages

  • Dynamic Layout Manipulation

    Hello,
    there is a view containing a transparent container (among other containers) that has approximately 25 UI elements.
    At design time it is not clear how many of these transparent containers are needed.
    Now I don't know how to deal with this issue.
    Can I copy the transparent container with its UI elements at runtime? If so, how?
    I don't want to re-create each UI element of this transparent container separately.
    Or do I have to use a separate view instead of the transparent container which can be embedded by a ViewContainerUIElement? Can I copy a view during runtime?
    Best regards, Hergen

    Hello Hergen,
    you can create a seperate component with the desired view (this view would have your container and UI elements then). Then you can use this "external" component multiple times in your application.
    See this link for more information:
    http://help.sap.com/saphelp_nw04s/helpdata/en/77/3545415ea6f523e10000000a155106/frameset.htm
    And especially this link:
    http://help.sap.com/saphelp_nw04s/helpdata/en/a7/1d8b412bb5b35fe10000000a1550b0/content.htm
    Best regards, Matthias

  • Dynamic layout

    How do you dynamically add layout to a group/transparent container. Set it to something like Gridlayout with col values etc.

    Hi Deepak,
    U can create UI elements dynamically.For designing layout dynamically use the dynamic layout manipulation correctly, you must understand the structure of a view:
    In a view, a number of UI elements is laid out in relation to one another. This is done in so-called containers. To describe it, a layout is selected for every container: FlowLayout, MatrixLayout, or RowLayout exist (see reference documentation, chapter Layout).
    Every UI element has layout data, in accordance with the embedding container. This layout data contains the description, at which position in the layout of the container an embedded UI element has its place.
    Hope this helps u,
    Regards,
    Nagarajan.

  • Dynamic layout elements determination logic for output of Pro-Forma Invoice

    This is my requirement below. Please give the suggestion    
    Business requires output to be generated in name of the client, with client logo and scenario specific data elements. To do this in Standard SAP will require to define hundreds and hundreds of layouts. By making most of the client/scenario elements on the layout we can greatly reduce the number of required layouts and reduce implementatuion effort and lead-time.
         The goal is to define a generic table that will hold most of the dynamic layout elements for different document types and countries, including logo, sender address etc.
          For this we will create Z-versions of the output types BA00 ( Order Confirmation, ZPRI (Pro-Forma Invoice) and RD00 (ZD00 Invoice).The layout text blocks will be permanently fixed.The print Program user-exit should call the Z-table that holds the dynamic layout elements and retrieve these elements and merge them with the matching layout text block.
    Message was edited by: janardhan b

    Hi Janardhan,
       Even I have faced the similar situation.but what we have done is instead of calling the dynamic text elements..Why don't we call the text elements based on the required condition ,Then u dont have to maintain all the text elements required in the table.In the table we can only have the doumnent type,client name,logo name and address.
    In the print program if u r using script layout then call the required text elements (write_text) based on the client name and document type that is fetched from the Z-table,Otherwise if u r going for smartforms then with in the layout give the condition under the conditions node of the window or the text.

  • Dump in adding a ui element to group dynamically

    hi all,
    I have a group which has a dropdown ,my requirement is when i click a button
    a dropdown should be created dynamically below the dropdown created at design time.
    My code in  wddomodifyview()
      cl_wd_dropdown_by_idx=>new_dropdown_by_idx(
       EXPORTING
           bind_texts                 = 'CN_RULEBUILDER.CA_CONDITION'
             RECEIVING
            control    = lr_input ).
       lr_group  ?= view->get_element( 'GRP_BUILDER' ).
    lr_group->add_child( lr_input ).
    when i run this i get dump
    Adapter error in MATRIX_LAYOUT "_03" of view "ZMCPTS_RULES_SCREEN.V_MAIN": No LayoutData exists for child element "_10" of the UIElementContainer
    Can someone please help me with this

    This is because you need to set the Layout for the new element added as below:
    data LR_FLOW_DATA type ref to CL_WD_FLOW_DATA.
    LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = lr_input ).
    Thanks,

  • Issue with emailing dynamically generated PDF (InteractiveForm UI element)

    Hi Experts ,
    I have a requirement according to which i need to generate PDF dynamically using webdynpro java and email the dynamically generated PDF.
    I am facing issue while emailing the dynamically genarated pdf.
    It gives me an exception :
    nested exception is: javax.mail.MessagingException: IOException while sending message;  nested exception is: java.io.IOException: no data
    This is because its unable to get the binary data (byte array) of the dynamically generated PDF which is required to send mail.
    Could some one suggest me how to fetch the binary data of the dynamically generated PDF.
    For dynamic PDF generation i am using dynamic generation of UI element   InteractiveForm UI Element 
    In case of static PDF (i.e. the PDF genarated by inserting the InteractiveFrom Ui element on the view using the insert child option) we do set the pdf source property of Interactive Form UI element to a context variable attribute of type binary but  my problem is ,how to set the PDF source of a dynamically generated Interactive form UI element to a context variable attribute of type binary ..
    Any help would be highly appreciated.
    Regards ,
    Navya

    Hi Frank ,
    the code to generate PDF dynamically is written in the WdDoModifyView section of the view as the PDF need to be generated dynamically., i.e. by adding InteractiveForm UI elements at  runtime.
    I tried the code suggested by you  but i gave mean exception.
    errorjava.io.FileNotFoundException:
    (The system cannot find the path specified)
    Kindly let me know where i am going wrong .
    Below is the code that i  had written in a separate method m_mail().
    This would take as input the name of the dynamically generated data node and is called from the wdDoModifyView section of the view
    public void m_mail( java.lang.String p_dynamicnodeName )
                   ByteArrayOutputStream templateSourceOutputStream = new ByteArrayOutputStream();
              //        This would need to have the Templatefile in the Mimes-Directory of the Webdynpro-Component
                   String templateUrl = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), "AdobeView1_InteractiveForm.xdp");
                   InputStream templateSourceInputStream = new FileInputStream(templateUrl);
                   IOUtil.write(templateSourceInputStream, templateSourceOutputStream);
                   IWDPDFDocumentCreationContext pdfContext = WDPDFDocumentFactory.getDocumentHandler().getDocumentCreationContext();
                   pdfContext.setData(WDInteractiveFormHelper.getContextDataAsStream(wdContext
                   .nodeCtx_vn_dynmcnd()
                   .getChildNode(p_dynamicnodeName, IWDNode.NO_SELECTION)));
                   pdfContext.setTemplate(templateSourceOutputStream);
                   pdfContext.setInteractive(false);
                   IWDPDFDocument pdf = pdfContext.execute();
                   if (pdf != null) {
                    pdfArray = pdf.getPDF();
    Kindly let me know where am i going wrong.
    Regards ,
    Navya

  • Dynamic Layout on Edit Customer page

        Hi, I need to customize Edit Customer page so that when the value of Line Of Business is "A", some fields should hide and some others should show, and when the value of Line Of Business is "B", those hidden fields should appear and some fields should hide.
    I've seen some documentation about customization, but I couldn't do what I need so far. The documents always say to use the Oracle Composer (Administration > Customize Customers Page), then click on "Select" on the left-upper corner, then click on the desired component and "Edit Component". There, I should be able to write some groovy expression on Expression Builder to indicate whether to hide or show the component, based on another field's value.
    My problem is that the options in the menu is always inaccessible! I have a print, but I don't know if I can attach it here neiter how to attach it....
    Does anybody have any idea of how to accomplish this? Is there any other way to do this type of customization?
    Any help would be appreciated...

    In Rel8, app composer introduces dynamic layout. This feature allows an object to have many create and detail layouts.
    These layouts can be dynamically shown based on role, record type, or advanced expressions. Record type and Advanced Expression run against the record.
    Think of it as the state of the record i.e. Record Type = 'Hot' Show Layout 1, Record Type = 'Cold' Show Layout

  • Layout generation error!!!

    Hi ,
            I created some Field Groups and have given the Field Structure. But when I try to do the Layout Generation for the field groups I get the error "No field group was selected in the blueprint table"
    Can somebody help.
    Regards,
    Shiny

    First of all, check that you have assigned a structure (screen structure) to a newly created field group: start transaction CRMC_BLUEPRINT_C, then follow Application Element -> Field Group -> Field Group. If structure is provided, make sure that it is a DDIC struture.
    If it won't help, define an application layout in CRMC_BLUEPRINT_C with that field group for an applicication you want to use it with.
    The really thing could help you with generation process is the CRMC_BLUEPRNTC table (check with se16). It should contain an entry for your field group. If it's not - this is the problem.

  • "No Disk" Error (premiere elements 11)

    I have successfully installed Adobe Premiere Elements 11 on my PC:
         Dell XPS 8300 
         Intel Core i7-2600 Quad Core (3.4 GHz, 8MB Cache)
         • 1GB Radeon HD 6450 Graphics
         • 16GB DDR3 1333 RAM
         • 1TB 7,200RPM Hard Drive (2 x 500GB RAID 0)
         • Windows 7 Home Premium 64-Bit
    When I open the application and click "New Project" I get the following error message:
    AdobePremiereElements.exe - No Disk
    There is no disk in the drive.  Please insert a disk into drive
         \Devices\harddisk2\DR3
    I can "cancel", "try again", or "continue".  The only thing that works is to hit "cancel"  (several times).  Premiere Elements will then open, but the error message will keep recurring.   Adobe Support (Chat) has not been much help.
    Anyone else come across this?  This seems to be a common error in earlier versions (version 9), but I can't seem to find any good solution to it.   HELP!!!!
    UPDATE:   Just as an FYI..while it's possible (but doubtful) there is preloaded software interfering, there is no other software (or viruses) installed on this computer.
    Message was edited by: [email protected]

    Boomps, I installed from here and it worked fine:     http://helpx.adobe.com/premiere-elements/kb/installing-smartsound.html There are even step-by-step instructions.  Good luck.
    Date: Mon, 7 Jan 2013 04:46:21 -0700
    From: [email protected]
    To: [email protected]
    Subject: "No Disk" Error (premiere elements 11)
        Re: "No Disk" Error (premiere elements 11)
        created by BoompsXXX in Premiere Elements - View the full discussion
    Not an answer!! I am new to this. I get the same error message and from what I can gather reading the traffic, I have to reinstall Smart sound. Can anyone help a simpleton. I searched the DVD for all files referencing Smart sount, there is plenty. I don't really understand how I reinstall and what??Any help would be great!!ThanksTara
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/4973936#4973936
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4973936#4973936
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4973936#4973936. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Premiere Elements by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How to create a dynamic radiobutton in webdynpro dynamically

    HI,
    I want to create radiobutton in webdynpro dynamically.But this button in not enabled.Code:-
         IWDNodeInfo info =wdContext.getNodeInfo().addChild("RadioBUttonDymanicNode",null,true,false,true,false,false,true,null,null,null);
         IWDRadioButton rb = (IWDRadioButton)view.createElement(IWDRadioButton.class,null);
         String testAtt = "testAtt";
         info.addAttribute ("testAtt","ddic:com.sap.dictionary.string");
         rb.bindSelectedKey("RadioBUttonDymanicNode." + testAtt);
         rb.bindKeyToSelect("aa");
         rb.setEnabled(true);
         theTransContainer1.addChild(rb);
    Please suggest me how to make it enable.
    Regards
    -Sandip

    Hi Sandip,
    Try this code inside the wdModifyView(),
    if (firstTime)
            IWDRadioButtonGroupByKey radioButtonGroup =(IWDRadioButtonGroupByKey)
            view.createElement(IWDRadioButtonGroupByKey.class, "MyRadioButtonGroupByKey");
            radioButtonGroup.bindSelectedKey(<attributeName>);
            radioButtonGroup.setEnabled(true);
            IWDTransparentContainer container=(IWDTransparentContainer)
            view.getElement("RootUIElementContainer");
            container.addChild(radioButtonGroup);
    Regards
    Kishan

  • Embeding ALV table in dynamically created view container UI element

    Hi ,
    I created a view container UI element dynamically .that is working fine . I am using standard ALV component . Now i want to embed ALV table in View container UI element dynamically > please help me in this .
    Thanks in advance ,
    Vijay vorsu

    Hi,
    I am not sure how to do add an ALV table dynamically but you can have a look at this blog which talks about creating and adding a TABLE ui element dynamically. And TABLE UI element may solve your problem.
    http://mamma1360.blog.163.com/blog/static/314740992008127115551165/
    Thanks,
    Abhishek

  • XML Parsing Error: no element found Location:Line Number 1, Column 1:

    Hi,
    i have a servlet code in which i am using bouncy castle encryption algorithm , if i tried to run that servlet on embeded weblogic server than my servlet works fine without error.
    but if i deploy same Servlet code on SOA domain console than i get following error.
    XML Parsing Error: no element found
    Location: http://localhost:7001/Encryption-PGPEncrypt-context-root/pgpservlet
    Line Number 1, Column 1:
    Please help me friends...

    Hi Chandra,
    Based on my research, the error message is only generated by FireFox when the render page is blank in Internet. For some reason, .NET generates a response type of "application/xml" when it creates an empty page. Firefox parses the file as XML and finding
    no root element, spits out the error message.
    Also, based on your description, the other sites are opened correctly, the issue only happened in Central Administration(CA). This means the SharePoint services are working fine.
    Since this issue only occurred in the CA, it might be due the application pool for the CA is corrupted. Please try to restart the application pool for the CA to resove the issue:
    1. Open Internet Information Service(IIS)
    2. List the application pools
    3. Select the application pool used for the CA
    4. Stop it, and then start it again.
    Note, if the application pool is running in Classic mode, please change it to be Integrated mode.
    Additionally, I found a similar thread, which may help you too:
    http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/824d7dda-db03-452b-99c4-531c5c576396
    If you have any more questions, please feel free to ask.
    Thanks,
    Jin Chen
    Jin Chen - MSFT

  • XML Parsing Error: no element found Line Number 1, Column 1:

    Hi All,
    I have deployed EAR on my standalone server using JDEV 11.1.1.6.0. I am able to get the WSRP portlet producer page on
    http://<server>:7001/contextRoot. But when i try to click on any of the WSDL URL it gives me "XML Parsing Error: no element found Line Number 1, Column 1:"
    and from IE it gives me: XML document must have a top level element. Error processing resource
    there can be a issue with the WSRPContainer.jar file. So i have remove it from my deployment profile, EAR and lib/classpath files.
    Can you please suggest a workaround.
    Regards,
    ND
    Edited by: ND on Dec 4, 2012 9:57 PM

    Hi All,
    this error normally comes when the WLS domain is not not properly created. if you get some exception for ./provesecurity.sh file while creating the domain, then the XML error comes.
    I did not went into the depth but figured out a workaround: restart the VM/hosted box and then create the domain, remember to use diff port name while creating it from the domain creation script.
    Regards,
    ND

  • XML Parsing Error: no element found In BI Publisher

    Hi Gurus,
    I tried to get XML output for a Data Model which was based on SQL queries.
    But I got the following error in Firefox
    XML Parsing Error: no element found
    Location: http://localhost:9704/xmlpserver/servlet/xdo
    Line Number 4, Column 1:
    In IE I got an other error:
    There is no end tag for DATA_SET
    Any ideas?
    Many thanks
    Laszlo

    Hi,
    I use 11g.
    I tried to create element link when I got this error.
    Now I am using groupink.
    Without using bind variable I got result (Cartesian product)
    However if i created and used bind variable I got the same error
    this is a dept data set:
    select     "DEPARTMENTS"."DEPARTMENT_ID" as DEPTNO,
         "DEPARTMENTS"."DEPARTMENT_NAME" as "DEPARTMENT_NAME",
         "DEPARTMENTS"."LOCATION_ID" as "LOCATION_ID",
         "DEPARTMENTS"."MANAGER_ID" as "MANAGER_ID"
    from     "HR"."DEPARTMENTS" "DEPARTMENTS"
    this is the emp data set:
    select     "EMPLOYEES"."COMMISSION_PCT" as "COMMISSION_PCT",
         "EMPLOYEES"."DEPARTMENT_ID" as "DEPARTMENT_ID",
         "EMPLOYEES"."EMAIL" as "EMAIL",
         "EMPLOYEES"."EMPLOYEE_ID" as "EMPLOYEE_ID",
         "EMPLOYEES"."FIRST_NAME" as "FIRST_NAME",
         "EMPLOYEES"."HIRE_DATE" as "HIRE_DATE",
         "EMPLOYEES"."JOB_ID" as "JOB_ID",
         "EMPLOYEES"."LAST_NAME" as "LAST_NAME",
         "EMPLOYEES"."MANAGER_ID" as "MANAGER_ID"
    from     "HR"."EMPLOYEES" "EMPLOYEES"
    WHERE "EMPLOYEES"."DEPARTMENT_ID" =:DEPTNO
    Thanks for any tip!
    Laszlo

  • Error rendering element. Exception: ORA-00942: table or view does not exist

    Guru,
    We are maintaining 10 internal Database through OEM 10g and using seesded reports.
    When we try to create simple custom reports against one of the Target database , its failing with following error message ,
    Query : select * from v$database
    Error rendering element.
    Exception: ORA-00942: table or view does not exist
    select * from dual & v$session working ( But query execution happeniing from Reposistory Database not from Target instance  )
    Note:
    I have reviewed thred "getting ORA-00942 while running report in GC"
    Please give some light .
    Regards,
    Raju

    This is an EM related question so I would suggest you post in the appropriate space "Enterprise Manager" -- https://forums.oracle.com/community/developer/english/enterprise_management/enterprise_manager/enterprise_manager_6
    You may also review (In Grid Control 10.2, Creating a Report to Query 'V$SESSION 'Fails: 'Error Rendering Element. Exception: ORA-00942 Table Or View Does Not Exist' (Doc ID 356755.1)) and implement the solution for v$database
    Thanks,
    Hussein

Maybe you are looking for