apache-flex WindowShade和CollapsibleAccordion问题,从Flex3迁移到Flex4

osh3o9ms  于 2022-11-01  发布在  Apache
关注(0)|答案(1)|浏览(122)

我的代码中有两个问题:
首先:是使用WindowShade。我在我的应用程序中有一个WindowShade,当我点击运行它的时候,一切都挂起了。当我使用Flex3编译的时候,它工作得很好。
代码如下所示:

<mdi_containers:MDIWindow xmlns:mdi_containers="flexlib.mdi.containers.*"
xmlns:flexlib_controls="flexlib.controls.*"                
xmlns:mx="http://www.adobe.com/2006/mxml"      
xmlns:containers="flexlib.containers.*"
          width="800" layout="absolute"
          height="500" title="News Articles"       
          textAlign="center"
          verticalGap="0" horizontalGap="0"
      minWidth="800"
          minHeight="500">
    <mx:Canvas  width="100%" styleName="roundedBottomCorner">

    <containers:WindowShade id="wshade_fox" top="0" width="100%" opened="false" visible="true"
            openIcon="{null}" closeIcon="{null}" paddingTop="0" 
            headerRenderer="{new ClassFactory(c7.views.components.news.header)}">                                              
<mx:VBox horizontalScrollPolicy="off" width="100%" height="225" verticalGap="0" horizontalGap="0">
</mx:VBox>                                     
                        </containers:WindowShade>                                           
</mx:Canvas>

第二:CollapsibleAccordion。我在CollapsibleAccordion里面有两块画布,在Flex4中一切都很好,但唯一的问题是,我无法看到画布上的标签。
此问题的代码如下:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"                
            xmlns:cal="cal.*"
            layout="absolute"
            addedToStage="stage_init()"
applicationComplete="init()"                            
        xmlns:geometry="com.degrafa.geometry.*"
        xmlns:degrafa="com.degrafa.*"
        xmlns:paint="com.degrafa.paint.*"
        xmlns:containers="flexlib.containers.*"
        xmlns:flexlib_controls="flexlib.controls.*"
        xmlns:mdi_containers="flexlib.mdi.containers.*"
        xmlns:auto="com.hillelcoren.components.*" 
        xmlns:local="*" backgroundColor="#f7fafe" backgroundGradientColors="[#f7fafe, #6caaeb]"
        xmlns:components="CollapsibleAccordion.*"
        xmlns:notifications="c7.views.components.notifications.*"
        xmlns:dbview="c7.views.apps.dashboard.*"
        modalTransparency="0.8" preloader="c7.views.components.Pre"
        modalTransparencyColor="0x000000" verticalScrollPolicy="auto"
        backgroundSize="100%"               
        xmlns:components1="c7.views.components.*" 
        xmlns:notification="c7.views.components.notification.*" 
        xmlns:news="c7.views.components.news.*">    
    <mdi_containers:MDICanvas id="mdic" horizontalScrollPolicy="off" verticalScrollPolicy="off"
        visible="{!GlobalModel.getInstance().dashboard_mode}"
         minWidth="{top_bar.width}"
        width="100%" height="100%" top="{top_bar.height}" backgroundAlpha="0">                              
       <mx:Canvas id="cvs_widget_bar" right="0" top="0" height="100%">
            <components:CollapsibleAccordion id="collapsibleAccordion1" height="100%" top="0" right="0"
                orientation="left" barSize="30" currentWidth="30" openSize="150"
                drawerButtonStyle="drawerButton" closeButtonStyle="drawerCloseRight" accordianStyle="drawerAccordion">
                <mx:Canvas width="100%" top="0" right="0" height="100%" label="Widget Bar">

                </mx:Canvas>
                <mx:Canvas width="100%" height="100%" label="Feedback" icon="{IconUtility.getClass(cvs_comment,'assets/cloud_main/images/article-48x48.png')}"
                    id="cvs_comment" top="0" right="0">

                </mx:Canvas>
            </components:CollapsibleAccordion>
        </mx:Canvas>
qxsslcnc

qxsslcnc1#

从Flex 3升级到Flex 4时,我遇到了类似的问题。我必须为headerClass定义一个按钮。因为我有一堆WindowShade,所以我在样式表中添加了:

flexlib|WindowShade {
   headerClass:ClassReference("mx.controls.Button");
}

或者,如果需要,在声明WindowShade时,可以在MXML中添加:

headerClass="mx.controls.Buttons"

...这样,您的“wshade_fox”声明看起来就像这样:

<containers:WindowShade id="wshade_fox" top="0" width="100%" opened="false" visible="true"
        openIcon="{null}" closeIcon="{null}" paddingTop="0" 
        headerRenderer="{new ClassFactory(c7.views.components.news.header)}"
        headerClass="mx.controls.Button">

希望这对你的第一个问题有帮助。

相关问题