Accessing values of components in a form in a JSP function

Hi,
I have a peculiar problem. I want to access the value of a textbox in my JSP method. Please let me know how to do that.
The code is
<%!     
     public boolean checkFile(String filepath)
     System.out.println("************ " + filepath);
     File f = new File(filepath);
     return (f.exists());
%>
the variable filepath should be the value taken from a text field.
When the user enters a file name i need to check if the file exists or not. Is there a better way to do this. Please suggets me a way to solve this.. Very urgent.
Thanks
pops

Well JSP is server side code and TextBoxes are html which is client side script. To get the value of an html Textbox you either can use Javascript and do it all client side or you can post your form to a JSP or servlet and use request.getParameter("field_name"); to get the value of the form field.
make sense?
-S-

Similar Messages

  • Access to graphical components in AddOn Forms with Indirect Access Licence

    Hi,
    we have been developing an add on whose forms contain SAP Business One graphical components such as Calendar, Choose from list, calculator..
    Our users who have indirect access licence havent' access to the graphical components Calendar and Calculator whereas they have access to choose from list.
    SAP communicated in the fact that Indirect Access Licence doesn't allow user to have access to SAP Business One forms but nothing is mentioned about the graphical components used in Add On forms.
    Moreover the difference of behaviour between Calendar and choose from list is not logic.
    Do you know if SAP intends to fix this problem and allow users with Indirect Access Licence to have access to graphical components in Add On forms ?
    Thank you in advance for your returns

    Thank you for your reply.
    I'm afraid I do not undersand.
    Do we have to develop again the graphical components Calendar and Calculator whereas they are available in the SDK ?
    If yes, how do you do to develop these components ?
    Thank you in advance.

  • Unable to access values from database in login page..

    Hey all,
    Friends I have a login.jsp page and I want if i enter username and password then it will be accessed from database and after verifying the details it will open main.jsp.I made a database as "abc" and created DSN as 1st_login having table 1st_login. But the problem is that I am unable to access values from database.
    So Please help me.
    Following is my code:
    <HTML>
    <body background="a.jpg">
    <marquee>
                        <CENTER><font size="5" face="times" color="#993300"><b>Welcome to the"<U><I>XYZ</I></U>" of ABC</font></b></CENTER></marquee>
              <br>
              <br>
              <br>
              <br><br>
              <br>
         <form name="login_form">
              <CENTER><font size="4" face="times new roman">
    Username          
              <input name="username" type="text" class="inputbox" alt="username" size="20"  />
              <br>
         <br>
              Password          
              <input type="password" name="pwd" class="inputbox" size="20" alt="password" />
              <br/>
              <input type="hidden" name="option" value="login" />
              <br>
              <input type="SUBMIT" name="SUBMIT" class="button" value="Submit" onClick="return check();"> </CENTER>
              </td>
         </tr>
         <tr>
              <td>
              </form>
              </table>
    <%
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection connection = DriverManager.getConnection("jdbc:odbc:1st_login");
    Statement statement = connection.createStatement();
    String query = "SELECT username, password FROM 1st_login WHERE username='";
    query += request.getParameter("username") + "' AND password='";
    query += request.getParameter("password") + "';";
    ResultSet resSum = statement.executeQuery(query);
    //change: you gotta move the pointer to the first row of the result set.
    resSum.next();
    if (request.getParameter("username").equalsIgnoreCase(resSum.getString("username")) && request.getParameter("password").equalsIgnoreCase(resSum.getString("password")))
    %>
    //now it must connected to next page..
    <%
    else
    %>
    <h2>You better check your username and password!</h2>
    <%
    }catch (SQLException ex ){
    System.err.println( ex);
    }catch (Exception er){
    er.printStackTrace();
    %>
    <input type="hidden" name="op2" value="login" />
         <input type="hidden" name="lang" value="english" />
         <input type="hidden" name="return" value="/" />
         <input type="hidden" name="message" value="0" />
         <br>
              <br><br>
              <br><br>
              <br><br><br><br><br>
              <font size="2" face="arial" color="#993300">
         <p align="center"> <B>ABC &copy; PQR</B>
    </BODY>
    </HTML>
    and in this code i am getting following error
    C:\Project\SRS\build\generated\src\org\apache\jsp\loginjsp.java:93: cannot find symbol_
    C:\Project\SRS\build\generated\src\org\apache\jsp\loginjsp.java:93: cannot find symbol_
    C:\Project\SRS\build\generated\src\org\apache\jsp\loginjsp.java:94: cannot find symbol_
    C:\Project\SRS\build\generated\src\org\apache\jsp\loginjsp.java:95: cannot find symbol_
    4 errors
    C:\Project\SRS\nbproject\build-impl.xml:360: The following error occurred while executing this line:
    C:\Project\SRS\nbproject\build-impl.xml:142: Compile failed; see the compiler error output for details.
    BUILD FAILED (total time: 6 seconds)

    As long as you're unable to compile Java code, please use the 'New to Java' forum. This is really trival.
    To ease writing, debugging and maintenance, I highly recommend you to write Java code in Java classes rather than JSP files. Start learning Servlets.

  • How can i pass the value one from to another form?

    hi all
    how can i pass the value one from to another form  with out use it when ever i want to needed this value that ican useit?
    like i have two fields U_test1 and U_test2  table name @AUSR
    that i have  four form  A! , A2,A3,A4    please tell me in details....?

    Hi,
    U can assign the values to some variables and access then in ur required forms.
    Vasu Natari.

  • Held on accessing values in a JSP

    Hi,
    I have JSP with some input fields embedded in it. Consider the input fields as follows. Call the JSP as index.jsp
    <input type = "text" name = "userid">
    <input type = "text" name = "email">
    I also have a submit button which passes control to another JSP. On the click of submit. I need to get the values entered by the user. and store them in a Hashtable and pass this Hashtable to the other JSP.
    Something like this
    <% Hashtable ht = new Hashtable();
    ht.put("userid", (value from the i/p field));
    ht.put("email", (value from the i/p field));
    session.setAttribute("MyHashTable", ht);
    %>
    How do I access the values entered by the user in the current JSP. Could please provide me with a solution.
    With Regards
    Murali

    Hi,
    Well the need for storing the information in a hashtable is that the second JSP needs as i/p the hastable containing the name-value pairs. Why I can't use request.getParameter is simply because the number of parameters from the previous page differs. What I mean is that I want my second JSP to be independent and linked to the any other JSP. The calling JSP has to pass these names and values as a hashtable okay. So with this in mind i need to acces the the values in the previous JSPs and store them in a hashtable. and pass this hashtable to the other JSP. This is what I am trying to acheive. The code that I have written is as follows but is not working.
    My index JSP is as follows
    <%@ page import = "java.util.Hashtable" %>
    <%
         Hashtable ht = new Hashtable();
         String urlback = "index.jsp";
         String urlhome = "index.jsp";
         String flag;
         if(request.getParameter("flag") == null)
              flag = "";
         else
              flag = request.getParameter("flag");
         if(flag.equals("1"))
              String value = (String) request.getParameter("name");
              ht.put("objectid", value);
              value = (String) request.getParameter("Email");
              ht.put("objectkey", value);
              value = (String) request.getParameter("date");
              session.setAttribute("MyHashTable", ht);
         session.setAttribute("urlback", urlback);
              session.setAttribute("urlhome", urlhome);
    %>          
    <html>
    <head>
         <script type = "text/javascript" language="javascript">
              function myfunction()
                   document.window.userDetails.submit="index.jsp?flag=1"
         </script>     
    <title>Test One JSP</title>
    </head>
    <body>
    <center><h1>Details Page Page IndexOne</h1></center>
    <hr>
    Enter the Details:
    <form method = "post" name = "userDetails" action = "test.jsp">
         <table>
              <tr><td>ObjectID</td>
              <td><input type = "text" name = "name" size = "7"></td>
              </tr>
              <tr><td>ObjectKey</td>
              <td><input type = "text" name = "Email" size = 16"></td>
              </tr>
              <tr><td>Date</td>
              <td><input type = "date" name = "date" size = "10"></td>
              </tr>
         </table>
         <input type = "submit" value = "SIGN" onclick = "myfunction()">
    </form>
    </body>
    </html>                          
    My test.jsp as follows
    <%@ page import="java.util.*" %>
    <%
    Hashtable ht = (Hashtable) session.getAttribute("MyHashTable");     
    String urlback = (String) session.getAttribute("urlback");
    String urlhome = (String) session.getAttribute("urlhome");
    Enumeration enum = ht.keys();
    String concat = "";
    while(enum.hasMoreElements())
    concat += enum.nextElement().toString() + ";" + ht.get(enum.nextElement().toString());
    %>
    <html>
    <head>Sample Test JSP
    <title>
    </title>
    </head>
    <body>
    <a href = "<%=urlback%>" ><img src = "PreviousArrow.gif"></a>
    <a href = "<%=urlhome%>" ><img src = "home_nav.gif"></a>
    </body>
    <form name="sample">
    <jsp:plugin type="applet" code="TestApplet" codebase="http://localhost:8080/test/jsp/" width="200" height="200" name = "TestApplet" >
    <jsp:params>
    <jsp:param name = "concat" value = "<%= concat %>" />
    </jsp:params>
    <jsp:fallback>
    Plugin tag OBJECT or EMBED not supported by browser.
    </jsp:fallback>
    </jsp:plugin>
    </form>
    </html>
    Could anybody say me why this JS is not called and the hashtable is not populated with the data.
    With Regards
    Murali
         

  • Need to access value on another component to cross-validate...

    Hi,
    I need to do a cross-validation on a field against value filled on the same form. The model is only updated after validation has completed successfully according to the Faces lifecycle, thus reading the managed bean would prove fruitless.
    Does anyone know how to access a value in another field on the same form so that I can cross-validate against?
    Regards...
    AT

    try this,
    request.getParameter("<BackingBeanName:fieldName>").
    This should give you the value.
    HTH !

  • Uploading Page Blob to Azure - Storage Exception: Make sure the value of Authorization header is formed correctly

    I am using Microsoft Azure Java SDK for Uploading Page Blobs (Size: 20G/40G). IN mid of Uploading, SDK throws Storage Exception:
    java.io.IOException: null
    at com.microsoft.azure.storage.core.Utility.initIOException(Utility.java:584) ~[classes/:na]
    at com.microsoft.azure.storage.blob.BlobOutputStream$2.call(BlobOutputStream.java:414) ~[classes/:na]
    at com.microsoft.azure.storage.blob.BlobOutputStream$2.call(BlobOutputStream.java:398) ~[classes/:na]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) ~[na:1.7.0_25]
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) ~[na:1.7.0_25]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.7.0_25]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) ~[na:1.7.0_25]
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) ~[na:1.7.0_25]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.7.0_25]
    at java.lang.Thread.run(Thread.java:724) ~[na:1.7.0_25]
    Caused by: com.microsoft.azure.storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
    at com.microsoft.azure.storage.StorageException.translateException(StorageException.java:162) ~[azure-storage-1.2.0.jar:na]
    at com.microsoft.azure.storage.core.StorageRequest.materializeException(StorageRequest.java:306) ~[azure-storage-1.2.0.jar:na]
    at com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:178) ~[classes/:na]
    at com.microsoft.azure.storage.blob.CloudPageBlob.putPagesInternal(CloudPageBlob.java:642) ~[classes/:na]
    at com.microsoft.azure.storage.blob.CloudPageBlob.uploadPages(CloudPageBlob.java:971) ~[classes/:na]
    at com.microsoft.azure.storage.blob.BlobOutputStream$2.call(BlobOutputStream.java:402) ~[classes/:na]
    ... 9 common frames omitted
    SDK Version:
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-storage</artifactId>
    <version>1.2.0</version>
    Please note this error shows up in the mid of Upload randomly: For example: Transferred bytes: 27325890560 out of total 42949673472 successfully and then fails with Exception pasted above.
    Is there a chance of time drift on a Linux Box causing this issue ? Any other pointers would help.
    Thanks.

    Hi Kriti,
    We believe its a timing issue. Would you be able to refer the following link and check if it helps?
    http://blogs.msdn.com/b/kwill/archive/2013/08/28/http-403-server-failed-to-authenticate-the-request-when-using-shared-access-signatures.aspx
    If not, would you be able to share the fiddler trace for this?
    Regards,
    Malar.

  • Get previous items unique value in new add item form

    Hi
    I have on list having items related to multiple locations.
    Every location is related to one user.
    When user logs in it filters the list with that users location.
    Now when user click on add new item I want to get the data related to his location using item event listener.
    But in new item form there is no way to get the location of that user in event listener as its new item.
    So I passed the qury string parameter form list and changed the add item form link and form to get the query string paramter as default value in Add new Item form.
    But again when user clicks on save button it redirects to original url without paramter. 
    How to redirect user to url with parameter on click on Save/Cancel.
    Is there any other way to get the previous item unique value in add new item from before executing the event listener?

    Hi,
    According to your post, my understanding is that you wanted to redirect user to url with parameter on click on Save/Cancel.
    You need to modify the onclick event need to as below:
    javascript: {{ddwrt:GenFireServerEvent('__redirect={{Home.aspx?Participant={@Participant}&amp;@Activity={@Activity}}}')}}
    Here is a similar thread for your reference:
    http://social.technet.microsoft.com/Forums/en-US/b506cfe5-650e-4017-b470-9ca0a75cd390/sharepoint-2010-list-how-to-pass-parameters-in-a-url-to-another-page?forum=sharepointcustomizationprevious
    In addition, you can creating an intermediate page which just finds the filed value with a DVWP and then redirect to RedirectURL with the filed value on the Query String.
    For more information, you can refer to:
    Redirect to Another Page from NewForm.aspx with the New Item’s ID
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Access a variable in the Adobe form for Java Scripting

    Hi,
    I am unable to know how to access the variable in a Adobe form.
    The variable is field of an internal table. My adobe form structure is as follows
    MAIN_PAGE->FORMSET->FirstFORM->EXT.
    in the EXT subform the variable(cust)  exists.
    The cust is in turn an internal table.

    Hello Sreelatha,
    I think we cannot hide a page.  as in, page is the main container.  In a container, we can hide any field using some scripting.  Even though if we hide the field, it is present on page but not visible. 
    but if some logic is there, please let me know.
    Thanks,
    Rakesh.
    Edited by: rakhi966 on Sep 8, 2011 8:54 PM

  • Rate and accessable value is not displaying for the tax invoice output

    Hello All,
      Rate and accessable value is not displaying for the tax invoice output. Rest of all outputs for invoices shows Rate and accessable value.
    Scenerio is free of charge sales order (samples) removing the goods from pant so excise invoice has been created and also updated. but for tax invoice out put rate and access value is not displaying.
        Pricing procedure: In pricing procedure account keys have not been maintained because there is not gl account upadation during billing for free of charge delivery.
    Thanks & Regards,
    ramesh

    hi Gurpreet,
    You can add values to that transient column programatically,either by getiing the row from the iterator and then row.setAttribute('Column_name','Value');
    Or providing value to it in the SQL...

  • I Need Help to Access The Source Code From A Form to Know the Calculation Formula

    Hi,
    I Need Help to Access The Source Code From A Form to Know the Calculation Formula. The application is a windows form application that is linked to SQL Server 2008. In one of the application forms it generates an invoice and does some calculations. I just
    need to know where behind that form is the code that's doing the calculations to generate the invoice, I just need to get into the formula that's doing these calculations.
    Thank you so much.

    Hi, 
    Thanks for the reply. This is a view and [AmountDue] is supposed to be [CurrentDueAmount] + [PastDueAmount] - [PaidAmount]. The view is not calculating [PaidAmount] right . Below is the complete code of the view. Do you see anything wrong in the code ?
    Thanks. 
    SELECT     [isi].[InvoiceID], [ii].[DueDate], [SubInvoiceID] = [isi].[ID], [INV_FacilityID] = [if].[ID], [if].[FacilityID],
    [iff].[FacilityFeeID], [LoanID] = NULL, [isi].[PortfolioID], [isi].[Portfolio], 
                          [PaymentType] = [isis_fee].[SectionType], [Name]
    = [iff].[Name], [ReceivedAmount], [dates].[CurrentDueAmount], 
                          [PastDueAmount] = CASE WHEN ISNULL([ReceivedAmount],
    0) > 0 THEN [pastdue].[PastDueFeeAmount] + ISNULL([ReceivedAmount], 0) 
                          WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply reset to current. */ CASE WHEN [pastdue].[PastDueFeeAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN 0 ELSE [pastdue].[PastDueFeeAmount]
    + ISNULL([ReceivedAmount], 0) END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [pastdue].[PastDueFeeAmount] < 0 THEN 0 ELSE
    [pastdue].[PastDueFeeAmount] END, [PaidAmount] = CASE WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [pastdue].[PastDueFeeAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN - ([pastdue].[PastDueFeeAmount]
    + ISNULL([ReceivedAmount], 0)) ELSE 0 END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [pastdue].[PastDueFeeAmount] < 0 THEN - [pastdue].[PastDueFeeAmount]
    ELSE 0 END, [AmountDue] = [unpaid].[UnpaidFeeAmount], [ID] = [iff].[FacilityFeeID]
    FROM         [dbo].[INV_SubInvoice] isi JOIN
                          [dbo].[INV_Invoice] ii ON [isi].[InvoiceID]
    = [ii].[ID] JOIN
                          [dbo].[INV_Facility] [if] ON [isi].[ID] = [if].[SubInvoiceID]
    JOIN
                          [dbo].[INV_FacilityFee] iff ON [if].[ID] = [iff].[INV_FacilityID]
    JOIN
                              (SELECT     [sis_fee].[ID],
    [sis_fee].[SectionTypeCode], [SectionType] = [st_fee].[Name], [sis_fee].[INV_FacilityFeeID]
                                FROM      
       [dbo].[INV_SubInvoiceSection] sis_fee JOIN
                   [dbo].[INV_SectionType] st_fee ON [sis_fee].[SectionTypeCode] = [st_fee].[Code]
                                WHERE      [INV_FacilityFeeID]
    IS NOT NULL AND [StatusCode] = 'BILL') isis_fee ON [iff].[ID] = [isis_fee].[INV_FacilityFeeID] JOIN
                              (SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                   [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedFeeAmount]), 
                   [ReceivedAmount] = SUM([iffa].[ReceivedFeeAmount])
                                FROM      
       [dbo].[INV_FacilityFeeAccrual] iffa
                                GROUP BY [iffa].[SectionID])
    dates ON [isis_fee].[ID] = [dates].[SectionID] LEFT JOIN
                              (SELECT     *
                                FROM      
       [dbo].[INV_FacilityFeeAccrual]) unpaid ON [dates].[SectionID] = [unpaid].[SectionID] AND 
                          [dates].[AccrualDeterminationDateMax] = [unpaid].[AccrualDeterminationDate]
    LEFT JOIN
                              (SELECT     [SectionID],
    [PastDueFeeAmount] = SUM([PastDueFeeAmount])
                                FROM      
       [dbo].[INV_FacilityFeeAccrual]
                                GROUP BY [SectionID]) pastdue
    ON [dates].[SectionID] = [pastdue].[SectionID]
    UNION
    SELECT     [isi].[InvoiceID], [ii].[DueDate], [SubInvoiceID] = [isi].[ID], [INV_FacilityID] = [if].[ID], [if].[FacilityID],
    [FacilityFeeID] = NULL, [il].[LoanID], [isi].[PortfolioID], [isi].[Portfolio], 
                          [PaymentType] = [isis_loan].[SectionType], [Name]
    = [il].[Name], [ReceivedAmount], [CurrentDueAmount], [PastDueAmount] = CASE WHEN ISNULL([ReceivedAmount], 
                          0) > 0 THEN [PastDueAmount] + ISNULL([ReceivedAmount],
    0) WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN 0 ELSE [PastDueAmount] + ISNULL([ReceivedAmount],
    0) END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN 0 ELSE [PastDueAmount]
    END, 
                          [PaidAmount] = CASE WHEN [isis_loan].[SectionTypeCode]
    = 'LOAN_PRIN' THEN 0 ELSE CASE WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN - ([PastDueAmount] + ISNULL([ReceivedAmount],
    0)) ELSE 0 END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN - [PastDueAmount]
    ELSE 0 END END, 
                          [AmountDue] = CASE WHEN [isis_loan].[SectionTypeCode]
    = 'LOAN_PRIN' THEN [CurrentDueAmount] ELSE [unpaid].[AmountDue] END, [ID] = [il].[LoanID]
    FROM         [dbo].[INV_SubInvoice] isi JOIN
                          [dbo].[INV_Invoice] ii ON [isi].[InvoiceID]
    = [ii].[ID] JOIN
                          [dbo].[INV_Facility] [if] ON [isi].[ID] = [if].[SubInvoiceID]
    JOIN
                          [dbo].[INV_Loan] il ON [if].[ID] = [il].[INV_FacilityID]
    JOIN
                              (SELECT     [sis_loan].[ID],
    [sis_loan].[SectionTypeCode], [SectionType] = [st_loan].[Name], [sis_loan].[INV_LoanID]
                                FROM      
       [dbo].[INV_SubInvoiceSection] sis_loan JOIN
                   [dbo].[INV_SectionType] st_loan ON [sis_loan].[SectionTypeCode] = [st_loan].[Code]
                                WHERE      [INV_LoanID]
    IS NOT NULL AND [StatusCode] = 'BILL') isis_loan ON [il].[ID] = [isis_loan].[INV_LoanID] JOIN
                              (SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                   [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[ExpectedPrincipalAmount]), 
                   [ReceivedAmount] = SUM([ReceivedPrincipalAmount])
                                FROM      
       [dbo].[INV_LoanPrincipalAmortization] iffa
                                GROUP BY [iffa].[SectionID]
                                UNION
                                SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                  [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedInterestAmount]), 
                  [ReceivedAmount] = SUM([ReceivedInterestAmount])
                                FROM      
      [dbo].[INV_LoanCashInterestAccrual] iffa
                                GROUP BY [iffa].[SectionID]
                                UNION
                                SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                  [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedInterestAmount]), 
                  [ReceivedAmount] = SUM([ReceivedInterestAmount])
                                FROM      
      [dbo].[INV_LoanPIKInterestAccrual] iffa
                                GROUP BY [iffa].[SectionID])
    dates ON [isis_loan].[ID] = [dates].[SectionID] LEFT JOIN
                              (SELECT     [AmountDue]
    = [UnpaidPrincipalAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
       [dbo].[INV_LoanPrincipalAmortization]
                                UNION
                                SELECT     [AmountDue]
    = [UnpaidInterestAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
      [dbo].[INV_LoanCashInterestAccrual]
                                UNION
                                SELECT     [AmountDue]
    = [UnpaidInterestAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
      [dbo].[INV_LoanPIKInterestAccrual]) unpaid ON [dates].[SectionID] = [unpaid].[SectionID] AND 
                          [dates].[AccrualDeterminationDateMax] = [unpaid].[AccrualDeterminationDate]
    LEFT JOIN
                              (SELECT     [PastDueAmount]
    = SUM([PastDuePrincipalAmount]), [SectionID]
                                FROM      
       [dbo].[INV_LoanPrincipalAmortization]
                                GROUP BY [SectionID]
                                UNION
                                SELECT     [PastDueAmount]
    = SUM([PastDueInterestAmount]), [SectionID]
                                FROM      
      [dbo].[INV_LoanCashInterestAccrual]
                                GROUP BY [SectionID]
                                UNION
                                SELECT     [PastDueAmount]
    = SUM([PastDueInterestAmount]), [SectionID]
                                FROM      
      [dbo].[INV_LoanPIKInterestAccrual]
                                GROUP BY [SectionID]) pastdue
    ON [dates].[SectionID] = [pastdue].[SectionID]
    UNION
    SELECT     [isi].[InvoiceID], [ii].[DueDate], [SubInvoiceID] = [isi].[ID], [INV_FacilityID] = [if].[ID], [if].[FacilityID],
    [FacilityFeeID] = NULL, [il].[LoanID], [isi].[PortfolioID], [isi].[Portfolio], 
                          [PaymentType] = 'PIK Interest Applied', [Name]
    = [il].[Name], [ReceivedAmount], [CurrentDueAmount] = - [dates].[CurrentDueAmount], 
                          [PastDueAmount] = - CASE WHEN ISNULL([ReceivedAmount],
    0) > 0 THEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN 0 ELSE [PastDueAmount] + ISNULL([ReceivedAmount],
    0) END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN 0 ELSE [PastDueAmount]
    END, [PaidAmount] = - CASE WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN - ([PastDueAmount] + ISNULL([ReceivedAmount],
    0)) ELSE 0 END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN - [PastDueAmount]
    ELSE 0 END, [AmountDue] = - [AmountDue], [ID] = [il].[LoanID]
    FROM         [dbo].[INV_SubInvoice] isi JOIN
                          [dbo].[INV_Invoice] ii ON [isi].[InvoiceID]
    = [ii].[ID] JOIN
                          [dbo].[INV_Facility] [if] ON [isi].[ID] = [if].[SubInvoiceID]
    JOIN
                          [dbo].[INV_Loan] il ON [if].[ID] = [il].[INV_FacilityID]
    JOIN
                              (SELECT     [sis_loan].[ID],
    [sis_loan].[SectionTypeCode], [SectionType] = [st_loan].[Name], [sis_loan].[INV_LoanID]
                                FROM      
       [dbo].[INV_SubInvoiceSection] sis_loan JOIN
                   [dbo].[INV_SectionType] st_loan ON [sis_loan].[SectionTypeCode] = [st_loan].[Code]
                                WHERE      [INV_LoanID]
    IS NOT NULL AND [StatusCode] = 'BILL' AND [sis_loan].[SectionTypeCode] = 'LOAN_INT_PIK') isis_loan ON 
                          [il].[ID] = [isis_loan].[INV_LoanID] JOIN
                              (SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                   [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedInterestAmount]), 
                   [ReceivedAmount] = SUM([ReceivedInterestAmount])
                                FROM      
       [dbo].[INV_LoanPIKInterestAccrual] iffa
                                GROUP BY [iffa].[SectionID])
    dates ON [isis_loan].[ID] = [dates].[SectionID] LEFT JOIN
                              (SELECT     [AmountDue]
    = [UnpaidInterestAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
       [dbo].[INV_LoanPIKInterestAccrual]) unpaid ON [dates].[SectionID] = [unpaid].[SectionID] AND 
                          [dates].[AccrualDeterminationDateMax] = [unpaid].[AccrualDeterminationDate]
    LEFT JOIN
                              (SELECT     [PastDueAmount]
    = SUM([PastDueInterestAmount]), [SectionID]
                                FROM      
       [dbo].[INV_LoanPIKInterestAccrual]
                                GROUP BY [SectionID]) pastdue
    ON [dates].[SectionID] = [pastdue].[SectionID]

  • Show Error string for all the components in a form at a time

    How do I show all the error strings for all the components in the form when the submit button is clicked?

    This code answers your question:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          import mx.events.ValidationResultEvent;
          import mx.validators.ZipCodeValidator;
          import flash.events.MouseEvent;
          public var v:ZipCodeValidator = new ZipCodeValidator();
          public var vResult:ValidationResultEvent;
          public function performValidation():void {
            v.domain = "US or Canada";
            v.listener=myZip;
            vResult = v.validate(myZip.text);
            if (vResult.type==ValidationResultEvent.INVALID) {
              myZip.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_OUT));            
              myZip.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_OVER));
        ]]>
      </mx:Script>
      <mx:TextInput id="myZip"/>
      <mx:Button label="Submit" click="performValidation();"/>
    </mx:Application>
    If this post answers your question or helps, please mark it as such. Thanks!
    http://www.stardustsystems.com
    http://www.stardustsystems.com/blog
    Adobe Flex Development and Support Services

  • JSF Navigation: Unexepcted value for action in h:form tag

    Hi
    I am running simple JSF application and when I click the button, it stays in the same page rather than the output page.
    I found that the resulting Html code has form action and that action is referring to current page.
    here is my JSF code...
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
    <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
    <f:loadBundle basename="gov.ca.dmv.dmvar.bundle.messages" var="msg"/>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
      <title>enter your name page</title>
    </head>
    <body>
       <f:view>
         <h1>
          <h:outputText value="#{msg.inputname_header}"/>
         </h1>
         <h:form id="helloForm">
          <h:outputText value="#{msg.prompt}"/>
          <h:inputText value="#{personBean.personName}" />
          <h:commandButton action="#{personBean.clickSearch}" value="#{msg.button_text}"></h:commandButton>
         </h:form>
       </f:view>
    </body>
    </html> Here is my html source
    <html>
    <head>
      <title>enter your name page</title>
    </head>
    <body>
         <h1>
          Welcome to EASE
         </h1>
         <form id="helloForm" method="post" action="/RSample/index.jsf;jsessionid=5AD3913EE84D54EF78A6F46B2AFFFB79" enctype="application/x-www-form-urlencoded">
          Tell us your name:
          <input type="text" name="helloForm:_id2" />
          <input type="submit" name="helloForm:_id3" value="ENTER" />
         <input type="hidden" name="helloForm" value="helloForm" /></form>
    </body>
    </html> I am giving the action for a button and its not attaching the action for the button ..but its assiging to the form action with wrong value.
    Anything I missed here?
    --Varma                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I am using JSF1.2
    I found in html code ...
    <form id="helloForm" method="post" action="/RSample/index.jsf;jsessionid=5AD3913EE84D54EF78A6F46B2AFFFB79" enctype="application/x-www-form-urlencoded">My index.jsp file is just forwarding to 'inputname.jsp'
    In 'inputname.jsp' i have created a text box and a button.
    <html>
    <body>
    <jsp:forward page="/pages/inputname.jsp"></jsp:forward>
    </body>
    </html>inputname.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
    <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
    <f:loadBundle basename="gov.ca.dmv.dmvar.bundle.messages" var="msg"/>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
      <title>enter your name page</title>
    </head>
    <body>
       <f:view>
         <h1>
          <h:outputText value="#{msg.inputname_header}"/>
         </h1>
         <h:form id="helloForm">
          <h:outputText value="#{msg.prompt}"/>
          <h:inputText value="#{personBean.personName}" />
          <h:commandButton id="button1" onclick="#{personBean.clickSearch}" value="#{msg.button_text}"></h:commandButton>
         </h:form>
       </f:view>
    </body>
    </html> PersonBean.java
    package gov.ca.dmv.dmvar.common;
    public class PersonBean {
            String personName;
            * @return Person Name
            public String getPersonName() {
               return personName;
            * @param Person Name
            public void setPersonName(String name) {
               personName = name;
            public String clickSearch(){
                 return "greeting";
         }faces-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC
        "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
        "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
      <navigation-rule>
       <from-view-id>/pages/inputname.jsf</from-view-id>
        <navigation-case>
         <from-outcome>greeting</from-outcome>
         <to-view-id>/pages/greeting.jsf</to-view-id>
       </navigation-case>
      </navigation-rule>
      <managed-bean>
        <managed-bean-name>personBean</managed-bean-name>
        <managed-bean-class>gov.ca.dmv.dmvar.common.PersonBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
    </faces-config>There are no errors after submitting. My only doubt is I am binding the commondButton action to bean method. But in the html code the <form action is referring to index.jsp?

  • Access values stored in 2D Array in HashMap

    Hi everyone i would like to know how to access values stored in a 2D array inside a HashMap
    Here is a drawing representation of the map.
    So to get the KEYS I just have to execute this code:
    this.allPeople = personInterests.keySet();But how can I get acces to the actual values inside the 2D Array?
    My goal is to create a treeSet and store all the elements of the first array in it, then look at the second array if any new elements are detected add them to the treeset, then third array and so on.
    I tried this code:
    Object[] bands = personInterests.values().toArray();
         for( int i=0; i<bands.length; i++)
              this.allBands.add(bands.toString());
    }But this.allBands.add(bands[i].toString())seems to be the problem, Dealing with a 2D array, this code only return a string representation of the Arrays and not a string representation of their elements.
    Using my logic I tried to execute:
       this.allBands.add(bands[0][i].toString());But i get a ARRAY REQUIRED BUT JAVA.LANG.OBJECT FOUND
    I really don't know the way to go.
    Thanks to anyone that will help.
    Regards, Damien.
    Edited by: Fir3blast on Mar 3, 2010 5:27 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    You'll just need to cast the object to the correct type. This is nothing to do with HashMap at all. If you don't know what that means then your google keywords are "java cast tutorial".

  • Fill DDL based on other field values in offline interactive adobe form

    Hi,
    I have a requirement where in i need to fill the values for a dropdown list  based on 3 other field values in offline adobe interactive forms which uses web service to interact with SAP.
    Note: I read many blogs and posts in SDN , but couldn get much info ab the same, so posting a new thread.
    Thank you.
    Regards,
    Soumya

    Hi Soumya,
    It is possible but a little bit tough and will make your form heavier.
    The solution is advisable only when there is not very much data required for the drop down(May be not more than 500 values as it will create performance issue).
    You can create a hidden table on the form contaning data for all the combinations. Depending on the selection of another 3 fields you can write the code to select only those values from this hidden table which are applicable to that selection. These values you can add to the drop down list removing the previous values.
    Only you have to do is on calculate or vlaidate event of target DDL you have to write your code.
    Pseudocode:
    1. Clear your DDL using deleteItem() method.
    2. Loop at your hidden table.
    3. Inside the loop check for applicable entries depending on selection in other 3 fields.
    4. Select the appropriate vlaues
    5. Add using additem method().
    Refer formCalc or JavaScript help for the appropriate code.
    Hope this will be helpfull.
    Regards,
    Vaibhav

Maybe you are looking for