Olivier Heintz created OFBIZ-4975:
-------------------------------------

             Summary: updatePortletSeqDragDrop is not working in PortalPage 
management
                 Key: OFBIZ-4975
                 URL: https://issues.apache.org/jira/browse/OFBIZ-4975
             Project: OFBiz
          Issue Type: Bug
          Components: specialpurpose/myportal
            Reporter: Olivier Heintz
            Priority: Minor


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
{code}
             <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>
{code}

the error was to not use a second field, the correct code should be
{code}
             <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>
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to