ViewStack - some pages call functions, others not

I have a mxml project file.  It has a Viewstack with 2 views (page 1 and page 2).

Page 1 has 5 chkboxes and 5 buttons.

You click a chkbox 1, and she calls a function that disables the button 1.

Then you goto Page 2, which simply shows the same 5 buttons with button 1 disabled.

Now go back to Page 1 and click chkbox 2, which disables the button 2.

Next, goto Page 2 and you'll see the button disabled 1, but 2 key is always enabled.

I still back and forth between Page 1 and Page 2, by clicking on the chkboxes

Page 1 keeps track of those who have been disabled, but Page 2 remembers only the disabling of button 1.

Using trace(), I found that the function that performs the deactivation on the re - view Page 2, is called only from the first posting of the Page 2.

I tried many different approaches, including "creationPolicy" variants, and nothing has worked.

How can I get Page 2 to call the function on the poster again?

Follows all of the code, if necessary.

<? XML version = "1.0" encoding = "utf-8"? >

< mx:Application

' xmlns:mx = ' http://www.Adobe.com/2006/MXML

"

layout ='

vertical "

>

< mx:Script >

<! [CDATA]

public var = buttonStates:Array [real true true true true ]

];

//------------------------------------------

public function

getState(ndx:int):Boolean

{

return

buttonStates [ndx];

}

//------------------------------------------

public function setFalse(ndx:int):

Sub

{

disable the button now

var mybtn:string = "pg1Btn"

+ String (ndx);

ce [mybtn] = true fake

;

for a future view (at Page 2)

[ndx] = buttonStates

fake

;

}

//------------------------------------------

public function goPage1():

Sub

{pageStack.selectedIndex = 0 ;}

Page 1

//------------------------------------------

public function goPage2():

Sub

{pageStack.selectedIndex = 1 ;}

page 2

//------------------------------------------

[]] >

< / mx:Script >

< mx:ViewStack

id=" pageStack "width =" " 100% "height =" " 100% " >

<!--> PAGE 1

< mx:VBox

id=" Page1 "width =" " 100% "

>

< mx:VBox id=" pg1header "width =" " 100% " >

< mx:Text " text = ' Page 1 - click on the check only ONE box "fontSize =" " 30 " />

< / mx:VBox >

< mx:HBox id=" pg1boxes "width =" " 100% "

>

< mx:VBox id=" pg1chkboxes "fontSize =" " 16 "

>

< mx:CheckBox id=" chkbox0 "label =" " ChkBox 0 "click =" setFalse (0) ""

/ >

< mx:CheckBox id=" chkbox1 "label =" " ChkBox 1 "click =" setFalse (1) ""

/ >

< mx:CheckBox id=" chkbox2 "label =" " ChkBox 2 "click =" setFalse (2) ""

/ >

< mx:CheckBox id=" chkbox3 "label =" " ChkBox 3 "click =" setFalse (3) ""

/ >

< mx:CheckBox id=" chkbox4 "label =" " ChkBox 4 "click =" setFalse (4) ""

/ >

< / mx:VBox >

< mx:VBox id=" pg1buttons "fontSize =" " 16 " >

< mx:Button id=" pg1Btn0 "label =" " 0 key "enabled =" " {}getState(0)} "

/ >

< mx:Button id=" pg1Btn1 "label =" " Button 1 "enabled =" " {getState(1)} "

/ >

< mx:Button id=" pg1Btn2 "label =" " Button 2 "enabled =" " {getState(2)} "

/ >

< mx:Button id=" pg1Btn3 "label =" " Button 3 "enabled =" " {getState(3)} "

/ >

< mx:Button id=" pg1Btn4 "label =" " Button 4 "enabled =" " {getState(4)} "

/ >

< / mx:VBox >

< / mx:HBox >

< mx:VBox >

< mx:Button id=" pg2Btnxfer "label =" " Go to Page 2 "fontSize =" " 24

"

Click = "{goPage2 ()}" "

/ >

< / mx:VBox >

< / mx:VBox >

<! - PAGE 2 - >

< mx:VBox

id=" Page2 "width =" " 100% "

