|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry5.corelib.components.Any
@SupportsInformalParameters public class Any
Turns any arbitrary (X)HTML element into a component. The element's start and end
tags are rendered, including any informal parameters and possibly an id
attribute. The id is provided by JavaScriptSupport.allocateClientId(String)
(so it will be unique on the client side) and is available after the component
renders using getClientId()
. The Any component has no template of its
own but does render its body, if any.
Some common uses are:
RenderNotification
mixin, triggers event
notifications when it enters the BeginRender and EndRender phases:
<img t:type="any" t:mixins="renderNotification">And the following renders a td element with the
NotEmpty
mixin to ensure
that a non-breaking space ( ) is rendered if the td element would
otherwise be empty:
<td t:type="any" t:mixins="NotEmpty">
InjectComponent
to get the component, then call getClientId()
to retrieve the ID.)
<table t:type="any" id="clientId">As an alternative to calling getClientId, you can use the
RenderClientId
mixin to force the id attribute to appear in the HTML:
<table t:type="any" t:mixins="RenderClientId">
<t:any element="prop:element" ... >
public class MyComponent extends Any { ... }
Component Parameters | ||||||
---|---|---|---|---|---|---|
Name | Description | Type | Flags | Default | Default Prefix | Since |
clientId | The desired client id, which defaults to the component's id. | String | prop: | literal | ||
element | The name of the element to be rendered, typically one of the standard (X)HTML elements, "div", "span", "a", etc., although practically any string will be accepted. The default comes from the template, or is "div" if the template does not specify an element. | String | literal |
Constructor Summary | |
---|---|
Any()
|
Method Summary | |
---|---|
String |
getClientId()
Returns the client id. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Any()
Method Detail |
---|
public String getClientId()
getClientId
in interface ClientElement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |