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

updatePortletSeqDragDrop is not working in PortalPage management

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Abandoned
    • Release Branch 13.07, Release Branch 14.12, Release Branch 15.12
    • None
    • myportal
    • None
    • Bug Crush Event - 21/2/2015

    Description

      When you try to change Portlet order in a PortalPage, most of the time it does'nt work.
      To show why, I start to change in minilang service, calculate attribute by a set

                   <iterate entry="modifyPp" list="modifyPpList">
                       <if-empty field="modifyPp.sequenceNum">
                           <set field="modifyPp.sequenceNum" value="newSequenceNo"/>
                           <else>
      -                        <calculate field="modifyPp.sequenceNum" type="Long">
      -                            <calcop operator="add" field="newSequenceNo">
      -                                <calcop operator="get" field="increase"/>
      -                            </calcop>
      -                        </calculate>
      -                        <calculate field="increase" type="Long">
      -                            <calcop operator="add" field="increase">
      -                                <calcop operator="get" field="increase"/>
      -                            </calcop>
      -                        </calculate>
      +                      <set field="modifyPp.sequenceNum" from="newSequenceNo+increase" />
      +                      <set field="increase" from="increase+increase" />
                           </else>
                       </if-empty>
                       <store-value value-field="modifyPp"/>
                   </iterate>
      

      the error was to not use a second field, the correct code should be

                   <iterate entry="modifyPp" list="modifyPpList">
                       <if-empty field="modifyPp.sequenceNum">
                           <set field="modifyPp.sequenceNum" value="newSequenceNo"/>
                           <else>
                            <if-empty field="newValue">
                                <set field="newValue" from="increase"/>
                            </if-empty>
                            <set field="modifyPp.sequenceNum" from="newSequenceNo+newValue" />
                            <set field="newValue" from="newValue+increase"/>
                           </else>
                       </if-empty>
                       <store-value value-field="modifyPp"/>
                   </iterate>
      

      Attachments

        1. OFBIZ-4975.patch
          2 kB
          Olivier Heintz

        Activity

          People

            erwan Erwan de Ferrieres
            holivier Olivier Heintz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: