on 01-27-2011 5:28 AM
I am using outbound plugs and inbound plug to navigate from one view to another which works fine. Now what i want is that there is a node which is declared in context of only VIEW1 (not Comp Controll).Now while navigating to another view VIEW2 i want this node's value to be passed as a parameter in the outbound plug to the inbound plug of VIEW2.
While creating outbound plug for view1 , I gave the Parameter name as "PAR_1" and type as "string". Then in the coding of action in VIEW1 , i used to code (from wizard) to fire the outbound plug along with the parameter.
Now on the recieveing end in VIEW2 how do i get the value of parameter "PAR_1". I can't see "PAR_1" in VIEW2 although i have given the parameter for outbound plug in VIEW1.
THANKS
hi
In the view2 , when you have created the inbound plug one eventhandler with name handle<plugname> will automatically get created.
there in that eventhandler, you will have only one parameter shown above that is of type wdevent.
there create one more with the same name and type as you have created for the outbound plug in the view1.
and then you can access its value directly form there.
in your case create a parameter of type string and name PAR_1 in the handle<inboundplug name> in view 2.
and then you can access that value from this parameter.
thanks
sarbjeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
THans sarbjeet and sahai , once again
I did the same what you guys told and it is working fine too. Just 1 warning message is coming in the code "The cast operation (f1 != f2 , MOVE f2 ? to f1) is currently only supported in object references.".
Though its a warning only and if i ignore the program gives the correct output but still i would like to know if i am doin something wrong.
1 more thing. THe parameter which i created in the inbound plug event (as u people said) , why i have to give the same name of parameter as PAR_1. Ideally according to languages like C++ and java , the parameters of the functions in the defintion need not have the same name as the parameter in the calling statement
THANKS
hi amber,
since you are passing the parameters from a view to another view this is locally transferre rite?....since it is local transfer the name of parameters should be the same if not given same it will result and errror because the system wont be able to map the value passed and recived.
thanks and regards,
sahai.s
hello amber,
i think that you have used some sql statement in the code where you are assigning the par_1 to some value in view 2 apart from mention name and type in the outbound/inbound plug..am i correct? if this is the case ....can you paste that code.because type cast error arises in sql statements generally
thanks and regards,
sahai.s
@sahai: Hey no , I am using very very simple example without any query or complex statement. I just have 2 radio buttons in VIEW1. On clicking the radio button, the naviagtion to view2 is done and the value of selected radio button is passed as a parameter in the plug.
In the view2 , i just have a caption in my layout where i am displaying the parameter value by setting the attribute.THe warning i get is in view2. Here is the code. Apart from this there is no coding in view2.
METHOD HANDLEPLUG_IN_V2 .
DATA:
NODE_CAPT_MSG TYPE REF TO IF_WD_CONTEXT_NODE,
ELEM_CAPT_MSG TYPE REF TO IF_WD_CONTEXT_ELEMENT,
STRU_CAPT_MSG TYPE IF_VIEW2=>ELEMENT_CAPT_MSG ,
ITEM_MSG LIKE STRU_CAPT_MSG-MSG.
* navigate from <CONTEXT> to <CAPT_MSG> via lead selection
NODE_CAPT_MSG = WD_CONTEXT->GET_CHILD_NODE( NAME = `CAPT_MSG` ).
* get single attribute
NODE_CAPT_MSG->SET_ATTRIBUTE(
EXPORTING
NAME = `MSG`
VALUE = PAR_1 ).
ENDMETHOD.
@sarbjeet: Actually when i write the code for setting attribute to a CAPTION with the value of PAR_1 then the warning comes (although the executions work successfully). If i comment this piece of code , the warning doesnt come.
@sahai: Where to right click exactly?? . Name of the code means which place ?
THANKS
@sarbjeet: I checked once again the type of attribute in view2 , its STRING only
@sahai: I check SLIN overview and it is showing 2 erros and 3 warnings in "FIELD CHECK" and 1 error in "syntax check warnings" (although in my prog it was showing only 1 warning total).
When i double click on FIELD CHECK warnings it gives details that 3 variables ie ELEM ,ITEM and 1 more are not referenced in my prog .(That is because i have declared them but not using them anywhere afterwards)
When i double click on FIELD CHECK Errors, it says "No write access to ELEM_CAPT_MSG takes place" which again i think is because i have declared it but not used it.
When i double click on SYNTAX CHECK WARNING , i get the same details which were coming in my program regarding casting.
"Syntax check warning
The CAST operation (f1 != f2, MOVE f2 ?TO f1) is currently only supported for
object references."
THanks
Hey Guys ,
I was looking at the code again and one thing caught my attention which might be related to this warning. THE ATTRIBUTE "MSG" and its node is not defined in the component controller but only in the 2nd view (as local). Is this the cause of the warning.If yes then what is the way to use the OBJECT to a local node and attribute in the program (is it the same as we do for COmponent controller nodes n attributes?)
THanks
hi amber,
whenever we make the node in component controller we make it as a global node i.e that very node will be availiable in all views in that particular code....whereas when we make a node in a view we make it local to that very node ...i.e suppose we make a node1...in view 1 this node will only be seen in view 1 but if same noe is declared in component controller then view1 as well as view2 will be able to use that node.....
try this information and check whether something helps revert back in case of issues.
regards,
sahai.s
hi amber,
transfer of parameters between views are done by using otbound/inbound plug and the handelers of that plug.
now,
check you eventhandler in the second view you will find there a parameter of type wdevent ...there you will have to make one more parameter of the type you want ...i.e in your case par_1 string type now having made that you will be able to access the value using this parameter.
best wishes.
regards,
sahai.s
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.