|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwicket.behavior.AbstractBehavior
wicket.markup.transformer.AbstractTransformerBehavior
wicket.markup.transformer.XsltTransfomerBehavior
public class XsltTransfomerBehavior
An IBehavior which can be added to any component except ListView. It allows to post-process (XSLT) the markup generated by the component. The *.xsl resource must be located in the same path as the nearest parent with an associated markup and must have a filename equal to the component's id.
The containers tag will be the root element of the xml data applied for
transformation to ensure the xml data are well formed (single root element).
In addition the attribute
xmlns:wicket="http://wicket.sourceforge.net" is added to the
root element to allow the XSL processor to handle the wicket namespace.
The reason why the transformer can not be used to XSLT the ListViews output is because of the ListViews markup being reused for each ListItem. Please use a XsltOutputTransformerContainer instead. Note: if the ListView is used to print a list of <tr> tags, than the transformer container must enclose the <table> tag as well to be HTML compliant.
AbstractOutputTransformerContainer,
XsltOutputTransformerContainer,
Serialized Form| Constructor Summary | |
|---|---|
XsltTransfomerBehavior()
Construct. |
|
XsltTransfomerBehavior(java.lang.String xslFilePath)
Instead of using the default mechanism to determine the associated XSL file, it is given by the user. |
|
| Method Summary | |
|---|---|
void |
onComponentTag(Component component,
ComponentTag tag)
Called any time a component that has this behavior registered is rendering the component tag. |
java.lang.CharSequence |
transform(Component component,
java.lang.String output)
Will be invoked after all child components have been processed to allow for transforming the markup generated. |
| Methods inherited from class wicket.markup.transformer.AbstractTransformerBehavior |
|---|
cleanup, newResponse, onException, onRendered |
| Methods inherited from class wicket.behavior.AbstractBehavior |
|---|
bind, detachModel, exception, rendered |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XsltTransfomerBehavior()
public XsltTransfomerBehavior(java.lang.String xslFilePath)
xslFilePath - XSL file path| Method Detail |
|---|
public void onComponentTag(Component component,
ComponentTag tag)
IBehavior
onComponentTag in interface IBehavioronComponentTag in class AbstractTransformerBehaviorcomponent - the component that renders this tag currentlytag - the tag that is renderedIBehavior.onComponentTag(wicket.Component,
wicket.markup.ComponentTag)
public java.lang.CharSequence transform(Component component,
java.lang.String output)
throws java.lang.Exception
ITransformer
transform in interface ITransformertransform in class AbstractTransformerBehaviorcomponent - The associated Wicket componentoutput - The markup generated by the child components
java.lang.ExceptionITransformer.transform(wicket.Component,
java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||