You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Jacques Le Roux (Jira)" <ji...@apache.org> on 2022/06/07 12:51:00 UTC
[jira] [Commented] (OFBIZ-12628) MenuItem doesn't follow correctly extend information
[ https://issues.apache.org/jira/browse/OFBIZ-12628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17550980#comment-17550980 ]
Jacques Le Roux commented on OFBIZ-12628:
-----------------------------------------
Hi Nicolas,
It works, I mean, when getting to https://localhost:8443/partymgr/control/findparty, I get the right title and target for SecondMenu when using:
{code:xml}
applications/party/widget/partymgr/PartyMenus.xml | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/applications/party/widget/partymgr/PartyMenus.xml b/applications/party/widget/partymgr/PartyMenus.xml
index f36741832f..f19683d367 100644
--- a/applications/party/widget/partymgr/PartyMenus.xml
+++ b/applications/party/widget/partymgr/PartyMenus.xml
@@ -37,6 +37,18 @@
<menu-item name="partyinv" title="${uiLabelMap.PartyInvitation}"><link target="partyInvitation"/></menu-item>
<menu-item name="importexport" title="${uiLabelMap.CommonImportExport}"><link target="ImportExport"/></menu-item>
</menu>
+
+<menu name="FirstMenu" extends="CommonInlineBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
+ <menu-item name="MyItem" title="test1">
+ <link target="GoAction" />
+ </menu-item>
+</menu>
+<menu name="SecondMenu" extends="FirstMenu">
+ <menu-item name="MyItem2" title="test2">
+ <link target="GoAction2" />
+ </menu-item>
+</menu>
+
applications/party/widget/partymgr/PartyScreens.xml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/applications/party/widget/partymgr/PartyScreens.xml b/applications/party/widget/partymgr/PartyScreens.xml
index 26966e4049..631b212efe 100644
--- a/applications/party/widget/partymgr/PartyScreens.xml
+++ b/applications/party/widget/partymgr/PartyScreens.xml
@@ -42,7 +42,9 @@ under the License.
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="pre-body">
- <include-menu name="MainActionMenu" location="component://party/widget/partymgr/PartyMenus.xml"/>
+ <!-- <include-menu name="MainActionMenu" location="component://party/widget/partymgr/PartyMenus.xml"/> -->
+ <include-menu name="SecondMenu" location="component://party/widget/partymgr/PartyMenus.xml"/>
+
</decorator-section>
<decorator-section name="body">
<platform-specific><html><html-template multi-block="true" location="component://common-theme/template/includes/SetMultipleSelectJs.ftl"/></html></platform-specific>
{code}
I though noticed something weird: both test 1 and test2 menus show. Do I miss something?
> MenuItem doesn't follow correctly extend information
> ----------------------------------------------------
>
> Key: OFBIZ-12628
> URL: https://issues.apache.org/jira/browse/OFBIZ-12628
> Project: OFBiz
> Issue Type: Bug
> Components: framework/widget
> Affects Versions: 22.01.01, Upcoming Branch
> Reporter: Nicolas Malin
> Assignee: Nicolas Malin
> Priority: Minor
> Attachments: OFBIZ-12628.patch
>
>
> When you use two menus where the second extend the first, menu item and menu link aren't propage correctly.
> The menu items and menu link presents on the second menu already have the first menu on their model.
>
> {code:java}
> <menu name="FirstMenu" extends="CommonInlineBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
> <menu-item name="MyItem">
> <link target="GoAction"/>
> </menu-item>
> </menu>
> <menu name="SecondMenu" extends="FirstMenu"/> {code}
> The result, if during the rendering some information are generate from the menu, in the previous case, it's always the "FirstMenu" that would be use.
> To solve it and don't break the thread safe pattern, I introduce two new constructor for ModelItem and MenuLink for duplicate the ModelMenuItem and MenuLink in memory with the new parent.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)