Skip to Content
author's profile photo Former Member
Former Member

Dynamic WebDynpro Controls

Hi,

I have a problem in my Application...the code is produced below.

Created a webDynpro application with two views View1 & View2.

Modify view of View1 is copied below...

________________________________

public static void wdDoModifyView(IPrivateUser wdThis, IPrivateUser.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

//@@begin wdDoModifyView

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

IWDAction GO = null;

IWDDropDownByIndex ddlist = (IWDDropDownByIndex)

view.createElement(IWDDropDownByIndex.class, "Mydropbox");

ddlist.bindTexts("MonthsOfYear.MonthName");

container.addChild(ddlist);

IWDButton myButton = (IWDButton) view.createElement(IWDButton.class, "MyButton");

myButton.setText("Hello");

myButton.setOnAction(GO);

myButton.setDesign(WDButtonDesign.EMPHASIZED);

myButton.setSize(WDButtonSize.DEFAULT);

container.addChild(myButton);

//container.addChild(myButton);

//@@end

}

-

-


Then I have created Action for "GO" set as in Modifyview and also event Handler

onActionGO to it.

Created outbound Plug inView1 and also Inbound plug in View2 and set the onActionGo

as below

-

-


public void onActionGO(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionGO(ServerEvent)

wdThis.wdGetContext().setLeadSelection(12);

wdThis.wdFirePlugOutbound();

//@@end

}

This doesn't take me to the View2.

I need help in this.

Thanks

Suresh

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 27, 2003 at 12:24 PM

    Hi Suresh,

    Did you set the Navigation Link between the Outbound and the Inbound plug? The code does not help too much.

    Greetings, Karin

    Add a comment
    10|10000 characters needed characters exceeded

    • Hallo Suresh,

      dynamic programming means, that you are totally responsible for correctly binding UI-element-properties to context attributes, UI-element-events to Action objects etc.

      For dynamically binding a UI-element-event to an Action you have to statically declare some dummy Action (call it 'Generic') in order to get a correpsonding action event handler generated by the Web Dynpro Generation Framework. This event-handler can than be accessed by IPrivate you passed null

      myButton.setDesign(WDButtonDesign.EMPHASIZED);

      myButton.setSize(WDButtonSize.DEFAULT);

      container.addChild(myButton);

      //container.addChild(myButton);

      //@@end

      }

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.