Parameter passing using ajax

hi,
I am trying to pass more than one parameter while sending the form to the action class using the ajax technology in struts, but unable to do tha.
Can anyone suggest any way for that.
Moreover, Can anyone tell does the form gets submitted when page is updated using ajax technology. If the form gets submitted, i can retrieve the values in the action class.
My code in the js file is like that:
var url = "DynamicXYZAction.do?strLimitLevel=" + escape(strLimitLevel)+"&strBusiness="+escape(strBusinessId);

Send the parameter values with the request url.
Developing Ajax applications with open source JBoss and MySQL.
http://www.regdeveloper.co.uk/2006/06/09/ajax_web_tutorial/
http://www.regdeveloper.co.uk/2006/06/20/ajax_web_tutorial_part2/

Similar Messages

  • # of parameters you can pass using AJAX

    I have a weird problem with an AJAX form combined with a CFC.  Just to rule out any possibilities, is there a limit on the number of input fields you can pass to a CFC using AJAX?  I only ask because it appears when the entire form is filled out the page throws an error that the CFC can't be found.
    Also, I'm noticing that 2 of the parameters are out of order (in red). Would that make a difference?  I'm also not sure why they are out of order when getting passed because they are not that way on the form.  Am I missing something here?
    CFC
    <cffunction name="LyricOpera" access="remote" returntype="array" output="false">
        <cfargument name="CurrentApplicationStep" type="string" default="" />
        <cfargument name="ScreenSelection" type="string" default="" />
        <cfargument name="Role1" type="string" default="" />
        <cfargument name="Opera1" type="string" default="" />
        <cfargument name="Company1" type="string" default="" />
        <cfargument name="Year1" type="string" default="" />
        <cfargument name="Role2" type="string" default="" />
        <cfargument name="Opera2" type="string" default="" />
        <cfargument name="Company2" type="string" default="" />
        <cfargument name="Year2" type="string" default="" />
        <cfargument name="Role3" type="string" default="" />
        <cfargument name="Opera3" type="string" default="" />
        <cfargument name="Company3" type="string" default="" />
        <cfargument name="Year3" type="string" default="" />
        <cfargument name="Aria1" type="string" default="" />
        <cfargument name="Aria1Opera" type="string" default="" />
        <cfargument name="Aria1Language" type="string" default="" />
        <cfargument name="Aria2" type="string" default="" />
        <cfargument name="Aria2Opera" type="string" default="" />
        <cfargument name="Aria2Language" type="string" default="" />
        <cfargument name="Aria3" type="string" default="" />
        <cfargument name="Aria3Opera" type="string" default="" />
        <cfargument name="Aria3Language" type="string" default="" />
        <cfargument name="Variable1Name" type="string" default="" />
        <cfargument name="Variable1Institution" type="string" default="" />
        <cfargument name="Variable1Address1" type="string" default="" />
        <cfargument name="Variable1City" type="string" default="" />
        <cfargument name="Variable1State" type="string" default="" />
        <cfargument name="Variable1Province" type="string" default="" />
        <cfargument name="Variable1Zipcode" type="string" default="" />
        <cfargument name="Variable1PostalCode" type="string" default="" />
        <cfargument name="Variable1Phone" type="string" default="" />
        <cfargument name="Variable1IntlPhone" type="string" default="" />
        <cfargument name="Variable1Country" type="string" default="" />
        <cfargument name="Variable1Email" type="string" default="" />
        <cfargument name="Variable2Name" type="string" default="" />
        <cfargument name="Variable2Institution" type="string" default="" />
        <cfargument name="Variable2Address1" type="string" default="" />
        <cfargument name="Variable2City" type="string" default="" />
        <cfargument name="Variable2State" type="string" default="" />
        <cfargument name="Variable2Province" type="string" default="" />
        <cfargument name="Variable2Zipcode" type="string" default="" />
        <cfargument name="Variable2PostalCode" type="string" default="" />
        <cfargument name="Variable2Phone" type="string" default="" />
        <cfargument name="Variable2IntlPhone" type="string" default="" />
        <cfargument name="Variable2Country" type="string" default="" />
        <cfargument name="Variable2Email" type="string" default="" />
    From Firebug
    argumentCollection{
    "CurrentApplicationStep":"Lyric-Opera",
    "ScreenSelection":"Submit",
    "Role1":"Abigail",
    "Opera1":"The Crucible",
    "Company1":"Kingwood Summer Opera",
    "Year1":"2010",
    "Role2":"Title role",
    "Opera2":"Suor Angelica",
    "Company2":"Kingwood Summer Opera",
    "Year2":"2008",
    "Role3":"Lauretta",
    "Opera3":"Gianni Schicchi",
    "Company3":"Sam Houston State University",
    "Year3":"2007",
    "Aria1":"Tacea la notte placida",
    "Aria1Opera":"Il Trovatore",
    "Aria1Language":"Italian",
    "Aria2":"Song to the Moon",
    "Aria2Opera":"Rusalka",
    "Aria2Language":"Czech",
    "Aria3":"Embroidery Aria",
    "Aria3Opera":"Peter Grimes",
    "Aria3Language":"English",
    "Variable1Name":"Todd R Miller",
    "Variable1Institution":"Lonestar College Kingwood",
    "Variable1Address1":"20000 Kingwood Dr",
    "Variable1City":"Kingwood",
    "Variable1State":"TX",
    "Variable1Province":"",
    "Variable1Zipcode":"77339",
    "Variable1Phone":"281-312-1485",
    "Variable1IntlPhone":"",
    "Variable1Country":"USA",
    "Variable1Email":"[email protected]",
    "Variable2Name":"Anne Heath-Welch",
    "Variable2Institution":"Todd Miller",
    "Variable2Address1":"309 East 13th Street",
    "Variable2City":"Houston",
    "Variable2State":"TX",
    "Variable2Province":"",
    "Variable2Zipcode":"77008",
    "Variable2Phone":"832-335-9108",
    "Variable2IntlPhone":"",
    "Variable2Country":"USA",
    "Variable2Email":"[email protected]",
    "Variable1Postalcode":"",
    "Variable2Postalcode":"",
    "Submit":"Continue"}
    methodLyricOpera
    returnFormat
    json

    The fix is to set "setHTTPMethod("POST");" for the AJAX proxy.  By default, the proxy function "setHTTPMethod("method");"  is set to "GET" and 47 input fields with corresponding data is over the limit.  The proxy function, "setHTTPMethod("method");", must be set to "POST" to avoid this error.

  • Parameter Passing using RaiseEvent

    Pardon me if this is a stupid question,I've just finished reading chapter 10 of the web dev guide. Anyway, here it goes:
    Using RaiseEvent I can pass parameter that can be used by RegisterForEvent and this parameter can be used by the function that is registered for that action.
    sample:
    document.PCC.RaiseEvent("urn:schemas.acme.com:email","MailArrived",var)
    document.PCC.RegisterForEvent("urn:schemas.acme.com:email","MailArrived",AcmeGotMail)
    function AcmeGotMail(){
    alert("this is the parameter: " + var )
    Question is I would like to pass that var to a jsp page,how can I do that?

    The only way I could think this would work would be to jump to that other JSP page when the event occurred. You could add control args (key=value pairs) for any number of arguments you wanted to read in the JSP page, and simpy make sure that JSP page is within the gateway space of the portlet web service.
    function AcmeGotMail(){
    window.location="nameofjsppagehere.jsp?arg1=val1&arg2=val2"
    Then in your "landing" page (nameofjsppagehere.jsp) you would parse the arguments using standard JSP parameter parsing methods.
    Classic portlet programming would have you set portlet preferences using the EDK on one page and pick them up on a second page you jump to. Try downloading the EDK sample "Quick Start - Java" from the Portlet samples area of the Developer tab under the Support Center. You might look at setprefs2.jsp and getprefs.jsp.
    David Phipps
    Plumtree Software

  • How can i upload file using ajax post request and jsp

    Hi
    this is my code files
    addPhoto.jsp
    <html>
    <head>
    <title>Add Photo</title>
    <script>
    var optionNo = 0;
    var i=1;
    var val=0;
    var file = 0;
    var exten = new Array(".jpg",".jpeg",".gif");
    function addValues()
         for(var i=0;i<5;i++)
              optionNo += 1;
              oNewOption = new Option();
              oNewOption.text = optionNo;
              oNewOption.value = optionNo;
              addSelect.add(oNewOption);
    function addBoxes()
         var str = "";
         var j=0;
         val = document.getElementById('addSelect').value;
         for(j=1; j<= val; j++)
              str = str + '<font size=3>file:' + j + '</font>';
              str = str + '<input type="file" id=filepath'+ j +' name=file'+ j + ' onchange="uploadFile(hidden'+ j + '.value)"><div id="result'+ j +'"></div>
              str = str + '<input type="hidden" name="hidden' + j + '" value=' + j +'>';
         document.getElementById('addPhoto').innerHTML = str;
    function uploadFile(value)
    var str = "filepath" + value;
    file = value;
    var param = document.getElementById(str).value;
    var parameter = "filepath=" + param;
    alert(parameter.length);
    if(checkValidity(param))
    var url = "uploadFile.jsp";
    if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    req.open("POST", url, true);
    req.setRequestHeader("Content-type", "multipart/form-data");
    //req.setRequestHeader("Content-length", parameter.length);
    req.setRequestHeader("Connection", "close");
    req.onreadystatechange = callback;
    req.send(null);
         else
              document.getElementById("result" + file).innerHTML = "upload .jpeg,.jpg,.gif Files Only";
    function callback() {
    if (req.readyState == 4) {
    updatepage(req.responseText);
    function updatepage(str){
         document.getElementById("result" + file).innerHTML = str;
    function checkValidity(str)
         var i=0;
         var j=0;
         var str1 = str.substring(str.lastIndexOf("."),str.length);
         alert(str1);
         for(i=0;i<exten.length;i++)
         if(str1.search(exten) != -1)
              j++;
              break;
         if(j>0)
              return true;
         else
              return false;
    </script>
    </head>
    <body onload="addValues()">
    <h5>Add Photo(s)</h5>
    <select id="addSelect" name="addSelect" onchange="addBoxes()">
    <option id="select" selected>Select</option>
    </select>
    <div id="addPhoto"></div>
    </body>
    </html>
    uploadFile.jsp
    <%@page import="java.io.*"%>
    <%
    /*try
    String contentType = request.getContentType();
         System.out.println(request.getMethod());
         System.out.println("Content type is :: " +contentType); 
         if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
              DataInputStream in = new DataInputStream(request.getInputStream());
              DataInputStream in1 = in;
              int formDataLength = request.getContentLength();
    System.out.println(formDataLength);
              byte dataBytes[] = new byte[formDataLength];
              int byteRead = 0;
              int totalBytesRead = 0;
              while (totalBytesRead < formDataLength)
                   byteRead = in1.read(dataBytes, totalBytesRead, formDataLength);
                   totalBytesRead += byteRead;
              out.println("<br>totalBytesRead : " + totalBytesRead + " : formDataLength = " + formDataLength);
         } catch(Exception e) {
              e.printStackTrace();
         try
         String filePath = request.getParameter("filepath");
         System.out.println(filePath);
         File f= new File(filePath);
         String path = f.getName();
         String contentType = request.getContentType();
         System.out.println(contentType);
         //InputStream in = new FileInputStream(filePath);
         DataInputStream in = new DataInputStream(request.getInputStream());
         int formDataLength = request.getContentLength();
         System.out.println(formDataLength);
    byte[] buf = new byte[1024];
    OutputStream out1 = new FileOutputStream("c:/docs/" + path);
    int len;
    while ((len = in.read(buf)) > 0) {
    out1.write(buf, 0, len);
    in.close();
    out1.close();
         out.write("File Uploaded SucssesFully");
    catch(Exception e)
         e.printStackTrace();
         out.write("error while Writing File");
    %>
    the above code in request.getContentType() i am getting 0. I am not passing the content length. for the same application with out using Ajax i am
    getting the size of file... it is very very urgent for me.. pls help me out on this...
    Any one having the code on this pls mail me the code...
    my mail id ... [email protected]
    Regards
    Ashok Kumar

    Sure, you can upload a file, using a form input element of type file. You pick this up with a servlet, though you need a special request wrapper to sort out the multi-part request you get back that way (there's a suitable package on jakarta.apache.org/commons)
    The servlet decrypts the file and can pass the results to a JSP for display.
    Don't try to do the complicated stuff in a JSP, it all gets incredibly messy, and that's not what JSPs are for.

  • Unable to get parameter by using a controller in OAF

    Hi!
    I'm new using OAF and will appreciate your help a lot!!
    FYI:
    Basically I have to add 2 descriptive flexfields in a page (by creating a VO) and I have to update the table with the information registered on those dff (I've done all the logic already).
    I created a Controller (CO) which calls a method declared in an Application module (AM) that executes a store procedure (the CO and AM have been created by me and they extend a standard CO and AM).
    Problem:
    However, just before updating.. I'm having a problem because I'm unable to get a parameter by using paramContext.getParameter("reqHeaderId"); that will help me to identify which row I need to update.
    Since the instruction is not capturing the value, it returns null and I got the following error when I try to convert it to Number: oracle.apps.fnd.framework.OAException: java.lang.NumberFormatException: null
    It's really important to mention that before getting to the page where I click the submit button that does the logic mentioned.. there are 2 pages before the one where I'm trying to capture the parameter and the parameter needed is set on the 1st page. I've been checking each standard CO of the 3 pages and they use the instruction pageContext.putParameter("reqHeaderId"); to pass it between the 3 pages (As far as I know, if not please correct me). On the 3rd and last standard CO it uses pageContext.getParameter("reqHeaderId"); to get the value and do some other logic.
    So why Im not getting the value if I do the same thing (pageContext.getParameter("reqHeaderId");) on my xxController (which extends the standard CO)?
    Here is the code of the controller:
    public class xxController extends standardController {
       public void processRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processRequest(pageContext, webBean);
       public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processFormRequest(pageContext, webBean);
        String str;
        str = pageContext.getParameter("_FORM_SUBMIT_BUTTON");
           if ((str != null) && (str.equals("SubmitButton")))
               String ReqHeaderId = pageContext.getParameter("reqHeaderId");
              String ReqLineId = pageContext.getParameter("reqLindId");
            Serializable[] parameters1 =
             ReqHeaderId
             ,ReqLineId
            ,pageContext.getParameter("xxavtBienServicio")     //dff
            ,pageContext.getParameter("xxavtAttribute3")         //dff
            String var = (String)am.invokeMethod("updateAttributes", parameters1);    // updateAttributes is the method that converts ReqHeaderId to number and executes my store procedure
    thank you for your help in advance!

    You need to verify that the parameter is being added to the pageContext from the first page to the last. You can do this by downloading the pages and all the class files to your development environment and put them into the myClasses directory. Then once you get it so it can be run in JDeveloper, you can actually invoke the debugger and do a watch on the page context for that parameter. It is important to note that you may need to download more than just those specific pages depending upon the setups of the supporting pages. I generally find it easier to just download everything for a particular application to my classes directory so I am not forever trying to find missing class files. Even then if they call some utility classes, you will need to download them to the JDevelper on your PC into the classes directory.  But once you are able to run the pages in JDeveloper you will be able to do a lot more with the debugger.
    Kristofer

  • JRC bug: apostrophe in string parameter passed to Crystal Report with Command datasource to SQL Server

    Post Author: nl11087
    CA Forum: JAVA
    A single quote/apostrophe in string parameter passed to a Crystal Report with Command datasource connecting to a SQL Server database, using sqljdbc driver does not escape the special character correctly. When doing a preview in the Crystal Reports IDE it allows you to escape the input parameter as expected and work correctly, but through the JRC component it fails. For string parameters without special sql server characters I experience no problems at all. When replacing the Command with a direct table there is also no problem.
    Reproduction:
    1. create a database db1, create a table table1 with a String type column col1.
    2. Create new report Report1.rpt, create a connection to above, Add Command using 'SELECT col1, col2, col3 FROM table1 WHERE col1 = '{?Par1}' . Add a parameter field Par1 : String
    3. In your java stand alone application using JRC add the parameter Par1 with a value "Jon Doe's Value" containing a single apostrophe. Export to PDF. (I also tried MSWord and this failed too, similar behavior). Additionally, in another test try to replaceAll("'","''") to escape it, preventing the code to break, but now it does not retrieve the expected row anymore and you end up with an empty report.
    Exception StackTrace:
    com.crystaldecisions.reports.exportinterface.exceptions.ExportException: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)
    Caused by: com.crystaldecisions.reports.formatter.formatter.c: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.l.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.a(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    ... 17 more
    Caused by: com.crystaldecisions.reports.dataengine.be: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.nr(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bn(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bp(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.s.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.aa(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    ... 23 more
    Caused by: com.crystaldecisions.reports.reportdefinition.datainterface.n: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.reportdefinition.datainterface.p.a(Unknown Source)
    ... 35 more
    Caused by: com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.queryengine.driverImpl.o.eC(Unknown Source)
    at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.ea(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.h(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.dV(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ax.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cy(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cz(Unknown Source)
    at com.crystaldecisions.reports.queryengine.b1.bc(Unknown Source)
    ... 36 more
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 's'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(Unknown Source)
    ... 48 more
    - JRCAgent3 detected an exception: An error occured while exporting the report
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)

    Post Author: nl11087
    CA Forum: JAVA
    A single quote/apostrophe in string parameter passed to a Crystal Report with Command datasource connecting to a SQL Server database, using sqljdbc driver does not escape the special character correctly. When doing a preview in the Crystal Reports IDE it allows you to escape the input parameter as expected and work correctly, but through the JRC component it fails. For string parameters without special sql server characters I experience no problems at all. When replacing the Command with a direct table there is also no problem.
    Reproduction:
    1. create a database db1, create a table table1 with a String type column col1.
    2. Create new report Report1.rpt, create a connection to above, Add Command using 'SELECT col1, col2, col3 FROM table1 WHERE col1 = '{?Par1}' . Add a parameter field Par1 : String
    3. In your java stand alone application using JRC add the parameter Par1 with a value "Jon Doe's Value" containing a single apostrophe. Export to PDF. (I also tried MSWord and this failed too, similar behavior). Additionally, in another test try to replaceAll("'","''") to escape it, preventing the code to break, but now it does not retrieve the expected row anymore and you end up with an empty report.
    Exception StackTrace:
    com.crystaldecisions.reports.exportinterface.exceptions.ExportException: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)
    Caused by: com.crystaldecisions.reports.formatter.formatter.c: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.l.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.a(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    ... 17 more
    Caused by: com.crystaldecisions.reports.dataengine.be: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.nr(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bn(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bp(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.s.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.aa(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    ... 23 more
    Caused by: com.crystaldecisions.reports.reportdefinition.datainterface.n: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.reportdefinition.datainterface.p.a(Unknown Source)
    ... 35 more
    Caused by: com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.queryengine.driverImpl.o.eC(Unknown Source)
    at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.ea(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.h(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.dV(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ax.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cy(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cz(Unknown Source)
    at com.crystaldecisions.reports.queryengine.b1.bc(Unknown Source)
    ... 36 more
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 's'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(Unknown Source)
    ... 48 more
    - JRCAgent3 detected an exception: An error occured while exporting the report
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)

  • How to get each value from a parameter passed like this '(25,23,35,1)'

    Hi
    One of the parameter passed to the function is
    FUNCTION f_main_facility(pi_flag_codes VARCHAR2) return gc_result_set AS
    pi_flag_codes will be passed a value in this way '(25,23,35,1)'
    How to get each value from the string
    like 25 first time
    23 second time
    35 third time
    1 fourth time
    I need to build a select query with each value as shown below:-
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3, code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 25 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q1,
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3,code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 23 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q2,
    (SELECT t2.org_id, RTRIM(xmlagg(xmlelement(e, t4.description || ';')
    ORDER BY t4.description).EXTRACT('//text()'), ';') AS DESCRIPTION
    from org_name t2, ref_org_name t3,code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 35 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date
    group by t2.org_id) q3,
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3, code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 1 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q4
    Please help me with extracting each alue from the parm '(25,23,35,1)' for the above purpose. Thank You.

    chris227 wrote:
    I would propose the usage of regexp for readibiliy purposes and only in the case if this doesnt perform well, look at solutions using substr etc.
    select
    regexp_substr( '(25,23,35,1)', '\d+', 1, 1) s1
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 2) s2
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 3) s3
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 4) s4
    from dual 
    S1     S2     S3     S4
    "25"     "23"     "35"     "1"In pl/sql you do something like l_val:= regexp_substr( '(25,23,35,1)', '\d+', 1, 1);
    If t2.att_type is type of number you will do:
    t2.att_type= to_number(regexp_substr( '(25,23,35,1)', '\d+', 1, 1))Edited by: chris227 on 01.03.2013 08:00Sir,
    I am using oracle 10g.
    In the process of getting each number from the parm '(25,23,35,1)' , I also need the position of the number
    say 25 is at 1 position.
    23 is at 2
    35 is at 3
    1 is at 4.
    the reason I need that is when I build seperate select for each value, I need to add the query number at the end of the select query.
    Please see the code I wrote for it, But the select query is having error:-
    BEGIN
    IF(pi_flag_codes IS NOT NULL) THEN
    SELECT length(V_CNT) - length(replace(V_CNT,',','')) FROM+ ----> the compiler gives an error for this select query : PLS-00428:
    *(SELECT '(25,23,35,1)' V_CNT  FROM dual);*
    DBMS_OUTPUT.PUT_LINE(V_CNT);
    -- V_CNT := 3;
    FOR L_CNT IN 0..V_CNT LOOP
    if L_CNT=0 then
    V_S_POS:=1;
    V_E_POS:=instr(pi_flag_codes, ',', 1, 1)-1;
    else
    V_S_POS:=instr(pi_flag_codes,',',1,L_CNT)+1;
    V_E_POS:=instr(pi_flag_codes, ',', 1, L_CNT+1)-V_S_POS;
    end if;
    if L_CNT=V_CNT then
    V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS));
    else
    V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS,V_E_POS));
    end if;
    VN_ATYPE := ' t2.att_type = ' || V_ID;
    rec_count := rec_count +1;
    query_no := 'Q' || rec_count;
    Pls help me with fetching each value to build the where cond of the select query along with the query number.
    Thank You.

  • Error processing a page when using AJAX

    hi apex forum.
    I need your help with a problem that presents me with an application in apex 4.2.
    I have developed a html screen, in which I have created a table that contains a detailed items and on which the user can enter some values. these data that user enters, I calculate a total at the end of the page. To view the current total of the entries , the user presses a button that uses AJAX (to avoid having to refresh the whole page)  to calculate totals and at the same time, i call an AJAX process to add each record to an apex_collection , until here everything perfect.
    The problem is that when I want to save the information to pass it from apex_collection to the database (by pressing a button and make the official insert), I must first have to refresh the page, if not do it this way, Apex generate an Error Message.
    it's important to say that error does not apper, if before pressing the button, i first refresh the page.  Any suggestions??
    I think I should use some internally command to synchronize or update the page.... any suggestions are welcome.,
    thanks in advance,

    Soooo...
    What is the error you are seeing?
    Is the multi-row process still there? What exactly happens on submit (computations, validations, processes)?
    Have you tried to run with debug enabled and were you able to see where the error originates?

  • Issue with parameter passing in ie7 to php xml

    Hi
    I wondered if anyone could offer a little advice what the issue is here.
    I have a page with xml generated from php in a separte file and presented by a dataset in spry.
    The xml is OK and in firefox it all works but ie seems to barf on it.
    The situation is this:
    I have a jump menu on a front page that provides a url with anumeric parameter passed like this
    platforms.php?platform_id=1
    This parameter is picked up by php on the platforms.php page using the $_GET Array and is passed into the code in my Spry dataset to the file that runs my query and returns my xml- so basically the page displays a dataset filtered on this parameter id.
    It works perfectly in FF.
    In IE if I link straight to the page without a parameter at all- so platforms.php the page loads OK using the default parameter I have set up in the top of this page to send the default id of 1 to the code page so the spry query says platform_sql.php?platform_id=1 and the xml generator is fine with thisiel. ie I do a
    if(isset($_GET['platform_id'])){
                                                                     $platform=$_GET['platform_id'];
    }else{
    $platform=1;
    The dataset loads Ok in IE but when I pass a parameter in the url from my jump menu IE gives a blank SPRY table i- it momentarily appears with just the placeholders for my dataset elements then vanishes. The source code of the page shows the correct id was set in the spry data going to my query file.
    There is an error in ie saying there is a javascript error but its not any help- in ie fashion- FF shown no such errors.
    I thought this might be a data type thing again in the dataset but its not - I have set the elements returned to simple strings but it still does not work.
    Is there a problem passing in a parameter like this to a spry dataset?

    After about half a day of mucking round I found the problem and a solution to this problem.
    What appeared to have happened was that some of the older content in my database used html originally encoded using a WYSWYG editor called ktml.
    Later data uses Tiny MCE. It looks like the character set of the two formats is slightly different and as a result some characters rendered incorrectly when passed through XML parsing where it specifies the character set as utf-8.
    Firefox on the whole seems to ignore the issue though looking at the raw xml output of my php-xml code- where "-" characters were (dashes) there was a question mark character shown. None the less in actual use on my page the xml was produced and the dataset worked out.
    In IE, it barfed at these same characters and failed to return the xml dataset.
    What confused the issue more was some of my smaller datasets if they by chance never had a "-" character in rendered OK in IE- hence my default dataset (platform_id=1) worked in IE. After much experimenting I noticed other ids worked too if there was never such a character.
    How I got round it was to wrap my server side data in the utf8_encode() function, and now all my xml is clean.
    The javascript error being thrown was a red herring though I could not tell until I managed to run my page in ie7 with Visual Studio Express error console running- I had this on a spare machine at work so could debug with it.
    All sorted now- now just need to find away to wrap all my datasets in collapsible panels that work.
    K

  • Help required for using ajax in netweaver

    Hi..
    Can i Use Ajax for my netweaver applications?? If yes, then how?? Any pointers regarding that will be adequately rewarded points..
    Thanks

    For pure JavaScript enabled AJAX application, no problem. You just write the application as usual and send XMLHttpRequest with parameters to server, then update the web page with your JavaScript code;
    I can show you some sample code here:
    <script type="text/javascript">
            function createXMLHttpRequest() {
                 var xmlHttp;
                if (window.ActiveXObject) {
                        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                else if (window.XMLHttpRequest) {
                        xmlHttp = new XMLHttpRequest();
                return xmlHttp;
            function onclick_changeModelHouse(id) {
                var xmlHttp = createXMLHttpRequest();
                xmlHttp.onreadystatechange = function(){
                     if(xmlHttp.readyState == 4) {
                          if(xmlHttp.status == 200) {
                               // here you get your page component with id or any you like,
                                    // then update it with data returned from the request you sent;
                                   // Here I update one image url path;
                                  var img = document.getElementById("houseModel");
                                   // suppose you return the image file name;
                         img.innerHTML="<img src='images/" + xmlHttp.responseText +  "'>";
                xmlHttp.open("GET", "http://myserver:8080/myApp//AjaxImageService?model="+id, true);
                xmlHttp.send(null);
    </Script>
    For some button in your page you add javascript code like
    onClick="onclick_changeModelHouse(id)"
    somthing.
    You need develop servlet to response your request, and usually you need pass back your data in XML format, here I just use plain text for easy understanding.

  • Parameter passing problem to standard JSP iView

    Hi,
    I'm trying to launch a standard iView with some a parameter directly from the browser by calling the url http://<server>/<iview>?<param>=<value>
    The iView ID is com.sap.pct.hcm.ecmmain.approval and by looking at its details from the content catalog I saw there was a property called CREVI. I would like to fill this in but the iview doesn't respond to the URL params at all. Setting them staticly by editing the iView works perfect.
    I have also checked that the "Parameters to pass from Page Request" property includes * and excludes some other properties than the one I'm testing.
    I thought this was going to be simple but can't just make it work..I guess I'm missing something basic or the property can't be used? Any ideas?
    Thanks,
    Mikko

    Hi Mikko,
    We have found inconsistencies with regards to parameter passing in the URL, sometimes they are read and sometimes not.  I suggest that you try to change the order of the parameters as this can affect if its read.  I also believe other parameters can interfere whether or not it is read so try various scenarios.
    Cheers,
    John

  • Parameter passing issue for HTMLDB report page

    Hi,
    I have created a HTMLDB report based on SQL query in which the where clause column needs to takeup dynamic value each time.
    So I have defined a hidden item on the page PUSERID of Source type "Static Assigment".
    And this variable is used in SQL as
    Select Name
    from employees
    where employeeid = :PUSERID
    Now when i try to run this report and pass the parameter thru the URL by edititng the URL to have parameter value as
    http://localhost:33492/pls/htmldb/f?p=104:8:8320056215249064505:::::PUSERID:CPRASAD
    This shows the page with no data found...though when i run the query manually it returns the result.
    Select Name
    from employees
    where employeeid = 'CPRASAD'
    Plz let me know the correct procedure to make this work?
    Thanks
    AJ

    Thanks Serigo..it works!
    But why we need to remove the colon?Was it symbolizing that there was no parameter passed initially on URL and later when I was expecting one which was acting as two parametes in case of my url example(one parameter as nothing and another ad PUSERID)

  • Example: Cascading Popup LOVs (Solution using Ajax)

    If you need popup LOVs to depend on each other, here's a way to do it:
    Put this in the header text of the page:
    <script type="text/javascript">
    function clearFormData(data) {
    var items = new Array();
    items.push(data);
    for (var i = 0; i < items.length;i++) {
    var item = items;
    document.getElementById(item).value = '';
    if (document.getElementById(item+'_HIDDENVALUE')) document.getElementById(item+'_HIDDENVALUE').value = '';
    return true;
    function setSessionData(data) {
    var get = new htmldb_Get(null,document.getElementById('pFlowId').value,null);
    var items = new Array();
    items.push(data);
    for (var i = 0;i < items.length;i++) {
    var item = items[i];
    var tempObjID = (document.getElementById(item+'_HIDDENVALUE')) ? item+'_HIDDENVALUE' : item;
    get.add(item, document.getElementById(tempObjID).value);
    get.get();
    return true;
    </script>
    These are some helper functions (makes it easier to port to other pages, you could also put them in an external js file).
    Now on the second (or whatever) popup LOV (one that needs the value of another), put following code into the field "Form Element Option Attributes":
    [i]onclick="setSessionData('P1_FIRST_POPUP')"
    Change "P1_FIRST_POPUP" into the id/name of the popup LOV that the second depends on.
    Now to clear the second one (if there is already something in it) you can put this into the "Form Element Option Attributes" field of the first popup LOV:
    onclick="clearFormData('P1_SECOND_POPUP')"
    Change the "P1_SECOND_POPUP" into the id/name of the popup LOV that depends on the first one.
    If you need more than one item to be set in the session use the javascript functions like this:
    onclick="setSessionData(['P1_FIRST_POPUP','ANOTHER_ITEM';'AND_SO_ON'])"
    onclick="clearFormData(['P1_SECOND_POPUP','ANOTHER_ITEM';'AND_SO_ON'])"
    This is the best solution I figured out so far for cascading popups.
    Demo: http://apex.oracle.com/pls/otn/f?p=36908:2
    If you need cascading select boxes it's better to use this solution: http://apex.oracle.com/pls/otn/f?p=11933:37 .
    Edit:
    - works now regardless of being logged in or not, I just forgot to take ou the 0 in the htmldb_Get call (=> always
    sent the session id "0", which didn't exist)
    - added a link to the demonstration

    excellent tip for using ajax to update session state.
    one small change to share:
    function setSessionData() {
    var get = new htmldb_Get(null,document.getElementById('pFlowId').value,null,null);
    for (var i = 0; i < arguments.length; i++) {
    var item = arguments\[i\];
    var tempObjID = (document.getElementById(item+'_HIDDENVALUE')) ? item+'_HIDDENVALUE' : item;
    get.add(item, document.getElementById(tempObjID).value);
    get.get();
    return true;
    set 4th argument to htmldb_Get constructor to null.. causes the script to retrieve the value from the hidden form field, rather than being set explicitely.
    just noticed this code is different from the demo, which does set a static value of 2. Tempted to hit cancel, but maybe this can avoid someone else a lot of head scratching.
    also, was having issues with Array.push() during debugging to find the above issue.. and changed the way html form element id(s) are passed to the function; opted to use the implicit "arguments" array instead. Minor, but worth noting.
    thanks again for the useful piece of code.
    edit:
    this wiki doesn't parse brackets well; added char escapes so they'll show.. will need to remove by hand.

  • Getting error Invalid length parameter passed

    Hi,
    I'm getting an error running my query. It say "Invalid length parameter passed to the LEFT or SUBSTRING  function. I will be getting the string in between of hyphen using the code below. May i ask your assistance or idea on how to fix this issue.
    thank you.
     Substring(ins.itemid,11,CHARINDEX('-',ins.itemid+'-',11)-11) AS MODEL
    Msg 537, Level 16,
    State 3, Line 1
    Invalid length parameter passed to the LEFT or SUBSTRING
    function.
    Sample data of Itemid.
    B300-4410-ONEMAX-U
    B300-1725-XWHT-U
    B300-3110-VT981-U
    B300-1720-DRZRKCROBLK-U
    B300-1720-DRDTHN32BLK-U

    That'll cause empty strings to show up into you're result set but shouldn't cause the the SUBSTRING function to fail. 
    The error is the result of the SUBSTRING function trying to bring back a negative number of characters.
    Try running the following and see what comes back...
    SELECT ins.itemid
    FROM dbo.TableName ins
    WHERE LEN(ins.itemid) < 11
    If you don't find any itemids what are less than 11 characters (I'm 99% sure you will), try using a little test script like the following to test suspect values...
    IF OBJECT_ID('tempdb..#temp') IS NOT NULL
    DROP TABLE #temp
    GO
    CREATE TABLE #temp (
    itemid VARCHAR(30)
    INSERT #temp (itemid) VALUES
    ('B300-4410-ONEMAX-U'),
    ('B300-1725- '),
    ('B300- 3110-VT981-U'),
    ('B300-1720-DRZRKCROBLK-U'),
    ('B300- 1720-DRDTHN32BLK-U')
    SELECT ins.itemid
    FROM #temp ins
    WHERE LEN(ins.itemid) < 11
    SELECT
    SUBSTRING(
    ins.itemid, 11, CHARINDEX('-',ins.itemid+'-',11)-11) AS MODEL FROM #temp ins
    HTH,
    Jason
    Jason Long

  • NEED PARAMETER PASSING SAMPLE INSTALLATION ZIP FILE...

    Hello All,
    I was viewing the following page:
    http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/
    articles/guidelines.parameter.passing.html
    Near the end of the page it reads, "For a detailed PL/SQL portlet
    sample, see the Parameter Passing sample included in the PL/SQL
    section including the Parameter Passing Sample Installation
    article and check out the source code in the downloadable zip
    file."
    The phrase "downloadable zip" near the end of this line is a link
    that is supposed to provide you with the zip file. When I click
    on this link I get the file to save as sample.zip. Files get
    downloaded but when I try to unzip it,
    I encounter error messages :
    Missing 1 bytes in Zip file (attempting to process anyway).
    Cannot open file: it does not appear to be a valid archive.
    If you downloaded this file, try downloading the file again.

    let say i have a code as below:
    public void init()
          String rootDirectory = JOptionPane.showInputDialog( this,
             "Please enter a directory name:" );
          FileTreePanel panel = new FileTreePanel( rootDirectory );
          getContentPane().add( panel );
       }and i use this code to call the batch file:
    import java.io.IOException;
    public class callbatch{
         public static void main(String args[]) {
              try {
                   Runtime runtime=Runtime.getRuntime();
                   Process process=runtime.exec("cmd /c start callnvcc.bat");
                   catch(IOException ioe) {
                        System.out.println(ioe);
         }how can i pass the rootDirectory into my callnvcc.bat?

Maybe you are looking for