>

< mx:VBox id=" pg2header "width =" " 100% " >

< mx:Text " text = ' Page 2 - getting the button inactive? "fontSize =" " 30 "

/ >

< / mx:VBox >

< mx:HBox id=" pg2hbox "width =" " 100% "

>

< mx:VBox id=" pg2vbox1 "width =" " 50% "

>

< mx:Button id=" pg2button "label =" " Return to Page 1 "fontSize =" " 24

"

Click = "goPage1 ()" "

/ >

< / mx:VBox >

< mx:VBox id=" pg2vbox2 "width =" " 25% " >

< mx:Button id=" pg3Btn0 "label =" " 0 key "enabled =" " {getState(0)} "

/ >

< mx:Button id=" pg3Btn1 "label =" " Button 1 "enabled =" " {getState(1)} "

/ >

< mx:Button id=" pg3Btn2 "label =" " Button 2 "enabled =" " {getState(2)} "

/ >

< mx:Button id=" pg3Btn3 "label =" " Button 3 "enabled =" " {getState (3)} "

/ >

< mx:Button id=" pg3Btn4 "label =" " Button 4 "enabled =" " {}getState(4)} "

/ >

< / mx:VBox >

< / mx:HBox >

< / mx:VBox >

< / mx:ViewStack >

< / mx:Application >

Hello

He now works as written.

permit property for each button on page 2 called on creation. Change in current page is not willing to remove all components and recreate after the back passage.

The link is something very useful gor the snd, it's much easier.

The first change:

[Bindable]

public var buttonStates:ArrayCollection = new ArrayCollection ([true, true, true, true, true]);

Collection ArrayCollection can be used in the bindings Array - not.

After this affair allowed another property to the data in the ArrayCollection collection. Also, you can link the Page1 buttons like this and remove the string

This [mybtn] true = false; service public setFalse(ndx:int)

:

/>

/>

/>

/>

/>

Tags: Flex

