Wiki

Clone wiki

AspectFaces / 7.4.@UiUse-and-@UiType

@UiUse enforces the use of a specific template. This basically means that field annotated with @UiUse bypasses the mapping rules and uses a specific template.

#!java

public class Address {
..
 @UiUse("country.xhtml")
 public Country getCountry() {
    return country;
 }
..

@​UiType is allowing you to use the mapping and also preserves the field type and help to specify the mapping.

#!java

public class Address {
..
 @UiType("readOnly")
 public String getInformation() {
    return information;
 }
..

And in the mapping

Mapping profile

#!xml

<mapping>
    <type>String</type>
    <default tag="inputTextTag.xhtml" maxLength="255" size="30" required="false" />
    <var name="username" tag="inputUsernameTag.xhtml" />
    <var name="org.my.company.Person.username" tag="inputUsernameTag.xhtml" />
    <condition expression='${not empty type and type == "readOnly"}' tag="outputTextTag.xhtml" />
</mapping>

Updated