Define the Access Privilege of Data Binding Manager"
m |
m (correct highlight (via JWB)) |
||
Line 4: | Line 4: | ||
{{ZKDevelopersGuidePageHeader}} | {{ZKDevelopersGuidePageHeader}} | ||
− | For better control of data-binding manager, you can set the access mode of the attribute-name of the component-name to be < | + | For better control of data-binding manager, you can set the access mode of the attribute-name of the component-name to be <code>both</code>(load/save), <code>load</code>(load Only), <code>save</code>(save Only), or <code>none</code>(neither) . |
− | < | + | <code><component-name attribute-name="@{bean-name.attribute-name,access='type-name'}"/></code> |
− | * < | + | * <code>type-name</code> represents a certain kind of access mode |
Multiple definition is NOT allowed and the later defined would override the previous defined one. | Multiple definition is NOT allowed and the later defined would override the previous defined one. | ||
− | In the following example, if the value of < | + | In the following example, if the value of <code>Textbox</code>, "<code>firstName</code>", and "<code>lastName</code>" has been modified, the value of <code>Listcell</code>, "<code>fullname</code>", will remain unchanged because Data Binding manager is informed not to update its value. |
<source lang="xml" > | <source lang="xml" > |
Latest revision as of 10:39, 19 January 2022
This documentation is for an older version of ZK. For the latest one, please click here.
This documentation is for an older version of ZK. For the latest one, please click here.
For better control of data-binding manager, you can set the access mode of the attribute-name of the component-name to be both
(load/save), load
(load Only), save
(save Only), or none
(neither) .
<component-name attribute-name="@{bean-name.attribute-name,access='type-name'}"/>
type-name
represents a certain kind of access mode
Multiple definition is NOT allowed and the later defined would override the previous defined one.
In the following example, if the value of Textbox
, "firstName
", and "lastName
" has been modified, the value of Listcell
, "fullname
", will remain unchanged because Data Binding manager is informed not to update its value.
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?>
<window width="500px">
<zscript><![CDATA[
Person person = new Person();
person.setFirstName("Bill");
person.setLastName("Gates");
]]>
</zscript>
<listbox>
<listhead>
<listheader label="First Name" width="100px" />
<listheader label="Last Name" width="100px" />
<listheader label="Full Name" width="100px" />
</listhead>
<listitem>
<listcell>
<textbox id="firstName" value="@{person.firstName}" />
</listcell>
<listcell>
<textbox id="lastName" value="@{person.lastName}" />
</listcell>
<listcell id="fullName"
label="@{person.fullName, access='none'}" />
</listitem>
</listbox>
</window>
Version History
Version | Date | Content |
---|---|---|