Are you initializing your _table attribute in your managed bean to a new CoreTable() when the managed bean is constructed? I use tr:table a lot and haven't had the problem you describe. I also checked and I do have both value and binding attributes set so you are correct in your previous email regarding that the attributes can be used together.
-Richard On Wed, Jul 29, 2009 at 4:51 AM, <[email protected]> wrote: > > Richard, thank you for your below reply. > > But, I do not think it is correct. > As an example, the table_selection.jspx of Trinidad demo > (at http://www.irian.at/trinidad-demo/faces/components/table_selection.jspx) > use both "value" and "binding" attributes. > And it works. > > So, after a day of pulling hair and trying many things, I found the issue. > Here I document it for others' benefit; > > It turns out the reason is the call "_table.getRowCount()" in my > setTable(CoreTable _table) method in BfeAttachedTemplates class. > > The getRowCount() is inherited from UIXCollection. > > The setTable(.) method is called by the Trinidad via the "binding" > attribute of tr:table > binding="#{bfeAttachedTemplates.table}" > > I don't know what underlying thing causes it, but when I comment this line, > it works. > > So, maybe it is a bug in Trinidad ? > > Regards, > ________________________ > Ilker Kiris > CTSD - DASF Group > Pershing LLC, a subsidiary of The Bank of New York Mellon Corporation > www.pershing.com > Office: (201)-413-4635 > Fax: (201)-413-9141 > Email: [email protected] > > > From: Richard Yee <[email protected]> > To: MyFaces Discussion <[email protected]> > Date: 07/28/2009 11:05 AM > Subject: Re: Table's data not displayed upon setting "binding" attribute > with tr:table > ________________________________ > > > Use either binding or value, not both. > If you use binding, you need to initialize bound component class with the > table data. > > Richard > > Sent from my iPhone > > On Jul 28, 2009, at 6:52 AM, [email protected] wrote: > > > Hello > > I'm new to Trinidad. > We are trying to introduce Trinidad to our company by using it on my current > project. > > I have a selectable table, and a tr:commandButton that will use the data in > the selected row of table. > > What is happening is; when I set the "binding" attribute, the table's rows > are being rendered empty (as shown in below screen shot) > > <mime-attachment.gif> > > But after I click the "Edit Template" button above and click refresh, table > data is there; > > <mime-attachment.gif> > > If I do NOT set "binding" attribute, then table is fine (like above screen). > > So, what am I doing wrong ? > > Any suggestions ? Any examples similar to what I'm trying to do ? > > > > Below is the jspx code; > ==================== > <?xml version="1.0" encoding="iso-8859-1"?> > <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0" > xmlns:f="http://java.sun.com/jsf/core" > xmlns:h="http://java.sun.com/jsf/html" > xmlns:trh="http://myfaces.apache.org/trinidad/html" > xmlns:tr="http://myfaces.apache.org/trinidad"> > <jsp:directive.page contentType="text/html;charset=utf-8"/> > <f:view> > <tr:document title="Table Demo"> > <tr:form> > <tr:messages/> > <tr:panelGroupLayout> > <!-- TODO change below line to get BFE > name from Managed Bean instance instead of below hard coded value of > 'Compliance' --> > <tr:outputText value="Business > Functional Entitlement Name: Compliance"></tr:outputText> > <tr:panelHeader text="Assigned to the > following default template"></tr:panelHeader> > <!-- > binding="#{bfeAttachedTemplates.table}" --> > <tr:table var="row3_1" > > value="#{bfeAttachedTemplates.bfeTemplates}" > > binding="#{bfeAttachedTemplates.table}" > allDetailsEnabled="true" > rowSelection="single" > > rangeChangeListener="#{bfeAttachedTemplates.createRangeChangeListener}" > width="100%" > rows="2" > rowBandingInterval="1" > emptyText="No Records Found" > summary="Templates"> > <tr:column headerText="Template Name" > width="20%"> > <tr:outputText > value="#{row3_1.templateName}" /> > </tr:column> > <tr:column headerText="Description" > width="80%"> > <tr:outputText > value="#{row3_1.description}" /> > </tr:column> > > <f:facet name="detailStamp" > > <tr:table var="sub" > value="#{row3_1.bfes}" > rows="20" > width="100%" > rowBandingInterval="1" > summary="Detail element > information"> > <tr:column width="10%"> > </tr:column> > <tr:column > headerText="Entitlement Category" width="20%"> > <tr:outputText > value="#{sub.entitlementCategory}"/> > </tr:column> > <tr:column > headerText="Business Functional Entitlement" width="60%"> > <tr:outputText > value="#{sub.bfe}"/> > </tr:column> > <tr:column > headerText="Access Level" width="10%"> > <tr:outputText > value="#{sub.accessLevel}"/> > </tr:column> > </tr:table> > </f:facet> > </tr:table> > > <tr:separator/> > <tr:panelHorizontalLayout > halign="center"> > <tr:commandButton text="Back to > Summary" action="goToSearchBfeSummary"></tr:commandButton> > <tr:spacer width="30" height="10"/> > <tr:commandButton text="Edit > Template" > actionListener="#{bfeAttachedTemplates.goToEditBfeTemplate}"></tr:commandButton> > </tr:panelHorizontalLayout> > <tr:separator/> > > <tr:spacer width="30" height="10"/> > <tr:panelHeader text="Audit > Trail"></tr:panelHeader> > <tr:table var="row3" > value="#{auditTrail.auditTrails}" > width="100%" > rows="20" > rowBandingInterval="1" > emptyText="No Records Found" > summary="Audit Trail"> > <tr:column headerText="Date/Time" > width="15%"> > <tr:outputText > value="#{row3.dateTimeAsString}" /> > </tr:column> > <tr:column headerText="User ID" > width="10%"> > <tr:outputText > value="#{row3.userId}" /> > </tr:column> > <tr:column headerText="User Name" > width="15%"> > <tr:outputText > value="#{row3.userName}" /> > </tr:column> > <tr:column headerText="Activity" > width="5%"> > <tr:outputText > value="#{row3.activity}" /> > </tr:column> > <tr:column headerText="Details" > width="55%"> > <tr:outputText > value="#{row3.details}" /> > </tr:column> > </tr:table> > </tr:panelGroupLayout> > </tr:form> > </tr:document> > </f:view> > </jsp:root> > > Here is the Managed Bean's code; > ============================== > import java.util.ArrayList; > import java.util.List; > > import javax.faces.event.AbortProcessingException; > import javax.faces.event.ActionEvent; > > import org.apache.myfaces.trinidad.component.core.data.CoreTable; > import org.apache.myfaces.trinidad.event.RangeChangeEvent; > import org.apache.myfaces.trinidad.event.RangeChangeListener; > import org.apache.myfaces.trinidad.model.CollectionModel; > import org.apache.myfaces.trinidad.model.ModelUtils; > > /** > * @author ilker kiris > * > */ > public class BfeAttachedTemplates { > /** > * If true > > > ****************************************************** > IMPORTANT: Any information contained in this communication is intended for > the use of the named individual or entity. All information contained in this > communication is not intended or construed as an offer, solicitation, or a > recommendation to purchase any security. Advice, suggestions or views > presented in this communication are not necessarily those of Pershing LLC > nor do they warrant a complete or accurate statement. > > If you are not an intended party to this communication, please notify the > sender and delete/destroy any and all copies of this communication. > Unintended recipients shall not review, reproduce, disseminate nor disclose > any information contained in this communication. Pershing LLC reserves the > right to monitor and retain all incoming and outgoing communications as > permitted by applicable law. > > Email communications may contain viruses or other defects. Pershing LLC does > not accept liability nor does it warrant that email communications are virus > or defect free. > ****************************************************** >

