Skip to Content
avatar image
Former Member

used WD comp java

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Nov 09, 2011 at 12:33 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Robin Van Het Hof

      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