Is there any way to call methods of one view from another

Hi experts,
I am new to webdynpro.I am having some requirement in which I need to call methods of one view from some other view of same component .So is there any way to do this.

Dear Pradeep,
This will solve your problem......( plz 1st read everything ..)
There are 2 views  :
i) Mandatory Attributes ' view(V1)
ii) Button' s  View..(V2)
1. Create a method in Component Controller.( M1).
2. Goto V2 . In the Action Handler method of Button , call method  M1 of component controller.
3. Write your Code in M1 instead of  V2 method.
4. Create an EVENT ( E1 ) in component controller.
5. Fire this event  from M1 before executing Action Code.
6. Now  Add the event handler method of  E1 in  V1 ( i.e. Mandatory attributes view. )   ..........clear????? .. set "METHOD TYPE" = Event Handler. instead of  Method.
7. In this event handler method in V1 , write the "check_mandatory_attribute_view" method.
8. use necessary flags..
Regards ,
Aditya.

Similar Messages

  • Can I Call method on one JVM from another through a dll?

    Let me explain.
    I have this java jar file that I can only have one instance of running at any given time. I'm using a shared data segment in a dll to store a bool indicating whether the program is already running or not. If it's already running, I have to not run the second instance and give focus to the current running instance.
    The jar file calls a native method "canInstantiate()" on a dll to see if there's already an app running. If there isn't, the env and obj are stored in the shared data segment of the dll and we return true. If there is already an instance of the program running, I want canInstantiate call a function on the current instance of the jar (like a callback) to tell it to request focus. It's not working. Can someone tell me if my code is right?
    The .h file
    #include "stdafx.h"
    #include <jni.h>
    #include "CardServer.h"
    #pragma data_seg("SHARED") // Begin the shared data segment.
    static volatile bool instanceExists = false;
    static JavaVM *theJavaVM = NULL;
    static JNIEnv* theJavaEnv= NULL;
    static jobject instanceObject = NULL;
    static jmethodID mid = NULL;
    static jclass cls = NULL;
    #pragma data_seg()
    #pragma comment(linker, "/section:SHARED,RWS")
    jdouble canInstantiate(JNIEnv *env, jobject obj);
    jdouble instantiate(JNIEnv *env, jobject obj);
    jdouble uninstantiate(JNIEnv *env, jobject obj);
    void grabFocus();
    </code>
    The .cpp file:
    <code>
    #include "MyFunctions.h"
    #include <string.h>
    #include <stdlib.h>
    #include "stdafx.h"
    #include <iostream.h>
    jdouble canInstantiate(JNIEnv *env, jobject obj)
    printf("In canInstantiate!!");
    if (!instanceExists)
    printf("No instance exists!!");
    return (jdouble)0.0;
    else
    printf("An instance already exists!!");
    grabFocus();
    return (jdouble)1.0;
    jdouble instantiate(JNIEnv *env, jobject obj)
    printf("**In CPP: Instantiate!!\n");
    cout << "At start, env is: " << env << endl;
    cout << "At start, obj is: " << obj << endl;
    if (instanceExists == false)
    instanceExists = true;
    theJavaEnv = env;
    instanceObject = obj;
    theJavaEnv->GetJavaVM(&theJavaVM);
    cls = (theJavaEnv)->FindClass("TheMainClassOfTheJar");
    if (cls == 0) {
    fprintf(stderr, "Can't find Prog class\n");
    exit(1);
    mid = (theJavaEnv)->GetMethodID(cls, "grabFocusInJava", "(I)I");
    if (mid == 0) {
    fprintf(stderr, "Can't find grabFocusInJava\n");
    exit(1);
    printf("About to call grabFocusInJava\n");
    grabFocus();
    printf("CPP: After the grab focus command in instantiate!!\n");
    cout << "At end, env is: " << env << endl;
    cout << "At end, obj is: " << obj << endl;
    return 0.0;
    else
    printf("CPP: Finished Instantiate!!\n");
    return 1.0;
    jdouble uninstantiate(JNIEnv *env, jobject obj)
    printf("CPP: In uninstantiate!!\n");
    if (instanceExists == true)
    instanceExists = false;
    theJavaVM = NULL;
    instanceObject = NULL;
    printf("CPP: Finishing uninstantiate!!\n");
    return 0.0;
    else
    printf("CPP: Finishing uninstantiate!!\n");
    return 1.0;
    void grabFocus()
    printf("In CPP::GrabFocus!!\n");
    instanceObject = theJavaEnv->NewGlobalRef(instanceObject);
    cls = (theJavaEnv)->FindClass("CardFormatter");
    if (cls == 0) {
    fprintf(stderr, "Can't find Prog class\n");
    exit(1);
    printf("Got the cls id again!!\n");
    if (cls == 0)
    printf("IT'S INVALID!!\n");
    mid = (theJavaEnv)->GetMethodID(cls, "grabFocusInJava", "(I)I");
    if (mid == 0) {
    fprintf(stderr, "Can't find grabFocusInJava\n");
    exit(1);
    theJavaEnv->CallIntMethod(instanceObject, mid, 2);
    printf("Called grabFocusInJava\n");
    </code>
    thanks in advance

    Can I Call method on one JVM from another through a dll
    ...The rest of your question merely expands on your title.
    And the answer to that question is no.
    When you call a method you are executing a "thread of execution." A thread of execution exists only in a single process. It can not exist in another process.
    If the dll is doing some interesting things then you could call a method that sets a flag. Data can move between instances. But you would then have to have a thread in that different process monitoring that flag. And sharing data in a dll is not a normal process, so it would have to be coded appropriately.
    If all you want to do is set the current focus to the existing application, then that can be done with existing windows functionality. You don't need to do anything special in your dll. You can probably search these forums to find the exact code. If not there are countless examples in windows repositories (like MSDN) on how to do that.

  • Is there any way to delete more than one email from the iPhone at a time?

    What if I know I've read everything already online - can I press my Mail icon and instead of opening & deleting one by one, can't I delete everything in my Mail that's there? THANKS!

    Use the edit button, then select all messages you want to delete, and press "Delete" button. You still have to select one by one, but you'd have to do it anyway.

  • How to call method of one View into another view?

    Hi Gurus,
    I am having 2 views defined in a main window say view1 & view2 i have method get_data defined in view1 & now want to call it in view2.
    Is this possible?
    Can this is also possible if the 2 views belong to a different window?
    Regards
    Rahul

    Hi.
    what type of sample code do you need? You do already have the method.
    What ever you do in it do it in the component controller.
    when calling it from the view instead of wd_this->get_data call wd_comp_controller->get_data( ).
    What data do you fetch in this method?
    If you just read context data you have to put these nodes in the component controller context also to share it between multiple views.
    If you need more info just paste the code of the get data method and explain what you are doing in it.
    Cheers,
    Sascha

  • Is there any way to call a method by name?

    Hi there,
    Is there any way to call a method by name?
    e.g. myobject.whatIAmLookingFor("the_name_of_a_myobject's_method",param1,param2,...);
    Thanx in advance

    Is there any way to call a method by name?
    Yes:
    <looking at his paint(Graphics g) method>
    Hey Sam! Commere Sam! Das a good boy!

  • Is there any way to call java program whenever i login to R3 System.?

    Hi Experts
    Is there any way to call java program whenever i login to R3 System.
    Means Whenever the user login to R3 system i should trigger one java program.. Is there any way
    Please help me
    Thanks & Regards
    Ravi Shankar B

    If you want to access to the Windows Taskbar, you should call some Win32 APIs and JNI. Refer to Win32 references.

  • Is there any way to call 'Action' in web.xml ?

    Dear All,
    My requirement is like, in my Deployement descriptior (web.xml) I would like to call "action" instead of calling welcome page(*.jsp).
    Iam using JBOSS with Jetty5.0 Servlet Container.Is there any way to call action in my deployment descriptor?
    Thanx in advance

    You can, but you have change your server configuration file. I am using Sun App server where we have a default-web.xml file in the config directory where it specifies which default file will be loaded, instead of calling the welcome.jsp. In Sun App server there is a parameter called <welcome-file-list> where you can specifiy which one to be loaded. I strongly believe there must be something like that in JBoss. Check out all the xml files in the JBoss config directory where you can find a solution to it.

  • Is there any way to print to a cannon mp495 from my iPad

    Is there any way to print to wireless cannon mp495 from iPad

    Well that printer isn't an airpritn printer so your going to have to download a third party item from the internet, that's what I did and it work's great. I like http://www.collobos.com/ it's called fingerprint, you can use the tes version first to make sure it work's and they buy iy for $10 and you don't have to go buy a new airprint printer.

  • I have an iphone and an ipad (which are connected by the same apple id) i broke the phone and sold it but i didnt get to factory reset it because it was broken, is there any way for me to wipe my iphone from my ipad?

    i have an iphone and an ipad (which are connected by the same apple id) i broke the phone and sold it but i didnt get to factory reset it because it was broken, is there any way for me to wipe my iphone from my ipad?

    Try this:
    Open the "Find my iPhone" app on your iPad, fill in your AppleID and password at the start up screen, and you should see a list of all your devices and their current location, if connected to a Wi-Fi or mobile data network. Devices not connected will be shown as "offline". But you can still trap on the icon and hit "erase iPhone" in the right hand window.
    If your iPhone is not listed, you did not activate this feature during the setup of the phone and it can't be erased remotely.
    If the phone is listed, even as offline, tap on "erase" to send the erase command. The next time your device will be connected to any kind of network, the content will be erased.

  • Is there any way to sync songs to iphone 4 from two PCs without getting any song erased?

    Is there any way to sync songs to iphone 4 from two PCs without getting any song erased?
    I want to sync songs to iphone using my laptop and office computer. Is there any way I can do this?

    No.  Pick one.

  • I have downloaded a Audio Book from Itunes Store, but rencently i have had to reinstall windows, is there any way to re-download the audio book from Itunes, i know that the audio books are one time downloads, but is there any way to get the audio book

    I have downloaded a Audio Book from Itunes Store, but rencently i have had to reinstall windows, is there any way to re-download the audio book from Itunes, i know that the audio books are one time downloads, but is there any way to get the audio book back as i have already paid for it once and i would not like to pay for it twice.

    If you haven't got a backup copy and if it's still in the store then you can try contacting iTunes support and see if they will grant you a re-download (there is no guarantee that they will) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • Is there any way to print to a canon printer from macbook?

    Is there any way to print to a canon printer from macbook?

    Yes. What happens when you try?

  • Is there any way to "resore" a previous backup, like from a different day?.....like a restore on my pc?????

    Is there any way to "resore" a previous backup, like from a different day?.....like a restore on my pc?????

    Here's one:  SMS Export Plus - Backup SMS and iMessages to your PC in excel file format on the App Store on iTunes
    Just Google iPhone SMS backup and you'll get all kinds of options.

  • Is there any way to watch a downloaded TV show from iTunes on my iPad without wifi?  I have an iPhone if that helps.

    Is there any way to watch a downloaded TV show from iTunes on my iPad without wifi?  I have an iPhone if this helps.

    If the TV Show is downloaded on your iPad, you don't need Wi-Fi to watch it.

  • Is there any way to get all my stuff transfered from my old broken iphone to a new one

    is there any way to get all my stuff transfered from my old broken iphone to a new one

    Guess you have your answer.  Maybe next time you'll read the User Guide and use the phone as recommended so this doesn't happen again.

Maybe you are looking for