ClientId

Home Search

Contribution to MarkupRenderer

MarkupRenderer is an object which will perform rendering of a page (or portion of a page). This interface exists to be filtered via MarkupRendererFilter.The MarkupRenderer service takes an ordered configuration of MarkupRendererFilters, which are used for ordinary page rendering (as opposed to partial page rendering for Ajax requests).

The following code show that in this module, the default JavaScriptSupport MarkupRendererFilter defined in TapestryModule.java is replaced by an other MarkupRendererFilter.

IdAllocator is used to "uniquify" names within a given context. A base name is passed in, and the return value is the base name, or the base name extended with a suffix to make it unique. In a portlet container, a portal page can use more than one instance of a portlet. So the portlet bridge need to give to each component id a suffix that is unique accross the portlet page. To do that, the new javaScriptSupport MarkupRendererFilter pass a specific IdAllocator instance with a namespace that start with the portletId to the JavaScriptSupport service.

In practice, if you want to use your portlet more than once in your portal page, don't fix the client id in your template.

Ajax Form with client id (Don't do that)

Instead, let's the component create a unique client ID with the namespace provided by t:id parameter.

Ajax Form without client id

and get the clientID form the component

If you want more details about What's the difference between id and t:id? see http://tapestry.apache.org/templating-and-markup-faq.html

More in this section