0 Replies Latest reply on Jul 29, 2008 9:26 PM by olegkon

    Complex View State handling

    olegkon Level 1

      I am trying to solve the following problem in Flex3:

      I have layout with 4 quadrants ["Ch" for Child component class]:

      Ch1 Ch2

      Ch3 Ch4

      If I click a button in ch4 [i.e. state ch4a], it is supposed to expand and cover Ch2, i.e.

      Class Parent1 [inside Accordion]:
      <view:Ch1 width="60%" />
      <view:Ch2 width="40%" />

      <view:Ch3 width="60%" />

      So in class Ch4 I created a view stateA which is based on BaseState.

      A) What makes more sense, fire event in class Ch4 on that button click,
      capture it in Parent1 and somehow [how?] change a layout so that Ch2 is not there
      but twice higher Ch4a is instead of it and no second part in HBox2 ?
      I would guess, ActionScript instead of MXML or is there a way to express that in MXML?
      Or how should that ActionScript look like ?

      B) The other [easier] possibility is to get a handle to Parent1 [parent container]
      from the viewstateA of Ch4 and do something like:
      <SetProperty target={this.parent} name="y" value="0">
      Is it feasible? So far that didn't work for me. Any suggestions?

      Few other details:
      1) it's all in Cairngorm AIR app;

      2) that button in Ch4 is on one side a toggle button between view states,
      on the other side processing is completely different, but I can handle that through calling
      2 different private functions. I am saying only in one state[BaseState] that event should be fired.

      3) Background: Ch1 and Ch3 have lots of dropdowns, and what user selected would be displayed
      in Ch4A [that top portion], so user "Signs" that info, that's a point of the whole screen.
      Is there easy way to pass these selections to Ch4 ?
      As of now, it's all buried deep inside some complex obscure VOs .

      Any help is very appreciated.

      Thank you in advance,