Maybe is because you have
if(getFiles()!= null) {
Maybe you should use
if(getFiles() == null) {
You're never initializing the value of files...
On 7/22/05, alex <[EMAIL PROTECTED]> wrote:
> Hi everyone ! I'm new to tapestry...
>
> I tried to build an example with contrib:Table component.(is the table example
> from the wiki ... but i tried to change it using tapestry 4 way...)
> I'm using tapestry beta 2 , jdk 5.0 , jetty 5.1.4 , eclipse 3.1.
>
> ---------------------
> The exception is this :
>
> Either the tableModel parameter or both source and columns parameters must be
> specified by component Home/fileTable.tableView
> Stack Trace:
> org.apache.tapestry.contrib.table.components.TableView.getTableModel
> (TableView.java:222)
> org.apache.tapestry.contrib.table.components.TableView.validateValues
> (TableView.java:467)
> org.apache.tapestry.contrib.table.components.TableView.renderComponent
> (TableView.java:499)
> org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:628)
> org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
>
> -----------------------------
>
> The source files are these :
>
> --------Home.html -------------
> <html>
> <head></head>
> <body>
> <span jwcid="[EMAIL PROTECTED]:Table" source="ognl:files"
> columns="filename:File:filename,!action"/>
> </body>
> </html>
> --------------------------
>
> ----------Home.page----------------
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE page-specification PUBLIC
> "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
> "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
>
>
> <page-specification class="tutorials.filelist.pages.FileList">
>
> <description>add a description</description>
>
> </page-specification>
> ------------------------------------------
>
> -----------FileList.java-----------------------
> package tutorials.filelist.pages;
>
> import java.io.File;
>
> import org.apache.tapestry.annotations.Bean;
> import org.apache.tapestry.annotations.Persist;
> import org.apache.tapestry.event.PageEvent;
> import org.apache.tapestry.event.PageRenderListener;
> import org.apache.tapestry.html.BasePage;
>
> public abstract class FileList extends BasePage implements PageRenderListener
> {
>
> @Persist("session")
> public abstract FileEntry[] getFiles();
> public abstract void setFiles(FileEntry[] archive);
>
> public void pageBeginRender(PageEvent event) {
> // TODO Auto-generated method stub
> if(getFiles()!= null) {
> FileEntry[] filesToShowInTheTable;
> FileEntry file1 = new FileEntry();
> file1.setId(1);
> file1.setFileName(new File("C:\file.txt"));
> filesToShowInTheTable = new FileEntry[1];
> filesToShowInTheTable[0] = file1;
>
> setFiles(filesToShowInTheTable);
>
> }
>
> }
>
> }
> -------------------------------
>
>
> I hope i did not miss anything.
> I know i must have done someting stupid... but i don't know what.
>
> Trying to find the cause for not taking into account the source , which
> is "files" , the last thing i could find was that the context build by ognl ,
> which has the root "Home" , does not contain "files" , and that is why it can
> not find it ... I don't know this has any relevance.Hope it has.
>
> Please help.Any kind of hint is more than welcome.
>
> Thanks!
>
> , Alex
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Communism is man's exploitation of man. Capitalism is just the opposite.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]