Flex: access to functions / components through mxml pages

For simplicity, I can say that I have two flex mxml pages.

form.mxml
button.mxml

If the following code was on the form.mxml page, it should work fine:

<custom:SelectView dSource="{_thedata}" id="form" visible="false">
</custom:SelectView>

<mx:LinkButton label="Show" id="lbShow" click="form.visible=true;>
<mx:LinkButton label="Show" id="lbHide" click="form.visible=false;>

But if the code was like:

form.mxml

 <custom:SelectView dSource="{_thedata}" id="form" visible="false">
 </custom:SelectView>

button.mxml

<mx:LinkButton label="Show" id="lbShow" click="form.visible=true;>
<mx:LinkButton label="Show" id="lbHide" click="form.visible=false;>

how can I call from button.mxml to change the .mxml form

---- a little more detail ---

My page looks like this: where is the query: AdvancedSearchFields basically includes the flex form on the page, and I want it to show / hide the user view below after the search is completed.

<query:AdvancedSearchFields searchType="projects" searchCategory="advanced" visible="true" id="AdvancedSearch" />

<custom:SelectView dSource="{_searchResults}" id="sv" visible="false">
+3
source share
3 answers

, . form.mxml .

, , , button.mxml . Button.mxml , , .

EDIT: , :

form.mxml

<custom:SelectView dSource="{_thedata}" id="form" visible="{buttons.showForm}">
</custom:SelectView>

<!-- include your buttons.mxml component using an ID of "buttons" -->

buttons.mxml

<mx:Script>
<![CDATA[
    [Bindable] public var showForm:Boolean = true;
]]>
</mx:Script>

<mx:LinkButton label="Show" id="lbShow" click="this.showForm=true;">
<mx:LinkButton label="Hide" id="lbHide" click="this.showForm=false;">

. , showForm , SelectView . , ( , ).

+4

button.mxml 'form', . :

Button.mxml:

<mx:Script>
<![CDATA[
    [Bindable] public var myForm:MyFormClass;
]]>
</mx:Script>

<mx:LinkButton label="Show" id="lbShow" click="myForm.form.visible=true;">
<mx:LinkButton label="Show" id="lbHide" click="myForm.form.visible=false;">

, Button.

0

, MVC, ​​ PureMVC. , , MXML, , . .

, ( ), . , .

0

Source: https://habr.com/ru/post/1698099/


All Articles