on 07-21-2006 3:36 AM
Hi,
I have the following problems.
I want someone to advise,
I want you to teach the code made [No2 Action].
1.Context is dynamically made.
<Code>
public void wdDoInit(){
IWDNodeInfo rootNodeInfo = wdContext.getNodeInfo();
IWDNodeInfo soNodeInfo =
rootNodeInfo.addChild(
"SalesOrders",
null,
true,
false,
true,
false,
false,
true,
null,
null,
null);
soNodeInfo.addAttribute("OrderNo", "ddic:com.sap.dictionary.integer");
soNodeInfo.addAttribute("SalesDate", "ddic:com.sap.dictionary.date");
soNodeInfo.addAttribute("SalesRep", "ddic:com.sap.dictionary.string");
soNodeInfo.addAttribute("LongText", "ddic:com.sap.dictionary.string");
IWDNode soNode = wdContext.getChildNode("SalesOrders", 0);
IWDNodeElement soElement = soNode.createElement();
soElement.setAttributeValue("OrderNo", new Integer(100));
soElement.setAttributeValue(
"SalesDate",
new Date(System.currentTimeMillis()));
soElement.setAttributeValue("SalesRep", "test");
soElement.setAttributeValue("LongText", "test");
}
</Code>
2.Cotext is moved and changed with Action.
SalesRep ⇒ Test(Context that has already been made)
<Code>
public void onActionGURR(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent ){
wdContext.currentContextElement().setTest(??????);
wdThis.wdFirePlugTotest();
}
</Code>
[?]I want you to teach the sample code put in the part.
Regards.
Hi
Accrording to your code i understood. You create one node(SalesOrders)with 4 attributes(OrderNo,SalesDate,SalesRep,LongText). Then load some values to the SalesOrders node.
You can fetch those(assigned) values using the following code.
int orderno =wdContext.getChildNode("SalesOrders",IWDNode.LEAD_SELECTION).getCurrentElement().getAttributeAsText("OrderNo");
Date SalesDate=wdContext.getChildNode("SalesOrders",IWDNode.LEAD_SELECTION).getCurrentElement().getAttributeAsText("SalesDate");
String SalesRep=wdContext.getChildNode("SalesOrders",IWDNode.LEAD_SELECTION).getCurrentElement().getAttributeAsText("SalesRep");
String LongText=wdContext.getChildNode("SalesOrders",IWDNode.LEAD_SELECTION).getCurrentElement().getAttributeAsText("LongText");
Kind Regards,
S.Saravanan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
The first line in the action onActionGURR is used to set the value for context attribute Test to some value.Here context attribute Test is created at design time.
Second line is firing the Plug to the next view.
Regards,
Ajay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Can you explaine?. What is your exact need?.
Kind Regards,
S.Saravanan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On the triggering of this action in [2] you seem to be getting the current context element , in this case the sales order and then setting one of its attributes "Test" to a string value?? Is this what you didnt understand.
Regards,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.