You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Glen Stampoultzis <gs...@iinet.net.au> on 2003/10/27 06:25:03 UTC

Form submits.

I'm trying to learn tapestry and I'm having a hard time of it 
unfortunately.  What I'm trying to do at the moment is submit a form.

I have a page with the following parts:

main.html
Main.page
MainPage.java


I tried adding a form with:

<form jwcid="@Form" listener="ognl:listeners.formSubmit">
         ....
</form>

Then adding this to the MainPage.java file:

     public void formSubmit(IRequestCycle requestCycle) {
         }

but I get:

Unable to resolve expression 'listeners.formSubmit' for 
com.avalon.seaview.web.MainPage@302e67[Main].
binding: ExpressionBinding[Main listeners.formSubmit cachedValue=null]
location: context:/Main.html, line 58

any idea's what I'm doing wrong?



Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/

Re: Form submits.

Posted by Glen Stampoultzis <gs...@iinet.net.au>.
Okay... I think I figured out my problem.

I had my .page and .html pages under the webapps/myapp directory instead of 
the webapps/myapp/WEB-INF directory.  It was working for a simple page but 
it causes those strange errors for the more complicated example.

Regards,

Glen


At 06:17 PM 27/10/2003, you wrote:

>Okay.  I changed things a bit and I got rid of the form error. (Still 
>don't understand why).  I'm now getting some problem with an TextField 
>component.  Here's the important bits:
>
>Main.html
>
>             <form jwcid="form">
>             <span jwcid="mytree"></span>
>             <p>
>             <input jwcid="aNewItem"/>
>             <p>
>             <input type="submit" value="Submit"/>
>             </form>
>
>Main.page:
>
><?xml version="1.0" encoding="UTF-8"?>
><!DOCTYPE page-specification PUBLIC
>   "-//Howard Lewis Ship//Tapestry Specification 1.3//EN"
>   "http://tapestry.sf.net/dtd/Tapestry_1_3.dtd">
>
><page-specification class="com.avalon.seaview.web.MainPage">
>
>     <component id="mytree" type="tree">
>         <binding name="items" expression="myItems"/>
>     </component>
>
>     <component id="aNewItem" type="TextField">
>         <binding name="value" expression="newItem"/>
>     </component>
>
>     <component id="form" type="Form">
>
>     </component>
>
></page-specification>
>
>Main page:
>
>public class MainPage
>         extends BasePage
>{
>     List myItems = new ArrayList();
>     String newItem;
>
>     public MainPage()
>     {
>         myItems.add( "Item 1" );
>         myItems.add( "Item 2" );
>     }
>
>     public List getMyItems()
>     {
>         return myItems;
>     }
>
>     public void setMyItems( List myItems )
>     {
>         this.myItems = myItems;
>     }
>
>     public String getNewItem()
>     {
>         return newItem;
>     }
>
>     public void setNewItem( String newItem )
>     {
>         this.newItem = newItem;
>     }
>
>     public void formSubmit(IRequestCycle requestCycle) {
>         System.out.println( "got here" );
>         System.out.println( newItem );
>     }
>
>}
>
>
>
>Many thanks,
>
>Glen
>
>At 04:37 PM 27/10/2003, you wrote:
>>Did you extend MainPage.java from BasePage? If you did, could you post 
>>more code?
>>
>>-Harish
>>
>>
>>Glen Stampoultzis wrote:
>>
>>>
>>>I'm trying to learn tapestry and I'm having a hard time of it 
>>>unfortunately.  What I'm trying to do at the moment is submit a form.
>>>
>>>I have a page with the following parts:
>>>
>>>main.html
>>>Main.page
>>>MainPage.java
>>>
>>>
>>>I tried adding a form with:
>>>
>>><form jwcid="@Form" listener="ognl:listeners.formSubmit">
>>>         ....
>>></form>
>>>
>>>Then adding this to the MainPage.java file:
>>>
>>>     public void formSubmit(IRequestCycle requestCycle) {
>>>         }
>>>
>>>but I get:
>>>
>>>Unable to resolve expression 'listeners.formSubmit' for 
>>>com.avalon.seaview.web.MainPage@302e67[Main].
>>>binding: ExpressionBinding[Main listeners.formSubmit cachedValue=null]
>>>location: context:/Main.html, line 58
>>>
>>>any idea's what I'm doing wrong?
>>>
>>>
>>>
>>>Glen Stampoultzis
>>>gstamp@iinet.net.au
>>>http://members.iinet.net.au/~gstamp/glen/
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>Glen Stampoultzis
>gstamp@iinet.net.au
>http://members.iinet.net.au/~gstamp/glen/


Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/

Re: Form submits.

Posted by Glen Stampoultzis <gs...@iinet.net.au>.
Okay.  I changed things a bit and I got rid of the form error. (Still don't 
understand why).  I'm now getting some problem with an TextField 
component.  Here's the important bits:

Main.html

             <form jwcid="form">
             <span jwcid="mytree"></span>
             <p>
             <input jwcid="aNewItem"/>
             <p>
             <input type="submit" value="Submit"/>
             </form>

Main.page:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE page-specification PUBLIC
   "-//Howard Lewis Ship//Tapestry Specification 1.3//EN"
   "http://tapestry.sf.net/dtd/Tapestry_1_3.dtd">

<page-specification class="com.avalon.seaview.web.MainPage">

     <component id="mytree" type="tree">
         <binding name="items" expression="myItems"/>
     </component>

     <component id="aNewItem" type="TextField">
         <binding name="value" expression="newItem"/>
     </component>

     <component id="form" type="Form">

     </component>

</page-specification>

Main page:

public class MainPage
         extends BasePage
{
     List myItems = new ArrayList();
     String newItem;

     public MainPage()
     {
         myItems.add( "Item 1" );
         myItems.add( "Item 2" );
     }

     public List getMyItems()
     {
         return myItems;
     }

     public void setMyItems( List myItems )
     {
         this.myItems = myItems;
     }

     public String getNewItem()
     {
         return newItem;
     }

     public void setNewItem( String newItem )
     {
         this.newItem = newItem;
     }

     public void formSubmit(IRequestCycle requestCycle) {
         System.out.println( "got here" );
         System.out.println( newItem );
     }

}



Many thanks,

Glen

At 04:37 PM 27/10/2003, you wrote:
>Did you extend MainPage.java from BasePage? If you did, could you post 
>more code?
>
>-Harish
>
>
>Glen Stampoultzis wrote:
>
>>
>>I'm trying to learn tapestry and I'm having a hard time of it 
>>unfortunately.  What I'm trying to do at the moment is submit a form.
>>
>>I have a page with the following parts:
>>
>>main.html
>>Main.page
>>MainPage.java
>>
>>
>>I tried adding a form with:
>>
>><form jwcid="@Form" listener="ognl:listeners.formSubmit">
>>         ....
>></form>
>>
>>Then adding this to the MainPage.java file:
>>
>>     public void formSubmit(IRequestCycle requestCycle) {
>>         }
>>
>>but I get:
>>
>>Unable to resolve expression 'listeners.formSubmit' for 
>>com.avalon.seaview.web.MainPage@302e67[Main].
>>binding: ExpressionBinding[Main listeners.formSubmit cachedValue=null]
>>location: context:/Main.html, line 58
>>
>>any idea's what I'm doing wrong?
>>
>>
>>
>>Glen Stampoultzis
>>gstamp@iinet.net.au
>>http://members.iinet.net.au/~gstamp/glen/
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/

Re: Form submits.

Posted by Harish Krishnaswamy <hk...@comcast.net>.
Did you extend MainPage.java from BasePage? If you did, could you post 
more code?

-Harish


Glen Stampoultzis wrote:

>
> I'm trying to learn tapestry and I'm having a hard time of it 
> unfortunately.  What I'm trying to do at the moment is submit a form.
>
> I have a page with the following parts:
>
> main.html
> Main.page
> MainPage.java
>
>
> I tried adding a form with:
>
> <form jwcid="@Form" listener="ognl:listeners.formSubmit">
>         ....
> </form>
>
> Then adding this to the MainPage.java file:
>
>     public void formSubmit(IRequestCycle requestCycle) {
>         }
>
> but I get:
>
> Unable to resolve expression 'listeners.formSubmit' for 
> com.avalon.seaview.web.MainPage@302e67[Main].
> binding: ExpressionBinding[Main listeners.formSubmit cachedValue=null]
> location: context:/Main.html, line 58
>
> any idea's what I'm doing wrong?
>
>
>
> Glen Stampoultzis
> gstamp@iinet.net.au
> http://members.iinet.net.au/~gstamp/glen/
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org