[jira] [Commented] (OFBIZ-11743) Multiple menu item link parameters get lost if link type is layered-modal

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-11743) Multiple menu item link parameters get lost if link type is layered-modal

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-11743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17119696#comment-17119696 ]

Nicolas Malin commented on OFBIZ-11743:
---------------------------------------

[~uHeidfeld], I tried to reproduce and understand to find the root, but unsuccessfully.

I applied :
{code:patch}
diff --git a/framework/webtools/widget/ServiceScreens.xml b/framework/webtools/widget/ServiceScreens.xml
index a3545e1305..962b3a75b6 100644
--- a/framework/webtools/widget/ServiceScreens.xml
+++ b/framework/webtools/widget/ServiceScreens.xml
@@ -238,7 +238,10 @@ under the License.
                             <condition><if-has-permission permission="SERVICE_JM_LOCK"/></condition>
                             <widgets>
                                 <container style="button-bar">
-                                     <link target="AddJobManagerLock" text="${uiLabelMap.CommonAdd}" style="buttontext create" link-type="layered-modal"/>
+                                     <link target="AddJobManagerLock" text="${uiLabelMap.CommonAdd}" style="buttontext create" link-type="layered-modal">
+                                             <parameter param-name="1" value="true"/>
+                                             <parameter param-name="2" value="fal&amp;se"/>
+                                     </link>
                                 </container>
                             </widgets>
                         </section>
@@ -263,6 +266,8 @@ under the License.
             <widgets>
                 <decorator-screen name="PopUpDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
+                        <label text="1: ${parameters.1}"/>
+                        <label text="2: ${parameters.2}"/>
                         <include-form name="AddJobManagerLock" location="component://webtools/widget/ServiceForms.xml"/>
                     </decorator-section>
                 </decorator-screen>
{code}

But when I call the modal, the result is good.

This generate a link

{code:java}
<a href="javascript:void(0);" id="FindJobManagerLock_LF_1_link" data-dialog-params="{&quot;presentation&quot;:&quot;layer&quot; ,&quot;1&quot;: &quot;true&quot;,&quot;2&quot;: &quot;fal&amp;se&quot;}" data-dialog-width="800" data-dialog-height="600" data-dialog-url="AddJobManagerLock" data-dialog-title="Add" class="buttontext create">
           Add</a>
{code}

And in the modal my values are as attendee
 !Capture d’écran de 2020-05-29 17-11-58.png!

Can you help me to spot the problem raise in this issue ?


> Multiple menu item link parameters get lost if link type is layered-modal
> -------------------------------------------------------------------------
>
>                 Key: OFBIZ-11743
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-11743
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework/widget
>    Affects Versions: Release Branch 18.12, 17.12.03, Trunk
>            Reporter: Ulrich Heidfeld
>            Assignee: Ulrich Heidfeld
>            Priority: Minor
>              Labels: Modal, link, menu, menu-item
>         Attachments: Capture d’écran de 2020-05-29 17-11-58.png
>
>
> I got problems by opening a modal via menu link with two parameters. Only the first parameter is successfully accessible in modal's screens definition.
> Investigation revealed that for a menu link of type 'layered-modal' inline JS-Code get created with defined action-String. This String is used to set following context parameters.
> The problem is, that parameter concatenating expression '&' is not encoded like
> {code:java}
> // .../control/uri?param1=1&amp;param2=2
> {code}
>  
> My solution for this problem was to extend MacroMenuRenderer#renderLink by replacing 
> {code:java}
> &amp;{code}
> by '&'.
> Furthermore, this method shows that submitted parameters, defined between menus link tags, will be ignored, if link type is 'layered-modal'. So, within action-String, we have to submit parameters.
>   



--
This message was sent by Atlassian Jira
(v8.3.4#803005)