cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic generation of UI element in Web Dynpro

sid_sunny
Contributor
0 Kudos

Hi All,

I want to add "Link to Action" UI element at runtime and so i added this piece of code in wdDoModifiyView

<b>int i = 0;

if (firstTime)

{

IWDTransparentContainer rootContainer = (IWDTransparentContainer)view.getElement("RootUIElementContainer");

while(i<5)

{

IWDLinkToAction Link1 = (IWDLinkToAction) view.createElement(IWDLinkToAction.class, "Link"+i);

IWDAction theAction = wdThis.wdCreateAction(IPrivateMySavedFormsListCompView.WDActionEventHandler.GENERIC_ACTION,"");

Link1.setOnAction(theAction);

Link1.mappingOfOnAction().addParameter("Command","Link"+i);

rootContainer.addChild(Link1);

i++;

}

}</b>

I had also created a action named GenericAction which has the following format

<b>public void onActionGenericAction(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String Command)

{</b>................

Now when i run my application i am unable to see the five links can somebody help regarding this

Regards

Sid

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

set the label/text for LinkToAction UIElement.

Link1.setText("");

Regards,Anilkumar

Answers (3)

Answers (3)

sid_sunny
Contributor
0 Kudos

Thanks to you to Armin

Former Member
0 Kudos

If you do this only the first time, then why you do it <b>programmatically </b>at all?

Apart from that, Anilkumar is correct, you have either to set a text or image for each link to see something.

Another bug in this code: You create the same action 5 times, a common action for all links is sufficient.

Armin

sid_sunny
Contributor
0 Kudos

Thanks Anil

I made a real blunder Thanks for such a promt response i have assigned full points to you

Regards

Sid