E.W.C. TaglibsE.W.C. provides a set of tag libraries for quick UI development. This one provide common tags that don't generate an output, so can be used together with other taglibs that focuses on HTML generation o XML generation. The component list:
ctxThe ctx tag is used to set the scope or context that will be used by other tags. This tag can be nested as needed. This tag expects the following parameters:
Example: <ewc:ctx className="demo.UserDemo"> [...] </ewc:ctx> Look for more details at the javadoc . If you are experiencing any problem, have a look at the implementation to completely understand the tag behaviour. if/elseThe if tag, combined with the else tag, is used to conditionally process its body. The if tag expects the following parameters:
The else tag must be added after an if tag and doesn't have any parameter. Example: <ewc:if src="book.new"> <h1>Creating a new book</h1> [...] </ewc:if> <ewc:else> <h1>Editing book: <ewc:label src="book.name"/></h1> [...] </ewc:else> Look for more details at the if and else javadoc. If you are experiencing any problem, have a look at the if and else implementation to completely understand the tags behaviour. forEachThe forEach tag iterates over a collection, changing the scope to the next item in each iteration. This tag expects the following parameters:
Example: [...] <ewc:forEach src="book.pages"> <tr> <td> <ewc:label src="'Page: @i'" /> </td> <td><ewc:label src="wordCount" /></td> <td><ewc-html:button css="button" caption="Select" onClick="../selectPage(@i)" /></td> <td><img src="images/page.gif" onclick="<ewc-html:throwEvent event="../selectPage(@i)" />"></td> <td> <table> <ewc:forEach src="paragraphs" indexName="j"> <tr> <td> <ewc:label src="'Page:@i Paragraph: @j'" /> </td> <td> <ewc-html:textField css="field" rows="3" cols="20" src="text" /> </td> </tr> </ewc:forEach> </table> </td></tr> </ewc:forEach> [...] Look for more details at the javadoc . If you are experiencing any problem, have a look at the implementation to completely understand the tag behaviour. includeThe include tag is used to include another page in that point.. This tag expects the following parameters:
Example: <ewc:ctx className="demo.UserDemo"> <table width="100%"> <tr> <td valign="top"> <ewc:include page="UserDemo.jsp" /> </td> <td> <!-- Include the page pointed in the "currentView" property of "demo.UserDemo" --> <ewc:include src="currentView" /> </td> </tr> </table> </ewc:ctx> Look for more details at the javadoc . If you are experiencing any problem, have a look at the implementation to completely understand the tag behaviour. labelThe label tag just evaluates an expression and prints its value. This tag expects the following parameters:
Example: [...] <ewc:label src="'Page:@i Paragraph: @j'" /> [...] Look for more details at the javadoc . If you are experiencing any problem, have a look at the implementation to completely understand the tag behaviour. |