cancel
Showing results for 
Search instead for 
Did you mean: 

Move UIElements dynamically

Former Member
0 Kudos

Hi again,

I've created a dynamic form with webdynpro, but I would like that some static UIElements (a group with action buttons) remain in the bottom of my form. Right now when I create a new elements dynamically they are added to the root. E.g:

Before executing my app:

Root

X

XX HeaderGroup

XXXx Label

X

XX ButtonsGroup

XXXX Button 1

XXXX Button 2

==================

After executing:

Root

X

X

XX HeaderGroup

XXXX Label

X

X

XX ButtonsGroup

XXXX Button 1

XXXX Button 2

X

X

XX DynamicGroup

XXXX Dynamic Element1

XXXX Dynamic Element2

===================

Desired display:

Root

X

X

XX HeaderGroup

XXXX Label

X

X

XX DynamicGroup

XXXX Dynamic Element1

XXXX Dynamic Element2

X

X

XX ButtonsGroup

XXXX Button 1

XXXX Button 2

===================

What do you suggest me?

Accepted Solutions (1)

Accepted Solutions (1)

former_member185029
Active Contributor
0 Kudos

Hi Joan,

Do not add the dynamic group to the root container.

Instead try to insert a container which will contain group container.

Do the similar thing with buttons.

Desired display:

Root

X

X

XX HeaderGroup

XXXX Label

X

X

XXTempGrp

XXX DynamicGroup

XXXX Dynamic Element1

XXXX Dynamic Element2

X

XXTempGrp1

XXX ButtonsGroup

XXXX Button 1

XXXX Button 2

Former Member
0 Kudos

I was considering Ashutosh solution, but I would like to know if it was possible to move elements dynamically like de move up/move down command in the web Dynpro editor. BTW, I will create a static group and add my dynamic elements to it.

Thanks everybody for your answers!

Joan

Former Member
0 Kudos

Hi,

Use the following to swap

public void swapChildren(int i, int j);

Regards

Ayyapparaj

Answers (2)

Answers (2)

former_member201361
Active Contributor
0 Kudos

Hi,

create the button group dynamically or

create the group in the design time ie statically(XXX DynamicGroup) and add the ui elements to the group dynamically at runtime .

thanks and regards

Former Member
0 Kudos

Hi,

Use the following method to add childrens to the container

public void addChild(IWDUIElement child, int index);

Ex:


IWDTransparentContainer container = (IWDTransparentContainer)view.getElement("RootElement");
	  IWDTextEdit textEdit = (IWDTextEdit)view.createElement(IWDTextEdit.class);
	  container.addChild(textEdit, 1);

Regards

Ayyapparaj