cancel
Showing results for 
Search instead for 
Did you mean: 

Create Dynamic UI element

Former Member
0 Kudos

Hi Experts,

i want to create fileupload,dropdown,inputfield,checkbox,,...etc , my requirement is ,when i click one button that time only i want to create dynamically one ui element,then when i click the second button that time second ui element is created

Please tell me how can i do that,its urgent

Regards,

Sundaresan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Create a context attribute lets say CreateUiComp of data type boolean

In the action handler of the button set this to true.

in the wdDomify do as follows

if(wdContext.currentContextElement(),getCreateUiComp) // True

{

IWDTransparentContainer container = (IWDTransparentContainer)view.getElement("<Root Contianer Name>");

IWDCaption caption = (IWDCaption)view.createElement(IWDCaption.class);

container.addChild(caption);

....

// Create rest of the UI components as needed

}

Regards

Ayyapparaj

Answers (2)

Answers (2)

Former Member
0 Kudos

Did you search this forum?

Armin

former_member201361
Active Contributor
0 Kudos

hi,

Create the Ui elements Dybamically in the Domodify Method of the view as

IWDGroup group = (IWDGroup) View.getElement("ID of the Group") ;

IWDInputField input = view.createElement(IWDInputField.class);

input.setLength(20);

input.bindValue("DynamicNode.input");

group.addElement(input);

In the Similar way u can create all the Ui elements .

create a Context Attributr of type WDVisibilty.

Bind the Visible Property of ythe Ui element to this Context Attribute.

finally in the doinit ,method set the First ui element to WDVisibilty.Visible.

and set the visible property of others ui elements to WDVisibilty.none.

finally in the Action of first ui element set the second Second Ui element to WdVisibility.Visisble. and so on.

Thanks and regards,

Fistae