Calling Java function from java script function

Hello,
I have a jsp in which on button click i am calling a java script function. now there is some data that i want to insert in a table on click of the same button. But in order to do that i need to write java code. but if i write java code inside the script function that is called on button click it doesnt work. what i understand is that i need to make a java function inside the jsp & call that from the script function. can someone tell me how to do that ?
this is the code i have written
function sendMail(iCount2)
     var eMailAddresses = "";
     var studRegId = "";
     for (var i=0; i <iCount2; i++)
          if(document.getElementById("chk" + i).checked)
               eMailAddresses = eMailAddresses+document.frmQueryBuilder.hdnEmail.value+",";
               studRegId = document.frmQueryBuilder.studRegId[i].value;
          <%     if(regTemp != "")
                    MakeConnection mc1 = new MakeConnection();
                    con1 = mc1.DBConnection();
                    String temp = "1";
                    System.out.println("inside the if loop for regTemp");
                    String query1 = "insert into studcompreg (studregid,compid) values(?,?)";
                    stmt1 = con1.prepareStatement(query1);
                    stmt1.setString(1,regTemp);
                    stmt1.setString(2,temp);
                    /*stmt1.setString(3,temp);
                    stmt1.setString(4,"01-jan-2005");*/
                    rsinst = stmt1.executeQuery();
          %>
     win = window.open('BackupMail.jsp?eMailAddresses='+eMailAddresses);

<%@ page import = "Utils.*" %>
<%@ page import = "java.sql.*" %>
<%@ page import = "java.lang.String.*"%>
<%@ page import = "java.text.*" %>
<%@ page import = "java.util.*"%>
<%
     String insertValues[] = new String[10];
     String regTemp = "";
     java.sql.Connection con1 = null;
     java.sql.ResultSet rs1 = null;
     java.sql.PreparedStatement stmt1 = null;
     java.sql.Statement stmtinst = null;
     java.sql.ResultSet rsinst = null;
     java.sql.Connection con = null;
     java.sql.PreparedStatement stmt = null;
     java.sql.ResultSet rs = null;
%>
<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" href="style.css" type="text/css">
<script language = "javascript">
/*Client side validations go here*/
function submitForm()
     document.frmQueryBuilder.submit();
function selectAll(iCount2)
     for (var i=0; i <iCount2; i++)
          document.getElementById("chk" + i).checked = true;
function deselectAll(iCount2)
     for (var i=0; i <iCount2; i++)
          document.getElementById("chk" + i).checked = false;
function sendMail(iCount2)
     var eMailAddresses = "";
     var studRegId = "";
     for (var i=0; i <iCount2; i++)
          if(document.getElementById("chk" + i).checked)
               eMailAddresses = eMailAddresses+document.frmQueryBuilder.hdnEmail.value+",";
               studRegId = document.frmQueryBuilder.studRegId[i].value;
               document.frmQueryBuilder.temp.value ="newOne";
               document.frmQueryBuilder.submit();
     win = window.open('BackupMail.jsp?eMailAddresses='+eMailAddresses);
</script>
</head>
<BODY>
<%
int MaxCount = 15;
int iCount1 = 0;
int iCount2 = 0;
int iCount3 = 0;
String query = "";
String eMailAddresses = "";
StringBuffer sbMail = new StringBuffer();
//String strValue[] = new String [MaxCount];
//try
     String strCriteria [] = new String [10];
     String strCondition [] = new String [10];
     String strValue1 [] = new String [10];
     String strCombo [] = new String [10];
     for (iCount3 = 0; iCount3 < 10; iCount3 ++ )
          strCriteria[iCount3] = "";
          strCondition[iCount3] = "";
          strValue1[iCount3] = "";
          strCombo[iCount3] = "";
     if (request.getParameter ("txtAction") != null)
          //String nothing = request.getParameter("chk"+iCount2);
          //System.out.println("Value of checkbox : " +nothing);
          String strQuery[] = new String [MaxCount];     
          StringBuffer sb = new StringBuffer();
          String AccessQuery = "";
          String strTmpQuery = "";
          String strTmpRefType[] = new String [4];
          int QueryLen = 0;
          int ModifyLen = 0;
          int QueryLenNew = 0;
          String strTmpRefType1 = "";
          String strTmpRefType2 = "";
