Passing two parameters to work

Hello

How to pass multiple parameters to a function? In the example below, the user selects a radio button, fills a TextInput, and clicks a button to submit the two parameters to a function. How to say function that the event contains two parameters, is to say the value of the option button and that of the TextInput?

< mx:RadioButton id = "png" label = "png" / >
< mx:RadioButton id = "png8" label = "png8" / >
< mx:HBox >
< mx:Text >
< mx:text > enter the size of the image < / mx:text >
< / mx:Text >
< mx:TextInput width = "30" id = 'size' text = "1024" > < / mx:TextInput >
< / mx:HBox >

< mx:Button label = "Snapshot" click = "clickHandler (event)" / > "

Thank you

Manolo

Hello

So if I understand you, you have a function to do something when the button is clicked.  You will need to acquire the values on the radio and textinput, so the button click handler would look like;

private void clickHandler(event:MouseEvent):void {}

Then you would have to acquire the values of two controls

var radio: RadioButton;

decide option button is selected and then store a reference to it in the variable radio (cos I don't ' know what data you want her)

If {(png.selected)

Radio = png;

} else {}

Radio = png8;

}

Then pass two parameters to a function have you that accepts two parameters.

myFunc (textField.text, radio);

}

Your function to accept these should look like

function (text: String, radioSelected:RadioButton): void {}

}

There's a few ways to do that is one.  This help, or the I understood you?

Andrew

Tags: Flex

