-
1. Re: How to wrap rich:column in a facelet tag
nbelaevski Oct 14, 2010 8:40 PM (in response to henryju)1 of 1 people found this helpfulHi Julien,
When column makes decision on whether filtering input is being rendered or not, it checks for the presence of "filterBy" value expression. But in your template it's always set, so you see the input (when Facelet templates are processed, new instances of VariableMapper pointing to tag expressions are created). So, as a workaround you can try creating TagHandler that will handle that - check Facelets API for details.
-
2. Re: How to wrap rich:column in a facelet tag
henryju Oct 15, 2010 4:46 AM (in response to nbelaevski)Hi Nick,
First thanks for your reply.
If I understand correctly you are suggesting to not use a xhtml template to create a custom tag but instead use a Java TagHandler (extending rich:column tag handler?). My concern is about WYSIWYG feature in Eclipse. I read that using xhtml template doesn't prevent VPE to display a preview of the page (I have not checked this point yet). But if I choose to use custom TagHandler I guess I will loose the ability to have a preview of my page.
Any suggestion?
Regards,
Julien
-
3. Re: How to wrap rich:column in a facelet tag
nbelaevski Oct 15, 2010 5:08 AM (in response to henryju)Julien,
In this case tag with custom tag handler will be wrapping included page content, so it will probably work.
-
4. Re: How to wrap rich:column in a facelet tag
ilya_shaikovsky Oct 15, 2010 5:27 AM (in response to henryju)as just simple alternative - you could create different facelets for simple columns and ones without filtering
-
5. Re: How to wrap rich:column in a facelet tag
henryju Oct 15, 2010 7:43 AM (in response to ilya_shaikovsky)Ilya Shaikovsky wrote:
as just simple alternative - you could create different facelets for simple columns and ones without filtering
Yeah, that's what is done currently and I want to refactor:
<my:columnWithFilter>
<my:columnWithSort>
<my:columnSimple>
<my:columnWithFilterAndSort>
...
Ugly isn't it
-
6. Re: How to wrap rich:column in a facelet tag
ahoehma Oct 15, 2010 9:18 AM (in response to henryju)1 of 1 people found this helpfulTry this:
<ui:composition xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:ui="http://java.sun.com/jsf/facelets">
<c:if test="#{!empty filterBy}">
<rich:column id="#{id}" filterBy="#{filterBy}"> <f:facet name="header"> <h:outputText styleClass="headerText" value="#{header}" /> </f:facet> <ui:insert/> </rich:column>
</c:if>
<c:if test="#{empty filterBy}">
<rich:column id="#{id}"> <f:facet name="header"> <h:outputText styleClass="headerText" value="#{header}" /> </f:facet> <ui:insert/> </rich:column>
</c:if>
</ui:composition>Regards
Andreas
-=[http://www.ahoehma.de]=-
-
7. Re: How to wrap rich:column in a facelet tag
henryju Oct 18, 2010 3:37 AM (in response to ahoehma)With optional filtering and optional sorting it leads to at least 4 combinations. I wanted to avoid duplicate code but it seems this is the only solution...
Thanks