cancel
Showing results for 
Search instead for 
Did you mean: 

used WD comp java

Former Member
0 Kudos

please clear my doubt.

scenario:*********************************

comp 1 view 1

user submits data (2 date fields) here.

comp2 view 2

i have get the submitted data here.

***********************************************************

in this case in which comp1 i have use interface and in which comp i have to use used dc comp.????

and also for date to transfer from view 1 to view 2 in which view i have to write the action method.???

i have wrote the action in view 2 and made those date fields available in interface of view 1 and used used dc comp in view 2 and already said wrote the action in view 2. and tried to get the data on screen using msg pool but no use.

it returns null.

shall i have to write any method in view 2 or where is my fault.

am using this code in Standard ESS MSS leave request application.

please help me and thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Madhu,

In comp1, you need to use the interface controller and in comp2 you need add the used DC.

The action method should be written in view1.

Reply me if you hav any queries.

Regards,

Jithin

Former Member
0 Kudos

Thanks jithis,

how to call this action method written in view 1 in view2 ????

cause user enters the data in view 1 of comp 1 but the action buttons are there in view 2 of comp 2.

and so i have wrote the code in view 2 under the submit action button.

please help.

i will create a new method in view 1 and then i will call that method in the view2 (where the button are there).

will this help me?

Former Member
0 Kudos

Hi Madhu,

You need to access the context node(which contains the user details) of comp1 in comp2. This can be acheived by using Interface contoller of comp1. Do the following steps (Taking in to account that you have already bound the user details to some context node):

1.) Open the Diagram view of comp1 and do a context mapping from interface controller to the view1's context.

2.) Select all the attribues which you want to share to comp2 and click Finish.

3) Save the meta data.

4) Take the comp2 and under used components , right click and add comp1.

5.) Save the meta data

6) Go to Diagram view of comp2 and you can see interface controller of comp1 under used components there. Do a context mapping from view2's controller to that interface controller. Again select the attribues (ie, user details) and click Finish.

Now in the action handler of view2, you can use the user details.

Reply me if you have any queries.

Regards,

Jithin

Former Member
0 Kudos

jithus thank you for your explanation.

i have done all the steps as u said.

i have tried to know the values by msg pool, it is showing null values.

i think we are missing the logic.

action method is in view 2 of comp 2.

but there should some action in view 1 of comp1, that should be triggered to set the values.

am i right?? i dont know, plz help me.

Former Member
0 Kudos

Hi Madhu,

Have you bound the all the input fields (which contains the userdetails) to context node of view1 in comp1? If that is the case, then data will be available and there is no need to do seperate action to put values.

And are you able to see the context node of view1(of compl1) replicated in view2(of comp2)?

Also how you are trying to display the value. use this format:

wdComponentAPI.getMessageManager().reportMessage(wdContext.node<nodename>().current<node name>Element().get<attribute name>());

Still if you are not getting the output, put the structure of the context node of view1 here. I will help you.

Regards,

Jithin

Former Member
0 Kudos

structure of context:

comp1

view1.

context:

workitem (node)->endda(attr)

workitem(node)->begda(attr)

comp2

view2 (action button is in this view, before action is executed i want put some condition here) (here i need those enda and begda attr's)

context:

Edited by: madhu1011 on Nov 10, 2011 1:53 PM

Qualiture
Active Contributor
0 Kudos

Jithus stated:

Have you bound the all the input fields (which contains the userdetails) to context node of view1 in comp1? If that is the case, then data will be available and there is no need to do seperate action to put values.

And are you able to see the context node of view1(of compl1) replicated in view2(of comp2)?

If you followed these steps, you should be perfectly able to bind your comp1 attributes to your comp2 view screen elements

Former Member
0 Kudos

Hi Madhu,

Follow these steps:

1.) First ensure that endda(attr) and begda(attr) are bound to an corresponding inputfields.(or any other simple controls which is there in your view) .(Binding can be acheived by taking the texts property of particular inputfield and binding it).

2.) Save the meta data.

3.) Go to diagramatic view of the comp1, and create a link from Interface controller to view controller (ie, view1's controller).This means that the data contained in view1's context is shared across to interface controller so that other controllers can acess it.

4.) Do context mapping by drag and dropping node workitem from left side(view1 controller) to right side(interface controller, which will be empty) and select both the attributes(* endda and begda *) from checkbox and click Finish.

5.) Save the meta data.

6.) Now go to comp2 and under it you will find "used components". Right click it and add comp1 controller. This means that you are using comp1 controller(or comp1's context in this case) in comp2 controller.

7.) Save the meta data.

8.) Now go to diagramatic view of comp2 controller and you can see a interface controller under used components(ie, interface controller of comp1 since we declare the usage of comp1 in comp2) there.

9.) Now create a link from view controller (ie,view2's controller) to that controller(ie, comp1's interface controller) under used components.

10.) Again do a context mapping by drag and dropping node workitem from left side(interface controller) to right side(view2 controller, which will be empty) and select both the attributes(* endda and begda *) from checkbox and click Finish.

11.) Save the meta data

12.) Now go to the implementation of view2(of comp2) and take the method(ie, event handler) which will handle the button click.

There just try to access the attributes by doing the following:

wdComponentAPI.getMessageManager().reportMessage(wdContext.nodeWorkitem().currentWorkitemElement().getEndda());

13.) Now save the meta data and try to Deploy and Run the application. It should return a message wiith endda attribute which you enter in the inputfield.

Similarly if you want to display begda attribute, do following coding:

wdComponentAPI.getMessageManager().reportMessage(wdContext.nodeWorkitem().currentWorkitemElement().getBegda());

Note: workitem, endda and begda are case sensitive.

Reply me if you have any queries.

Regards,

Jithin

Answers (0)