• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF2, facelets and custom tag.

 
jsf begginer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want do do something like this:

Define custom facelets tag in xhtml file:

myDatatable.xhtml

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"

<p:dataTable id="datatable" var="user" value="#{datamodel}" rows="10" lazy="true" rowsPerPageTemplate="10,15,50">

!!!???!!!

</p:dataTable>

</ui:composition


and i want to use my tag like this: (name of tag in definition is myDatatable) and it was definied on page as customTag

page using my myDatatable tag
<customTag:myDatatable datamodel="#{userListDataModel}">

<p:column>
<f:facet name="header">
<h:outputText value="Username" />
</f:facet>

<h:link value="#{user.username}" outcome="userDetails.jsf" >
<f:param name="userId" value="#{user.id}" />
</h:link>

</p:column>

<p:column>
<f:facet name="header">
<h:outputText value="email" />
</f:facet>
<h:outputText value="#{user.email}" />
</p:column>



</customTag:myDatatable>

My question is what can I put into !!!???!!! line of my custome tag to process/redered body of my customTag:myDatatable
 
Tim Holloway
Bartender
Posts: 18417
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"jsf begginer",

We don't have many rules here at the JavaRanch, but we do insist that you use your Real Name and not some sort of "handle" or obvious alias. If you're not sure about this, see
http://www.javaranch.com/name.jsp .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!