Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: Trunk
    • Fix Version/s: Trunk
    • Component/s: ALL COMPONENTS
    • Labels:
      None

      Description

      To see how it works, apply the patch (optionally add ajax-loader.gif to framework\images\webapp\images) and go to Accounting -> Find Invoices (or to any other screen with form widget that uses LookupPartyName lookup ). Then type some letters to From Party ID or To Party ID fields.

      Bilgin

      1. ajaxLookup.patch
        18 kB
        Bilgin Ibryam
      2. ajax-loader.gif
        2 kB
        Bilgin Ibryam
      3. ajaxLookup.patch
        9 kB
        Bilgin Ibryam

        Activity

        Hide
        Bilgin Ibryam added a comment -

        btw you'd better use business theme while testing. I still didn't add the necessary styles to other themes.

        Show
        Bilgin Ibryam added a comment - btw you'd better use business theme while testing. I still didn't add the necessary styles to other themes.
        Hide
        Jeroen van der Wal added a comment - - edited

        Hi Bilgin,

        An excellent improvement on the usibility of Ofbiz! I have only a few coments:

        1. The results are now ordered by the ID and results display in the <ID> <Description> format. I Could imagine that users want the results displayed in a <Description> <ID> format and sorted accordingly. I noticed that you can set this on the individual lookup but i would be nice to set it on a global level, In the lookup defintion you then only have to set the search fields, the id field and the description fields:
          • by id: [10000] My Company
          • by description: My Company [10000]
        2. I would like to see a separate row for each etry returned
        3. Could you extend the width of the resultbox to prevent text wrapping

        Jeroen

        Show
        Jeroen van der Wal added a comment - - edited Hi Bilgin, An excellent improvement on the usibility of Ofbiz! I have only a few coments: The results are now ordered by the ID and results display in the <ID> <Description> format. I Could imagine that users want the results displayed in a <Description> <ID> format and sorted accordingly. I noticed that you can set this on the individual lookup but i would be nice to set it on a global level, In the lookup defintion you then only have to set the search fields, the id field and the description fields: by id: [10000] My Company by description: My Company [10000] I would like to see a separate row for each etry returned Could you extend the width of the resultbox to prevent text wrapping Jeroen
        Hide
        Bilgin Ibryam added a comment -
        • Added possibility to specify more than one fields to search for a match.
        • Added some defaults, so ajaxifying a lookup screen is as easy as specifying two fields:entityName and fieldNames
        • Show only 10 records in the autocompleter, which is configurable from widget.properties. (I was wondering would it be better to use EntityListIterator for the search ?)
        • Move hard coded image location from markup to css.
        • Added autocompleter to LookupPerson lookup.
        Show
        Bilgin Ibryam added a comment - Added possibility to specify more than one fields to search for a match. Added some defaults, so ajaxifying a lookup screen is as easy as specifying two fields:entityName and fieldNames Show only 10 records in the autocompleter, which is configurable from widget.properties. (I was wondering would it be better to use EntityListIterator for the search ?) Move hard coded image location from markup to css. Added autocompleter to LookupPerson lookup.
        Hide
        Jacques Le Roux added a comment -

        Hi Bilgin,

        I used FF3.5.5 on Windows Xp and nothing happened. It worked well with Opera, IE8 and Chrome.
        For FF it's maybe because FF stores previously entered strings in fields or maybe I have a plugin which interfer.

        Nice feature!

        Thanks

        Show
        Jacques Le Roux added a comment - Hi Bilgin, I used FF3.5.5 on Windows Xp and nothing happened. It worked well with Opera, IE8 and Chrome. For FF it's maybe because FF stores previously entered strings in fields or maybe I have a plugin which interfer. Nice feature! Thanks
        Hide
        Scott Gray added a comment -

        Here's a few comments, nothing that blocks committing your patch, just things we need to think about improving at some point:

        • you can't search for a string that spans across multiple fields e.g. entering firstName and a partial lastName will return no results. I guess we can't do anything about this until the entity engine supports string concatenation (it doesn't right?).
        • when the session has expired the autocompleter stops working properly but no feedback is given to the user
        • I'm not sure if we're worried about this right now but I've noticed that autocompleters used by other apps often hide the key from the user and only display the description in the textbox (much like a dropdown). Only raising this here as something we need to think about supporting.
        • we should avoid returning html from the server since it is specific to the script.aculo.us autocompleter and instead return a json object which can then be converted in whatever format is necessary.
        • we should use EntityFindOptions.setMaxRows rather than trimming the results after the search
        Show
        Scott Gray added a comment - Here's a few comments, nothing that blocks committing your patch, just things we need to think about improving at some point: you can't search for a string that spans across multiple fields e.g. entering firstName and a partial lastName will return no results. I guess we can't do anything about this until the entity engine supports string concatenation (it doesn't right?). when the session has expired the autocompleter stops working properly but no feedback is given to the user I'm not sure if we're worried about this right now but I've noticed that autocompleters used by other apps often hide the key from the user and only display the description in the textbox (much like a dropdown). Only raising this here as something we need to think about supporting. we should avoid returning html from the server since it is specific to the script.aculo.us autocompleter and instead return a json object which can then be converted in whatever format is necessary. we should use EntityFindOptions.setMaxRows rather than trimming the results after the search
        Hide
        Bilgin Ibryam added a comment -

        Thanks guys for your reviews and comments. I did some more changes according to your comments and committed it to trunk in #894149

        Jeroen, you can show/hide the returned values(keys) from widget.properties Also each entry is in separate line and there is no text wrapping any more.

        Jacques, it works for me using FF3.5.5 on vista. No idea what prevented it in your case.

        Scott, I used setMaxRows and added possibility to hide/show the key in the list. As for the error message and using json, this will require changes in scriptaculous library.

        I will keep the issue open for later improvements. Here are few more things to improve:

        • add possibility to pass target-parameter from the lookup.
        • add possibility to add extra conditions to search query (for example to filter disabled parties)
        Show
        Bilgin Ibryam added a comment - Thanks guys for your reviews and comments. I did some more changes according to your comments and committed it to trunk in #894149 Jeroen, you can show/hide the returned values(keys) from widget.properties Also each entry is in separate line and there is no text wrapping any more. Jacques, it works for me using FF3.5.5 on vista. No idea what prevented it in your case. Scott, I used setMaxRows and added possibility to hide/show the key in the list. As for the error message and using json, this will require changes in scriptaculous library. I will keep the issue open for later improvements. Here are few more things to improve: add possibility to pass target-parameter from the lookup. add possibility to add extra conditions to search query (for example to filter disabled parties)
        Hide
        Adrian Crum added a comment -

        Bilgin,

        I had to make a small change to your code (rev 940245) because the empty img element created invalid HTML, and adding empty attributes to it (to make it valid HTML) caused problems with some browsers.

        It would be best if the span element was left empty and the JavaScript code inserted the img element when needed.

        Show
        Adrian Crum added a comment - Bilgin, I had to make a small change to your code (rev 940245) because the empty img element created invalid HTML, and adding empty attributes to it (to make it valid HTML) caused problems with some browsers. It would be best if the span element was left empty and the JavaScript code inserted the img element when needed.
        Hide
        Bilgin Ibryam added a comment -

        Thanks Adrian.

        BTW in rev 940274 I moved the span and img creation to javascript, but I think it doesn't solve the empty src attribute problem. At least now it the renderer is cleaner.

        Show
        Bilgin Ibryam added a comment - Thanks Adrian. BTW in rev 940274 I moved the span and img creation to javascript, but I think it doesn't solve the empty src attribute problem. At least now it the renderer is cleaner.

          People

          • Assignee:
            Bilgin Ibryam
            Reporter:
            Bilgin Ibryam
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development