Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Duplicate
    • Affects Version/s: Trunk
    • Fix Version/s: None
    • Component/s: party
    • Labels:
      None
    • Environment:

      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

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

        Activity

        Marco Risaliti created issue -
        Marco Risaliti made changes -
        Field Original Value New Value
        Attachment AjaxPartyEvents_2.java [ 12340769 ]
        Attachment AjaxPartyEvents.java [ 12340768 ]
        Attachment AjaxPartyServices.java [ 12340770 ]
        Marco Risaliti made changes -
        Attachment diff.log [ 12340773 ]
        Attachment AjaxPartyServices_2.java [ 12340771 ]
        Attachment ajax.js [ 12340772 ]
        Marco Risaliti made changes -
        Attachment diff_2.log [ 12340774 ]
        Jacopo Cappellato made changes -
        Description 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
        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
        Jacques Le Roux made changes -
        Assignee Jacques Le Roux [ jacques.le.roux ]
        Jacques Le Roux made changes -
        Assignee Jacques Le Roux [ jacques.le.roux ]
        Gavin made changes -
        Workflow jira [ 12383643 ] OFbiz Workflow [ 12504771 ]
        Jacques Le Roux made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Si Chen [ sichen ]
        Resolution Duplicate [ 3 ]

          People

          • Assignee:
            Si Chen
            Reporter:
            Marco Risaliti
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development