Class Any

  extended by org.apache.tapestry5.corelib.components.Any
All Implemented Interfaces:

public class Any
extends Object
implements ClientElement

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:

Component Parameters
NameDescriptionTypeFlagsDefaultDefault PrefixSince
clientIdThe desired client id, which defaults to the component's id.Stringprop:componentResources.idliteral
elementThe 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.Stringliteral

Constructor Summary
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()
Returns the client id. This has side effects: this first time this is called (after the Any component renders its start tag), a unique id is allocated (based on, and typically the same as, the clientId parameter, which defaults to the component's id). The rendered element is updated, with its id attribute set to the unique client id, which is then returned.

Specified by:
getClientId in interface ClientElement
unique client id for this component

Copyright © 2003-2012 The Apache Software Foundation.