cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos