Calling a function and passing parameters via Variables

I've got an XML file that is loading in data and is calling functions.
I've figured out how to call the methods from classes with variables set from the XML file:
var functionToCall:String = xml.functions.func[0].to_fire.toString();
myClass[functionToCall]();
This calls the function perfectly.
I was wondering if there is anyway to pass parameters into the function as well through variables.  Some functions may have no parameters, some functions could have 5... so the xml could be like this:
<functions>
   <func>
    <to_fire>function1</to_fire>
    <param>
     <value>true</value>
     <type>Boolean</type> <!-- Must be set to Boolean, String or Number -->
    </param>
   </func>
   <func>
    <to_fire>function2</to_fire>
    <param/>
   </func>
   <func>
    <to_fire>function3</to_fire>
    <param>
     <value>false</value>
     <type>Boolean</type> <!-- Must be set to Boolean, String or Number -->
    </param>
    <param>
     <value>My String Value</value>
     <type>String</type> <!-- Must be set to Boolean, String or Number -->
    </param>
    <param>
     <value>10</value>
     <type>Number</type> <!-- Must be set to Boolean, String or Number -->
    </param>
   </func>
</functions>
whats the best way to set something like this up?

how would I set something like that up?
in the class:
public function myFunction(_param1:String, _param2:Number):void {
then to call it, would ParamTypes be cast as an array or object or something?
var functionVariable:String = "myFunction";
myClass[functionVariable](??);
Or do I structure the XML file in some way to pass in the information?

Similar Messages

  • Calling WebDynpro Application and Passing parameters

    Hi,
    I want to call a webdynpro application from another application and also i want to pass parameters to the called webdynpro application.
    Is there an example on SDN which shows how this can be done. If not please advise how this can be done.
    Thanks and Regards
    Sidharth

    Hi Sidharth,
    until the tutorial is available, here's a step by step guide.
    1. Create an outbound exit plug, for example "CallApp" in an interface view controller belonging to the calling component.
    2. Add a string parameter 'Url' to the plug "CallApp". It's important that the parameter starts with uppercase 'U'.
    3. Declare a controller usage of the interface view controller for the view controller, which will fire the plug.
    4. Add an action to the calling view controller.
    5. Add the following code snippet to the method body of the action handler. Change the application name "CalledApp" to the name of your called application and the wdThis.wdGet<YourInterfaceView>Controller().wdFirePlugCallApp(url) so that it matches the names you defined. The example will not work, if the application is not part of the deployable object the calling component resides in.
    IWDDeployableObject componentDPO = wdComponentAPI.getDeployableObjectPart().getDeployableObject();
    String appName = "CalledApp";
    WDDeployableObjectPart[] applicationParts = componentDPO.getParts(WDDeployableObjectPartType.APPLICATION);
    WDDeployableObjectPart appPart = null;
    for (int idx = 0; idx < applicationParts.length; idx++) {
      appPart = applicationParts[idx];
      if (appPart.getShortName().equals(appName)) {
        break;
      appPart = null;
    if (appPart == null) {
      throw new WDRuntimeException(
        "The application: " + appName + " is not a part of: " + componentDPO.getName());
    Map urlParameters = new HashMap(1);
    urlParameters.put(ClientConstants.APPLICATION_PREFIX + "Param1", "Parameter sent by caller.");
    try {
      String url = WDURLGenerator.getApplicationURL(appPart, urlParameters);
      wdThis.wdGet<YourInterfaceView>Controller().wdFirePlugCallApp(url);
    } catch (WDURLException e) {
      throw new WDRuntimeException(e);
    6. Add a string value attribute named "ReceivedParameter" to the context of the component controller owning the target interface view.
    7. Declare a controller usage of this component controller for the target interface view controller.
    8. Add a startup plug to the target interface view controller. Add a parameter ("Param1" in this example) to the plug. It's important, that the name of the plug parameter is the same (case sensitive) as used for the URL generation.
    9. Add the following to the method body of the startup plug handler:
    wdThis.wdGet<YourComponent>Controller().wdGetContext().currentContextElement().setReceivedParameter(Param1);
    10. To check, if the parameter passing works, map a value attribute in a view controller to the component controller context and bind e.g. the text property of a TextView to that attribute.
    Hope that helps.
    Regards
    Stefan

  • Shell script calling SQL Program and passing parameters

    Hi guys,
    Greetings from Toronto. Is it possible to pass a string or strings as parameters to a sql program from a shell script ?
    Shell Script
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    sqlplus.exe -s $p_user_id @$RD_PATH/rd_test.sql $p_user_id $p_job_id
    SQL Program (rd_test.sql)
    -- Accept system input parameters
    define p_user_id = &1
    define p_job_id = &2
    -- Wondering if its possible to pass these 3 parameters from a shell script program.
    -- (1) rd_test-$p_job_id-3-1.lis
    -- (2) RD_PRINTER(rd_test,3)
    -- (3) t_data
    select
    t_data=''rd_test-'||'''$p_job_id'''||'-1-1.txt''
    t_data_dir=''.''
    ksh $RD_PATH/another_shell_prog.sh $p_user_id $p_job_id '||a.rd_value||' '
    ||b.rd_value||' rd_test-$p_job_id-3-1.lis $RD_PRINTER(rd_test,3) '||
    '$t_data $t_data_dir'||'
    exit_status=$?
    check_command'
    from rd_job_parameter b, rd_job_parameter a
    where a.job_id = &2
    and a.jp_module_id = 'RDTEST'
    and b.job_id = a.job_id
    and b.module_id = a.module_id
    /As always, its not something I have to solve this minute. Any help would be appreciated
    and I will be thinking of the problem.
    Thanks
    Raj
    Edited by: Raj404261 on Jun 25, 2009 11:40 AM
    Edited by: Raj404261 on Jun 25, 2009 5:29 PM

    Hi Sean,
    Thanks for the reply. I am not at work yet. I already do have the if condition to call 2 separate sql scripts. I was hoping them to be reduced to one sql script. That's why I was hoping to pass some of those values to the select statement as parameters.
    Here is what I was hoping to pass from the shell script based on an IF condition. The good thing about it is that I can hard code these 3 parameters in the shell script in the IF and ELSE conditions. Is it possible to tag these 3 hard coded values in the command line after $p_job_id and then capture these 3 parameters in the SQL program ?
    1. rd_test-$p_job_id-3-1.lis or rd_test-$p_job_id-3-1.lis
    2. RD_PRINTER(rd_test,3) or RD_PRINTER(rd_test,4)
    3. t_data=''rd_test-'||'''$p_job_id'''||'-1-1.txt''
    Shell script :
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    if [condition]
       sqlplus.exe -s $p_user_id @$RD_PATH/rd_test.sql $p_user_id $p_job_id
    else
       sqlplus.exe -s $p_user_id @$RD_PATH/rd_test.sql $p_user_id $p_job_id
    fi
    ksh $RD_PATH/another_shell_prog.sh $p_user_id $p_job_id '||a.rd_value||' '
    ||b.rd_value||' rd_test-$p_job_id-3-1.lis $RD_PRINTER(rd_test,3) '||
    '$t_data $t_data_dir'||'

  • Linking form and report and passing parameters

    Is it possible to call a link with parameter from form to report? Let's say I have a form based on EMP table and when user clicks on DEPT_ID label I want to pass DEPT_ID as a parameter to a report showing detailed information about this department. All my attempts to do it were unsuccessful.
    I've seen many questions like this in this thread and most answers refer to Portal FAQ document but there is NO information there on linking form forms to reports and passing parameters between them.
    Any help will be greatly appreciated!
    Thanks.
    null

    This can be easily done. First open up two instances of your Portal. In one window, you will need to go into your component you wish to link FROM. In the other window you will need to go into your component you wish to link TO. In the component you wish to link TO there will be a moduleid. Note this somewhere. Then, you will see an area that says: "Call Interface: Show". Click on this. (In the window you are linking to.). In this window, you will see a bunch of stuff. At the bottom you will see a URL call. This is the call you need to use. At the top, it explains each piece of the URL call. Just subsitute YOUR appropriate information into the URL call. In the form you wish to link FROM, you will need to create a button. Just click on the green plus sign at the top of the screen (when in edit mode) and then declare it a button by using the Item Type drop down. Once you create this button, it will appear at the bottom, click on it and you will see an area to insert a Javascript. Click the onClick and insert:
    get_field_name = getField(this.form,'COLUMN_NAME_IN_DATABASE');
    window.open('/pls/cc_prod/DAD_NAME.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=MOD_ID_HERE&p_arg_names=_sessionid&p_arg_values=&p_arg_names=COLUMN_NAME_IN_DATABASE&p_arg values='+GETFIELD_NAME+'&p_arg_names=_COLUMN_NAME_IN_DATABASE_cond&p_arg_values=%3D');
    In the fourth tab, where it says, "....before displaying form" insert the following: (This will tell the form how to handle the getField function.)
    htp.p('<script language="JavaScript1.3">
    < !--
    function getField(form,fieldName)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    for (var i = 0; i < form.length; i++)
    slicedName = form.elements.name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName)
    return form.elements[i].value;
    //-->
    </script>');
    I hope this helps.
    null

  • How to open a page from a Form and pass parameters to the form on that page

    I found a similar example on this forum, but it did not work for me:
    declare
    l_names owa.vc_arr;
    l_values owa.vc_arr;
    i number;
    begin
    PORTAL.wwpro_api_parameters.retrieve(l_names, l_values);
    FOR i in 1..l_names.count
    LOOP
    htp.p(l_names(i) || ' ' || l_values(i));
    END LOOP;
    end;
    By using this method i get the parameters for the Form, like the session ID, but not the parameters for the Page that the form is displayed in.
    Another method I tried:
    To open a Form from a Form and pass parameters works fine like this:
    --In the After processing page PL/SQL event.
    declare
    v_id number;
    blk varchar2(10):='DEFAULT';
    Begin
    v_id:=p_session.get_value_as_number (p_block_name=&gt;blk,p_attribute_name=&gt;'A_ID');
    if v_id &gt; 0 then
    htp.formOpen('PORTAL.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=2649500412&p_arg_names=_show_header&p_arg_values=YES&p_arg_names=ID&p_arg_values='||to_char(v_id),'post');
    htp.formSubmit(NULL,'Upload Files');
    htp.formClose;
    end if;
    End;
    But I want to open a Page containing the Form instead of just opening the Form. Is this possible to open a Page and pass paramters to the page, and then let the form inside the Page access the passed paramters. The reason for this is that a Form cannot be based on a page template, or can it? When opening the form i want to keep the left menu, which I can if it is a page based on my template with the left menu.
    Best regards
    Halvor

    Hi,
    You can do this by calling the url of the page with the form. You can then use p_arg_names and p_arg_values to pass parameters. In the called form you can get the value from p_arg_names and p_arg_values and assign it to the form field.
    You can call this code in the success procedure of the calling form.
    declare
    v_id number;
    blk varchar2(10):='DEFAULT';
    v_url varchar2(2000);
    Begin
    v_id:=p_session.get_value_as_number (p_block_name=>blk,p_attribute_name=>'A_ID');
    v_url := <page_url>;
    if v_id > 0 then
    call(v_url||'&p_arg_names=id&p_arg_values='||v_id);
    end if;
    End;
    In the called form in "Before displaying form" plsql section write this code.
    for i in 1..p_arg_names.count loop
    if p_arg_names(i) = 'id' then
    p_session.set_value(
    p_block_name => blk,
    p_attribute_name => 'A_ID',
    p_value => p_arg_values(i)
    end if;
    end loop;
    This code picks up the value from p_arg_values and assigns it to the form field.
    Hope that helps.
    Thanks,
    Sharmila

  • Call Javascript function to pass a id  from APEX report column link

    Hi,
    Can anyone help me, in a report column link i'm calling a function to pass an id and i want to onclick change a icon on that column based on the value on the column status of this table.
    Is this possible?

    Hi Ron,
    I am doing exaclty what you have suggested me but no luck. I started changing the DEMO_CUSTOMERS application to my requirements.The report is working fine and on the report I have created a page attribute to the Hyper linked column and linked that to the page 2 and assign that attribute with #JOBNUM#.
    I am able to pass that value on to form when I click on the JOBNUM. But the problem is I am not able to pass that value into the SQL query so that my query pulls 20+ columns on to the Form ( which is second page ).
    Small clarification... On the form region it is said FORM NAME and type is HTML is that is the way the APEX was designed or does it need to say region type as FORM.
    Thanks for your help in advance.
    Cheers,
    Krishna.

  • Connecting Crystal reports with dashboards and passing parameters

    Hi ,
    Can anyone have any document on Connecting Crystal reports with dashboards and passing parameters.
    I would appreciate for this.
    Thank You.

    Hi Ganesh,
    You can refer the following links for connecting Crystal reports with dashboards:
    Dashboard integration in Crystal Reports using flash variables | Clariba Blog
    https://websmp102.sapag.de/~sapidp/011000358700001426732009E/Xcelsius_EmbeddingInCR2008.pdf
    http://events.asug.com/2012BOUC/0315_Integrating_SAP_Dashboards_into_SAP_Crystal_Reports.pdf
    Regards,
    Renu

  • How to run and pass parameters to exe file from the .txt file

    hi,
     i am facing problem with passing parameters to the .exe file which is run by labview.firstly i have  .txt script with parameters which i have to pass to .exe file. This .exe file is also a software and that script is written for it.And now i have to create  programm in labview which should fullfill following points.
      1. I have to use one knob named 'Run script'.If i pressed the knob ,it should open the Browser where i can choose .txt script file.
      2. .exe application should open(Path already chossen).
      3. after passing the parameters .exe application should closed.
      4.And labview now should update his parameter
    I can just open .exe file using Exce.vi but i dont getting any idea to do more than this.can somebody please help me?
    Solved!
    Go to Solution.

    This depends on the exe file. Does it retrieve the information as standard input or does it require the information as command line arguments?
    Depending on this, you can read the txt-file in LV (using the file functions) and pass the content to the System Exec.vi.
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • How can i get the name of a symbol and pass to a variable?

    Hello! Is posible to get the name of a symbol and pass to a variable??
    Thanks
    Sonia

    Ok. Bravo
    Please mark this as 'Answered' - it will help others on the forum -

  • Pass parameters via POST in WDPortalNavigation.navigateAbsolute method

    Hi,
    how can i pass parameters via POST method from WD Application using WDPortalNavigation.navigateAbsolute method
    Should i pass the parameters as part of the NavigationTarget URL or they should be passed via different parameter?
    Thanks,
    Yuly Roberman

    What is the procedure to pass parameters via POST using WebDynpro ?
    I am required to pass XML Data via POST.
    I have gone through the following :
    a) http://help.sap.com/saphelp_nw04/helpdata/en/9e/a073001903c9419592b14c2aa63669/content.htm
    b) Inter Navigation Application in Web Dynpro
    However, I could not find any reference to do the same via POST.
    Can anyone throw light on the same ?
    Best Regards,
    Subramanian V.

  • Executing a program and passing parameters using ProcessStartInfo

    I am trying to run an application and pass parameters from within a c# desktop application.  It appears to attempt to execute but it doesn’t run and the exeProcess shows errors in the locals.
    Here is the code:
    ProcessStartInfo startBin2TextApp =
    new
    ProcessStartInfo(strNowRunThis, strDataFile +
    " a");
    startBin2TextApp.CreateNoWindow =
    true;
    startBin2TextApp.UseShellExecute =
    false;          startBin2TextApp.WindowStyle =
    ProcessWindowStyle.Hidden;
    Process exeProcess =
    null;
    exeProcess = Process.Start(startBin2TextApp);
    This is what is in the Arguments when Process.Start(startBin2TextApp) is ready to execute.
    Arguments         "C:\\Users\\10065421\\Documents\\ab\\Working\\Projects\\Panel Explorer\\B640130A.DAT a"             
    After the line is executed, exeProcess shows an error in most of the attributes.  For instance, BasePriority shows “exeProcess.BaePriority” threw an exception of type “System.InvalidOperationException”.
    I ran this from the command prompt so I know it runs on this machine with the same parameters I am using in the code.
    Any ideas?
    Thanks.

    Here is the complete code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.IO;
    using System.Diagnostics;
    using System.Threading.Tasks;
    namespace PanelExplorerV1
        public
    class
    CommonCode
    public
    delegate
    void
    PassStatusBackFunction(string
    msg);
    public
    void RunBinToText(PassStatusBackFunction
    messageCallback)
    try
    string strStartDirectory =
    string strDataPath =
    string strDataFile =
    string strDataFileTitle =
    string strBin2TextPath =
    string strDestinationDirectory;
    string strNowRunThis =
    //int intReturnValue = 0;
                    strStartDirectory =
    Application.StartupPath;
    OpenFileDialog dlgCommonDialog =
    new
    OpenFileDialog();
    //CommonDialog dlgCommonDiaglog = new CommonDialog();
                    dlgCommonDialog.FileName =
    //dlgCommonDialog.CancelError = true;
                    dlgCommonDialog.Filter =
    "Binary Data Files (*.dat)|*.dat|All Files (*.*)|*.*";
                    dlgCommonDialog.ShowDialog();
                    strDataFile = dlgCommonDialog.FileName;
                    strDataFileTitle = dlgCommonDialog.Title;
                    if
    (strDataFile.Length == 0)
    return;
                    strDataPath =
    Path.GetDirectoryName(strDataFile);
    object argumentHolder = 1;
                    messageCallback("Extracting data from
    " + strDataFile +
    "!!!  Please Wait");
                    strBin2TextPath = strStartDirectory +
    "\\" +
    "Bin2Txt.exe";
                    strDestinationDirectory = strDataPath +
    "\\" +
    "Bin2Txt.exe";
                    System.IO.File.Copy(strBin2TextPath,
    strDestinationDirectory);
                    strNowRunThis = strDestinationDirectory;
    ProcessStartInfo startBin2TextApp =
    new
    ProcessStartInfo(strNowRunThis, strDataFile +
    " a");
                    startBin2TextApp.CreateNoWindow =
    true;
                    startBin2TextApp.UseShellExecute =
    false;         
                    startBin2TextApp.WindowStyle =
    ProcessWindowStyle.Hidden;
                    Process
    exeProcess = null;
                    exeProcess =
    Process.Start(startBin2TextApp);
                    messageCallback("Finished Extracting
    data from " + strDataFile);
    return;
    catch (InvalidOperationException
    inEx)
    Console.WriteLine(inEx.Message);

  • How to call PL/SQL function and pass parameter to ODI variable?

    Can I call PL/SQL function and assign a return value to an ODI variable? Also can I assign ODI variable to IN paramter and assign OUT parameter to ODI variable? What ODI doc has that information?
    Thanks

    Hi,
    Refer this http://odiexperts.com/how-to-use-plsql-procedures-and-functions-in-odi
    Thanks,
    Sutirtha

  • How to call a BW WEB template from R/3 and pass parameters to the report

    Is it possible to call a BW web template from an R/3 system, through an abap program?
    I have a BW WEB report template. This works very good, and i have 3 variables in the query.
    Now, i need to invoke the BW web template from inside of an abap in R/3..
    And i want to pass 3 variables from the R/3 ABAP to the BW WEB TEMPLATE.....
    Is possible to call BW web templates from R/3??
    PLEASE!!! HELP ME..
    Carlos E. España
    ADATSA
    [email protected]

    Thank you very much for your valuable help, i checked your suggestion and looks great. But i need to pass 3 parameters from an ABAP to the wad query report.
    How can i pass the parameters to the web template???
    another issue: My WAS (Web Application Server 6.20) is not public, is currently working for a local area network.
    The access to this report is from outside of the office, so we need to access this through the PORTAL.

  • Call External C++ function and pass XML

    Hi,
    I need to call external C++ function from Oracle and pass to it XML file from Oracle table? Can you give short guide how to do it?
    Regards

    Your question sounds like is about using an Oracle database (or other application), and not about C++ programming or the using the C++ compiler. You are more likely to find a helpful answer in an Oracle database (or other application) forum.

  • Calling a new browser window with WD Abap and passing data via POST

    Hi there,
    does anybody know whether passing data via POST method is possible when opening a new browser window from within a Web Dynpro Component? In my case I use method IF_WD_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW for opening a new browser window. Now I want to pass a big amount of data which is only possible via POST method. How can I achieve that or is it not considered inside the Web Dynpro Framework?
    Kind regards,
    Albert

    Hi Priya,
    can you please explain a little bit more what you mean? I didn't get it..
    Kind regards,
    Albert

Maybe you are looking for

  • How do I enable the Mac keys in windows XP?

    I recently bought a new Mac keyboard with a num pad. Before that I was using a normal mac keyboard. I cannot remember if I changed the drivers or any settings before, but my old mac keyboard could lower and increase volumes using the assigned buttons

  • DSDP 3.0 - CM 2012 R2 CU3 - Import Driver Packages Fail - Root element is missing

    I realize that the Dell Server Deployment Pack 3.0 plug in is a vendor plugin to CM 2012 R2 but they (dell) are clueless.  So I am hoping that there is some knowledge here. I've opened a case with Dell and have used the Dell forums to document my iss

  • Installing Elements 8.0

    I own Adobe PS Elements 8.0. I am allowed to install it on 2 computers.  I have 2 computers, Home and Work. Recently, my old computer, Home 1, crashed and I bought a new one, Home 2. I am trying to install elements 8.0 on Home 2. I have entered my li

  • I really need help in getting my music back my hard drive crashed

    I need help in re-downloading my music i bought, My computer's hard drive crashed last week an i finally got a new one an i spent like 30$ on music an videos, so i was wondering how to get them back... Im lost without out my music please help me

  • Same problem, just in reverse... ?!

    Lot of people noticed that the update to 10.4.4 contained a problem with Bluetooth. They can't send from their mobile to their Mac. My problem: I can't send from my Mac (iMac G5 iSight 10.4.6) to my mobile (Nokia 7610)! I click 'Send file...' and my