Skip to Content
avatar image
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 comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    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 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

        }