You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by st...@wachovia.com on 2005/09/09 22:36:58 UTC
help with upload component in 4.0 in Tapestry portlet
I have a Tapestry portlet. Trying to get some of the basic components to
work, Upload in this case. Doesnt seem like my listener is getting
invoked. Anything blatantly wrong? I have a System.out thats never getting
hit. The portlet is deployed in JBoss portal 2.0.
// View.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="com.wachovia.tapestry.portlet.View">
<component id="upload" type="Upload">
<binding name="file" value="uploaded"/>
</component>
<component id="uploadForm" type="Form">
<binding name="listener" value="uploadSubmit"/>
</component>
</page-specification>
// View.html
<form jwcid="uploadForm">
<table bgcolor="#c0c0c0" cellpadding="4">
<tr><td><input jwcid="upload" type="file"/></td></tr>
<tr><td><input type="submit" value="upload"/></td></tr>
</table>
</form>
// View.java
public abstract class View extends BasePage implements
PageBeginRenderListener {
private IUploadFile uploaded;
public abstract IUploadFile getUploaded();
public abstract void setUploaded(IUploadFile uploaded);
/* (non-Javadoc)
* @see
org.apache.tapestry.event.PageBeginRenderListener#pageBeginRender(org.apache.tapestry.event.PageEvent)
*/
public void pageBeginRender(PageEvent arg0) {}
public void uploadSubmit(IRequestCycle cycle) {
System.out.println("uploadSubmit invoked");
String path = "c:\tmp";
IUploadFile file = getUploaded();
File destFile = new File(path + "/" + file.getFileName());
file.write(destFile);
}
}
Re: help with upload component in 4.0 in Tapestry portlet
Posted by Howard Lewis Ship <hl...@gmail.com>.
Please add a bug to JIRA. I just checked ... I forgot to move the
upload support from the Servlet pipeline to the generic pipeline
(where it can be shared by the portlet code).
On 9/9/05, steven.libonati@wachovia.com <st...@wachovia.com> wrote:
> I have a Tapestry portlet. Trying to get some of the basic components to
> work, Upload in this case. Doesnt seem like my listener is getting
> invoked. Anything blatantly wrong? I have a System.out thats never getting
> hit. The portlet is deployed in JBoss portal 2.0.
>
> // View.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="com.wachovia.tapestry.portlet.View">
>
> <component id="upload" type="Upload">
> <binding name="file" value="uploaded"/>
> </component>
>
> <component id="uploadForm" type="Form">
> <binding name="listener" value="uploadSubmit"/>
> </component>
>
> </page-specification>
>
> // View.html
> <form jwcid="uploadForm">
> <table bgcolor="#c0c0c0" cellpadding="4">
> <tr><td><input jwcid="upload" type="file"/></td></tr>
> <tr><td><input type="submit" value="upload"/></td></tr>
> </table>
> </form>
>
> // View.java
>
> public abstract class View extends BasePage implements
> PageBeginRenderListener {
> private IUploadFile uploaded;
>
> public abstract IUploadFile getUploaded();
> public abstract void setUploaded(IUploadFile uploaded);
>
> /* (non-Javadoc)
> * @see
> org.apache.tapestry.event.PageBeginRenderListener#pageBeginRender(org.apache.tapestry.event.PageEvent)
> */
> public void pageBeginRender(PageEvent arg0) {}
>
> public void uploadSubmit(IRequestCycle cycle) {
> System.out.println("uploadSubmit invoked");
>
> String path = "c:\tmp";
> IUploadFile file = getUploaded();
> File destFile = new File(path + "/" + file.getFileName());
> file.write(destFile);
> }
> }
>
--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
Professional Tapestry training, mentoring, support
and project work. http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: help with upload component in 4.0 in Tapestry portlet
Posted by Nick Stuart <ba...@gmail.com>.
I'm actually not 100% sure if its required or not but the sumbit
button should have a jwcid="@Submit" on it. Try it out and see it
works.
On 9/9/05, steven.libonati@wachovia.com <st...@wachovia.com> wrote:
> I have a Tapestry portlet. Trying to get some of the basic components to
> work, Upload in this case. Doesnt seem like my listener is getting
> invoked. Anything blatantly wrong? I have a System.out thats never getting
> hit. The portlet is deployed in JBoss portal 2.0.
>
> // View.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="com.wachovia.tapestry.portlet.View">
>
> <component id="upload" type="Upload">
> <binding name="file" value="uploaded"/>
> </component>
>
> <component id="uploadForm" type="Form">
> <binding name="listener" value="uploadSubmit"/>
> </component>
>
> </page-specification>
>
> // View.html
> <form jwcid="uploadForm">
> <table bgcolor="#c0c0c0" cellpadding="4">
> <tr><td><input jwcid="upload" type="file"/></td></tr>
> <tr><td><input type="submit" value="upload"/></td></tr>
> </table>
> </form>
>
> // View.java
>
> public abstract class View extends BasePage implements
> PageBeginRenderListener {
> private IUploadFile uploaded;
>
> public abstract IUploadFile getUploaded();
> public abstract void setUploaded(IUploadFile uploaded);
>
> /* (non-Javadoc)
> * @see
> org.apache.tapestry.event.PageBeginRenderListener#pageBeginRender(org.apache.tapestry.event.PageEvent)
> */
> public void pageBeginRender(PageEvent arg0) {}
>
> public void uploadSubmit(IRequestCycle cycle) {
> System.out.println("uploadSubmit invoked");
>
> String path = "c:\tmp";
> IUploadFile file = getUploaded();
> File destFile = new File(path + "/" + file.getFileName());
> file.write(destFile);
> }
> }
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org