Similar Questions

  • Problem AJAX (problems of passing two parameters to an application process)

    Hello

    I need to pass two parameters to a procedure of application via an AJAX request.

    All are my events show below, as you can see that the second p_arg_values does not contain any value. Its as if this get.add('TEMPORARY_ITEM_2',pThis2.value); line is ignored. What changes can I make to do this work?


    P2_QUERY_GROUP (the HTML Form element attributes)
    OnChange = "get_query_select_list_xml (This, 'P2_QUERY', 'P2_PRODUCT_GROUP')" "
    function get_query_select_list_xml(pThis,pSelect,pThis2){ 
        var l_Return = null;
        var l_Select = html_GetElement(pSelect);
        var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
                  'APPLICATION_PROCESS=Query_Select_XML',0);
        get.add('TEMPORARY_ITEM',pThis.value);
        get.add('TEMPORARY_ITEM_2',pThis2.value);
        gReturn = get.get('XML');
        if(gReturn && l_Select){
            var l_Count = gReturn.getElementsByTagName("option").length;
            l_Select.length = 0;
            for(var i=0;i<l_Count;i++){
                var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    }
    }
    get = null;
    }

    Query_Select_XML (Application Process)
    declare
    l_counter number;
    l_o_name varchar2(2000);
    begin
    owa_util.mime_header('text/xml', FALSE );
    htp.p('Cache-Control: no-cache');
    htp.p('Pragma: no-cache');
    owa_util.http_header_close;
    htp.prn('<select>');
    for rec in (select QUERY, ID
    from     TECH_DB_VIDEO_QUERY
    WHERE instr(QUERY_GROUPS,addzero(:TEMPORARY_ITEM))>0
    AND instr(PRODUCT_GROUPS,addzero(:TEMPORARY_ITEM_2))>0
    ORDER BY QUERY)
    loop
    htp.prn('<option value="' || rec.id || '">' || rec.query || '</option>');
    end loop;
    htp.prn('</select>');
    end;


    FIREBUG Output

    Post
    p_arg_names     TEMPORARY_ITEM
    p_arg_names     TEMPORARY_ITEM_2
    p_arg_values     16
    p_arg_values     
    p_flow_id     107
    p_flow_step_id     0
    p_instance     3349916470781784
    p_request     APPLICATION_PROCESS=Query_Select_XML

    Response
    <select></select>

    Regards
    Adam

    Adam:

    The second 'get.add' should be

    get.add('TEMPORARY_ITEM_2', $x(pThis2).value);
    

    CITY

  • passing several parameters to work

    Hello

    For some historical reason, there are some clients who share the same group id in our customer database.

    We have a report that has a client_name and/or customer_number as parameter multiple_value and it works fine. However, the user is now asking a customer number if there is requested there is another customer who shares the same party_id, while other clients should also be included in the report.

    If I use a condition, or I use a function to find the another customer with the same party_id, it becomes a problem if more than one client is selected in the settings.

    Is there a solution, or will we have to change the setting so that a single value is allowed?

    Thank you.
    Leah

    Hi Lea,.

    It's "apps.jafi_disco_utils_pkg" is a function? A function always returns a single value. If it is your function please try to avoid the function and you try to create a State with 'IN' operator having user enter multiple values option.

    See you soon

  • Passing two settings for reprot

    suite of Oracle 10 g developer

    I'm reporting form 10g with a parameter, it works very well.
    but I want to pass two parameters. I tried but not succeeded.

    1 p_date =' | : btn.at_date
    2 p_date1 =' | : btn.at_date1
    ------- With One Parameter ------------
    DECLARE 
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
     
    BEGIN
     
    repid := FIND_REPORT_OBJECT('REPORT1');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, 'paramform=no p_date=' || :btn.at_date);
     
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep); 
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') 
    LOOP 
      rep_status := report_object_status(v_rep); 
    END LOOP; 
     
    if
     rep_status = 'FINISHED'
    then
      WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1) ||
      '?server=rserver' ); 
    else
      message ( 'error while running reports-object '  || error_text );
      message ( ' ' );
      clear_message;
    end if;
    end;
    I tried this report but empty.
    QT char(1):='''';
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no P_date='||QT||:btn.at_date||QT||' p_date1='||QT||:btn.at_date1||QT); 
    Published by: 867210 on February 21, 2013 03:24

    867210 wrote:
    Solved this problem

    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no sdate='||:btn.sdate|| ' ' || 'edate='||:btn.edate);  
    

    Published by: 867210 on February 21, 2013 21:51

    I always add space on the side of setting... As my example also works...

    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no sdate='||:btn.sdate||' edate='||:btn.edate);  
    

    Mark as answer.

  • How to pass the parameters in the http post method?

    Hello

    I want to download the mp3 file on server and I need to pass two parameters with the post method.

    Here is my code for this.

                          String userid="id_user=8379";
                  String filename="trackName=sample.mp3";
                  String params=userid+"&"+filename;            
    
                            httpcon=(HttpConnection)Connector.open("http://api.upload.com/gStorage/uploadSong?output=json",Connector.READ_WRITE);
                httpcon.setRequestMethod(HttpConnection.POST);
                httpcon.setRequestProperty("Content-type","application/x-www-form-urlencoded");
                httpcon.setRequestProperty("Content-type","audio/mpeg3");
                os=httpcon.openOutputStream();
                os.write(params.getBytes("UTF-8"));
                fc=(FileConnection)Connector.open("file:///E:/sample.mp3",Connector.READ_WRITE);
                fileis=fc.openInputStream();
                bos=new ByteArrayOutputStream();
                byte[] data=new byte[50000];
                int ch;
                while ((ch=fileis.read(data,0,data.length))!=-1) {
                    bos.write(data,0,ch);
                }
                os.write(bos.toByteArray());
                os.close();
                System.out.println("Response code From server"+httpcon.getResponseCode());
                if(httpcon.getResponseCode()!=HttpConnection.HTTP_OK)
                {
                    System.out.println("Failed to upload bytes");
                }
                else
                {
                    //is=httpcon.openInputStream();
                    DataInputStream dis=httpcon.openDataInputStream();
                    int ch1;
                    StringBuffer buffer1=new StringBuffer();
                    while ((ch1=dis.read())!=-1) {
                        buffer1.append((char)ch1);
                    }
                    System.out.println("Response From Server"+buffer1.toString());
                }
            } i am getting response code ok but fail to upload file.
    

    may I passing the parameter in the wrong way?

    thankx.

    Hello

    Nitin I currently do a midlet project.

    So I used multipart post method.

    I just read this article. http://MindTouch.firmstep.com/AchieveForms/Design_Guide/Integration_Actions/types/HTTP_POST#top

    package com.http.main;
    
    import java.io.ByteArrayOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Enumeration;
    import java.util.Hashtable;
    
    import javax.microedition.io.Connector;
    import javax.microedition.io.HttpConnection;
    
    import com.sun.midp.io.BufferedConnectionAdapter;
    
    public class HttpMultipartRequest
    {
        static final String BOUNDARY = "----------V2ymHFg03ehbqgZCaKO6jy";
    
        byte[] postBytes = null;
        String url = null;
    
        public HttpMultipartRequest(String url, Hashtable params, String fileField, String fileName, String fileType, byte[] fileBytes) throws Exception
        {
            this.url = url;
    
            String boundary = getBoundaryString();
    
            String boundaryMessage = getBoundaryMessage(boundary, params, fileField, fileName, fileType);
    
            String endBoundary = "\r\n--" + boundary + "--\r\n";
    
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
    
            bos.write(boundaryMessage.getBytes());
    
            bos.write(fileBytes);
    
            bos.write(endBoundary.getBytes());
    
            this.postBytes = bos.toByteArray();
    
            bos.close();
        }
    
        String getBoundaryString()
        {
            return BOUNDARY;
        }
    
        String getBoundaryMessage(String boundary, Hashtable params, String fileField, String fileName, String fileType)
        {
            StringBuffer res = new StringBuffer("--").append(boundary).append("\r\n");
    
            Enumeration keys = params.keys();
    
            while(keys.hasMoreElements())
            {
                String key = (String)keys.nextElement();
                String value = (String)params.get(key);
    
                res.append("Content-Disposition: form-data; name=\"").append(key).append("\"\r\n")
                    .append("\r\n").append(value).append("\r\n")
                    .append("--").append(boundary).append("\r\n");
                System.out.println("****In while Loop:-****"+res);
            }
            res.append("Content-Disposition: form-data; name=\"").append(fileField).append("\"; filename=\"").append(fileName).append("\"\r\n")
                .append("Content-Type: ").append(fileType).append("\r\n\r\n");
            return res.toString();
        }
    
        public byte[] send() throws Exception
        {
            HttpConnection hc = null;
    
            InputStream is = null;
    
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
    
            byte[] res = null;
    
            try
            {
                hc = (HttpConnection) Connector.open(url);
    
                hc.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + getBoundaryString());
                hc.setRequestProperty("Content-Length",postBytes+"");
    
                hc.setRequestMethod(HttpConnection.POST);
    
                OutputStream dout = hc.openOutputStream();
    
                dout.write(postBytes);
                dout.close();
    
                int ch;
    
                is = hc.openInputStream();
                StringBuffer buffer=new StringBuffer();
    
                while ((ch = is.read()) != -1)
                {
                    bos.write(ch);
                    buffer.append((char)ch);
                }
                res = bos.toByteArray();
                System.out.println(buffer.toString());
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }
            finally
            {
                try
                {
                    if(bos != null)
                        bos.close();
    
                    if(is != null)
                        is.close();
    
                    if(hc != null)
                        hc.close();
                }
                catch(Exception e2)
                {
                    e2.printStackTrace();
                }
            }
            return res;
        }
    }
    

    and use it in this way

    public void getBytes()
        {
            ByteArrayOutputStream bos=null;
            try
            {
                bos=new ByteArrayOutputStream();
                InputStream fis=getClass().getResourceAsStream("/super.mp3");
                int ch;
                byte[] data=new byte[120];
                while((ch=fis.read(data,0,data.length))!=-1)
                {
                    bos.write(data,0,data.length);
                }
                Hashtable params=new Hashtable();
                //params.put("id_user","8474");
                params.put("id_user","8379");
                params.put("file1","audio.mp3");
                HttpMultipartRequest httpreq=new HttpMultipartRequest("http://api.upload.com/gStorage/uploadSong?", params,"file1","xpressMusic.mp3","audio/mpeg",bos.toByteArray());
                httpreq.send();
                bos.close();
                fis.close();
            }
            catch (Exception e) {
                System.out.println("Exception"+e);
            }
    

    Here, the key is contenttype, contentLength.you can get the info on it from the link above.

    thankx.

  • I have my old laptop work, admin access, and I need to pass the parameters of language from German to English, especially the menus. Can you please indicate.

    I have my old laptop work, admin access, and I need to pass the parameters of language from German to English, especially the menus. Can you please indicate.

    A.I have changed the time zone.

    But I can't understand how to move to the menus in ENGLISH and the keyboard settings. They are in German. Need urgent help

    The system is running on Windows XP Professional

    Thank you for your help in advance.

    (Yes the multi language pack is somewhere on the laptop... where I'm not sure)

    Hello

    1. - you want to say that you have an administrator access on this computer?

    2. What is the operating system default language when the laptop was purchased?

    If the default language is German so it is not possible to change it to English.

    Reference: to change the language used for menus and dialog boxes

  • HIS 520W does not meet two parameters

    Hello

    I have a Cisco SA 520W, which does not seem to respond to the two parameters of the configuration.  I have enabled/disabled/re-enabled several times and still no change in behavior.

    The first is PING on the WAN interface.  I want to enable it, but the check box is cleared and the box does not respond to pings WAN.

    The second is periodic audits of the firmware.  I put my user name and password in the configuration and left the box empty but the router on a regular basis (once per hour perhaps) check cisco.com for updated firmware update.

    I am running the latest firmware of 1.1.21

    Brian

    We have seen some strange behaviors on ping of the WAN interface.  We are aware of it and looking to solve it.

    I'm not aware of the issue with the firmware for update checking.  I'll pass this along to the team.

  • Accessing content BI in OBIEE11g and him passing multiple parameters

    Hello

    I have just testted accessing OBIEE11.1.1.6 BI content and passing multiple parameters following the link:

    http://www.rittmanmead.com/2012/07/navigating-to-BI-content-in-obiee11g-and-passing-multiple-parameters/

    I added two js in UserScripts.js more


    USERSCRIPT.customPortalPageNav = {function (arg_array)}
    var str = "parent. PortalPageNav (1 ";
    for {(args in arg_array)
    var arg_name = args;
    var value = arg_array [arg_name];
    "" Str += "," ' + value + ' "';
    }
    (STR +=») ';
    eval (STR);
    };

    USERSCRIPT.customPortalNav.publish = {parameters: []}
    "new USERSCRIPT.parameter("1","Dashboard","/shared/FOLDERNAME/_portal/DASHBOARDNAME"),
    New USERSCRIPT.parameter ("2", "Page", "insert your Page"),
    new USERSCRIPT.parameter ("3", "Table", "insert a table"),
    new USERSCRIPT.parameter ("4", "Column", "insert a column"),
    new USERSCRIPT.parameter ("5", "Value", "Insert Value")]};

    and restart the presentation Service.

    but in the column properties > Interaction > value primary Interaction > links of Action > add > new > call browser Script

    I can not found customPortalPageNav in the menu.

    Anyone know what stage can cause?

    Thank you!

    Hi Leo,

    Correct function name. Change of customPortalNav to customPortalPageNav

    USERSCRIPT.customPortalNav.publish = {parameters: []}

    USERSCRIPT.customPortalPageNav.publish = {parameters: []}

    Kind regards
    DpKa

  • PASS URL parameters

    Hi all
    I checked the GO url with a filter feature - works great, if I try to add more number of parameters, it does not work. BI takes a single parameter value. I tried with 10 filter value in the URL GO. For this, I have passes the parameters to
    .. Saw.dll? GO & Path = < ReortPath > & Action = Browse & P0 = 10 & P1 = eq & P2 = Col1 & value = P3 & P4 = Col2 & P5 = value...

    is there a any restriction on the number of parameters to OBI?

    Hi, the syntax of URL go that you guys were talking about is old. I don't know when OBIEE has published this new syntax, but it is quite flexible in terms of number of parameters to pass HTML controls.

    New syntax is something like that

    http://saw.dll? «Go & Path = / shared //& Action = Navigate & Options = fdr & Col1 = "" & val1 ='' & op1 = eq...»
    You can replace %20 for spaces

    I found more information on this new syntax at this site:

    http://sureshotstrategies.WordPress.com/2008/12/13/integrating-Oracle-OBIEE-content-using-go-URL-syntax-2/

    Good luck
    SAI

    Published by: Sai Kumar Reddiboyina, on September 20, 2009 13:33

  • If you use Firefox I can not long enlargement of two fingers to work on my Apple. The same site will expand using Safari, so I guess it has to do with Firefox

    If you use Firefox I can not long enlargement of two fingers to work on my Apple. The same site will expand using Safari, so I guess it has to do with Firefox

    Some actions have been removed in Firefox 4 and later versions.

    You can restore the zoom feature by changing the related values of downtown on the topic: config page.

    browser.gesture.pinch.in -> cmd_fullZoomReduce
    browser.gesture.pinch.in.shift -> cmd_fullZoomReset
    browser.gesture.pinch.out -> cmd_fullZoomEnlarge
    browser.gesture.pinch.out.shift -> cmd_fullZoomReset
    browser.gesture.pinch.latched -> false
    

    To open the topic: config page, type Subject: config in the address bar (address) and press the 'Enter' key, as you type the url of a Web site to open a Web site.

    If you see a warning then you can confirm that you want to access this page.

    • Use the filter at the top bar of the on: page config to more easily spot a preference.
    • Preferences that have changed see the bold (user set).
    • Preferences you can restore the default value or change via the context menu.
  • How to put in place two sound devices and make two of them work at the same time?

    I am on Windows 7 Ultimate and I have a problem...

    I downloaded the SRS Audio Essentials software that improves the sound quality

    And I have Realtek audio device which is an audio driver that come with bulit in sound card

    But the problem is that I can choose only one of them as the default audio device

    When I was with Windows Xp, two of them worked at the same time...

    He is the captain:

    http://www.Flickr.com/photos/96392754@N07/8812378555/

    Help, please!

    PS: Sorry for my bad English... ^_^

    Hello

    Unfortunately this does happen, as it is by design,

    Here, a single device can be marked as default device, follow these steps below for more information.

    a. Click Start, type Sound in the box to start the search.
    b. click sound in the results of search at the top of the start menu.
    c. click the reading notice the check mark next to the default device.

    For all windows questions do not hesitate to contact us and we will be happy to help you.

  • UCM - Disqualification integration: I have integrated the two and cleaning works well for me. Problems with correspondence

    Hello

    I have installed and configured the two and cleaning works. But for correspondence in real-time, deduplication triggers only after outside firstname and lastname are entered (Email ID, address). Please can someone explain how the processes are triggered.
    Loading the batch by using list import, cleanup is working but does not. I can't see even duplicate Contacts after the execution of work for DQMgr for the deduplication (lot Contact Match).

    Thank you and best regards,

    Karim

    See article 6 of the Guide of Services company:

    Oracle® Enterprise Data Quality

  • Problem passing several parameters in URL

    I use a redirection to a URL action in a button (Apex 4.0.2) and I can't seem to understand how to properly complete multiple page items. I can use a parameter and the value is passed; However, when I try to pass two only the first element is filled. I don't know there is something wrong with my syntax, I don't know what.

    I use the $x () function I found in another thread here and as a sidebar, where can I find documentation on this feature? There seems to be little information here above.
    javascript:redirect('f?p=101:13:&SESSION.::NO::P13_REQ_ID,P13_REQUEST_NUMBER:'+$x('P3_REQUEST_ID').value,+$x('P3_REQ_NUMBER').value);
    Two items being passed are valid, because I can remove the comma from the value param string and two values of the element passed are concatenated into the first param element.

    Hello

    Try this:

    javascript:redirect('f?p=101:13:&SESSION.::NO::P13_REQ_ID,P13_REQUEST_NUMBER:'+$x('P3_REQUEST_ID').value + ',' + $x('P3_REQ_NUMBER').value);
    

    Kind regards
    Dirk

  • with two parameters of submit button

    Hello

    You are able to send two parameters in a submitForm by javascript? I would like to send the pdf itself over its xml to a servlet.

    Thank you

    See this class getDocuments method. You can get all attachments using Java code.

    http://help.Adobe.com/en_US/LiveCycle/9.0/programLC/Javadoc/com/Adobe/LiveCycle/formsservi ce/client/FormsServiceClient.html

    Thank you

    Srini

  • passing multiple parameters to a portlet

    Hi all

    I created a form of portlet a taskflow using the WSRP producer connection I add this portlet in the JSF page a new application.
    1. is it possible to create a portlet that accepts multiple parameters?
    2. is it possible to map a portlet from method to method in the new application.
    3. is there an implicit event that can be passed when all parameters are passed to the portlet.

    What is my requirement:-I send some 4-5 (String) parameters of the new application for the purposes of the portlet.
    What would be the sequence in which would be called the setters of this parameters in the Portlet application?

    can you please me if this is possible and how to do it. A tutorial would be useful.

    Kind regards
    ND

    Your question is associated with WebCenter and you must request this in the forum {forum: id = 354}.

    Anyway, you can pass several parameters to a portlet. Set the parameters as parameters to the corresponding defined TaskFlow. When the taskflow is wrapped as a portlet producer by the JSF Portlet Bridge all taskflow parameters to expose as a separate navigation portlet settings. If you consume the portlet to a page, then the portlet parameters will be bound to variables PageDef and you can use these variables to pass values of parameter to the portlet. If you need to re - send the new parameter values when running, just set the corresponding pageDef variables and update the tag by PPR. Don't forget to mark the binding region of the portlet in the PageDef as RefreshIfNeeded, otherwise it will not get the new values and is not refreshed.

    Read the next article in the documentation on the use of the navigation settings to link contextual portlets:
    http://download.Oracle.com/docs/CD/E14571_01/WebCenter.1111/e10148/jpsdg_pages.htm#CHDJABHD

    If you have additional questions, please ask them in the WebCenter forums.

    Dimitar

Maybe you are looking for

  • "Back" button problem

    I have only the back button. The next button is no more. But my problem is that I can't use the back button. It is always gray and cannot select. I have to use the BACKSPACE on the keyboard to get back on the web. Could you help me with this problem

  • Question display preferences

    I have a set of mounting upward with three monitors running off a video (3.5 GHz 6-core Intel Xeon E5) MacPro running 10.10.3. I have reset the PRAM this morning and now cannot get the monitors displayed correctly. The display prefs window seems not

  • 4710 proBook manual repair s

    Hi all! We have a set of student books 34, model ProBook s 4710 (SKU VC322EA #AK8). Now that the warranty for these computers are expired, is it possible to get a manual of maintenance, preferably in pdf format, so that we can exchange for spare part

  • My computer crashes sometimes when windows loads up.

    My computer sometimes freezes when it loads Windows. He can do it two or three times before it works. After that windows does not load it gives a message saying "a problem has been detected and windows has shut down to prevent damage to your computer

  • BlackBerry 10 Blackberry os 10.3.3

    someone knows when you bid 10.3.3 for all BlackBerry.  The best system in the world.