Skip to Content
avatar image
Former Member

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Aug 20, 2007 at 10:39 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 10:54 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 11:15 AM

    Hi,

    1. first insert the DropdownByIndex UI element

    2.create a one action

    2. go to the DropdownByIndex Properties Event-->onSelect assign the corresponding action

    these are steps for creating the dynamic actions

    Regards,

    P.Manivannan

    Add comment
    10|10000 characters needed characters exceeded