on 06-16-2005 7:57 AM
Hi everyone,
I've followed the tutorial to make 2 WD iViews communicate...but without success.
In iView Sender, I created an input field and a button. In the event handler of this button, I wrote :
public void onActionSend(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionSend(ServerEvent)
String id = wdContext.currentContextElement().getID();
WDPortalEventing.fire("urn:com.portaleventing", "Send", id);
//@@end
}
Can I write what I want for the namespace and the event ?
In the iView Receiver, here is what I wrote :
public void wdDoInit()
{
//@@begin wdDoInit()
WDPortalEventing.subscribe("urn:com.portaleventing",
"Send",
wdThis.wdGetReactPortalEventingAction());
//@@end
}
and
public void onActionReactPortalEventing(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String dataObject1 )
{
//@@begin onActionReactPortalEventing(ServerEvent)
wdContext.currentContextElement().setID(dataObject1);
//@@end
}
I created 2 iViews and put them in a Page.
When I click on the sender button, nothing appears in the receiver.
Can someone help ?
Thanks in advance.
hi,
The first argument should be your package name.. and in the second view the argument should be dataObject.
One more point is both iViews should be in the same page
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
If the namespace is fine adn the event name is same ,
Check the following..
Are u using different servers . Then are they in the same domain ? If its not then eventing wont work.
Is the namespace and event name already in use.
Is the argument in the eventhandler named dataObject
Are both the iViews in the same page
Rgds
Bharathwaj
Hi Bharathwaj,
In order to send 2 parameters, I did 2 calls to the fire method.
WDPortalEventing.fire("urn:com.eventing", "Send", firstName);
WDPortalEventing.fire("urn:com.eventing", "Send1", lastName);
Notice the change of the event name (Send and Send1).
In the Receiver, I wrote :
WDPortalEventing.subscribe("urn:com.eventing",
"Send",
wdThis.wdGetReactPortalEventingAction());
WDPortalEventing.subscribe("urn:com.eventing",
"Send1",
wdThis.wdGetReactPortalEventing1Action());
And it works.
You can pass complex objects through java serialized objects
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.