Skip to Content
author's profile photo Former Member
Former Member

syntax for how to call method of one comp in other comp wd java.

Let us assume,

there is method1 in view1 comp1.

tell me syntax for calling method 1 in view2 comp2

thanks in advance.

Edited by: madhu1011 on Nov 9, 2011 11:31 AM

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Nov 09, 2011 at 10:58 AM

    You need to create a usage for your second component so it can be used in your first component.

    After that, you call the method in comp 2 from comp 1 for instance like:

    wdThis.wdGetComp2Interface().getMethod()

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 09, 2011 at 01:09 PM

    Hi Madhu,

    This is the situation:

    comp1-> method 1 , view1

    comp2-> view2

    You need to access method1 in view2 of comp2.

    For that, do the following steps:

    1.) First create a method (for eg: method1) in comp1 (under implementation of view1).

    eg: public void method1(){

    <......some logic...>

    }

    2.)Save the meta data.

    3.) In comp2, you will find an option called used components. In that right click and add the component comp2. (Carefully select comp1 itslef).

    4.)Save the meta data.

    5.) Then go to view2 of comp2 and take implementaion part and right the following logic in wddoinit() (or any other standard or custom method).

    wdThis.wdGetComp2Interface().getMethod("method1");

    By this way, we can access the method1 of comp1 in comp2.

    Regards,

    Jithin

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.