String strTmpRefType3 = "";
     String strTmpRefType4 = "";
          strQuery[0] = "SELECT STUDREGID, NAME,STUDID,PROGRAM,BRANCH,CPI,EMAIL FROM STUDREGDTLS WHERE";
          sb.append(strQuery[0]);
          for (iCount3 = 1; iCount3 < 11; iCount3 ++)
               iCount1++;
               strCriteria[iCount3 - 1] = request.getParameter("criteria" + iCount1);
               strCondition[iCount3 - 1] = request.getParameter("condition" + iCount1);
               strValue1[iCount3 - 1] = request.getParameter("value" + iCount1);
               strCombo[iCount3 - 1] = request.getParameter("combo" + iCount1);
          System.out.println("Loop"+iCount3);
               if (!request.getParameter("criteria" + iCount1).equals("null"))
                    System.out.println("Started getting parameters");
                    strTmpRefType1 = request.getParameter("criteria" + iCount1);
                    if (request.getParameter("condition" + iCount1).equals("ANYWHERE"))
                              System.out.println("Entered anywhere if of Anywhere");
                              strTmpRefType2 = "LIKE";
                    else if (request.getParameter("condition" + iCount1).equals("STARTSWITH"))
                                   strTmpRefType2 = "LIKE";
                         else
                              System.out.println("Anywhere & Startswith not selected");
                              strTmpRefType2 = request.getParameter("condition" + iCount1);
                    if (request.getParameter("condition" + iCount1).equals("ANYWHERE"))
                              strTmpRefType3 = "\'" + "%" request.getParameter("value" iCount1)+ "%" + "\'";
                    else if (request.getParameter("condition" + iCount1).equals("STARTSWITH"))
                                   strTmpRefType3 = "\'" request.getParameter("value" iCount1)+ "%" +"\'";
                         else if (request.getParameter("condition" + iCount1).equals("="))
                                        strTmpRefType3 = "\'" + request.getParameter("value" + iCount1)+ "\'";
                                        System.out.println(strTmpRefType3);
                              else
                                        strTmpRefType3 = request.getParameter("value" + iCount1);
                    strTmpRefType4 = request.getParameter("combo" + iCount1);
                    System.out.println("Value of strTmpRefType2" +strTmpRefType2);     
               strQuery[iCount3] = " upper(" strTmpRefType1 ") " strTmpRefType2 " upper(" strTmpRefType3 ") " strTmpRefType4 "";
                    System.out.println("Making Qyery"+iCount3);
               sb.append(strQuery[iCount3]);
               if (request.getParameter ("txtAction") != null)
                         MakeConnection mc = new MakeConnection();
                         con = mc.DBConnection();
                         QueryLen = sb.length();                         
                         ModifyLen = strTmpRefType4.length();
                         QueryLenNew = (QueryLen - ModifyLen);
                         sb.delete(QueryLenNew, QueryLen);
                         AccessQuery = sb.toString();
                         System.out.println(AccessQuery);
                         stmt = con.prepareStatement (AccessQuery);
                         rs = stmt.executeQuery();
%>
<table width="563" >
<tr><td><DIV CLASS="windowtitle">Student Search</DIV></td></tr>
<tr><td><DIV CLASS="udGroupBoxHdrDiv">Enter Search Criteria</DIV></td></tr>
<tr><td CLASS="bgcol">
<FORM name=frmQueryBuilder METHOD='POST'>
<INPUT TYPE=hidden Name='txtAction' value='S'>
<table >
<%
     for(iCount1 = 1; iCount1 < 11; iCount1++)
               System.out.println (strCriteria[iCount1-1]);
               if(iCount1 == 9)
%>                         <TR valign=top>
<%
               else
%>                          <TR>
<%
%>
<TD width="47"><LABEL CLASS="assoctext">Criteria </LABEL></td><td width="150">
          <SELECT NAME='<%="criteria" + iCount1%>' size="1">
<OPTION VALUE='null'>- - - - - - - - - - - - - - - - -</OPTION>
     <OPTION VALUE='AGE' <%=strCriteria[iCount1-1].equals("AGE")?"selected":""%>>AGE</OPTION>
     <OPTION VALUE='BRANCH' <%=strCriteria[iCount1-1].equals("BRANCH")?"selected":""%>>BRANCH</OPTION>
     <OPTION VALUE='CPI' <%=strCriteria[iCount1-1].equals("CPI")?"selected":""%>>CPI</OPTION>
     <OPTION VALUE='DEPARTMENT' <%=strCriteria[iCount1-1].equals("DEPARTMENT")?"selected":""%>>DEPARTMENT</OPTION>
<OPTION VALUE='DREAMCOMP' <%=strCriteria[iCount1-1].equals("DREAMCOMP")?"selected":""%>>DREAM COMPANY</OPTION>
<OPTION VALUE='PROGRAM' <%=strCriteria[iCount1-1].equals("PROGRAM")?"selected":""%>>PROGRAM</OPTION>
<OPTION VALUE='SKILLSET' <%=strCriteria[iCount1-1].equals("SKILLSET")?"selected":""%>>SKILL SET</OPTION>
<OPTION VALUE='WORKEX' <%=strCriteria[iCount1-1].equals("WORKEX")?"selected":""%>>WORK EX</OPTION>
</SELECT>
          </TD>
     <TD width="88">
          <SELECT NAME='<%="condition" + iCount1%>'>
               <OPTION VALUE='<=' <%=strCondition[iCount1-1].equals("<=")?"selected":""%>><=</OPTION>
               <OPTION VALUE='>=' <%=strCondition[iCount1-1].equals(">=")?"selected":""%>>>=</OPTION>
               <OPTION VALUE='=' <%=strCondition[iCount1-1].equals("=")?"selected":""%>>EXACT MATCH</OPTION>
               <OPTION VALUE='ANYWHERE' <%=strCondition[iCount1-1].equals("ANYWHERE")?"selected":""%>>ANYWHERE</OPTION>
               <OPTION VALUE='STARTSWITH' <%=strCondition[iCount1-1].equals("STARTSWITH")?"selected":""%>>STARTS WITH</OPTION>
          </SELECT>
