Paul, I want to say dataTable renders all rows based on the value attribute. 
Then again, I want to say, somewhere I added the rendered={ } logic and the
"row" didn't display(i.e. I didn't have a blank row).  

If I remember correctly, I didn't have a <f:facet name="header"> tag and I
was only displaying a few columns inside a commandLink which took me to a
details page.  It's been a while...

I echo the collection level filter - but you already know that from your
original post.





William Huang-2 wrote:
> 
> agreed, is always better and faster if you can do it in the query level
> with an additional where clause.  But I am not sure if that's what Paul
> was
> looking for.
> 
> William Huang
>                                                                        
>              "Virtudazo,                                               
>              Dennis                                                    
>              \(Exchange\)"                                              To
>              <[EMAIL PROTECTED]         "MyFaces Discussion"            
>              com>                      <[email protected]>      
>                                                                         cc
>              08/29/2006 03:29                                          
>              PM                                                    Subject
>                                        RE: How to not display a row in 
>                                        <t:dataTable> based on the row  
>              Please respond to         content?                        
>                  "MyFaces                                              
>                 Discussion"                                            
>              <[EMAIL PROTECTED]                                         
>                  ache.org>                                             
>                                                                        
>                                                                        
> 
> 
> 
> 
>  I think the simplest way is to filter at the query level. Rebuild your
> datamodel when the filter criteria changes, based on the resultset that
> either includes or excludes in stock items, rather than hacking the
> hiding/showing of rows when rendering.
> 
> -----Original Message-----
> From: William Huang [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 29, 2006 3:05 PM
> To: MyFaces Discussion
> Subject: Re: How to not display a row in <t:dataTable> based on the row
> content?
> 
> I haven't try this yet, but ideally, you would implement your own
> DataModel
> class by extending the javax.faces.model.DataModel or other subclasses.
> Make sure you have the right logic in the getRowCount(), and getRowData(),
> in the getRowData() method, you can control which row to display or not
> display.  make sure your getRowCount matches.  I think ideally, this is
> very similar to how java SWING table and its data model works as well.
> 
> Let me know if that helps,
> 
> William Huang
> 
>              delbd
>              <[EMAIL PROTECTED]>
>                                                                         To
>              08/29/2006 02:04          MyFaces Discussion
>              PM                        <[email protected]>
>                                                                         cc
> 
>              Please respond to                                     Subject
>                  "MyFaces              Re: How to not display a row in
>                 Discussion"            <t:dataTable> based on the row
>              <[EMAIL PROTECTED]         content?
>                  ache.org>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> I played recently with datatable, and a custom component. The custom
> component was creating different children depending on the data itself,
> each row having a different data. That's how i discovered datatable is not
> very flexible. It creates only one set of children, reprensenting a rown
> ,and only change the rowindex and clientid between rows. So trying to
> 'hide' rows is quite difficult. There are 2 ways imho
> - create a filtered collection (most easy way)
> - create a custom component that better fits your needs John Ruffin a
> écrit
> :
>> Try some permutation of this: rendered="#{not row.isInStock}" on your
>> components.  Not sure if you'll end up with blank rows or not.
>>
>>
>> ::SammyRulez:: wrote:
>>
>>> can't u modify the business method that create the collaction of the
>>> value attriubute of the datattable.
>>>
>>> Before you ask is not possible to set rowstyle on particular var
>>> attribute values.
>>>
>>> My two cents is to put a image in a column with an icon that displays
>>> only if the item is in stock
>>>
>>>
>>> 2006/8/29, Paul Spencer <[EMAIL PROTECTED]>:
>>>
>>>> I am have a list that is displayed by <t:dataTable>  I would like to
>>>> selectively display the object in that list, i.e. filter them, via
>>>> the JSP tag configuration.
>>>>
>>>> As an example the collection contains a list of parts.  The part
>>>> object also contains the method isInStock().  So the <t:dataTable>
>>>> should only display object where row.isInStock() is true.
>>>>
>>>> I know that a new list containing only inStock object can be created
> and
>>>> that list could be passed to <t:dataTable>, but I have simplified
>>>> the example for the purpose of this illustration.
>>>>
>>>> Paul Spencer
>>>>
>>>>
>>>>
>>>>
>>>>
>>> --
>>> ::SammyRulez::
>>> http://www.kyub.com/blog/
>>> -----------------------------------------------------------------
>>> La programmazione è per un terzo interpretazione e per due terzi
>>> ispirazione.
>>>  E per un terzo misitificazione
>>>
>>>
>>>
>>
>>
> 
> 
> Disclaimer: This electronic mail and any attachments are confidential and
> may be privileged. If you are not the intended recipient, please notify
> the
> sender immediately by replying to this email, and destroy all copies of
> this email and any attachments. Thank you.
> 
> 
> 
> 
> 
> ***********************************************************************
> Bear Stearns is not responsible for any recommendation, solicitation,
> offer or agreement or any information about any transaction, customer
> account or account activity contained in this communication.
> ***********************************************************************
> 
> Disclaimer: This electronic mail and any attachments are confidential and
> may be privileged. If you are not the intended recipient, please notify
> the sender immediately by replying to this email, and destroy all copies
> of this email and any attachments. Thank you.
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-not-display-a-row-in-%3Ct%3AdataTable%3E-based-on-the-row-content--tf2183816.html#a6046963
Sent from the MyFaces - Users forum at Nabble.com.

Reply via email to