Piotr Zarzycki created FLEX-35310:
-------------------------------------
Summary: Issue with same Id assigned to components in different
views
Key: FLEX-35310
URL: https://issues.apache.org/jira/browse/FLEX-35310
Project: Apache Flex
Issue Type: Bug
Affects Versions: Apache FlexJS 0.8.0
Reporter: Piotr Zarzycki
Attachments: DoubleIdIssue.zip, DoubleMDLIdIssue.zip,
two_spans_with_same_id.png
*Issue:*
Components in old Flex SDK could have same "Id" in different. Unfortunately in
FlexJS assigning same "Id" for components laying out in different views cause
major problems with behavior of those components in HTML.
*Scenario:*
I've created two small examples (both contains already built application - you
can run it from target/javascript/bin/js-debug/index.html):
1) Built with pure Basic components
- FirstView and SecondView file has following code:
{code}
<?xml version="1.0"?>
<js:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/flexjs/basic">
<js:Label id="lblView" text="My Label First View"/>
</js:Group>
{code}
- View usage:
{code}
<js:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/flexjs/basic"
xmlns:views="views.*">
<js:beads>
<js:VerticalLayout />
</js:beads>
<views:FirstView width="100" height="50"/>
<views:SecondView width="100" height="50"/>
</js:View>
{code}
*Results:* Attached image: "two_spans_with_same_id.png"
2) Built with MDL only components.
- View1 and View2 file has following code:
{code}
<?xml version="1.0"?>
<mdl:Grid xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mdl="library://ns.apache.org/flexjs/mdl"
xmlns:js="library://ns.apache.org/flexjs/basic"
xmlns:models="models.*"
width="100">
<mdl:model>
<models:MenuModel id="menuModel"/>
</mdl:model>
<mdl:Button id="menu_btn2" text="Menu Button 2" width="100"/>
<mdl:Menu dataMdlFor="menu_btn2" ripple="true" bottom="true"
left="false"
labelField="label" className="customMenuItemRenderer">
<mdl:beads>
<js:ConstantBinding
sourceID="menuModel"
sourcePropertyName="menuItems"
destinationPropertyName="dataProvider" />
</mdl:beads>
</mdl:Menu>
</mdl:Grid>
{code}
- View usage:
{code}
<?xml version="1.0"?>
<mdl:NavigationLayout xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mdl="library://ns.apache.org/flexjs/mdl"
xmlns:views="views.*">
<mdl:NavigationLayoutContent>
<views:View1 height="100" width="200"/>
<views:View2 height="100" width="200"/>
</mdl:NavigationLayoutContent>
</mdl:NavigationLayout>
{code}
*Results:*
View1 and View2 contains "Menu" which is associated to some button. In this
case second menu is not working at all. - Once I change "Id" for one of the
menu in - both started to work. - But this is definitely not a solution.
*Expected results:*
FlexJS should allow for declaring same "Id" value in different view.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)