[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.8

Dynamic Froms posting data 2-part

Asked by ZeeshanSyedJC in Java Server Pages (JSP)

Tags: froms, java, javescript

Hey guys.  I have the following questions regarding the following script below.  Within the script (towards the bottom) you will see the precise sections I am concerned with commented.  Please see the section respective to each questions below:
1.)  I have a javescript dynamic calendar pop-up window which opens when the users clicks the image.  As you can see the NAME property for the INPUT form item is assigned according to the iterations of the recordset.  The pop-up window is programmed to replace the value of the INPUT field for the table row that was selected.  Currenty, the pop-up window has a javascript fuction which sets the VALUE of the INPUT Item that has the name "First"  how can I make this dynamic so that it replaces the values of only the selected cell??  
2.)  I need to have an Oracle stored procedure that needs to run when the user clicks the submit button.  The stored procedure will need to take as parameteres all of the original values of the record from the recordset, as well as the values that have been changed.  How do I set up the parameter list for the Stored Procedure call to handle this?


<%@page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*"%>

<%  Driver DriverRateQuery = (Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    Connection ConnRateQuery = DriverManager.getConnection("jjdbc:oracle:thin:@127.0.0.1:1521:myDataBase","scott","tiger");
    PreparedStatement StatementRateRec = ConnRateQuery.prepareStatement("SELECT ACTIVE_IND,
                                                                              TO_CHAR(FIRST_DATE,'MM/DD/YYYY') FIRST_DATE,
                                                                              INTL_RATE INTL_RATE,
                                                                              TO_CHAR(LAST_DATE,'DD/MM/YYYY') LAST_DATE,
                                                                              LAST_UPD_DATE,
                                                                              MARKET,
                                                                              RATE_TYPE,
                                                                              TERMINAL_ID,
                                                                              MARKET_NAME,
                                                                              ACTIVE_IND  
                                                                         FROM myRateTable,
                                                                              myMarkets  
                                                                        WHERE myRateTable.MARKET = myMarkets.MARKET );
    ResultSet RateRec = StatementRateRec.executeQuery();
    boolean RateRec_isEmpty = !RateRec.next();
    boolean RateRec_hasData = !RateRec_isEmpty;
    Object RateRec_data;
    int RateRec_numRows = 0;

    PreparedStatement StatementRateType = ConnRateQuery.prepareStatement("SELECT DISTINCT
                                                                                rate_type,
                                                                                DECODE(rate_type,'CPS','Caps','BP','BluePrints') rate_label
                                                                           FROM myRateTable");
    ResultSet RateType = StatementRateType.executeQuery();
    boolean RateType_isEmpty = !RateType.next();
    boolean RateType_hasData = !RateType_isEmpty;
    Object RateType_data;
    int RateType_numRows = 0;
%>
<HTML>
<FORM name="Record" action="">
<TABLE>
  <% if (!RateRec_isEmpty ) { %>
 
  <% while ((rateRecord_hasData)&&(Repeat1__numRows-- != 0)) { %>  
  <tr valign="middle">
        <td height="27">
            <input name="terminalID"
                   type="text"
                   id="terminalID"
                   value="<%=((((RateRec_data = RateRec.getObject("TERMINAL_ID"))==null || RateRec.wasNull())?"":RateRec_data))%>"
                   size="10"
                   readonly>
        </td>
        <td height="27">
            <input value="<%=((((RateRec_data = RateRec.getObject("INTL_RATE"))==null || RateRec.wasNull())?"":RateRec_data))%>" type="text" name="BillingRate">

        </td>
        <td height="27">
            <select name="RateType" size="1">
                <% while (RateType_hasData) { %>
                <option value="<%=((RateType.getObject("RATE_TYPE")!=null)?RateType.getObject("RATE_TYPE"):"")%>"
                       <%=(((RateType.getObject("RATE_TYPE")).toString().equals(((((RateRec_data = RateRec.getObject("RATE_TYPE"))==null
                          || RateRec.wasNull())?"":RateRec_data)).toString()))?"SELECTED":"")
                        %>
                          >
                        <%=((RateType.getObject("RATE_LABEL")!=null)?RateType.getObject("RATE_LABEL"):"")%>
                </option>
                <% RateType_hasData = RateType.next(); }
                    RateType.close();
                    RateType = StatementRateType.executeQuery();
                    RateType_hasData = RateType.next();
                    RateType_isEmpty = !RateType_hasData;
                 %>
            </select>
         </td>
         
        <td height="27">
           <%
            <input id=First
                   readOnly
                   maxlength=10
                   size=10
                   value=<%=((((RateRec_data = RateRec.getObject("FIRST_DATE"))==null || RateRec.wasNull())?"":RateRec_data))%>
                   name=First
             >
            <img id=IMG1 src="images/calendar.gif"
                  onClick="javascript:popUp('http://localhost/StartCalender.htm')"
                  width=24
                  border="0"
                  align="absmiddle"
             >
        </td>
       
        //------------------------QUESTION PART 1 ----------------------------------//
        <td height="27">
            <input id=First
                   readOnly
                   maxlength=10
                   size=10
                   value=<%=((((RateRec_data = RateRec.getObject("LAST_DATE"))==null || RateRec.wasNull())?"":RateRec_data))%>
                   name=<%String("First") + (String)Repeat1__index%>
             >
            <img id=IMG1 src="images/AllPages/calendar.gif"
                  onClick="javascript:popUp('http://localhost/EndCalender.htm')"
                  width=24
                  border="0"
                  align="absmiddle"
             >
        //------------------------QUESTION PART 2 ----------------------------------//
        </td>
        <td width="158" height="27" bordercolor="#FFFFFF">
          <input name="updRate"
                 type="button"
                 id="updRate"
                 value="Update Rate">
        </td>

   </tr>
   <% Repeat1__index++; rateRecord_hasData = rateRecord.next(); } %>  

</TABLE>
</FORM>

</HTML>
<% rateRec.close(); rateType.close(); ConnRateQueryord.close(); %>
[+][-]09/09/02 04:41 PM, ID: 7273529Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Java Server Pages (JSP)
Tags: froms, java, javescript
Sign Up Now!
Solution Provided By: fritz_the_blank
Participating Experts: 3
Solution Grade: C
 
[+][-]09/08/02 04:21 PM, ID: 7271372Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/08/02 10:00 PM, ID: 7271673Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/09/02 02:04 PM, ID: 7273124Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/09/02 02:41 PM, ID: 7273217Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/02 05:59 PM, ID: 7275626Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/25/02 08:42 AM, ID: 7302344Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92