Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-269

Ajax a form element in ofbiz

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Duplicate
    • Trunk
    • None
    • party
    • None
    • Based on svn 7564

    Description

      This is a copy of the old Jira issue http://jira.undersunconsulting.com/browse/OFBIZ-885 from Fred Forester.

      ======================================================

      This is an exmaple of how to Ajaxize a control in ofbiz. It uses an auto complete event
      for the last name on the party lookup page. when the last name is selected it fills the partyId on the form. the example does not take any role types or groups into account.

      All Comments Work Log Change History Sort Order:
      Comment by Fred Forester [16/May/06 10:14 AM] [ Permlink ]
      patch file

      Comment by Fred Forester [16/May/06 10:15 AM] [ Permlink ]
      new file

      Comment by Fred Forester [16/May/06 10:17 AM] [ Permlink ]
      a patch and a new file

      Comment by Fred Forester [16/May/06 10:19 AM] [ Permlink ]
      Sorry about the duplicate files. the upload made it appear to me that one replaced the other.

      Comment by Si Chen [19/May/06 09:14 AM] [ Permlink ]
      This is my version of your AjaxPartyServices.java as AjaxPartyEvents.java

      Comment by Si Chen [19/May/06 09:16 AM] [ Permlink ]
      Hey everybody - this works!

      I looked at your code and would like to suggest -

      1. AjaxPartyServices.java is really AjaxPartyEvents.java since you have written an Events servlet not a Service. I just changed it and uploaded it for you.

      2. I think a lot of the Javascript in findparty.ftl should be moved into an ajax javascript file that could be shared everywhere, since they seem to be pretty standard?

      3. Please clean up the formatting of AjaxPartyEvents.java. See http://ofbizwiki.go-integral.com/Wiki.jsp?page=FAQ27

      Comment by Si Chen [19/May/06 09:38 AM] [ Permlink ]
      David and Andy -

      Can you make a specialized/ajax directory so we can put some ajax-related stuff in there, like this, that all the applications/ can use, but at the same time not mess with framework/?

      Comment by Fred Forester [19/May/06 09:42 AM] [ Permlink ]
      I agree 100% with all 3 points and had every intention of getting to 1 and 2. didn't know about 3 till just now

      I found out last night after loading 200,000 users that things got a little slow.
      a temporary fix was to require at least 5 characters in the lastname.

      I'm working on 2 other jira things now and can get to this on tuesday.

      Comment by Si Chen [19/May/06 11:21 AM] [ Permlink ]
      Great.

      Also I think it would be nice to change your AjaxPartyEvents.java to a more generic AjaxEvents.java and parametrize the entities and fields, etc., so that it could be used everywhere for auto-completion. We could then integrate it into the form-widget at a later date.

      Comment by Fred Forester [23/May/06 04:51 PM] [ Permlink ]
      Here are the new files for the ajax lastname control. I wasnt sure what was wrong with the formatting. maybe a critique of the formatting would give me a better idea of what's wrong.

      Fred

      Attachments

        1. diff.log
          7 kB
          Marco Risaliti
        2. diff_2.log
          7 kB
          Marco Risaliti
        3. AjaxPartyServices.java
          7 kB
          Marco Risaliti
        4. AjaxPartyServices_2.java
          7 kB
          Marco Risaliti
        5. AjaxPartyEvents.java
          7 kB
          Marco Risaliti
        6. AjaxPartyEvents_2.java
          7 kB
          Marco Risaliti
        7. ajax.js
          5 kB
          Marco Risaliti

        Activity

          People

            sichen Si Chen
            risalitm Marco Risaliti
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: