com.sencha.gxt.core.client
Annotation Type XTemplates.TemplateCondition


@Target(value=TYPE)
@Retention(value=RUNTIME)
public static @interface XTemplates.TemplateCondition

Defines a single method on an object that should be accessible from within XTemplate conditional statements. By default, Object.equals(Object) is defined as :equals in an XTemplate, so this is legal:


interface TemplateUsingEquals extends XTemplates {
  @XTemplate("<tpl if='o1:equals(o2)'>true</tpl>")
  SafeHtml tpl(Object o1, Object o2);
}


Required Element Summary
 java.lang.String methodName
          The name of the method to invoke from a compiled template.
 java.lang.Class<?> type
           
 
Optional Element Summary
 java.lang.String name
          The name of the method to define.
 

Element Detail

type

public abstract java.lang.Class<?> type
Returns:
the type the condition method is defined on.

methodName

public abstract java.lang.String methodName
The name of the method to invoke from a compiled template. This method must exist on type() or a superclass.

Returns:
the method to invoke on type()

name

public abstract java.lang.String name
The name of the method to define. Defaults to the methodName().

Returns:
the name of the method as it will be used in XTemplate source, or "" if the same as methodName()
Default:
""


Copyright © 2012. All Rights Reserved.