John,
found two case errors in getter/setter:
value="#{quarantineRec.matchtext}"
getMatchText()
value="#{quarantineRec.filteredby}"
getFilteredBy()
after fixing this, creating a dummy QuarantineBean and removing the
layout tag from jsp i added this to tobago-example-demo and it worked fine.
see attached files for my changes
Regards,
Volker
John wrote:
> <%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="t"
> %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <%@ taglib tagdir="/WEB-INF/tags/layout" prefix="layout" %>
> <layout:main>
> <jsp:body>
> <t:panel>
> <f:facet name="layout">
> <t:gridLayout rows="fixed"/>
> </f:facet>
> <t:box height="300px" width="800px">
> <t:sheet value="#{quarantine.messagesList}" id="sheet"
> columns="3*;3*;3*;3*;3*"
> var="quarantineRec" state="#{quarantine.selectedMessages}"
> showPageRange="right" pagingLength="7">
> <t:column label="From" id="From" sortable="true">
> <t:out value="#{quarantineRec.sender}"/>
> </t:column>
> <t:column label="To" id="To" sortable="false" align="center">
> <t:out value="#{quarantineRec.recipient}"/>
> </t:column>
> <t:column label="Subject" id="Subject" sortable="true">
> <t:out value="#{quarantineRec.subject}"/>
> </t:column>
> <t:column label="Matched" id="Matched" sortable="true">
> <t:out value="#{quarantineRec.matchtext}"/>
> </t:column>
> <t:column label="Filtered" id="Filtered" sortable="true">
> <t:out value="#{quarantineRec.filteredby}"/>
> </t:column>
> </t:sheet>
> </t:box>
> </t:panel>
> </jsp:body>
> </layout:main>
>
> --------------------
> QuarantineRec
> --------------------
> public class QuarantineRec {
> private int id = 0;
> private String filename = null;
> private String sender = null;
> private String recipient = null;
> private String subject = null;
> private String filteredby = null;
> private String matchtext = null;
>
> public QuarantineRec() {}
>
> String quarantine = System.getProperty("EMP.home") +
> File.separatorChar +
> "Data"
> + File.separatorChar + "RouterProcessorEngines" +
> File.separatorChar
> + "0" + File.separatorChar + "Quarantine";
>
> public int getId() { return this.id; }
> public void setId(int id) { this.id = id; }
> public String getFilename() { return this.filename; }
> public void setFilename(String filename) { this.filename = filename; }
> public String getSender() { return this.sender; }
> public void setSender(String sender) { this.sender = sender; }
> public String getRecipient() { return this.recipient; }
> public void setRecipient(String recipient) { this.recipient =
> recipient; }
> public String getSubject() { return this.subject; }
> public void setSubject(String subject) { this.subject = subject; }
> public String getFilteredBy() { return this.filteredby; }
> public void setFilteredBy(String filteredby) { this.filteredby =
> filteredby; }
> public String getMatchText() { return this.matchtext; }
> public void setMatchText(String matchtext) { this.matchtext =
> matchtext; }
>
> public String getFullFilename() {
> return quarantine + File.separatorChar + filename;
> }
>
> }
>
> -----Original Message-----
> From: Volker Weber [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 03, 2006 12:36 PM
> To: MyFaces Discussion
> Subject: Re: Question on passing List to Sheet in Tobago
>
> They are accessed via getters.
>
> Please post your code of the sheet, maybe i can find the problem.
>
> Have you looked at the sheet in the tobago examples?
>
> Regards,
> Volker
>
> John wrote:
>
>>Are the properties accessed directly (they must be public)? Or, are
>>they accessed via getters (they can be private)?
>>Right now they are private with getters. I'm using the syntax you
>>stated in the sheet - not working.
>>
>>Thanks,
>>
>>John
>>
>>-----Original Message-----
>>From: Volker Weber [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, May 03, 2006 12:17 PM
>>To: MyFaces Discussion
>>Subject: Re: Question on passing List to Sheet in Tobago
>>
>>John,
>>
>>each of the lists objects could accessed while rendering a row by the
>>name set to the var attribute of the sheet.
>>
>>e.g.: you have a managedBean "bean" with a property "persons", which
>>is a list of person objects. The person object has a property "name".
>>
>><tc:sheet value="#{bean.persons}" var="data">
>> <tc:column label="Header">
>> <tc:out value="#{data.name}"/>
>> <tc:column>
>></tc:sheet>
>>
>>here var="data" means you can access the person object inside the
>>sheet by #{data}.
>>
>>Regards,
>> Volker
>>
>>John wrote:
>>
>>
>>>When using a List as a datasource for a sheet, where the List contains
>>
>>
>>>objects that represent row field data, how does the sheet know how to
>>>break the object's data apart for display in the various fields.
>>>
>>>I originally thought that I could just do getters in the object
>>>matching the field names in the sheet, but it doesn't get the data. It
>>
>>
>>>shows the right number of rows, so I know it's retrieving the List
>>>members ok, it just doesn't display the field data.
>>>
>>>John
>>>
>>
>>
>>--
>>Don't answer to From: address!
>>Mail to this account are droped if not recieved via mailinglist.
>>To contact me direct create the mail address by concatenating my
>>forename to my senders domain.
>>
>
>
> --
> Don't answer to From: address!
> Mail to this account are droped if not recieved via mailinglist.
> To contact me direct create the mail address by concatenating my
> forename to my senders domain.
>
--
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.
<%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="t"
%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:view>
<t:page>
<t:panel>
<f:facet name="layout">
<t:gridLayout rows="fixed"/>
</f:facet>
<t:box height="300px" width="800px">
<t:sheet value="#{quarantine.messagesList}" id="sheet"
columns="3*;3*;3*;3*;3*"
var="quarantineRec" state="#{quarantine.selectedMessages}"
showPageRange="right" pagingLength="7">
<t:column label="From" id="From" sortable="true">
<t:out value="#{quarantineRec.sender}"/>
</t:column>
<t:column label="To" id="To" sortable="false" align="center">
<t:out value="#{quarantineRec.recipient}"/>
</t:column>
<t:column label="Subject" id="Subject" sortable="true">
<t:out value="#{quarantineRec.subject}"/>
</t:column>
<t:column label="Matched" id="Matched" sortable="true">
<t:out value="#{quarantineRec.matchtext}"/>
</t:column>
<t:column label="Filtered" id="Filtered" sortable="true">
<t:out value="#{quarantineRec.filteredby}"/>
</t:column>
</t:sheet>
</t:box>
</t:panel>
</t:page>
</f:view>package org.apache.myfaces.tobago.example.demo.test;
import org.apache.myfaces.tobago.model.SheetState;
import java.util.List;
import java.util.ArrayList;
/**
* Created by IntelliJ IDEA.
* User: weber
* Date: 03.05.2006
* Time: 22:17:50
* To change this template use File | Settings | File Templates.
*/
public class QuarantineBean {
public List<QuarantineRec> messagesList;
public SheetState selectedMessages;
public QuarantineBean() {
messagesList = new ArrayList<QuarantineRec>(20);
for (int i = 0; i < 20; i++) {
messagesList.add(new QuarantineRec(i));
}
}
public List<QuarantineRec> getMessagesList() {
return messagesList;
}
public void setMessagesList(List<QuarantineRec> messagesList) {
this.messagesList = messagesList;
}
public SheetState getSelectedMessages() {
return selectedMessages;
}
public void setSelectedMessages(SheetState selectedMessages) {
this.selectedMessages = selectedMessages;
}
}
package org.apache.myfaces.tobago.example.demo.test;
import java.io.File;
/**
* Created by IntelliJ IDEA.
* User: weber
* Date: 03.05.2006
* Time: 22:10:57
* To change this template use File | Settings | File Templates.
*/
public class QuarantineRec {
private int id = 0;
private String filename = null;
private String sender = null;
private String recipient = null;
private String subject = null;
private String filteredby = null;
private String matchtext = null;
public QuarantineRec() {
}
public QuarantineRec(int i) {
id = i;
sender = "sender_" + i;
recipient = "recipient_" + i;
subject = "subject_" + i;
filteredby = "filteredby_" + i;
matchtext = "matchtext_" + i;
}
String quarantine = System.getProperty("EMP.home") +
File.separatorChar +
"Data"
+ File.separatorChar + "RouterProcessorEngines" +
File.separatorChar
+ "0" + File.separatorChar + "Quarantine";
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public String getFilename() {
return this.filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
public String getSender() {
return this.sender;
}
public void setSender(String sender) {
this.sender = sender;
}
public String getRecipient() {
return this.recipient;
}
public void setRecipient(String recipient) {
this.recipient =
recipient;
}
public String getSubject() {
return this.subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getFilteredby() {
return this.filteredby;
}
public void setFilteredby(String filteredby) {
this.filteredby =
filteredby;
}
public String getMatchtext() {
return this.matchtext;
}
public void setMatchtext(String matchtext) {
this.matchtext =
matchtext;
}
public String getFullFilename() {
return quarantine + File.separatorChar + filename;
}
}