getProperty
getProperty
Reads a property value on this form.
Parameters
name(string): The name of the property to read (a Property defined on the form in the LucyStudio designer)
Returns: any — the property's current value, or null when no such property exists
Common properties
| name | Return type | Description |
|---|---|---|
"id" | String | The current form's ID |
"title" | String | The form title |
"orientation" | String | Layout direction. One of "inherit", "auto", "vertical", "horizontal". Defaults to "inherit" |
"designWidth" | double? | The design reference width |
"designHeight" | double? | The design reference height |
"backgroundColor" | Color? | The background color |
note
Passing an unregistered property name returns null — it doesn't raise an error.
Example
// 폼 ID 확인 (재사용 폼에서 어떤 폼인지 식별)
var formId = $form.getProperty("id");
$log.i("현재 폼:", formId);
// 타이틀 확인 후 조건부 변경
var title = $form.getProperty("title");
if (title !== "편집 중") {
$form.setProperty("title", "편집 중");
}
// 디자인 너비로 비율 계산
var dw = $form.getProperty("designWidth");
$log.i("기준 너비:", dw);
Related
$form.setProperty(name, value)— changes a property value