Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-6314 Widget Refactoring - Placeholder issue
  3. OFBIZ-6404

Allow form/grid widget hyperlinks to be grouped into a single column

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Implemented
    • Affects Version/s: Trunk
    • Fix Version/s: 16.11.01
    • Component/s: framework
    • Labels:
      None

      Description

      This issue was created from a Nicholas Malin's suggestion in OFBIZ-6402 to support hyperlink rendering similar to the original FTL that was replaced by the patch for that issue.

      1. flatgrey.png
        23 kB
        Nicolas Malin
      2. OFBIZ-6404_2.patch
        25 kB
        Christian Carlow
      3. OFBIZ-6404_3.patch
        25 kB
        Christian Carlow
      4. OFBIZ-6404.patch
        28 kB
        Nicolas Malin
      5. OFBIZ-6404.patch
        21 kB
        Nicolas Malin
      6. thomawak.png
        49 kB
        Nicolas Malin

        Issue Links

          Activity

          Hide
          soledad Nicolas Malin added a comment -

          Hey thanks Christian to open an issue with bits of my brain (just Nicholas is Russian name, I'm French so Nicolas )

          My first idea on this issue is to add the possibility to call <include-menu> in the grid/form or directly set the <menu> element for more visibility.

          <grid>
              <field name="partyId">...
              <field name="partyName">...
              <include-menu menu-name="PartyActionList" ...>
          </grid>
          

          or

          <grid>
              <field name="partyId">...
              <field name="partyName">...
              <menu name="PartyActionList">
                  <menu-item name="createNew" title="${uiLabelMap.AccountingBillingAccount}" >
                      <condition>
                          <if-service-permission service-name="acctgBasePermissionCheck" main-action="VIEW"/>
                      </condition>
                      <link target="/accounting/control/FindBillingAccount" url-mode="inter-app">
                          <parameter param-name="partyId"/>
                      </link>
                  </menu-item>
                  <menu-item name="PartyCommEvents" title="${uiLabelMap.PartyCommunications}" >
                      <link target="ListPartyCommEvents">
                          <parameter param-name="partyId"/>
                      </link>
                  </menu-item>
                  <menu-item name="findRequest" title="${uiLabelMap.PartyPartyRequests}" >
                      <condition>
                          <if-has-permission permission="ORDERMGR" action="_VIEW"/>
                      </condition>
                      <link target="/ordermgr/control/FindRequest" url-mode="inter-app">
                          <parameter param-name="lookupFlag" value="Y"/>
                          <parameter param-name="fromPartyId" from-field="partyId"/>
                          <parameter param-name="externaLoginKey" from-field="externalLoginKey"/>
                      </link>
                  </menu-item>...
              </menu>
          </grid>
          

          If some one have an other or better idea !

          Show
          soledad Nicolas Malin added a comment - Hey thanks Christian to open an issue with bits of my brain (just Nicholas is Russian name, I'm French so Nicolas ) My first idea on this issue is to add the possibility to call <include-menu> in the grid/form or directly set the <menu> element for more visibility. <grid> <field name= "partyId" >... <field name= "partyName" >... <include-menu menu-name= "PartyActionList" ...> </grid> or <grid> <field name= "partyId" >... <field name= "partyName" >... <menu name= "PartyActionList" > <menu-item name= "createNew" title= "${uiLabelMap.AccountingBillingAccount}" > <condition> < if -service-permission service-name= "acctgBasePermissionCheck" main-action= "VIEW" /> </condition> <link target= "/accounting/control/FindBillingAccount" url-mode= "inter-app" > <parameter param-name= "partyId" /> </link> </menu-item> <menu-item name= "PartyCommEvents" title= "${uiLabelMap.PartyCommunications}" > <link target= "ListPartyCommEvents" > <parameter param-name= "partyId" /> </link> </menu-item> <menu-item name= "findRequest" title= "${uiLabelMap.PartyPartyRequests}" > <condition> < if -has-permission permission= "ORDERMGR" action= "_VIEW" /> </condition> <link target= "/ordermgr/control/FindRequest" url-mode= "inter-app" > <parameter param-name= "lookupFlag" value= "Y" /> <parameter param-name= "fromPartyId" from-field= "partyId" /> <parameter param-name= "externaLoginKey" from-field= "externalLoginKey" /> </link> </menu-item>... </menu> </grid> If some one have an other or better idea !
          Hide
          ofbizzer Christian Carlow added a comment -

          Hey Nicolas,

          Both of your proposals seem reasonable to me but the first supports more modularity so its probably the more worthy of the two if only 1 is supported.

          Show
          ofbizzer Christian Carlow added a comment - Hey Nicolas, Both of your proposals seem reasonable to me but the first supports more modularity so its probably the more worthy of the two if only 1 is supported.
          Hide
          soledad Nicolas Malin added a comment -

          Ok, I created a first draft with only the model and rendering to add a menu in a form.

          I add a new MenuField called like this

                  <field name="cacheMenu" title=" " use-when="hasUtilCacheEdit"><menu name="ListCacheForm" location="component://webtools/widget/Menus.xml"/></field>
          

          To test, apply the patch on trunk, ant build start, and go to https://localhost:8443/webtools/control/FindUtilCache

          I'm really open to all suggestion !

          Show
          soledad Nicolas Malin added a comment - Ok, I created a first draft with only the model and rendering to add a menu in a form. I add a new MenuField called like this <field name= "cacheMenu" title= " " use-when= "hasUtilCacheEdit" ><menu name= "ListCacheForm" location= "component: //webtools/widget/Menus.xml" /></field> To test, apply the patch on trunk, ant build start , and go to https://localhost:8443/webtools/control/FindUtilCache I'm really open to all suggestion !
          Hide
          ofbizzer Christian Carlow added a comment -

          Hey Nicolas,

          The patch works for me. Is there other work that needs to be done before committing?

          Show
          ofbizzer Christian Carlow added a comment - Hey Nicolas, The patch works for me. Is there other work that needs to be done before committing?
          Hide
          ofbizzer Christian Carlow added a comment -

          Hey Nicolas,

          Menu items with link-type="hidden-form" are not handled by this patch. For some reason the hidden form doesn't even get rendered so the anchor href javascript:document.form.submit() does nothing. If his is committed as is then devs will have to make sure the links aren't of type hidden-form for the links to work. This is fairly minor for menus but I was going to build off your patch and support forms to be embedded within forms but the same problem exists.

          Discussions about a higher level widget like grid or column between screen and forms seem likely to handle the form within form functionality. Those enhancements seem to get closer to being able to replace more complex FTL orderitems.ftl with widgets.
          https://issues.apache.org/jira/browse/OFBIZ-6314
          http://ofbiz.135035.n4.nabble.com/Widget-Overhaul-td4661774.html

          Show
          ofbizzer Christian Carlow added a comment - Hey Nicolas, Menu items with link-type="hidden-form" are not handled by this patch. For some reason the hidden form doesn't even get rendered so the anchor href javascript:document.form.submit() does nothing. If his is committed as is then devs will have to make sure the links aren't of type hidden-form for the links to work. This is fairly minor for menus but I was going to build off your patch and support forms to be embedded within forms but the same problem exists. Discussions about a higher level widget like grid or column between screen and forms seem likely to handle the form within form functionality. Those enhancements seem to get closer to being able to replace more complex FTL orderitems.ftl with widgets. https://issues.apache.org/jira/browse/OFBIZ-6314 http://ofbiz.135035.n4.nabble.com/Widget-Overhaul-td4661774.html
          Hide
          ofbizzer Christian Carlow added a comment -

          This is a revised patch of the original so that the menu column rendering is handled the same as a display field instead of an edit one because otherwise menu items with link-type="hidden-form" get wrapped in the edit form causing html forms within forms which is against the recommended standard.

          Menu items of type hidden form were also modified so that the itemIndex is extracted from the context if it exists and appended to the end of the form id otherwise duplicate id names occur preventing the anchor link href javascript hidden form submission by id from succeeding. Hopefully this doesn't break other functionality involving menus such as ModelTree.

          Show
          ofbizzer Christian Carlow added a comment - This is a revised patch of the original so that the menu column rendering is handled the same as a display field instead of an edit one because otherwise menu items with link-type="hidden-form" get wrapped in the edit form causing html forms within forms which is against the recommended standard. Menu items of type hidden form were also modified so that the itemIndex is extracted from the context if it exists and appended to the end of the form id otherwise duplicate id names occur preventing the anchor link href javascript hidden form submission by id from succeeding. Hopefully this doesn't break other functionality involving menus such as ModelTree.
          Hide
          adrianc@hlmksw.com Adrian Crum added a comment -

          The widget model changes look okay to me. I don't have time to review the entire patch.

          Show
          adrianc@hlmksw.com Adrian Crum added a comment - The widget model changes look okay to me. I don't have time to review the entire patch.
          Hide
          ofbizzer Christian Carlow added a comment -

          The newest patch was modified and incorporated into OFBIZ-6501. <menu> was changed to <include-menu>, consistent with <include-form> <include-grid> and <include-screen>. <grid> and <form> already exist as tags in form definitions so prefixing with <includ- was necessary and consistent with the way screens and grids are included in screen definitions.

          Show
          ofbizzer Christian Carlow added a comment - The newest patch was modified and incorporated into OFBIZ-6501 . <menu> was changed to <include-menu>, consistent with <include-form> <include-grid> and <include-screen>. <grid> and <form> already exist as tags in form definitions so prefixing with <includ- was necessary and consistent with the way screens and grids are included in screen definitions.
          Hide
          soledad Nicolas Malin added a comment -

          Christian the patch application failed on trunk 1685656. Are you sure on your git diff ?

          I use just :

          patch -p0 < /tmp/OFBIZ-6404_2.patch 
          

          and have a result like

          .... 2 out of 2 hunks FAILED -- saving rejects to file framework/widget/src/org/ofbiz/widget/artifact/ArtifactInfoGatherer.java.rej
          patching file framework/widget/src/org/ofbiz/widget/model/FieldInfo.java
          Hunk #1 FAILED at 61 (different line endings).
          Hunk #2 FAILED at 86 (different line endings).
          2 out of 2 hunks FAILED -- saving rejects to file framework/widget/src/org/ofbiz/widget/model/FieldInfo.java.rej
          patching file framework/widget/src/org/ofbiz/widget/model/ModelFieldVisitor.java
          Hunk #1 FAILED at 31 (different line endings).
          Hunk #2 FAILED at 71 (different line endings).
          2 out of 2 hunks FAILED -- saving rejects to file framework/widget/src/o.....
          
          Show
          soledad Nicolas Malin added a comment - Christian the patch application failed on trunk 1685656. Are you sure on your git diff ? I use just : patch -p0 < /tmp/OFBIZ-6404_2.patch and have a result like .... 2 out of 2 hunks FAILED -- saving rejects to file framework/widget/src/org/ofbiz/widget/artifact/ArtifactInfoGatherer.java.rej patching file framework/widget/src/org/ofbiz/widget/model/FieldInfo.java Hunk #1 FAILED at 61 (different line endings). Hunk #2 FAILED at 86 (different line endings). 2 out of 2 hunks FAILED -- saving rejects to file framework/widget/src/org/ofbiz/widget/model/FieldInfo.java.rej patching file framework/widget/src/org/ofbiz/widget/model/ModelFieldVisitor.java Hunk #1 FAILED at 31 (different line endings). Hunk #2 FAILED at 71 (different line endings). 2 out of 2 hunks FAILED -- saving rejects to file framework/widget/src/o.....
          Hide
          ofbizzer Christian Carlow added a comment -

          Hey Nicolas,

          I was able to apply the patch to the svn trunk without problems in eclipse. I'm attaching the svn diff after the git patch was applied from eclipse.

          Show
          ofbizzer Christian Carlow added a comment - Hey Nicolas, I was able to apply the patch to the svn trunk without problems in eclipse. I'm attaching the svn diff after the git patch was applied from eclipse.
          Hide
          soledad Nicolas Malin added a comment -

          Arf, same result ....

          Show
          soledad Nicolas Malin added a comment - Arf, same result ....
          Hide
          soledad Nicolas Malin added a comment - - edited

          Ok, I didn't found any reason that the patch failed, I reapply it by hand

          Christian Carlow Ok thanks for your review and correction on hidden-form. I continue the improve the patch with your corrections and :

          • adding new menu type on CommonMenu.xml CommonInlineBarMenu
          • adding new css class in-line-bar
          • implement css class ion thomawak and flatgrey themes (see screenshot)

          The css is just a testing (I'm not a css expert )

          If it's OK I will merge it and check the global issue OFBIZ-6501

          I forgot: thanks Adrian Crum for your review is an important for us !

          Show
          soledad Nicolas Malin added a comment - - edited Ok, I didn't found any reason that the patch failed, I reapply it by hand Christian Carlow Ok thanks for your review and correction on hidden-form. I continue the improve the patch with your corrections and : adding new menu type on CommonMenu.xml CommonInlineBarMenu adding new css class in-line-bar implement css class ion thomawak and flatgrey themes (see screenshot) The css is just a testing (I'm not a css expert ) If it's OK I will merge it and check the global issue OFBIZ-6501 I forgot: thanks Adrian Crum for your review is an important for us !
          Hide
          soledad Nicolas Malin added a comment -

          done on trunk at revision 1686116

          Show
          soledad Nicolas Malin added a comment - done on trunk at revision 1686116

            People

            • Assignee:
              soledad Nicolas Malin
              Reporter:
              ofbizzer Christian Carlow
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development