Me n My Programming

If Only I Have TIme

Marama Code 119 ~ Exported Properties

As you may know by now, there are two types of entities in Marama. Yes, the first is Model Entity and the second is Shape Entity. This example is concern about retrieving and updating  exported properties in Shape Entity.

In Shape Definer (where you define what shape you like to represent your model), you can set the attribute display as Exported Properties. Exported Properties is different from Label, TextField n TextArea Shape. Exported Properties will not display the input in it. It will only appear in the Properties View.

Enough for the intro. The trouble with Exported Properties is that you can’t retrieve or update the value using normal shape command:

shape.setPropertyValue(“AttributeName”, “NewName”); or

shape.getPropertyValue(“AttributeName”).toString();

You need to use this command instead:

shape.getModelEntity.setPropertyValue(“AttributeName”, “NewName”); or

shape.getModelEntity.getPropertyValue(“AttributeName”).toString();

You need to add .getModelEntity to the shape because it’s referring directly to the Model Entity. The usual method access the Model Entity through Shape Entity.

Did you get it? Ya, it’s a bit confusing. Welcome to Marama!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Information

This entry was posted on August 24, 2011 by in Life on Marama.
%d bloggers like this: