>From: Richard Wallace <[EMAIL PROTECTED]> > > Hello again, > > I'm working on creating a dataTable and I'm having a problem trying to > figure out exactly how to do it in nothing but html. I've done this > before with help from the list, but that was a simple one column table > without any headers. Now I need to create a multi-column table with > headers and there are no examples of this in the use-cases that I could > find (the xrolodex.html just has a one column, the contact name). I was > trying this: > [snippet] > > Thinking that maybe the facectName was a special attribute that would be > picked up by the Clay parser, but it's not. So what do I need to do to > make Clay recognize those elements as facets > for the columns? Do I just need to give them a jsfid? If so, which one? > The example above uses all HTML to create the table. A cleaner way would be to use the XML config. For Example: <component jsfid="editCoordinatorColumn" extends="column" id="editCoordinatorColumn"> <element renderId="1" jsfid="outputText" facetName="header"> <attributes> <set name="value" value="Edit" /> </attributes> </element> <element renderId="2" jsfid="commandLink"> <attributes> <set name="value" value="edit" /> <set name="action" value="[EMAIL PROTECTED]" /> <set name="immediate" value="true"/> </attributes> <element renderId="1" jsfid="param"> <attributes> <set name="name" value="username"/> <set name="value" value="#{coordinator.username}"/> </attributes> </element> </element> </component>
<component jsfid="coordinatorUsernameColumn" extends="column" id="coordinatorUsernameColumn"> <element renderId="1" jsfid="outputText" facetName="header"> <attributes> <set name="value" value="Coordinator" /> </attributes> </element> <element renderId="2" jsfid="outputText"> <attributes> <set name="value" value="#{coordinator.username}" /> </attributes> </element> </component> <component jsfid="coordinatorTable" extends="dataTable" allowBody="false"> <attributes> <set name="value" value="[EMAIL PROTECTED]"/> <set name="var" value="e"/> <set name="rows" value="5"/> <set name="first" value="0"/> <set name="styleClass" value="contacts"/> <set name="headerClass" value="contactsHeader"/> <set name="rowClasses" value="contactsRow1, contactsRow2"/> </attributes> <element renderId="1" jsfid="coordinatorUsernameColumn"/> <element renderId="2" jsfid="editCoordinatorColumn"/> </component> <table jsfid="cordinatorTable"> <tr><th>Coordinator <tr><th>Edit <tr><td>Mock User <tr><td><a href=#>Mock Edit</a> </table> This will give you more reuse options. You can use inheritance to create a table and add columns. Gary > Thanks, > Rich > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >