Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Duplicate
    • Affects Version/s: SVN 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. 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

        Hide
        Si Chen added a comment -

        I am currently out of the office. If you are a client of Open Source
        Strategies, please contact our support list for help.


        Si Chen
        Open Source Strategies, Inc.
        sichen@opensourcestrategies.com
        http://www.OpenSourceStrategies.com

        Show
        Si Chen added a comment - I am currently out of the office. If you are a client of Open Source Strategies, please contact our support list for help. – Si Chen Open Source Strategies, Inc. sichen@opensourcestrategies.com http://www.OpenSourceStrategies.com
        Hide
        Si Chen added a comment -

        I am currently out of the office. If you are a client of Open Source
        Strategies, please contact our support list for help.


        Si Chen
        Open Source Strategies, Inc.
        sichen@opensourcestrategies.com
        http://www.OpenSourceStrategies.com

        Show
        Si Chen added a comment - I am currently out of the office. If you are a client of Open Source Strategies, please contact our support list for help. – Si Chen Open Source Strategies, Inc. sichen@opensourcestrategies.com http://www.OpenSourceStrategies.com
        Jacques Le Roux made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Si Chen [ sichen ]
        Resolution Duplicate [ 3 ]
        Hide
        Jacques Le Roux added a comment -

        Thanks for the reminder Erwan!

        Show
        Jacques Le Roux added a comment - Thanks for the reminder Erwan!
        Hide
        Erwan de FERRIERES added a comment -

        Hi all,

        could we close this issue, as it seems it is now implemented with lookup screens ?

        Cheers,

        Show
        Erwan de FERRIERES added a comment - Hi all, could we close this issue, as it seems it is now implemented with lookup screens ? Cheers,
        Gavin made changes -
        Workflow jira [ 12383643 ] OFbiz Workflow [ 12504771 ]
        Hide
        Si Chen added a comment -

        It's a very good proof of concept though. We played around with Ajax for a bit, but now that Andy's doing more along those lines, let's see what he comes with.

        Show
        Si Chen added a comment - It's a very good proof of concept though. We played around with Ajax for a bit, but now that Andy's doing more along those lines, let's see what he comes with.
        Jacques Le Roux made changes -
        Assignee Jacques Le Roux [ jacques.le.roux ]
        Hide
        Jacques Le Roux added a comment -

        OK, thanks Si and Fred for comments.

        Show
        Jacques Le Roux added a comment - OK, thanks Si and Fred for comments.
        Hide
        Fred Forester added a comment -

        Jacques,

        I did this as an example or POC. it was never intended to be commited as is.

        Thanx
        Fred

        Show
        Fred Forester added a comment - Jacques, I did this as an example or POC. it was never intended to be commited as is. Thanx Fred
        Hide
        Si Chen added a comment -

        Jacques,

        I think the patch is a good demonstration of how it could be done but would need quite a bit of work before it should be committed. I'd prefer something where the returned result from the search is not formatted inside a java method but by a FTL which can be modified more easily. Also it might be better to use one of Andy's ajax libraries instead of the custom ajax javascript here.

        Andy put some ajax stuff into the framework and wanted a general standard pattern, and I think that's what we should try to do.

        Si

        Show
        Si Chen added a comment - Jacques, I think the patch is a good demonstration of how it could be done but would need quite a bit of work before it should be committed. I'd prefer something where the returned result from the search is not formatted inside a java method but by a FTL which can be modified more easily. Also it might be better to use one of Andy's ajax libraries instead of the custom ajax javascript here. Andy put some ajax stuff into the framework and wanted a general standard pattern, and I think that's what we should try to do. Si
        Hide
        Jacques Le Roux added a comment -

        Hi Si,

        Have you still some comments and suggestions on this (please see https://issues.apache.org/jira/browse/OFBIZ-269#action_12435513)

        Else I will close it...

        Thanks

        Show
        Jacques Le Roux added a comment - Hi Si, Have you still some comments and suggestions on this (please see https://issues.apache.org/jira/browse/OFBIZ-269#action_12435513 ) Else I will close it... Thanks
        Hide
        Jacques Le Roux added a comment -

        May this issue closed or attached to another ?

        Show
        Jacques Le Roux added a comment - May this issue closed or attached to another ?
        Hide
        Si Chen added a comment -

        Jacques, We will have some comments and suggestions on this for you shortly. Si

        Show
        Si Chen added a comment - Jacques, We will have some comments and suggestions on this for you shortly. Si
        Jacques Le Roux made changes -
        Assignee Jacques Le Roux [ jacques.le.roux ]
        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
        Marco Risaliti made changes -
        Attachment diff_2.log [ 12340774 ]
        Marco Risaliti made changes -
        Attachment diff.log [ 12340773 ]
        Attachment AjaxPartyServices_2.java [ 12340771 ]
        Attachment ajax.js [ 12340772 ]
        Marco Risaliti made changes -
        Field Original Value New Value
        Attachment AjaxPartyEvents_2.java [ 12340769 ]
        Attachment AjaxPartyEvents.java [ 12340768 ]
        Attachment AjaxPartyServices.java [ 12340770 ]
        Marco Risaliti created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development