</TD><TD width="38"><LABEL CLASS="assoctext">Value </LABEL></TD>
<TD width="186"><INPUT NAME=<%="value" + iCount1%> value='<%=strValue1[iCount1-1]%>' size="20" >
</TD>
<TD width="187"><SELECT NAME='<%="combo" + iCount1%>'>
               <OPTION VALUE='AND' <%=strCombo[iCount1-1].equals("AND")?"selected":""%>>AND</OPTION>
               <OPTION VALUE='OR' <%=strCombo[iCount1-1].equals("OR")?"selected":""%>>OR</OPTION>
          </SELECT>
</TD>
</TR>
<%
%>
</table>
</td></tr>
<tr><td align=center>
<BR>
<INPUT CLASS="butstyle" type="button" id="cmdSave" enableAlways = "0" value="Submit" onclick="return submitForm();" >
</td></tr>
</table>
<table width="698">
<tr><td colspan = 6><DIV CLASS="udGroupBoxHdrDiv">Students Matching the Required Crieria</DIV></td></tr>
<TR>
     <TD CLASS="tblhdr" width="50"></TD><TD CLASS="tblhdr" width="155">Student Name</TD>     <TD CLASS="tblhdr" width="150">Student
Id</TD><TD CLASS="tblhdr" width="150">Program</TD><TD CLASS="tblhdr" width="150">Branch</TD><TD CLASS="tblhdr" width="62">CPI</TD>
     </TR>
<%          int i = 0;
     if (request.getParameter ("txtAction") != null)
               while( rs.next())
%>
<%                         System.out.println("Entered Output Loop"+ rs.getString("Name"));
                         System.out.println("Entered Output Loop.........."+ rs.getString("Email"));     
                         sbMail.append(rs.getString("Email")).append(",");
                         regTemp = rs.getString("STUDREGID");
                         i++;
                         System.out.println("student reg id........."+regTemp);
                         System.out.println("value of i........."+i);
%>                    
               <TR CLASS="bgcol">
                         <TD width="25"><INPUT TYPE="checkbox" NAME='<%="chk" + iCount2%>' id='<%="chk" + iCount2%>' VALUE=""></TD>
                         <TD width="155"><INPUT NAME=txtName size=20 value='<%=rs.getString("NAME")%>'></TD>
                         <TD width="150"><INPUT NAME=txtStudId size=20 value='<%=rs.getString("STUDID")%>'></TD>
                         <TD width="150"><INPUT NAME=txtProgram size=20 value='<%=rs.getString("PROGRAM")%>'></TD>
                         <TD width="150"><INPUT NAME=txtBranch size=20 value='<%=rs.getString("BRANCH")%>'></TD>
                         <TD width="62"><INPUT NAME=txtCpi size=4 value='<%=rs.getString("CPI")%>'></TD>
               </TR>
                         <INPUT type="hidden" NAME=hdnEmail value='<%=rs.getString("Email")%>'>
                         <INPUT type = "hidden" NAME = studRegId value = '<%=rs.getString("studRegId")%>'>
                         <INPUT type ="hidden" NAME =temp value ="">
<%
                         iCount2++;
     eMailAddresses = sbMail.toString();
               if (con != null)
                         con.close();
//catch( Exception e)
          System.out.println ("ERROR " + e);
          if (con != null)
                    con.close();
%>
</table>
<table width="698" align=center>
<tr><td>
<BR>
<INPUT CLASS="butstyle" valign=top type="button" id="cmdSave" enableAlways = "0" value="Select All" onclick="return selectAll(<%=iCount2%>)" >
</td>
<td>
<BR>
<INPUT CLASS="butstyle" valign=top type="button" id="cmdSave" enableAlways = "0" value="Deselect All" onclick="return deselectAll(<%=iCount2%>)" >
</td>
<td>
<BR>
<INPUT CLASS="butstyle" valign=top type="button" id="cmdSave" enableAlways = "0" value="Send Mail" onclick="sendMail(<%=iCount2%>)" >
</td>
</tr>
</table>
</FORM>
</BODY>
</HTML>
<%     System.out.println("value inside hidden var temp"+request.getParameter("temp"));     
     if((request.getParameter("temp") != null) && (request.getParameter("temp").equals("newOne")))
     //if(regTemp != null)
          MakeConnection mc1 = new MakeConnection();
          con1 = mc1.DBConnection();
          String temp = "1";
          System.out.println("inside the if loop for regTemp");
          String query1 = "insert into studcompreg (studregid,compid) values(?,?)";
          stmt1 = con1.prepareStatement(query1);
          stmt1.setString(1,regTemp);
          stmt1.setString(2,temp);
          /*stmt1.setString(3,temp);
          stmt1.setString(4,"01-jan-2005");*/
          rsinst = stmt1.executeQuery();
