Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: SVN trunk
    • Fix Version/s: SVN trunk
    • Component/s: framework
    • Labels:
      None

      Description

      I did a small extention to lookup autocompleter code and now it is able to load description for the lookup field values.

      For example when you load a form with lookup fields, currently you see only the Id in the lookup field (which is not very descriptive). After applying the patch, you will see also a description, next to lookup button. The description value is the same one that appears in the autocompler and it is specifiued for in each lookup screen.
      You will see the description also when a value is returned from a lookup screen or when a value is selected from autocompleter or when you type a valid Id in the lookup field.
      Internally it does an ajax call to get the description for the supplied value in lookup field.

      I'd like to know if you want to see this feature in ofbiz and/or if you have any ideas to improve it.

      Bilgin

      1. ieLookupDesc.patch
        0.6 kB
        Atul Vani
      2. fieldlookup.js.patch
        1 kB
        Jacques Le Roux
      3. lookup_description.patch
        23 kB
        Bilgin Ibryam
      4. lookup_description.patch
        20 kB
        Bilgin Ibryam
      5. lookup_description.patch
        9 kB
        Bilgin Ibryam

        Activity

        Hide
        Jacques Le Roux added a comment -

        HI Bilgin,

        I did not test, nor review yet. So I comment only at the functionnal level in the following.

        Yes, this is very interesting. I think everybody reusing the backend crossed this issue. In a custom application we introduced the possiblity to look for names (or descriptions as you call it) and show thenm in the lookup field. This of course because end users often prefer to see names/descriptions than Ids. This is also demonstrated in the 2d layered lookups in form widgets examples. But this implies to create a hidden field to put the value (Id) really used underneath by the targets->services which is a bit redundant and not straightworward. So yes IMO, this would be a great enhancement and I'd even like to generalize its use. Coupled with the layered lookups it would really simplify both developers and end users experiences.

        Show
        Jacques Le Roux added a comment - HI Bilgin, I did not test, nor review yet. So I comment only at the functionnal level in the following. Yes, this is very interesting. I think everybody reusing the backend crossed this issue. In a custom application we introduced the possiblity to look for names (or descriptions as you call it) and show thenm in the lookup field. This of course because end users often prefer to see names/descriptions than Ids. This is also demonstrated in the 2d layered lookups in form widgets examples. But this implies to create a hidden field to put the value (Id) really used underneath by the targets->services which is a bit redundant and not straightworward. So yes IMO, this would be a great enhancement and I'd even like to generalize its use. Coupled with the layered lookups it would really simplify both developers and end users experiences.
        Hide
        Bilgin Ibryam added a comment -

        Jacques, I think we are on the same page.

        The final goal is to have possibility for displaying description/name instead_of OR together_with the ID. In most of other web based systems it is the way you described: the ID is stored in a hidden field, and the description is in the input box. I think this can be easily done once we have the descriptions available. But as you already know ofbiz lookup definitions don't have information about how to get the description information (there is only lookup url) so I decided to reuse the autocompleter logic and get the description the same way.

        Note that autocompleter and lookup descriptions are available only to form widget lookups which refer to lookup screens with autocompleter support. Once we are sure that it is covered in most of ofbiz screen we can think on hiding the IDs totally (or it can be configured) and display only the description.

        Show
        Bilgin Ibryam added a comment - Jacques, I think we are on the same page. The final goal is to have possibility for displaying description/name instead_of OR together_with the ID. In most of other web based systems it is the way you described: the ID is stored in a hidden field, and the description is in the input box. I think this can be easily done once we have the descriptions available. But as you already know ofbiz lookup definitions don't have information about how to get the description information (there is only lookup url) so I decided to reuse the autocompleter logic and get the description the same way. Note that autocompleter and lookup descriptions are available only to form widget lookups which refer to lookup screens with autocompleter support. Once we are sure that it is covered in most of ofbiz screen we can think on hiding the IDs totally (or it can be configured) and display only the description.
        Hide
        Bilgin Ibryam added a comment -

        Made show/hide lookup description configurable from widget.properties

        Show
        Bilgin Ibryam added a comment - Made show/hide lookup description configurable from widget.properties
        Hide
        Bilgin Ibryam added a comment -

        Committed to trunk in rev 933130
        To see this feature in action set widget.lookup.showDescription to Y in widget.properties

        Show
        Bilgin Ibryam added a comment - Committed to trunk in rev 933130 To see this feature in action set widget.lookup.showDescription to Y in widget.properties
        Hide
        Jacques Le Roux added a comment -

        Hi Bilgin,

        It seems that it works well for form lookups but not from FTL templates. It sounds weird since they use almost the same flow. Could I miss something or is it not yet implemented? To easily try you may use the OFBIZ-3442 patch and maybe the issue is actually in this patch...

        Thanks

        Show
        Jacques Le Roux added a comment - Hi Bilgin, It seems that it works well for form lookups but not from FTL templates. It sounds weird since they use almost the same flow. Could I miss something or is it not yet implemented? To easily try you may use the OFBIZ-3442 patch and maybe the issue is actually in this patch... Thanks
        Hide
        Bilgin Ibryam added a comment -

        Thanks for testing Jacques. I saw your post in OFBIZ-3442 that actually there is no error.
        I tested the lookup descriptions in catalog and order manager, and it is working correct in both places using FTL.
        If you find a specific screen, let me know and I will check it.
        In the mean time I did a fix in rev 935644, which was needed after changes in the generated html

        Show
        Bilgin Ibryam added a comment - Thanks for testing Jacques. I saw your post in OFBIZ-3442 that actually there is no error. I tested the lookup descriptions in catalog and order manager, and it is working correct in both places using FTL. If you find a specific screen, let me know and I will check it. In the mean time I did a fix in rev 935644, which was needed after changes in the generated html
        Hide
        Jacques Le Roux added a comment -

        Yes, thanks for having checked Bilgin.

        Show
        Jacques Le Roux added a comment - Yes, thanks for having checked Bilgin.
        Hide
        Jacques Le Roux added a comment - - edited

        Unfortunately this uses the fire Prototype function which seems to not work in IE (I'm surprised Prototype team did not see this issue).

        It was blocking me in a client application, but as we did not use this feature I simply commented out the related lines. I attach the patchin case someone needs it

        Show
        Jacques Le Roux added a comment - - edited Unfortunately this uses the fire Prototype function which seems to not work in IE (I'm surprised Prototype team did not see this issue). It was blocking me in a client application, but as we did not use this feature I simply commented out the related lines. I attach the patchin case someone needs it
        Hide
        Jacques Le Roux added a comment -

        This patch is not intended to be commited but we need to find a solution for this issue in IE (at least IE8...). Maybe simply waiting for IE9 will be enough...

        Show
        Jacques Le Roux added a comment - This patch is not intended to be commited but we need to find a solution for this issue in IE (at least IE8...). Maybe simply waiting for IE9 will be enough...
        Hide
        Atul Vani added a comment -

        Hi Bilgin, Jacques,

        I am not actually sure what's the issue on IE,
        but when i used it on IE8 the description was not being displayed at all.
        With Firefox it was working fine. After doing some research I ended up with this patch (attached). Seem like 'textContent' doesn't work in IE.

        Thanks & Regards
        Atul Vani

        Show
        Atul Vani added a comment - Hi Bilgin, Jacques, I am not actually sure what's the issue on IE, but when i used it on IE8 the description was not being displayed at all. With Firefox it was working fine. After doing some research I ended up with this patch (attached). Seem like 'textContent' doesn't work in IE. Thanks & Regards Atul Vani
        Hide
        Jacques Le Roux added a comment -

        Thanks Atul,

        Maybe it help, but as it does not fix the issue I reported, I can't say (I can't use lookups in IE8)

        Show
        Jacques Le Roux added a comment - Thanks Atul, Maybe it help, but as it does not fix the issue I reported, I can't say (I can't use lookups in IE8)
        Hide
        Jacques Le Roux added a comment -

        Actually this problems is not in all case, I'm looking for the configuration where this problem arises...

        Show
        Jacques Le Roux added a comment - Actually this problems is not in all case, I'm looking for the configuration where this problem arises...
        Hide
        Jacques Le Roux added a comment -

        The problem I reported appears only (in IE8 at least) if the lookup field is disabled (we use it in a custom application where the name is shown instead and the Id hidden)

        Show
        Jacques Le Roux added a comment - The problem I reported appears only (in IE8 at least) if the lookup field is disabled (we use it in a custom application where the name is shown instead and the Id hidden)
        Hide
        Jacques Le Roux added a comment -

        Thanks Atul,

        Your patch is in trunk at r949844, R10.04 at r949847

        Show
        Jacques Le Roux added a comment - Thanks Atul, Your patch is in trunk at r949844, R10.04 at r949847
        Hide
        Atul Vani added a comment -

        Hi Jacques,

        prototype's fire() function works fine for me, I tried an alert() and it pops up in IE the way it should,
        the only problem i could see in my IE was description not being displayed.

        Here's some additional info.
        IE8 (version 8.0.6001.18813) (I didn't bothered to check for updates since like ages, so it might not be the latest)
        I found the problem for partyId lookup in https://localhost:8443/ordermgr/control/findorders and tested the fix on the same.

        Jacques, this is the part i didn't get "if the lookup field is disabled (we use it in a custom application where the name is shown instead and the Id hidden)"
        when/why do we disable the lookup field?

        I guess I failed to reproduce the problem, Please post the steps.

        Thanks & Regards
        Atul Vani

        Show
        Atul Vani added a comment - Hi Jacques, prototype's fire() function works fine for me, I tried an alert() and it pops up in IE the way it should, the only problem i could see in my IE was description not being displayed. Here's some additional info. IE8 (version 8.0.6001.18813) (I didn't bothered to check for updates since like ages, so it might not be the latest) I found the problem for partyId lookup in https://localhost:8443/ordermgr/control/findorders and tested the fix on the same. Jacques, this is the part i didn't get "if the lookup field is disabled (we use it in a custom application where the name is shown instead and the Id hidden)" when/why do we disable the lookup field? I guess I failed to reproduce the problem, Please post the steps. Thanks & Regards Atul Vani
        Hide
        Jacques Le Roux added a comment -

        Hi Atul,

        It's only when the lookup field is disabled, ie disabled="true". We use that because in this app the user see only the name not the Id (hidden in another related field). To prevent any issues witt the end user (not able to recall the names) we also disable the lookup field.

        HTH

        Show
        Jacques Le Roux added a comment - Hi Atul, It's only when the lookup field is disabled, ie disabled="true". We use that because in this app the user see only the name not the Id (hidden in another related field). To prevent any issues witt the end user (not able to recall the names) we also disable the lookup field. HTH

          People

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

            Dates

            • Created:
              Updated:

              Development