Luke Vanderfluit wrote:
> Hi.
> 
> I have a component that displays a form.
> When the form displays I want to display different stuff based on whether a 
> property of an object that I send to the form is null or not.
> 
> Im calling the form component from the parent like this:
> <OrgForm organisation="{organisation}"/>
> 
> Now how do I access the properties of organisation inside the component 
> before 
> it displays?

You could set the visible attribute to false

  <OrgForm organisation="{organisation}" visible="false" />

then in your function set it to true once your UI logic has executed.

[Bindable] //getter ommited.
public funciton set organisation(o:Organisation):void{
    _organisation = o;

    changeForm(); //changes visibility to true.
}

private var saveOrUpdate:String = "Update";

private function changeForm():void{
  if (_organisation.organisationId == null) {
        saveOrUpdate = "Save";
  }

   this.visible = true;
}

cheers,
  - shaun

Reply via email to