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

Sort Links in Lookup for Data Resource Id causes unwanted behaviour on Find Content page

    Details

      Description

      How to reproduce :
      1. Log in the Content component
      2. Go to the Content tab. https://localhost:8443/content/control/findContent
      3. In the search form, open the lookup of the field ' Data Resource Id '
      4. Click on any of the table header links to sort the table. Results will be displayed on a new unstyled window closing the Lookup dialog.

      1. screenshot-1.png
        58 kB
        Aditya Sharma
      2. OFBIZ-9280.patch
        2 kB
        Aditya Sharma
      3. OFBIZ-9280.patch
        2 kB
        Aditya Sharma

        Activity

        Hide
        aditya.sharma Aditya Sharma added a comment -

        Problem:
        1. Lookup dialog for dataResourceId uses "ListLookupDataResource" form to list Data Resource records.
        2. "ListLookupDataResource" form extends "ListDataResource" form for all the fields.
        3. Sort-field is set to true in "ListDataResource" form for all the fields.
        4. Sort-field adds <a> hyperlink to "LookupResource" .
        5. When clicked <a> link it moves to a new page and doesn't renders the response in the Lookup dialog.
        Solution:
        First of all it is a lookup to select DataResourceId so as the pattern followed in other lookups in OFBiz it should not have any sort-fields.To set it false, it should be overridden. If all fields needs to be overridden it is better not to extend "ListDataResource" form and add these fields right away.
        Apart from that added 'widget-style="smallSubmit"' to dataResourceId according to the uniform pattern followed.

        Show
        aditya.sharma Aditya Sharma added a comment - Problem: 1. Lookup dialog for dataResourceId uses "ListLookupDataResource" form to list Data Resource records. 2. "ListLookupDataResource" form extends "ListDataResource" form for all the fields. 3. Sort-field is set to true in "ListDataResource" form for all the fields. 4. Sort-field adds <a> hyperlink to "LookupResource" . 5. When clicked <a> link it moves to a new page and doesn't renders the response in the Lookup dialog. Solution: First of all it is a lookup to select DataResourceId so as the pattern followed in other lookups in OFBiz it should not have any sort-fields.To set it false, it should be overridden. If all fields needs to be overridden it is better not to extend "ListDataResource" form and add these fields right away. Apart from that added 'widget-style="smallSubmit"' to dataResourceId according to the uniform pattern followed.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Hi Aditya,

        I tried to apply your patch on trunk HEAD but it seems deprecated. Please create a new one, thanks.

        Show
        jacques.le.roux Jacques Le Roux added a comment - Hi Aditya, I tried to apply your patch on trunk HEAD but it seems deprecated. Please create a new one, thanks.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Aditya,

        Not suite sure, but I think I mixed up issues when I asked you the same for OFBIZ-7759. Anyway it's done now

        Show
        jacques.le.roux Jacques Le Roux added a comment - Aditya, Not suite sure, but I think I mixed up issues when I asked you the same for OFBIZ-7759 . Anyway it's done now
        Hide
        aditya.sharma Aditya Sharma added a comment -

        Thanks Jacques for the review I will update all my previous patches too with latest revision.

        Show
        aditya.sharma Aditya Sharma added a comment - Thanks Jacques for the review I will update all my previous patches too with latest revision.
        Hide
        aditya.sharma Aditya Sharma added a comment -

        Updated patch according to latest revision.

        Show
        aditya.sharma Aditya Sharma added a comment - Updated patch according to latest revision.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Hi Aditya,

        It kinda works but not really because the columns are no longer sortable. There is a good side effect, the size of the view works when it does not w/o the patch

        Show
        jacques.le.roux Jacques Le Roux added a comment - Hi Aditya, It kinda works but not really because the columns are no longer sortable. There is a good side effect, the size of the view works when it does not w/o the patch
        Hide
        aditya.sharma Aditya Sharma added a comment -

        Hi Jacques,
        I took various other references of List forms from ofbiz but can't find one with sortable in Lookup. When we make a field as sort true, it adds <a> to table headings and <a> always opens up to a new page. So its better to remove sort as its support may not be applicable to a lookup dialog. If I am missing something, please guide me with that.

        Show
        aditya.sharma Aditya Sharma added a comment - Hi Jacques, I took various other references of List forms from ofbiz but can't find one with sortable in Lookup. When we make a field as sort true, it adds <a> to table headings and <a> always opens up to a new page. So its better to remove sort as its support may not be applicable to a lookup dialog. If I am missing something, please guide me with that.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Thanks Aditya,

        Your slightly modidied patch is in
        trunk r1789863
        R16.11 r1789864
        R15.12 r1789865
        R14.12 r1789866

        I simply added the header-row-style="header-row-2" style

        Show
        jacques.le.roux Jacques Le Roux added a comment - Thanks Aditya, Your slightly modidied patch is in trunk r1789863 R16.11 r1789864 R15.12 r1789865 R14.12 r1789866 I simply added the header-row-style="header-row-2" style
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        BTW Aditya,

        The same problem exists in the ListLookupContent that you fixed for another reason at OFBIZ-7759. Could you please apply the same there?

        Show
        jacques.le.roux Jacques Le Roux added a comment - BTW Aditya, The same problem exists in the ListLookupContent that you fixed for another reason at OFBIZ-7759 . Could you please apply the same there?
        Hide
        aditya.sharma Aditya Sharma added a comment -

        Thank Jacques I have already created a separate ticket for ListLookupContent too as OFBIZ-9279.

        Show
        aditya.sharma Aditya Sharma added a comment - Thank Jacques I have already created a separate ticket for ListLookupContent too as OFBIZ-9279 .
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Great, thanks Aditya

        Show
        jacques.le.roux Jacques Le Roux added a comment - Great, thanks Aditya

          People

          • Assignee:
            jacques.le.roux Jacques Le Roux
            Reporter:
            aditya.sharma Aditya Sharma
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development