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

Problem with Client side eventing in Webdynpro

Hi All,

I have the following scenario to implement in Webdynpro using Client-side eventing.

I have one page consisting of one Portal iview Pv1 and an Webdynpro iview Wd1.

In Pv1, there is an button which fires a client side event named "event1" using

EPCM.raiseEvent( "urn:clientside", "event1", index );

In Wd1, i have two views view1 and view2 and view1 is visible initially. There is a button But1 in view1 to navigate to view2.

Now on the click of the button in Pv1, i need some process to happen in view1 and i implement this by subscribing the portal event:

WDPortalEventing.subscribe("urn:clientside", "event1",wdThis.wdGetAction1Action());

in the Init method of view1 and it works fine.

Now i need to navigate to view2 from view1 and need to use the same event "event1" in view2 also. So, i unsubscribed the event before leaving view2

WDPortalEventing.unsubscribe("urn:clientside", "event1",wdThis.wdGetAction1Action());

wdThis.wdFirePlugToview2();

And everything worked fine upto this.

When i am in view2, i need to portal button to take me back to view1. i.e., on the click of the button in portal iview, i need to navigate from view2 to view1 in webdynpro iview.

To do this, i used the follwing set of codes in view2

public void wdDoInit()

{

WDPortalEventing.subscribe("urn:clientside", "event1",wdThis.wdGetAction2Action());

}

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

{

WDPortalEventing.unsubscribe("urn:clientside", "event1",wdThis.wdGetAction2Action());

wdThis.wdFirePlugToview1();

}

But in the end, on the click of the button in portal, i can see the the webdynpro iview navigation to view1 from view2, but suddenly it throws the following error

com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Instance of view controller view2 does not exist.

To summarise my scenario,

When view1 is visible in Wd1 iview, the portal event should do some process in the view1 and it is working fine. When i navigate from view1 to view2, the click of the portal button should take me back to view1 and i am facing error in this step.

I don't find any flaw in my coding i have given above. Correct me if you find any. Or, if you have any other way to implement my scenario, Please reply back.

I would be very thankful for any help.

Regards,

Vijay.K

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 05, 2006 at 02:48 PM

    Hi,

    You can also give a try using the inter-application navigation in portal. Here is the following working code to call iview from each other, on an action:

    WDPortalNavigation.navigateAbsolute(

    "ROLES:portal_content/com.cv.kaar.Test_Page2",

    WDPortalNavigationMode.SHOW_INPLACE,

    (String) null,

    (String) null,

    WDPortalNavigationHistoryMode.NO_DUPLICATIONS,

    (String) null,

    (String) null,

    "Name=" + wdContext.currentContextElement().getName());

    Regards

    Srinivasan T

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Hemant,

      I just use a static member in a java class which i deployed along with my webdynpro application. Since it is a static member, its value remained unchanged upon refreshing the page.

      So, i just populated this value in view2 before refreshing the page and used this value in the doInit() of view1, which gets loaded after refreshing. Hence it seems like passing parameter to the view1 from view2.

      Hope you understand.

      Regards,

      Vijay.K

      Message was edited by: Vijay Kannan

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.