Creation of UI Element on the action of a button?

Hi,
Can we create some UI Element on the action of some button, i.e. writing code to create UI Element outside the wdDoModifyView() method of the view?
Regards,
Smriti.

Hi,
We can create an UI element dynamically, on button click action..Follow the steps given below:
1. Create a static variable say ' myvar ' of type com.sap.tc.webdynpro.progmodel.api.IWDView in last declaration part(ie. inside //@@begin others //@@end.
Eg: static IWDView myview;
2. 2. In wdDoModifyView(), add the following
myview=view;
3. Now add the following code in the "OnAction<Submit>" event to create an UI element dynamically:
IWDTransparentContainer rootContainer = (IWDTransparentContainer)view.getElement("RootUIElementContainer");
IWDLinkToAction Link1 = (IWDLinkToAction) view.createElement(IWDLinkToAction.class, "Link1");
rootContainer.addChild(Link1);
Hope it helps!!!
Regards,
TFG - Kumara Guru

Similar Messages

  • Capturing the action of a button when its disabled to enabled

    I have a few buttons on my application that are disabled and wont be enabled until all info is entered. The info is captured correctly but I cannot capture the enabled button on my playback. Any help?

    Amalia,
    There is a setting that should work choose Options-->New Scripts and select "General" under the recording node in the tree on the left. Check the box "Record parameter set events for form entry." Select "File"-->"New Script" and record a new one. The setting allows e-Tester to play through the events as it populates the fields.

  • How to create an UI element dynamically on action in drop down?

    Hi,
    How to create an UI element dynamically on action of selecting a value from the  drop down?
    help out with the steps i need to follow..

    Hi,
    <u><i><b>Dynamic UI Element creation</b></i></u>
    We can create it only in the WD Modify View.
    Get the instance for the Root UI Element Container.
    Create the UI element Ex: Input Field, Text View etc.
    Bind the UI Element to the Attribute Value.
    Now bind the UI Element to the Root UI Element Container.
              IWDTransparentContainer root =(IWDTransparentContainer)view.getRootElement();
              IWDDropdownByIndex DdbName = (IWDDropdownByIndex)view.createElement(IWDDropdownByIndex.class,"DdbName");
              IWDDropdownByIndex DdbAge = (IWDDropdownByIndex)view.createElement(IWDDropdownByIndex.class,"DdbAge");
              IWDDropdownByIndex DdbGender = (IWDDropdownByIndex)view.createElement(IWDDropdownByIndex.class,"DdbGender");
              IWDNode Mad =wdContext.getChildNode("Person",0);
              IWDAttributeInfo NameAtt = Mad.getNodeInfo().getAttribute("Name");
              IWDAttributeInfo AgeAtt = Mad.getNodeInfo().getAttribute("Age");
              IWDAttributeInfo GenderAtt = Mad.getNodeInfo().getAttribute("Gender");
              DdbName.bindValue(NameAtt);
              DdbAge.bindValue(AgeAtt);
              DdbGender.bindValue(GenderAtt);
              root.addChild(DdbName);     
              root.addChild(DdbAge);
              root.addChild(DdbGender);
    <u><i><b>Dynamic Action Creation</b></i></u>
    Create the Action in the Action tab.
    Create a Button.
    Get the reference for the created action (Through the Event Handler).
    Bind the Action to the Button.
    Bind the Button to the Root UI element Container.
    IWDButton ButGo = (IWDButton)view.createElement(IWDButton.class,"ButGo");
    IWDAction ActGo = wdThis.wdCreateAction(IPrivateStartView.WDActionEventHandler.GO,"Click");
    ButGo.setOnAction(ActGo);
    root.addChild(ButGo);
    Now write the required code for the Event Handler that is associated with the Action.
    //@@begin onActionGo(ServerEvent)
        IWDNode Mad = wdContext.getChildNode("Person",0);
         wdComponentAPI.getMessageManager().reportSuccess(Mad.getCurrentElement().getAttributeAsText("Name"));
         wdComponentAPI.getMessageManager().reportSuccess(Mad.getCurrentElement().getAttributeAsText("Age"));
         wdComponentAPI.getMessageManager().reportSuccess(Mad.getCurrentElement().getAttributeAsText("Gender"));
    //@@end
    Regards
    SURYA

  • Automatic creation of WBES element using front end application

    Hi,
    i am looking at developing a front end tool where user will provide the required data and project name/wbes lement in the request. upon approval from project manager, sytem must creation requird WBE element in the requested project automatically. there will be multiple requests supplied to create wbes lements under the existing projects.
    for Eg. assume that there is a project AB11.00001 
    i have already have one 4th level wbes element like displayed below:
    AB11.00001
    AB11.00001.01
    AB11.00001.01.01
    AB11.00001.01.01.01
    AB11.00001.01.01.02
    AB11.00001.01.01.03
    now i would like to add new 3rd level and 4th level for above project as mentioned below:
    AB11.00001
    AB11.00001.01
    AB11.00001.01.01
    AB11.00001.01.01.01
    AB11.00001.01.01.02
    AB11.00001.01.01.03
    AB11.00001.01.02
    AB11.00001.01.02.01
    AB11.00001.01.02.02
    AB11.00001.01.02.03
    AB11.00001.01.03
    AB11.00001.01.03.01
    AB11.00001.01.03.02
    AB11.00001.01.03.03
    this must be done either using bapi or any other programme, i tried with bapi, but not able to solve, pls help me with best way of executing this auto application rather creating manually one by one using CJ20N. i am very sure we have finest ABAP'rs in this forum who will build this programme..
    thanks
    naveen lewis
    Edited by: naveennl on Aug 16, 2010 11:39 AM

    Hi Rifaee,
    appplogies for misunderstanding..
    i want only the clues how i can execute this using some of the available SAP functionalities.. ofcourse finest ABAP'rs only think out of the box to solve this and rest will usually answer it as not feasible.
    Edited by: naveennl on Aug 16, 2010 11:51 AM

  • Get element that triggered action

    Hello,
    Does anybody know how to find out which element on the screen triggered the action? Within action method I need to know which element triggered the action.
    Elements are created dynamically and action to them is bound during run time.
    Thank you.

    Example: You have 2 buttons "B1", "B2" and both are assigned the same action. How to know in the action handler which button was pressed?
    Solutions: Event parameter mapping
    B1.mappingOfOnAction().addParameter("Button", "B1");
    B2.mappingOfOnAction().addParameter("Button", "B2");
    Declare an action parameter "Button" of type String. Then at runtime, this parameter will contain "B1" or "B2" depending on the button that was pressed.
    Armin

  • Detecting double-click in the action of a JButton

    I have a similar problem to the poster of http://forum.java.sun.com/thread.jsp?forum=52&thread=93004 and I'm wondering if anyone has a better solution.
    A fuller description of my problem.
    My JButtons represents certain pallette items. Clicking a pallete item puts the button in a selected state (changes its border to show it's selected). The action on this button sets a mode state on the canvas to indicate what was selected. I then click on a canvas workspace to place an instance of that item onto the canvas based on the current mode.
    The selected JButton then pops up and the user needs to select a new pallette icon.
    What I want as an option so that if a pallette button is double-clicked it remains selected even after the item has been placed on the canvas allowing the user to place several copies around the canvas before selecting another item.
    I'd like if possible to determine this from the buttons action rather than registering a listener to the button because parts of the framework I am using pass just the actions around.
    I could do this by looking at the time between actions being triggered but this seems like a messy solution (can I pickup the operating system settings for double-click delay).
    Any other ideas?

    thebobster,
    This doesn't answer your original question, so if you're determined to use d-clicks on a JButton, don't bother reading further.
    I've always found double-clicking on a JButton non-intuitive, not to mention messy to implement. I prefer CTRL-click, etc, to indicate a sticky click.
    Perhaps you could use an image to indicate your palette button: you'll need just 2 images--up-state and down-state--and d-clicks will be easy to implement.
    --A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to set a navigation case as the action for a CoreCommandButton

    Hi all,
    I dynamically display a CoreCommandButton on my jspx using code in the backing bean.
    I want to set a navigation case to this button so that I can navigate to a separate page when clicking the button.
    CoreCommanButton has a setAction method which needs a methoBinding. If my navigation case is "goMaintainPr", how do I set this as the action of my button? Can I create a methodBinding for my navigation case? If so how?
    Cheers.
    Kaz.

    I am creating my CoreCommanButton in the backing bean like:
              CoreCommandButton editElemBtn = new CoreCommandButton();
              editElemBtn.setId(elemCd + "-edit");
              editElemBtn.setText("Edit");
    and then add it to the page from the backing bean. So I need to be able to set the action to the above button like:
              editElemBtn.setAction(action); -- here, action needs to be a methodBinding. So i cannot just assign my navigation case as a String.
    How do I create a methodBinding with my navigation case ?

  • Is it possible to customize the actions of the new Forget Button.

    As I use a number of pinned tabs I don't want the Forget Button to close tabs and open clean window because I have to reset the pinned tabs every time I use the button
    I just want to delete cookies and recent history (to clear the cache when I am updating my blogs). I know I can do this in the History Menu under Clear Recent History but it would be neat if I could do it from this one button
    Is it possible to set the actions for this button or is fixed?

    Hi,
    Could you check below is the one are you looking at
    APO customisation > supply chain planning > SNP >
    basic settings > maintain global snp settings > Orders
    per bucket
    Regards
    R. Senthil Mareeswaran.

  • PhotoShop Elements from the App Store cannot run actions??

    I am so upset that I spent $80 to download PhotoShop Elements 9 from the App Store and then found out that it cannot run actions and presets!!!! For some reason, the version of PSE that you get from the app store is not capable of this, which is the main reason I NEED and USE PhotoShop! Please tell me I am wrong and if so, how to fix it!!! I have them installed in the files correctly but they don't show up in PS. Thank you for any help you can provide, thanks!

    I just loaded my actions using the PSE 10 from the App Store.
    Close PSE.
    Access the System library location from Finder, Click menue, "Go" then select "Go to Folder...". Type in  "~/Library" and click Go.
    The systems Library will open up and then you take this path:
    Application Support > Adobe > Adobe Photoshop Elements 10 Editor > Presets > Actions (The Actions folder is where you move your actions file to)
    Then go to the Photo Creations Folder > Locales > en_US and delete the MediaDatabase.db3 file (move it to the trash)
    The next time you launch PSE your Actions DB will be rebuilt with the new actions installed.

  • How to use the "Actions" in Photoshop Elements 11

    I am wanting to use the "Actions" in Photoshop Elements 11.  But when I get the actions box up, it is only showing a small list of effects to use.  The tutorials I have checked into all show a very long list of actions. When I click on the little arrow and click on "load actions", I am getting nothing. Everything is blank.  It says "No items match your search."  Please help! 

    To use the existing actions, try the following:
    1. Open one of the Action Sets, in this example Special Effects is the Action Set, by pressing the small arrow beside the set name.
    2. Then click on the name of the Action, in this example Faded Ink is the Action name.
    3. Then press the Play button to run the action.

  • I'm wanting to use the "Actions" in Photoshop Elements 11.  But when I get the Actions box up, it is only showing a small list of effects to use.  And no side bar to go any further.  When I click on the little arrow at top and then click on "load actions"

    I'm wanting to use the "Actions" in Photoshop Elements 11. But when I get the actions box up, it is only showing a small list of effects to use. And no side bar. So I can't go any further.  When I click on the little arrow at top and click on "load actions", I am only getting a box with empty space saying "No items match your search".  The folder at the top does say "Actions".  How do I get more effects?  The tutorials that I've checked into all show a long list of effects in their box.  Can anyone help? 

    To use the existing actions, try the following:
    1. Open one of the Action Sets, in this example Special Effects is the Action Set, by pressing the small arrow beside the set name.
    2. Then click on the name of the Action, in this example Faded Ink is the Action name.
    3. Then press the Play button to run the action.

  • How to use the action OnExpandAll on UI element Tree

    Hi, experts .
    I am in WDA developing project and developing the screen which has Tree .
    I want to expand all nodes when users click the button on the head of Tree .
    I copied the application `WDT_TREE` and created Tree of my application successfully .
    And I created the action OnExpandAll on my Tree and tried to create the function to expand all nodes .
    But I do not know how to use the action OnExpandAll .
    I can see the button to start action OnExpandAll on the head of Tree .
    I am trying to write logic in the action . But it does not work successfully .
    (In my tree , when I click the button for OnExpandAll , all nodes are outputted on root node .
    Because my logic is wrong ... )
    Please give me any hints .
    Masao

    Hi
    As your case it is a recursive node.
    then you have to create method and call it recursively for the expanall functionality.
    do it like this.
    create an attribute the node FOLDER
    name = 'ISEXPANDED'
    type = WDY_BOOLEAN.
    Now bind the property expanded of treenode FOLDER UI to this attribute.
    now go to the methods tab and create one method say name ZEXPANDALL.
    in thsi method make one importing parameter of type ( type ref to ) if_wd_context_node. and name NODE.
    then write the following code in this method.
    method ZEXPANDALL .
    DATA ELT TYPE WDR_CONTEXT_ELEMENT_SET.
    DATA EL TYPE REF TO IF_WD_CONTEXT_ELEMENT.
    data nd type ref to if_wd_context_node.
    data nds type WDR_CONTEXT_CHILD_MAP.
    data chld type wdr_context_child.
    data nf type ref to if_wd_context_node_info.
    data name type string.
    ELT = node->GET_ELEMENTS( ).
    LOOP AT ELT INTO EL.
      EL->SET_ATTRIBUTE(
      NAME = 'ISEXPANDED'
      VALUE = ABAP_TRUE
      data parent_key type string.
    EL->get_attribute( exporting name = 'TEXT' importing value
    = parent_key ).
    * create the child nodes
        create_node(
          exporting
            cur_element = EL
            parent_key  = parent_key ).
    nds = el->get_child_nodes( ).
    loop at nds into chld.
      nd ?= chld-node.
      nf = nd->get_node_info( ).
    name  = nf->get_name( ).
    if name eq 'FOLDER'.
      zexpandall(                             "recursive call
      nd
    endif.
      endloop.
      ENDLOOP.
    endmethod.
    NOw go to your eventhandler created for action expandall.
    there write the following code.
    method ONACTIONEXPANDALL .
    DATA lo_nd TYPE REF TO if_wd_context_node.
      lo_nd = wd_context->get_child_node( 'FOLDER' ).
      ZEXPANDALL( lo_nd ).
    endmethod.
    thats it.
    Thanks
    sarbjeet singh

  • Creation of UI elements on click of a button in ADOBE form

    Hello Experts,
    I have a requirement which is ,
    on the ADOBE form after pressing some action Button i need to create a row of UI elements like Textbox label and Radio button with the values coming from Backend WDA application.
    Number of rows created are equivalent to number of  times button is clicked.
    Also in some cases i have to preload the rows with the existing data.
    Please let me know if this requirement can be accomplished in ADOBE form.
    Any inputs ,Suggestion and help will be very helpful.
    Thanks,
    Siddharth

    Thanks for the help,
    I resolved this by creating elemnts in WD context on click of a button in ADOBE form,And in form i used the WD context structure as a table with required cell editors.
    PDF form should be of type dynamic in this case.

  • Creation of PL Element without it being a cost element

    Hi
    I have to asign two PL elements in T code 0KEK for transfer of material between two profit centers. The two elements should not be <b>cost elements</b> but they should be PL Elements to be used only in PCA.
    We have to create PL elements through FS00. But the system automatically creates a new cost element when i create a GL as a PL nature. Pls let me know how to create a PL element without it being a cost element.
    Regards
    Sanil Bhandari

    Hi Sanil
    IN OB13 
    Controlling integration tab
    select : Manual creation of cost element and create GL accts.
    Hope this works
    Best Regards
    Ashish Jain

  • Automatic creation of cost elements

    Dear All,
    The automtic creation of cost elements functionality is not working for some GL accounts in production. When new GL accounts are created, the same are not created as cost elements. All the standard settings viz 'selection of automatic creation' in controlling area configuration, creation of number ranges in OKB2 etc are in place. We posted in OSS and they are not able to find reasons why this is happening.
    Has anyone faced a situation like this? Please post your valuable thoughts and share your inputs. We currently have a log created by user on this and pending for quite sometime.
    Thanks in advance
    Venkatesh

    Hi,
    Yes. We do face problem like this often. We wriggle out by updating through manually when we are very nearer to go-live date. Otherwise, we can create an abap program and meet the deficiency.
    Trust this helps much!
    Cheers!

Maybe you are looking for