%>

Similar Messages

  • How to call java script function from JSP ?

    how to call java script function from JSP ?

    i have function created by java script lets say x and i want to call this function from jsp scriplet tag which is at the same page ..thanks

  • Calling Java Script Function from Applet

    How can I call the Java Script method from Applet. This should work both on IE and NN running on both Windows NT and solaris. I know it is possible to call the function in Java script using JSObject. But I don't have JSObject at run time. Please let me know how to call Java Script function from applet without using JSObject.

    For Java <-> JavaScript communication in Netscape / Mozilla see:
    http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/lc.html#1014290
    http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/lc.html#1008480

  • Calling java script from link

    Hi,
    I have a link on the page, when i click on the link i should call java script. Java script is written on page level edit area as HTML text.
    Can you give me the syntax ? how to call that script

    say you had a javascript function defined on or accessible to your current page that looked like this...
    function popupURL(url)
    {w = open(url,"winLov","Scrollbars=1,resizable=1,width=800,height=600");
    if (w.opener == null)
    w.opener = self;
    w.focus();}
    ...you could then call it with a link that looked like this...
    &lt;a href="javascript:popupURL('http://www.google.com');"&gt;Open Google in Another Window&lt;/a&gt;
    ...hope this helps,
    raj

  • Calling java script from a button

    Hi,
    I have a Form and I would like to let the end-user to confirm some action that was initiated by pressing a button. The best way would be to call Java script, but the button is an 'item' button and not a 'region' button - i..e it is placed between items and not above the region, like Save, Cancel etc.
    In case of 'item' buttons I do not have 'Optional URL Redirect' field where to place the javascript call.
    Tamas

    You can try this..
    Instead of using button
    Edit the Item to which you want to associate a button.
    Go to Element tab
    Under Post Element Text enter
    </ br> <a href="#" -onclick=call_me() class="t20Button">Click me</a>Note : you need to change class="t20Button", i'm using theme 20 and in that the look and feel of button is derive from t20Button.
    remove the hyphen before onclick ..
    Regards,
    Shijesh

  • How to call Java script from java code?Can Jscript be executed at server?

    Hi All,
    We are using 'WebTrends' tool to analyze our site usage pattern.
    To use WebTrends, we need to :
    1) call Java Script code from the java code
    2)Java script has to be executed at server.
    Please comment on two points mentioned above. If yes, please let me know how to do them?
    Thanks in advnce,
    Regards,
    Ganga

    You can check out Rhino project.
    [http://www.mozilla.org/rhino/]

  • Column link - call java script & assign current report column value to item

    Hi,
    How to call java script and assing current report column value to item?
    I have a button column in the report to 'delete' the selected row.
    I want to first show dialog box with message 'Are you sure?'. If yes, process to delete
    will be executed, else no action.
    In order to fire JS, I used Column Link ->Target=URL.
    Problem: The alert is showing but I don't know how to pass selected row's primary
    key value to process (to delete selected row).
    I have a item which can be used to store selected primary key value but don't know how to assign the value
    when button pressed.
    Thanks in advance
    Dip

    Ok. The issue has been resolved by following way.
    PAGE PROCESS: delete_request
    begin
    delete xyz
    where id = :P8_id;
    commit;
    end;BUTTON URL:
    javascript: DelRec(null,'CREATE', 'f?p=&APP_ID.:8:&SESSION.:delete_request:NO::P8_id:#id#');Java Script:
    <script language="JavaScript1.1" type="text/javascript">
    function DelRec(msg, req, url){
    var confDel = msg;
    if(confDel ==null){
    confDel= confirm("Are you sure?");
    }else{
    confDel= confirm(msg);}
    if (confDel== true){
    redirect(url);           }
    </script>

  • Calling java script in view

    Hi gurus,
    I am stuck with some issu, here is my issue as fallows
    Scenario:
    I am planning to open outlook client by passing some java script and i want to attach history of the email like same as reply button in MSoutlook
    - To call java script i am using webwidget UI element in WDJ and on action of  button i am calling that java script like as fallows
    String html = ReplyAll_class_j.callActiveXFromHTML(this.wdComponentAPI,"toemail", "fromAdd", "Subject of email",  <html><body>htmlbody</body></html>);
    wdContext.currentContextElement().setHtml(html);
    -  in java class i am passing some java script like as fallows
    public static String callActiveXFromHTML(IWDComponent compAPI,String toMailAddress,String ccEmailAddress,String mailSubject,String htmlBody) {
    Script is here
    the Issue is when i click the button it is not opening the outlook client but it is doing when i am click on the tab to recall the component, I thought it is doing this because i am passing "this.wdComponentAPI" as a parameter, but i dont know other solutions so please help me in this issue
    thanks in advance
    Anu

    Hi,
    I am not sure why is that statement "WE CANNOT CALL JS from WDJ"???? I did that pretty number of time in my developments. Can you please try the below mentioned way...
    Inside your method what ever you write to open the JS window
    String htmlcontent="Your HTML Content";
    try
    byte[] html=new byte [ 4096 ] ;
    html=htmlcontent.getBytes("UTF-8");
    wdContext.currentContextElement().setVaHTML(html);
    IWDWindow win =wdThis.wdGetAPI().getComponent().getWindowManager()
              .createNonModalExternalWindow(WDWebResource.getWebResource(html, WDWebResourceType.HTML).getURL(),"window Name As per your choice");
    win.setWindowSize(600,600);
    win.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
    win.removeWindowFeature(WDWindowFeature.TOOL_BAR);
    win.removeWindowFeature(WDWindowFeature.MENU_BAR);  
    win.show();
    catch(WDURLException url)
    wdComponentAPI.getMessageManager().reportException("WDURLException::"+url.toString(),true);
    Regards,
    SrinivaS

  • How to call a subroutine from sap script

    hi friends,
    Can anybody tell me How to call a subroutine from sap script .
    thanks n regards .
    Mahesh

    hi..
    Calling ABAP Subroutines: PERFORM 
    You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
    PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
    The system does not execute the PERFORM command within SAPscript replace modules, such as TEXT_SYMBOL_REPLACE or TEXT_INCLUDE_REPLACE. The replace modules can only replace symbol values or resolve include texts, but not interpret SAPscript control commands.
    Syntax in a form window:
    /: PERFORM <form> IN PROGRAM <prog>
    /: USING &INVAR1&
    /: USING &INVAR2&
    /: CHANGING &OUTVAR1&
    /: CHANGING &OUTVAR2&
    /: ENDPERFORM
    INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
    OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
    The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
    FORM <form> TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    ENDFORM.
    The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
    The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.
    From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (‘First page’, ‘Next page’, ‘Last page’) is printed as local variable symbol.
    Definition in the SAPscript form:
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    / &BARCODE&
    Coding of the calling ABAP program:
    REPORT QCJPERFO.
    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA: PAGNUM LIKE SY-TABIX, "page number
    NEXTPAGE LIKE SY-TABIX. "number of next page
    READ TABLE IN_PAR WITH KEY ‘PAGE’.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY ‘NEXTPAGE’.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE OUT_PAR WITH KEY ‘BARCODE’.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = ‘|’. "First page
    ELSE.
    OUT_PAR-VALUE = ‘||’. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = ‘L’. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    regards,
    veeresh

  • Getting error in calling Java Script function in HTMLB page

    Hi
      I am having a button in HTMLB page which calls the Java Script function for click event.I have included the Java Script in the script folder of the application.
    I am calling the function present in JS like this,
    <SCRIPT src="portalsdc.js"></SCRIPT>
    function buttonClick() {
    someFunc()
    <hbj:button
    onClientClick="JavaScript:buttonClick();"
    disabled="false"
    design="STANDARD"
    />
    The Error i am getting in calling someFunc()is "Object Expected " ..
    Any suggestion how to make it work.
    Thanks in advance
    Saravanan

    Hi,
    My code in page is
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <hbj:content id="myContext" >
    <hbj:page title="Epcf iView" >
    <SCRIPT src="portalsdc.js"></SCRIPT>
    <script language="JavaScript">
    function buttonClick() {
         someFunc()
    </script>
    <hbj:form>
    <hbj:button
    id="sendEvent"
    text="Send event"
    width="125px"
    tooltip="This button raises an event ..."
    onClientClick="JavaScript:buttonClick();"
    disabled="false"
    design="STANDARD"
    />
    </hbj:form>
    </hbj:page>
    </hbj:content>
    The code in Java script portalsdc.js is :
    function someFunc()
         alert ("HI");
    Even i have set and tried jsObjectNeeded = TRUE for button.
    Thanks and Regards,
    Saravanan

  • Calling java script from  HTMLInputText component of java server faces

    Iam attempting to do some thing like this
    HtmlInputText component = new com.ntrs.wcm.ui.components.inputtext.HtmlInputText();
         component.setId(componentId);
         component.setValueBinding("value",
                   FacesContext.getCurrentInstance().getApplication().createValueBinding(backingBeanEL));
         component.setSize(length);
         component.setMaxlength(length);
    now on the component iam calling the followng jav ascript function
    component .setOnkeydown("DisableCtrlKey(event)");
    The java script
    iam calling is
    function disableCtrlKey(e)
    //list all CTRL + key combinations you want to disable
    var forbiddenKeys = new Array(‘a’, ‘n’, ‘c’, ‘x’, ‘v’, ‘j’);
    var key;
    var isCtrl;
    if(window.event)
    key = window.event.keyCode; //IE
    if(window.event.ctrlKey)
    isCtrl = true;
    else
    isCtrl = false;
    else
    key = e.which; //firefox
    if(e.ctrlKey)
    isCtrl = true;
    else
    isCtrl = false;
    //if ctrl is pressed check if other key is in forbidenKeys array
    if(isCtrl)
    for(i=0; i<forbiddenkeys .length; i++)
    //case-insensitive comparation
    if(forbiddenKeys.toLowerCase() == String.fromCharCode(key).toLowerCase())
    alert(‘Key combination CTRL + ‘
    +String.fromCharCode(key)
    +‘ has been disabled.’);
    return false;
    return true;
    I have this function in the correct js page of my application but the script doesnt get executed and still iam able to do ctrl+v on the text box can anyone suggest waht i might be doing wron

    You can try this..
    Instead of using button
    Edit the Item to which you want to associate a button.
    Go to Element tab
    Under Post Element Text enter
    </ br> <a href="#" -onclick=call_me() class="t20Button">Click me</a>Note : you need to change class="t20Button", i'm using theme 20 and in that the look and feel of button is derive from t20Button.
    remove the hyphen before onclick ..
    Regards,
    Shijesh

  • Calling Java Script to open a Map (Like Google Map) from Oracle Forms 10g

    Hello,
    We are on Oracle EBS rel 12, Forms 10g. We have a requirement of calling a Custom Map application (Like Google Maps) from Oracle Forms 10g.
    When the user enters the address like town, city, country etc and clicks on a button there should be a call to this Google Map like application which will pass the co-ordinates (Latittude, Longitude) to the map and shows the place on it. If the user selects a different location on this maps and closes the window the parameters co-ordinates (Latittude, Longitude) should be back in the calling form and this new location should replace the original location.
    I appreciate if I can get some help for the above requirements.
    Thank you.
    GM

    Thank you for your reply. I was reading on the metalink that we could use the to call the java script from oracle Forms 10g (Doc ID 265863.1)
    Example:
    WEB.SHOW_DOCUMENT ('javascript:void(window.open("http://www.oracle.com","","location=no,toolbar=no,menubar=no,status=no,"));self.close()','_blank');
    I tried it but it did not open the any window as it claims. Am I missing anything? Is there any IE related setting which I need to modify for the above to work?
    Regards
    GM

  • Problem in calling Java Script and Process at the same time

    Hi Frenz,
    I have a requirement like this. when i press the button a page level process(Not Application level Process) and java script function has to happen. i wrote the Java script function to close the child window and reload the Parent window. I wrote the Process for the Parent window to get the updated screen.
    But the Process is not happening and the only the java script function is achieved.
    Can you suggest any idea to achieve both of the things at the same time?
    Thanks in Advance.....

    See this example:
    http://apex.oracle.com/pls/otn/f?p=31517:93
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Calling stored procedure from php script.

    I have the following stored procedure in Oracle 8:
    CREATE OR REPLACE procedure kunde_create
    (iname1 in varchar2,
    iname2 in varchar2,
    iname3 in varchar2,
    ianrede in number,
    istrasse in varchar2,
    iland varchar2,
    iplz in varchar2,
    iort in varchar2,
    iortsteil in varchar2,
    itelefon in varchar2,
    iemail in varchar2,
    itelefax in varchar2,
    imobil in varchar2,
    ianrufer in varchar2,
    izusinfo in varchar2,
    izusatz2 in varchar2,
    okdnr out varchar2)
    is
    vkndnr number;
    vadrnr number;
    vkdnr varchar2(15);
    ikugru constant number:=4;
    minkdnr constant varchar2(15):='44000000';
    maxkdnr constant varchar2(15):='50000000';
    begin
    ..... SOME CODE ....
    okdnr:='something_to_output';
    commit;
    end kunde_create;
    I am trying to call this SP from a php script, in this way:
    $connection = ora_logon("username@db", "password");
    $cursor = ora_open($connection);
    ora_commitoff($connection);
    $cu=ora_parse($cursor, "begin KW.kunde_create ( :Sta_nameD, :Sta_name2D, :Sta_kugruD, :ianredeD, :Sta_straD, :Sta_landD, :Sta_plzD, :Sta_ortD, :Sta_ortsteilD, :Sta_telD, :Sta_mailD, :Sta_faxD, :Sta_tel2D, :Sta_anruD, :Sta_zusD, :Sta_zus2D ,:okdnr); end;");
    ora_bind($cursor, ":Sta_nameD", $Sta_nameD, 32, 1);
    ora_bind($cursor, ":Sta_name2D", $Sta_name2D, 32, 1);
    ora_bind($cursor, ":ianredeD", $ianredeD, 32, 1);
    ora_bind($cursor, ":Sta_straD", $Sta_straD, 32, 1);
    ora_bind($cursor, ":Sta_landD", $Sta_landD, 32, 1);
    ora_bind($cursor, ":Sta_plzD", $Sta_plzD, 32, 1);
    ora_bind($cursor, ":Sta_ortD", $Sta_ortD, 32, 1);
    ora_bind($cursor, ":Sta_ortsteilD", $Sta_ortsteilD, 32, 1);
    ora_bind($cursor, ":Sta_telD", $Sta_telD, 32, 1);
    ora_bind($cursor, ":Sta_mailD", $Sta_mailD, 32, 1);
    ora_bind($cursor, ":Sta_faxD", $Sta_faxD, 32, 1);
    ora_bind($cursor, ":Sta_tel2D", $Sta_tel2D, 32, 1);
    ora_bind($cursor, ":Sta_anruD", $Sta_anruD, 32, 1);
    ora_bind($cursor, ":Sta_zusD", $Sta_zusD, 32, 1);
    ora_bind($cursor, ":Sta_zus2D", $Sta_zus2D, 32, 1);
    ora_bind($cursor, ":okdnr", $okdnr, 32, 2);
    ora_exec($cursor); //Line 93
    This code brings me back this error:
    Warning: Can't find variable for parameter in /www/vaillant/htdocs/www_tisweb/html/php/testdb/connect.php on line 93
    I tried nearlly everything, but it doesnt work :(
    Can anybody help me please.
    Thanx in advance,
    Ahmed Adaileh

    I had to make a few modifications to get your example to work. The
    biggest change was to the ora_bind syntax. I also found I had to
    define a variable to hold the OUT value before doing the ora_exec.
    Otherwise I got the error you saw. I'm not sure why defining it first
    is necessary. I didn't dig deeply into PHP's oracle.c code.
    My final script is below. It displays "okdnr is something_to_output".
    I tested using PHP 4.3.3 against Oracle 9.2.
    The best general suggestion I can make is to use PHP's oci8 driver
    unless you need to be compatible with existing PHP code. There is an
    example of using OUT binds in oci8 to call a stored procedure at
    PHP and serveroutput
    -- CJ
    <?php
    // Changed connection details to suit my environment
    $connection = ora_logon("scott@MYDB", "tiger");
    $cursor = ora_open($connection);
    ora_commitoff($connection);
    // Changed schema to SCOTT to match who I'd created the procedure as
    $cu=ora_parse($cursor, "begin SCOTT.kunde_create ( :Sta_nameD, :Sta_name2D, :Sta_kugruD, :ianredeD, :Sta_straD, :Sta_landD, :Sta_plzD, :Sta_ortD, :Sta_ortsteilD, :Sta_telD, :Sta_mailD, :Sta_faxD, :Sta_tel2D, :Sta_anruD, :Sta_zusD, :Sta_zus2D ,:okdnr); end;");
    // Allocated the IN parameter variables
    $Sta_nameD      = 'a';
    $Sta_name2D     = 'a';
    $ianredeD       = 1;
    $Sta_straD      = 'a';
    $Sta_landD      = 'a';
    $Sta_plzD       = 'a';
    $Sta_ortD       = 'a';
    $Sta_ortsteilD  = 'a';
    $Sta_telD       = 'a';
    $Sta_mailD      = 'a';
    $Sta_faxD       = 'a';
    $Sta_tel2D      = 'a';
    $Sta_anruD      = 'a';
    $Sta_zusD       = 'a';
    $Sta_zus2D      = 'a';
    $Sta_kugruD     = 'a';
    // Changed ora_bind syntax to match
    // http://www.php.net/manual/en/function.ora-bind.php
    ora_bind($cursor, "Sta_nameD", ":Sta_nameD", 32, 1);
    ora_bind($cursor, "Sta_name2D", ":Sta_name2D", 32, 1);
    // Change ianredeD type to 2 to match procedure definition
    ora_bind($cursor, "ianredeD", ":ianredeD", 32, 2);
    ora_bind($cursor, "Sta_straD", ":Sta_straD", 32, 1);
    ora_bind($cursor, "Sta_landD", ":Sta_landD", 32, 1);
    ora_bind($cursor, "Sta_plzD", ":Sta_plzD", 32, 1);
    ora_bind($cursor, "Sta_ortD", ":Sta_ortD", 32, 1);
    ora_bind($cursor, "Sta_ortsteilD", ":Sta_ortsteilD", 32, 1);
    ora_bind($cursor, "Sta_telD", ":Sta_telD", 32, 1);
    ora_bind($cursor, "Sta_mailD", ":Sta_mailD", 32, 1);
    ora_bind($cursor, "Sta_faxD", ":Sta_faxD", 32, 1);
    ora_bind($cursor, "Sta_tel2D", ":Sta_tel2D", 32, 1);
    ora_bind($cursor, "Sta_anruD", ":Sta_anruD", 32, 1);
    ora_bind($cursor, "Sta_zusD", ":Sta_zusD", 32, 1);
    ora_bind($cursor, "Sta_zus2D", ":Sta_zus2D", 32, 1);
    // Changed okdnr type to 1 to match procedure definition
    ora_bind($cursor, "okdnr", ":okdnr", 32, 1);
    // Bound missing parameter
    ora_bind($cursor, "Sta_kugruD", ":Sta_kugruD", 32, 1);
    // Preallocated the output variable - I'm not sure why this is
    // necessary nor what size is needed.
    // When this line is commented out I get:
    //   Warning: Can't find variable for parameter in test01.php on line XX
    $okdnr = "a";
    ora_exec($cursor);
    print "okdnr is $okdnr";
    ?>

  • Calling a pkg from managed code and then using reflection to call a method from a script task

    Hi we run 2012 std.  I have some pretty good evidence that when I call my pkg from a .net service, a script component in that pkg fails when trying 2 use reflection to load and invoke our .net message history method.  The exception is either on
    the invoke or in the message history method.  I suspect its in the method but will take additional steps 2 verify.
    But when I run the pkg stand alone, it has no problem and the method does what it is supposed 2 do.
    There r no vars passed from the service to the pkg.  I wonder if its a managed to unmanaged to managed issue that the community is already aware of.  If not, my apologies 4 posting this quickly.
    I'll post more info here as I collect it. 

    we have 2 theories after showing the exception trace to folks who r more adept at managed code.
    the first is related to the fact that our 3rd party dlls (I think entity framework is included in these) r older versions.  I don't want to discount this theory but we have some evidence already that this might not be true.
    I hope I can do justice to the 2nd theory but will make it clearer and clearer as I get a better understanding.  I believe this is what Arthur was saying and I applaud his instincts.  They explained that .net is so "smart" that it detected
    a change in namespace  (ie context as Arthur said) and purposely threw an exception 2 save us from ourselves.  The workarounds discussed were a bit over my head but I will continue trying to better understand it.  The fact that many of the methods
    we call after reflection r now merged into one assembly seemed relevant to the discussion and possible workarounds.   
    this link came up in their discussion and I believe the bottom line here is that by qualifying assembly names further (in config?)r, a workaround is possible. 
    http://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname(v=vs.110).aspx  .
    This link came up as well and has something to do with ILMerge and workarounds to ILMerge. 
    http://elegantcode.com/2011/04/02/dynamically-load-embedded-assemblies-because-ilmerge-appeared-to-be-out/  .
    Finally, this link came up and seems to have something to do with embedding your dlls in one assembly without them losing their identity.
    http://blogs.msdn.com/b/microsoft_press/archive/2010/02/03/jeffrey-richter-excerpt-2-from-clr-via-c-third-edition.aspx
    I'll post more here as we muddle thru this.

  • How to call a procedure from  Shell Script

    Friends,
    How can i call a procedure from a shell script ? If any one know the answer , let me know immediately .
    Thanks in advance .
    Chakks

    We connect using SQLPlus commands on the Unix server:-
    Our code block is below:- We've got DBMS_OUTPUT in the procedure, hence the spooling. You don't need all this, but you do need the sqlplus directory, etc... in your profile.
    sqlplus -s <<EOF > ${CREATE_LOG_FLE}
    $UserName/$Password@$SID
    SET SERVEROUTPUT ON SIZE 1000000;
    spool ${CREATE_LOG_FLE}
    EXECUTE $STORED_PROC(${Months}, ${DeleteRecords});
    EOF
    Hope that helps

Maybe you are looking for

  • How can I put a contact in two or more Address Books without making a 'new contact' for each?

    I would like to put several of my contacts in more than one Address Book; but, if I move them (drag'n'drop) from one they no longer remain in the original Book...which I want. I'd like to segregate different interest groups and file them in separate

  • Convert Photoshop Elements 7 for Windows to a Mac version?

    I have Photoshop Elements 7 for Windows and just got a Mac.  I was wondering if Adobe would convert Elements to a Mac version for a fee.  Anyone had experience with that?  Thanks. tialldplucy

  • Missing functions in Slideshow Editor?

    I am (clearly) a novice Aperture user, and am struggling with the Slideshow Editor Default Settings set up. I would like to add text to various slides in a slideshow. BUT... I have looked through all the booklet and online help with regards to adding

  • Creating Rough Cuts from an Extension in Prelude CC 2014

    I am building an extension panel using extension builder 3 for Prelude CC 2014 and want to have a button to create rough cuts from a selection of markers. After looking at the CSXS API I can see that the events which I would need to use, such as com.

  • GWIA and Route.cfg

    My customer is currently moving away from GroupWise to the Google Cloud email solution, that said they have a question regarding how the GWIA can be used to forward mail messages to team members from sources such as routers, switches, etc,. Situation