facebook

Seems onChange in form:select not work in generated code

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #345740 Reply

    cidy.long
    Member

    Actually. I am doing a form submit with MyEclipse for Spring 2014 to evaluate product in my future development.

    There are about 14 fields need to be filled when I do a payment record for a customer payment. As most information already in the system, I don’t want to fill up everything from scratch again and again.

    The basic idea is, when I create a new payment record, system will generate a payment sequence number and then pop on a drop down list to show every custom in the system. I pick up one custom from the list (who is the payer).

    I need a short javascript code from here to listen on this field onchange, if the field value changed, javascript will trigger a submit action to submit the payment ID and Customer ID to my controller (not save with the save function in controller), the method under controller will based on submitted info to get lots more information from the record to shows what’s customer past payment looks like, and fill such information back to model in the view, and then I just change some value and press save button to submit whole new payment, the system will save the new payment record.

    This is some ting like two steps submit, first step submit is a filter and auto filler without any button pressing. Last step will press save button to call save service to save the value.

    I have some code in my JSP like this:

    <form:select id=”payment_payerId” path=”payerId” onchange=”javacriptfunction to submit the information to my newly added method in controller”cssStyle=”width:300px;”>
    <form:option value=”-1″ label=”—- Please Select —–” />
    <form:options items=”${AvailableUserList}”></form:options>
    </form:select>
    <script type=”text/javascript”>Spring.addDecoration(new Spring.ElementDecoration({elementId : “payment_payerId”,widgetType : “dijit.form.Select”,widgetAttrs : {promptMessage: “<fmt:message key=”payment.payerid.help”/>”}})); </script>

    last paragraph javascript is used to decoration the UI, I need some help to change this to call my controller method in my controller class as:

    @RequestMapping(“/autoFillPayment”)
    public ModelAndView autoFillPayment(@RequestParam String paymentIdKey, String payerID) {
    ModelAndView mav = new ModelAndView();
    /*add object to generate drop down list in UI*/
    /*String pisequence=getPaymentIDSequence(thsssequenceDAO);*/
    mav.addObject(“PISequence”,paymentIdKey);
    mav.addObject(“PayerID”, payerID);
    payername=getPayerNamebyCustomerID(customersDAO, payerID);
    mav.addObject(“PayerName”,payername);
    /*Map<String, String> availableUserList = getAvailableUserList(customersDAO);
    mav.addObject(“AvailableUserList”, availableUserList);*/
    /*End of adding*/
    mav.addObject(“payment”, new Payment());
    mav.addObject(“newFlag”, true);
    mav.setViewName(“payment/editAutoFillPayment.jsp”);

    return mav;
    }

    I tried quite lots different way to make it, but not work at all.

    Any suggestion and help with many thanks!

    Happy New Year! GUYS!

    #345768 Reply

    support-tony
    Keymaster

    Cidy,

    Happy New Year to you, too, again!

    Though we try to help, where we can, questions about development issues are better addressed in external forums (such as stackoverflow.com, and others). I’m afraid we don’t have the resources to investigate development issues for our users, unless they are directly caused by MyEclipse problems. Of course, if we can see the resolution quickly, we will answer. Unfortunately, in this case, some investigation would be needed.

    You may find useful information by searching on keywords in your problem (for example, searching on “connecting a spring form to jsp” – without the quotes – brings up some pages that might help you).

    If you post on an external forum for assistance, it would probably help if you mentioned what you have tried, to get this to work.

    I hope you find a solution. In the meantime, if you have MyEclipse issues, please let us know.

    #345770 Reply

    cidy.long
    Member

    I had found a work around. As new version have a lots change, I had worked out. Thank you.

    There is an other issue about the date format. I can set the UI format in Australia locale. If you have any idea, please let me know.

    Cidy

    #345799 Reply

    support-tony
    Keymaster

    Cidy,

    I’m glad you solved your problem. I’m afraid I’m not sure exactly what your latest issue is, but, again, it’s a development issue. We recommend using external development forums for such issues, as I mentioned in my last reply. However, a Web search on setting the locals in a JSP yielded a number of hits, including this one, which may help.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Seems onChange in form:select not work in generated code

You must be logged in to post in the forum log in