Similar Questions

  • Impossible to move the mouse cursor using the trackpad on laptop Sony and some of its functions does not work.

    Former title: Sony trackpad not working no-Windows 8

    Hi guys,.

    I have a sony vaio s series that I bought last January. It comes preinstalled with windows 8, and I use it only about 2 - 3 times a week. 2 weeks ago my trackpad stopped working because I can't move my cursor. I can zoom in and zoom out, and other things, but there is a problem with some functions of the trackpad. I checked the synaptic driver and it says that it is up-to-date.
    now, I suspected that it might be a hardware problem, so I sent it to sony Service Center because it is still under warranty. Unfortunately, it is not the case and I was informed that it's a software problem. They advise me reinstall windows 8 because it is the only solution to the problem, they believe. (I want to clarify that it is probably not Fn + F1, as when I start the laptop, the trackpad works perfectly fine for about 30 secods and suddenly Soundtracks autour after that).
    I hesitate to do because it is a daunting task and I'm not really intuitive with such things. I wonder if you have any suggestions or if anyone has experienced the same problem.
    My hunch is that a windows update is responsible for this, but I'm not entirely sure. Indeed, 3 weeks after I bought my laptop, that this has already happened to my once but after the reboot, the trackpad has worked well. now even by restarting the computer does not help. Basically, I have to use a mouse which is not convenient when I'm on the road...
    Thank you very much! appreciate any help I can get, really. I'm about to want to sell my new laptop T_T

    I finally solved the problem. I reinstalled the driver in safe MODE. Hope it could be useful to someone else

  • Create some pages BW and others of color in the same document in pdf.

    Hello

    I want to create my pdf documents but the first page color and BW (gray) other pages.

    Can we do this generation of pdf?

    To be more precise, we do no claim themselves or generic PDF creators who have settings on a page-by-page basis to force the conversion of color to grayscale during the PDF creation process itself. This includes all Adobe applications and the functionality provided by Acrobat.

    The easiest way to achieve this would be to create a PDF file of the first page in color, then create a separate PDF file of the remaining pages using parameters to force grayscale for this file. (Such an arrangement is easily achievable in Adobe InDesign, for example, but not in other applications, including printing to the instance of Adobe PDF PostScript Windows printer driver). Then, combine the two files in Acrobat and save the result.

    Alternatively, you can create two files of color and then after creating the file, use Acrobat Preflight for the second file to grayscale and then combine them as above.

    -Dov

  • Some pages showing don't not the columns correctly since FF 37.0.1 update

    The problem showed up on a few pages on Lynda.com. IE 11 is not the problem.

    Here's a screenshot of a problem on Lynda.com in FF page, showing the column displays incorrectly:

    https://support.CDN.Mozilla.NET/media/uploads/images/2015-04-08-23-33-54-0d7e35.PNG

    And here is a screenshot of the same page in IE 11, is not displayed correctly:

    https://support.CDN.Mozilla.NET/media/uploads/images/2015-04-08-23-35-00-77f7ad.PNG

    Steps of troubleshooting so far:
    1 Refresh FF. No joy.
    2 disable all add-ons. No joy.
    3. run FF in safe mode. No joy.

    Nevermind, I fixed it. Changed some settings of Java, then changed their return.

  • Some pages don't is not loading. FF30 downloads a strange file.

    Hello

    When I try to view certain web pages, Firefox says "Download began" and saves a strange file in the download on my Android phone folder without displaying web content. Whenever I have to go to the download folder and remove the file/files.

    This symptom occurred after the update to version 30. Using android 4.3.

    (please try to visit www.avea.com.tr. Downloaded file names: dw + 5hStx, pFjzGly6 etc..)

    Thank you

    http://www.avea.com.tr/Web/ sends a type of invalid file to Firefox. They need to fix their site. The problem is that the home page is sent as application/vnd.wap.xhtml+xml which is not correct for Firefox.

  • CP1518ni: demo pages color ok/other not ok

    When I print a demo page, everything looks glorious. But when I print anything else (Word documents), the Red comes out a very pale orange.  My black cartridge is 68% to 41% cyan, magenta to 30% and 60% yellow. I can do, or do I need a new printer?

    Thank you in advance for any help you can offer.

    Hi @aowen,

    I'd be happy to help you with your printer Laserjet CP1514ni. I understand your page demo prints well, but when you print from the computer the colors do not appear as you expect. I suggest using the following document as it will guide you through the necessary troubleshooting steps: HP Color LaserJet CP1514n and CP1515n, CP1518ni printer - print quality problems.

    This will help you determine if it's time for a new printer or not. Personally, I suspect that the problem may have something to do with the settings to print from the demo page prints fine.  good demo page is an indication that the material is not the root cause.

    I hope this helps, good luck!

  • Parts of some pages won't load not

    Nice day.

    I own a desktop computer, and is the serial number, {deleted personal information}. The product number is, bm415aa #aba. When I go on our radar local viper which shows where storms are and how much time until they come to your area, the map itself will not charge. I went to the nascar race today to look at the standings, and he said: reg is null. I went to uninstall a program, and I think I uninstalled the wrong program. Another time, I was told to download Adobe Flash Player active x or the plugin Flash Player 11 remains, I air remains and Adobe reader x (10.1.3) I don't know anything about computers other than to do normal things with my computer. I hope you or someone can help me. Thank you for your time. Buttons

    I forgot to mention that I have already all the mansions downloaded on my computer. Thank you

  • When you try to download videos on the web, open the appropriate folder on the computer for video rentals, the list of videos is incomplete. Why some are recognized and others not?

    Windows 7, new
    Windows Media player and movie maker, new

    It was working fine before.  I thought that the videos are in the same format, however, the 2 videos that are available (I didn't know this before) were put on Youtube and others were not.  I think that there is a kind of publication that is not made for the remaining videos so the format might be different.
    Also there is no "All files" just a list of all types of file in the menu dropdown.  I'll look in to the additional formatting.
    Thank you!
      
    Audrey

  • Help please. My spry menu bar font sizes are smaller in some pages than others.

    My spry menu bar font sizes are smaller on some pages compared to others. I can't understand why since I am referencing the same file of sprymenbarhorizontal.css on both pages. I am new to dreamweaver and HTML. Help, please.

    I'll post my code if someone tell me how do.

    Hello

    You can use a different font instead of '%' in px size in your "sections" like I did (12px was that my choice to see what is happening. Of course you can use all the other sizes):

    1. in the present case:

    UL. MenuBarHorizontal
    {
    margin: 0;
    padding: 0;
    list-style-type: none;
    do-size: 12px;
    / * font size: 70%; * /
    cursor: default;
    Width: 865px;
    }

    2. here:

    UL. MenuBarHorizontal li
    {
    margin: 0;
    padding: 0;
    list-style-type: none;
    do-size: 12px;
    / * font size: 70%; * /
    position: relative;
    text-align: left;
    cursor: pointer;
    Width: 168px;
    float: left;
    border-bottom: 1px solid #660066;
    border-right: 1px solid #660066;
    border-left: 1px solid #660066;
    border-top: 1px solid #660066;
    }

    3. in the present case:

    UL. MenuBarHorizontal ul
    {
    margin: 0;
    padding: 0;
    list-style-type: none;
    do-size: 12px;
    / * font-size: 100%; * /
    z index: 1020;
    cursor: default;
    Width: 164px;
    position: absolute;
    left:-1000em;
    }

    Hans G.

  • My navigation links on some pages and not on others. All bearings have a link page, in the master page.

    My navigation links on some pages and not on others. Only 2 of my 7 links work on the home page, 6 of the 7 work on another, and on other pages, they work. They are all together in the master and are linked to their corresponding page. No idea why?

    Layers. There is other content on top of your navigation. Even the transparent part of the other objects will block the mouse events to reach your NAV.

    At this point you probably just 'Layer 1' in the layers panel. Content on the layer 1 on the master page will always be behind the content on the layer 1 on the page to that master is applied.

    Create a 'layer 2' (which will be on top of the layer-1) and go to navigation. Now the navigation will be on top of the element on the layer 1 on your page and these elements will block are more mouse events to reach your NAV.

  • PS ask activetion again. the worm is first CS PS v8, it fails, I tried to call help number given on the page but service does not exist, redirect to .../go/activation statement fails, it causes some assistance - activate is not possible to click

    PS ask activetion again. the worm is first CS PS v8, it fails, I tried to call help number given on the page but service does not exist, it redirects to .../go/activation

    statement fails it causes some assistance - activate is not possible to click

    Adobe has disabled the server activation for pre CS3 products a long time ago and that's why you are unable to activate your product. I can not to suggest what to do, but I don't know that CS2 owners with this problem can download a version specially created that doesn't require activation. To my knowledge, no such version exists for CS. If it was me, then as the real owner of the software and just unable to use it due to having no mechanism to activate, I download CS2 and use it until someone from Adobe told me to stop. It is a sensitive issue because the download site clearly indicates that there must be an existing CS2 owner. However, the url to the download was posted the pirate not many Adobe Web sites not as a way to free download the CS2. I imagine that there have been hundreds if not thousands of downloads from 2013 when it became first available and so far Adobe has not made any attempt to restrict the download to current owners of CS2. Their policy is quite clear if CS2 is not given away for free. Fortunately, I use CC2015, I can't make a call on it, but the URL is below if you want to move forward.

    Download Adobe Acrobat 7 and Adobe Creative Suite 2

    Terri

  • After printing a page, when I try to print again it says print function is not available

    I have a Canon MG6250 connected via USB. I run Windows 7 with all latest updates and the version of Firefox is currently 38.0.5. Since some time, probably about a year, starting after a new version of Firefox, I think, I have problems printing. (Sorry I don't remember which version it started happening.) Unless I'm waiting for the printer to prepare completely, although the print dialogue box appears and I click on print, often (not always) nothing happens. If I try to print again I get a pop-up window indicating that the print function is not available. If I then close Firefox and try to restart it, it tells me Firefox is already running. I have to put an end to its process through the Task Manager. Often, I want to print from several tabs already charges with the pages to print. Even if I managed to get the first tab print, somewhere along the line the same thing often happens: before I printed the tab page from the last I get the box pop up again and I have to end the process of Firefox to make it work again. I can generally prevent his happening if I monitor the activity of the CPU of my computer (via System Mechanic) and make sure that all activity ceased after printing a tab until I try to print on the other. This makes printing of desperately slow Firefox!

    I don't have any problems printing of any other application.

    Note that relatively recently, due to a failure of the system disk, I reinstalled Windows and all my software. I was hoping that a by-product of doing this can solve the problem with printing from Firefox, but it didn't.

    I would be very grateful for a solution to this problem.

    I continued to use IE with no problems printing. But then after Firefox 3.0 came out I gave it another go - and the problem seems to have been resolved. No matter how much time I spend in another tab and select print, it behaves as it should. Thank God - Firefox is so much better than IE.

  • Call the library function does not find the DLL in the directory where are my LLBs

    I'm using LabVIEW 8.6.  I have a set of screws in several LLBs.  All LLBs located in a directory.  Most of my screws is wrappers for the functions in a DLL.  I was told to put my DLL in the directory where are the LLBs, and apparently this is how the previous programmer has worked (using an earlier version of LabView).

    In the configuration of the library call, I've specified .dll without path.  (This is how we want our screws are an API that will integrate other programmers, so I don't know where they put things and I can't use absolute paths).

    When I insert the VIs in LabVIEW, LabVIEW can not find the DLL and wonder of spotted.  It's just that here in the directory with the LLBs and when I double click on it, everything works fine.  However my absolute path to the DLL now appears in the library to call configuration, and we don't want that.

    Does anyone know how to make this work?  I guess the location of the screw (or LLBs, in this case) should be the current directory and thus Windows search there for the DLL.  However, it seems that this is not the case (in the least, in the latest version of LabVIEW).

    Thank you.

    Batya

    Well someone using your library should not have to dig into your screws and do it all on his own. Instead your library must wrap that and hide disorders it altogether.

    The cluster of error has been added when the dynamic path option has been added. It is not useful hide this error output, so it's always there. As well as the dynamic path, there was the improved error handling added the CLN. One of them is that the level of verification when calling function errors (exception handling) can be specified. I guess that some of these options may generate an error code instead of bring up a dialog box, as they did before and that the output of error code can be useful even in the case of static calls.

    As to what you want to do, I would have long managed that with a DLL that has essentially the same functions as your other wrapper DLLs and an initiliasation function that returns a pointer to a structure of functional distribution based on the actual DLL you want to call. Quite like what an object-oriented function dispatch table is. Then, when your interface initilising you call initialize function and specify the device interface/type that you want to use and after that all other functions take a pointer extra function parameter expedition as the first parameter, in addition to the parameters of the real function. This dispatch function pointer would be just a pointer to a structure that contains the table of function for this interface pointers and the sake of LabVIEW would simply be an integer of size pointer.

    The wrapper function then checks the pointer structure validity send feature and call the actual function with the remaining parameters. It is a C programming and may require a planning and desigining the different interfaces to facilitate this kind of technique of the expedition, but it will certainly pay to long-term and make your library even can be used in previous versions of LabVIEW, so that VB etc. without delicate dynamic loading in the level high, programming environment.

    Rolf Kalbermatter

  • Help! JavaScript works not when the object is moved from one page to the other!

    Hi all:

    I am new to Adobe Livecycle Designer (version 8.0). I created an interactive pdf form of 3 pages with many objects (text fields, radio buttons, drop-down lists, etc.), our company wants to quickly start to use.

    I'm having trouble with some of my Javascript does not not with some of my items on page 2 of the form. Specifically, there is a drop down menu to "Country" on page 2 of my form. When the user selects, for example, 'United States' in the list, I have the Javascript code that is supposed to change the 'currency' list drop-down to "Dollars" rawValue accordingly (on the change event).

    I think that my Javascript syntax is correct, but I am not sure. Here's my simple Javascript associated with the "Country" drop-down list (Note: rawValue 80 = 'United States' and 105 rawValue = "US $"):

    -


    Form1. Page1.cmbContactInfoCountry::change :-(JavaScript, client).


    If (this.rawValue == 80) {}

    cmbCurrency.rawValue = 105;

    }

    It sounds pretty simple and it WORKS when my "Country" drop-down list is moved to page 1 of the form, but it WON'T WORK when I move the combo box "Country" return to page 2 of the form (i.e. where it belongs).

    Anyone has suggestions or solutions? I spent probably 6-8 hours of racking my brain trying to figure out why it works when on a single page, but it does not work when to move to another page. I guess I can have corrupted something OR that I not address fully the proper name of the object?

    Help, please!

    Frustrated and helpless, near Chicago.

    Taylor T

    Yes, it's a quirk of... in the drop-down lists when you select an item in the DOF it is not committed until you exit the field, unless you do the following:

    If (this.boundItem (xfa.event.newText) == 1) {}

    cmbCurrency.rawValue = 1;

    }

    ElseIf (this.boundItem (xfa.event.newText) == 2) {}

    cmbCurrency.rawValue = 2;

    }

    The xfa.resolveNode stuff was not necessary that both objects are of the same subform, and as such can 'see' each other.

    Think like a folder structure subforms - elements can see what is in their own folder but will say where to find things in other folders. If cmbCountry was subform1 and cmbCurrency was so in subform2 that rawValue above lines would look like:

    subform2.cmbCurrency.RawValue = 1;

    It's a good idea to name all your objects, subforms, etc. it is to work with script is much easier - so you won't have to deal with things like these pieces of xfa.resolveNode you had before (as well). He ones because you have more than one subform called "subform", the number of hooks is the Instance number (when you have several of the same object) if the program has to differentiate between the various "subform".

    The number of instance come in handy, but for things like the rows of the table and so on when you need to make calculations.

  • Both functions can call each other?

    I'm convert code and you ran into two functions which call each other. While I seems to have converted the two functions in plsql ok, they compile, apparently because they Ref each other. As soon as I get off referring to a call from one function to the other function, they both compile.

    I know that Oracle 10 g supports recursion; and on the surface of things, this situation is not very different from the recursion. If the two functions are correct, I would hope they would compile.

    I couldn't find a good part by searching the forums on this topic... but I hope that someone will have some info on this issue.

    Hello

    Lecaro wrote:
    It must be something of that order. You and others have suggested creating a package. I never did it. Can I put all my functions in a single package, including the two who call each other, or should I put both functions in two separate package in order to avoid the same problem?

    You probably want to put the two functions which call each other in a single package, but you probably don't want to put each of the functions you have already written in a single package.

    Usually, a package contains some logical grouping of procedures that call each other or dealing with the problems of the same nature. When you call a procedure in a package, the entire package is loaded into memory.

    For example, I have a package called pk_dt that does various things on the dates (for example, if a specific date is a public holiday). Some functions in this package call others in the package, some do not, but I put them in the same package because I predict that any job that calls one has a good chance of the call to the other.

    The permissions are another thing to consider when you bundle procedures in packages.

Maybe you are looking for

  • How can I change the margin between inches and millimetres units?

    Firefox 23.0.1 Windows 8.Use the preview before printing-> layout-> margins & header/footer

  • I had a problem with my iphone screen 6

    My screen cracked 4 months ago. For about 3 months I have no problems. Then 1 month ago about the screen started to become numb. This continued for weeks, I thought because my screen was cracked but because of people here, I learned that this was not

  • Help for the reconciliation of the table in a sequence

    I need assistance with the values of an array 1 d of channels read. Table 1 d of strings contains the names of the columns in a different table. This must be included in a file, but only once. IM is able to do, but the only problem, the table 1 d of

  • Can I do a waveform graph view more samples currently read?

    I have DAQ 17 channels at a rate of 500 samples per second read and then write in a PDM file and a few gauges, a waveform graph.  I'd like to graph waveform to display more than the samples that are currently read, I want to only show the last 10 sec

  • hack Hotmail account

    Today, some guy hacked my hotmail now my email can not access thorugh my email program and iphone... the funny thing is that I can always connect through the... strange site? and I found the below email is in my frame of hotmail... best part the guys