Neal and Matthias,

Thank you for two excellent posts.  Neal, you expressed my concerns
exactly.  I did not see a way to make x:columns work.  Matthias,  your
solution looks excellent.  I am not sure if it covers all of my cases
but it will definitely get me closer.  I will see if we can make this
work.

BTW, I was not really aware of x:columns or what it did.  Not
surprising given the low level of documentation out there.  Matthias,
would you be willing to help us out with improving this documentation?
 Could you put something together like what we have for some of the
other components (http://myfaces.apache.org/components/tree2.html).

If you feel adventurous you can write it using Forrest (there is a
components-template.xml that you can use to get you started.) 
Otherwise if you sent me the text and a screen shot I could port it
over for you.  My coworker has already improved the datatable examples
(which I will commit shortly) and I'll see if we can add one that
incorporates x:column as well.

Regards,
sean


On Apr 12, 2005 9:55 AM, Broekelmann, Mathias <[EMAIL PROTECTED]> wrote:
> Hi Neal,
> 
> > -----Original Message-----
> > From: Neal Haggard [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, April 12, 2005 3:20 PM
> > To: MyFaces Development
> > Subject: RE: Proposed improvement to x:dataTable
> >
> >
> > Mathias,
> >
> >    While your x:columns is very nice, it does not answer
> > Sean's request to have something where the columns can be
> > independently formatted.  All of your columns in x:columns
> > must have the same output, so we can't have one column that
> > provides a link to an outside source, or is otherwise
> > dynamically rendered.
> 
> You can put everything into a columns component. I use the rendered
> flag to switch the components defined in the jsp on or off. So
> everything is defined in the
> columns component (through includes of other jsps).
> 
> >
> >    We also evaluated using x:columns and are on the road to
> > writing our own custom table & column components to meet our
> > user requirements.  Our users are wanting to be able to
> > dynamically re-order the columns in the table, and pick and
> > choose which ones to show.  We're currently planning on
> > implementing this by having the JSP define all the possible
> > columns, and specify on the column what index the columns
> > should have (to specify column ordering, to be sorted &
> > handled by our DataTable).  We're also adding a rendered
> > attribute to the column, to allow columns to be shown/hidden
> > as needed.
> 
> Our users do the same with the columns component. They choose the
> columns they want and the content is rendered in depend of the
> data which contains the column. How the content is rendered is defined
> through one of the nested panelgroups inside the columns component.
> 
> >
> >    If anyone has any ideas of how we can meet our user
> > requirements with some available component out there, we'd
> > love to hear about it.
> >
> 
> Here is an example how we use the columns component:
> 
> Content of overview.jsp which shows the datatable
> 
> <x:dataTable rowClasses="data,data2" preserveDataModel="false"
> styleClass="data" border="0" frame="box"
>         value="#{overview.resourcesModel}" var="line" >
>         <h:column rendered="#{overview.modifiable}">
>                 <f:facet name="header">
>           <h:commandLink styleClass="hauptnav"
> action="#{overview.create}">
>             <h:graphicImage border="0" title="Erstellen"
>               value="/public/images/admin/erstellen.gif" alt="Erstellen"
> />
>           </h:commandLink>
>                 </f:facet>
>                 <h:commandLink styleClass="hauptnav"
> action="#{overview.modify}">
>                         <h:graphicImage border="0" title="Bearbeiten"
> 
> value="/public/images/admin/bearbeiten.gif" alt="Bearbeiten" />
>                 </h:commandLink>
>         </h:column>
>         <x:columns value="#{overview.attributes}" var="attr">
>                 <f:facet name="header">
>                         <h:outputText value="#{attr.label}" />
>                 </f:facet>
> 
>                 <!-- we use panelGroup to switch the rendering of
> different content -->
> 
>         <h:panelGroup rendered="#{attr.booleanType && attr.value !=
> null}">
> 
>             <!-- show a boolean value through graphic images -->
> 
>             <h:graphicImage
> url="/public/images/admin/activeCheckBox.gif"
>               rendered="#{attr.value}" />
>             <h:graphicImage
> url="/public/images/admin/inactiveCheckBox.gif"
>               rendered="#{!attr.value}" />
>         </h:panelGroup>
>         <h:panelGroup rendered="#{!attr.booleanType}">
> 
>             <!-- show other values through normal outputText -->
> 
>             <h:outputText value="#{attr.value}" />
>         </h:panelGroup>
> 
>         </x:columns>
>     <h:column rendered="false">
>         <f:facet name="header">
>               <h:commandLink value="..."
> action="#{overview.selectAttributes}" />
>         </f:facet>
>   </h:column>
> </p:dataTable>
>

Reply via email to