Uploaded image for project: 'Click'
  1. Click
  2. CLK-2

Form <-> DAO autoloading

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      Provide a facility to automatically populate a Form's field values from a Java Object's attributes, and to set an Object's attributes from the Form Field values. For example:

      public void onGet() {
      Integer customerId = Integer.valueOf(getContext().getRequest().getParameter("customerId"));
      Customer customer = CustomerDAO.findByPK(customerId);
      form.copyFrom(customer);
      }

      public void onPost() {
      if (form.isValid())

      { Customer customer = new Customer(); form.copyTo(customer); CustomerDAO.save(customer); }

      }

      Attachments

        Activity

          People

            medgar Malcolm Edgar
            medgar Malcolm Edgar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: