Question

I have a component with a couple property definitions and an init() method. I am able to access getUuid() but not getSandwich().

component output="false" accessors="true" {
  property
    name="uuid"
    type="string"
    default=""
    hint="The sandwich ID";
  property
    name="sandwich"
    type="string"
    default=""
    hint="The fucking sandwich";

  public any function init() {
    this.setUuid(CreateUUID());
    this.setSandwich = "Peanut Butter and Banana";
    return this;
  }

}

The Uuid property and corresponding getSandwich() method are available in the instance as expected where in the case of sandwich, the property is not set even though the value is applied to the setSandwich() method.

sandwich machine

Was it helpful?

Solution

(From the comments)

this.setSandwich = "Peanut Butter and Banana";

Is that a typo or bug (ie that overwrites the setSandwich() method with a simple string)? Did you mean:

this.setSandwich( "Peanut Butter and Banana" ); 

?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top