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 2004/02/03 04:46:49 UTC

Conditional form elements. Does it work?

I've got a form with some conditional form controls.  At the top of the 
form is a selection control that submits on change.  When it submits it 
triggers a condition that adds more elements to the form.  This gives the 
following error:

--------------8<-------------------
You have clicked on a stale link.

Rewind of form ConfigureSeaview/form expected only 1 form elements, but an 
additional id was requested by component ConfigureSeaview/hostName.

This is most likely the result of using your browser's back button, but can 
also be an application error.
--------------8<-------------------

I think I understand why this happens but what I really need is a way I can 
implement this behavior without triggering this error.

Here's the form I'm using:

--------------8<-------------------
<form jwcid="form@Form" listener="ognl:listeners.submit" 
delegate="ognl:beans.delegate">
   <p>&nbsp;</p>
   <table border="0">
     <tr>
       <td>Please select the type of database you wish to run:</td>
       <td><select id="dbType" jwcid="dbType" name="select"/>
                         </td>
     </tr>
     <tr>
       <td>&nbsp;</td>
       <td>&nbsp;</td>
     </tr>
   </table>
   <p>&nbsp; </p>
         <div jwcid="mssqlserver">
                 <table border="0">
                         <tr>
                                 <td>Host Name: </td>
                                 <td><input type="text" jwcid="hostName"/></td>
                         </tr>
                         <tr>
                                 <td>Port: </td>
                                 <td><input type="text" jwcid="port"/></td>
                         </tr>
                         <tr>
                                 <td>Database: </td>
                                 <td><input type="text" jwcid="database"/></td>
                         </tr>
                         <tr>
                                 <td>Username: </td>
                                 <td><input type="text" jwcid="username"/></td>
                         </tr>
                         <tr>
                                 <td>Password:</td>
                                 <td><input type="password" 
jwcid="password"/></td>
                         </tr>
                 </table>
         </div>
   <p>&nbsp;  </p>
   <p><input value="Submit" type="submit"></p>
</form>
--------------8<-------------------






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

Re: Conditional form elements. Does it work?

Posted by Harish Krishnaswamy <hk...@comcast.net>.
You are right, FormConditional does belong in the core library and it 
will find its way in, in 3.1. We are in beta now and so are hesitant to 
add new stuff to the framework.

-Harish

Glen Stampoultzis wrote:

>
> Interesting...  before I saw your response I experimented with 
> creating a <property-specification> and using that to set or reset the 
> section (in combination with a hidden field to pass the value through 
> between resets).  This approach seemed to work okay.  Presumably 
> because the value isn't changing until after the rewind (but before 
> the second render).  FormConditional sounds easier though.
>
> What's difference between contrib and the standard library?  It seems 
> to me that FormConditional would be important enough to stick in the 
> standard library.
>
> Thanks for your help,
>
> Glen
>
>
> At 03:30 PM 3/02/2004, you wrote:
>
>> There is a FormConditional component in contrib that you might want 
>> to use. That should take care of this problem.
>>
>> -Harish
>>
>> Glen Stampoultzis wrote:
>>
>>>
>>> I've got a form with some conditional form controls.  At the top of 
>>> the form is a selection control that submits on change.  When it 
>>> submits it triggers a condition that adds more elements to the form.
>>> This gives the following error:
>>>
>>> --------------8<-------------------
>>> You have clicked on a stale link.
>>>
>>> Rewind of form ConfigureSeaview/form expected only 1 form elements, 
>>> but an additional id was requested by component 
>>> ConfigureSeaview/hostName.
>>>
>>> This is most likely the result of using your browser's back button, 
>>> but can also be an application error.
>>> --------------8<-------------------
>>>
>>> I think I understand why this happens but what I really need is a 
>>> way I can implement this behavior without triggering this error.
>>>
>>> Here's the form I'm using:
>>>
>>> --------------8<-------------------
>>> <form jwcid="form@Form" listener="ognl:listeners.submit" 
>>> delegate="ognl:beans.delegate">
>>>   <p>&nbsp;</p>
>>>   <table border="0">
>>>     <tr>
>>>       <td>Please select the type of database you wish to run:</td>
>>>       <td><select id="dbType" jwcid="dbType" name="select"/>
>>>                         </td>
>>>     </tr>
>>>     <tr>
>>>       <td>&nbsp;</td>
>>>       <td>&nbsp;</td>
>>>     </tr>
>>>   </table>
>>>   <p>&nbsp; </p>
>>>         <div jwcid="mssqlserver">
>>>                 <table border="0">
>>>                         <tr>
>>>                                 <td>Host Name: </td>
>>>                                 <td><input type="text" 
>>> jwcid="hostName"/></td>
>>>                         </tr>
>>>                         <tr>
>>>                                 <td>Port: </td>
>>>                                 <td><input type="text" 
>>> jwcid="port"/></td>
>>>                         </tr>
>>>                         <tr>
>>>                                 <td>Database: </td>
>>>                                 <td><input type="text" 
>>> jwcid="database"/></td>
>>>                         </tr>
>>>                         <tr>
>>>                                 <td>Username: </td>
>>>                                 <td><input type="text" 
>>> jwcid="username"/></td>
>>>                         </tr>
>>>                         <tr>
>>>                                 <td>Password:</td>
>>>                                 <td><input type="password" 
>>> jwcid="password"/></td>
>>>                         </tr>
>>>                 </table>
>>>         </div>
>>>   <p>&nbsp;  </p>
>>>   <p><input value="Submit" type="submit"></p>
>>> </form>
>>> --------------8<-------------------
>>>
>>>
>>>
>>>
>>>
>>>
>>> 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/
>

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


RE: Conditional form elements. Does it work?

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Useful components usually start in contrib, get stable and then can move to the framework proper.

In some cases (such as Palette and Table) it is useful to keep them out of the core, to demonstrate
just how much can be done from a library (that is, what can be packaged into a component library,
such as assets, scripts, services, etc).

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components 
http://howardlewisship.com


> -----Original Message-----
> From: Glen Stampoultzis [mailto:gstamp@iinet.net.au] 
> Sent: Monday, February 02, 2004 11:55 PM
> To: Tapestry users
> Subject: Re: Conditional form elements. Does it work?
> 
> 
> 
> Interesting...  before I saw your response I experimented 
> with creating a 
> <property-specification> and using that to set or reset the 
> section (in 
> combination with a hidden field to pass the value through between 
> resets).  This approach seemed to work okay.  Presumably 
> because the value 
> isn't changing until after the rewind (but before the second 
> render).  FormConditional sounds easier though.
> 
> What's difference between contrib and the standard library?  
> It seems to me 
> that FormConditional would be important enough to stick in 
> the standard 
> library.
> 
> Thanks for your help,
> 
> Glen
> 
> 
> At 03:30 PM 3/02/2004, you wrote:
> >There is a FormConditional component in contrib that you 
> might want to 
> >use. That should take care of this problem.
> >
> >-Harish
> >
> >Glen Stampoultzis wrote:
> >
> >>
> >>I've got a form with some conditional form controls.  At 
> the top of the 
> >>form is a selection control that submits on change.  When 
> it submits it 
> >>triggers a condition that adds more elements to the form.
> >>This gives the following error:
> >>
> >>--------------8<-------------------
> >>You have clicked on a stale link.
> >>
> >>Rewind of form ConfigureSeaview/form expected only 1 form 
> elements, but 
> >>an additional id was requested by component 
> ConfigureSeaview/hostName.
> >>
> >>This is most likely the result of using your browser's back 
> button, but 
> >>can also be an application error.
> >>--------------8<-------------------
> >>
> >>I think I understand why this happens but what I really 
> need is a way I 
> >>can implement this behavior without triggering this error.
> >>
> >>Here's the form I'm using:
> >>
> >>--------------8<-------------------
> >><form jwcid="form@Form" listener="ognl:listeners.submit" 
> >>delegate="ognl:beans.delegate">
> >>   <p>&nbsp;</p>
> >>   <table border="0">
> >>     <tr>
> >>       <td>Please select the type of database you wish to run:</td>
> >>       <td><select id="dbType" jwcid="dbType" name="select"/>
> >>                         </td>
> >>     </tr>
> >>     <tr>
> >>       <td>&nbsp;</td>
> >>       <td>&nbsp;</td>
> >>     </tr>
> >>   </table>
> >>   <p>&nbsp; </p>
> >>         <div jwcid="mssqlserver">
> >>                 <table border="0">
> >>                         <tr>
> >>                                 <td>Host Name: </td>
> >>                                 <td><input type="text" 
> >> jwcid="hostName"/></td>
> >>                         </tr>
> >>                         <tr>
> >>                                 <td>Port: </td>
> >>                                 <td><input type="text" 
> jwcid="port"/></td>
> >>                         </tr>
> >>                         <tr>
> >>                                 <td>Database: </td>
> >>                                 <td><input type="text" 
> >> jwcid="database"/></td>
> >>                         </tr>
> >>                         <tr>
> >>                                 <td>Username: </td>
> >>                                 <td><input type="text" 
> >> jwcid="username"/></td>
> >>                         </tr>
> >>                         <tr>
> >>                                 <td>Password:</td>
> >>                                 <td><input type="password" 
> >> jwcid="password"/></td>
> >>                         </tr>
> >>                 </table>
> >>         </div>
> >>   <p>&nbsp;  </p>
> >>   <p><input value="Submit" type="submit"></p>
> >></form>
> >>--------------8<-------------------
> >>
> >>
> >>
> >>
> >>
> >>
> >>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/
> 


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


Re: Conditional form elements. Does it work?

Posted by Glen Stampoultzis <gs...@iinet.net.au>.
Interesting...  before I saw your response I experimented with creating a 
<property-specification> and using that to set or reset the section (in 
combination with a hidden field to pass the value through between 
resets).  This approach seemed to work okay.  Presumably because the value 
isn't changing until after the rewind (but before the second 
render).  FormConditional sounds easier though.

What's difference between contrib and the standard library?  It seems to me 
that FormConditional would be important enough to stick in the standard 
library.

Thanks for your help,

Glen


At 03:30 PM 3/02/2004, you wrote:
>There is a FormConditional component in contrib that you might want to 
>use. That should take care of this problem.
>
>-Harish
>
>Glen Stampoultzis wrote:
>
>>
>>I've got a form with some conditional form controls.  At the top of the 
>>form is a selection control that submits on change.  When it submits it 
>>triggers a condition that adds more elements to the form.
>>This gives the following error:
>>
>>--------------8<-------------------
>>You have clicked on a stale link.
>>
>>Rewind of form ConfigureSeaview/form expected only 1 form elements, but 
>>an additional id was requested by component ConfigureSeaview/hostName.
>>
>>This is most likely the result of using your browser's back button, but 
>>can also be an application error.
>>--------------8<-------------------
>>
>>I think I understand why this happens but what I really need is a way I 
>>can implement this behavior without triggering this error.
>>
>>Here's the form I'm using:
>>
>>--------------8<-------------------
>><form jwcid="form@Form" listener="ognl:listeners.submit" 
>>delegate="ognl:beans.delegate">
>>   <p>&nbsp;</p>
>>   <table border="0">
>>     <tr>
>>       <td>Please select the type of database you wish to run:</td>
>>       <td><select id="dbType" jwcid="dbType" name="select"/>
>>                         </td>
>>     </tr>
>>     <tr>
>>       <td>&nbsp;</td>
>>       <td>&nbsp;</td>
>>     </tr>
>>   </table>
>>   <p>&nbsp; </p>
>>         <div jwcid="mssqlserver">
>>                 <table border="0">
>>                         <tr>
>>                                 <td>Host Name: </td>
>>                                 <td><input type="text" 
>> jwcid="hostName"/></td>
>>                         </tr>
>>                         <tr>
>>                                 <td>Port: </td>
>>                                 <td><input type="text" jwcid="port"/></td>
>>                         </tr>
>>                         <tr>
>>                                 <td>Database: </td>
>>                                 <td><input type="text" 
>> jwcid="database"/></td>
>>                         </tr>
>>                         <tr>
>>                                 <td>Username: </td>
>>                                 <td><input type="text" 
>> jwcid="username"/></td>
>>                         </tr>
>>                         <tr>
>>                                 <td>Password:</td>
>>                                 <td><input type="password" 
>> jwcid="password"/></td>
>>                         </tr>
>>                 </table>
>>         </div>
>>   <p>&nbsp;  </p>
>>   <p><input value="Submit" type="submit"></p>
>></form>
>>--------------8<-------------------
>>
>>
>>
>>
>>
>>
>>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: Conditional form elements. Does it work?

Posted by Harish Krishnaswamy <hk...@comcast.net>.
There is a FormConditional component in contrib that you might want to 
use. That should take care of this problem.

-Harish

Glen Stampoultzis wrote:

>
> I've got a form with some conditional form controls.  At the top of 
> the form is a selection control that submits on change.  When it 
> submits it triggers a condition that adds more elements to the form.  
> This gives the following error:
>
> --------------8<-------------------
> You have clicked on a stale link.
>
> Rewind of form ConfigureSeaview/form expected only 1 form elements, 
> but an additional id was requested by component 
> ConfigureSeaview/hostName.
>
> This is most likely the result of using your browser's back button, 
> but can also be an application error.
> --------------8<-------------------
>
> I think I understand why this happens but what I really need is a way 
> I can implement this behavior without triggering this error.
>
> Here's the form I'm using:
>
> --------------8<-------------------
> <form jwcid="form@Form" listener="ognl:listeners.submit" 
> delegate="ognl:beans.delegate">
>   <p>&nbsp;</p>
>   <table border="0">
>     <tr>
>       <td>Please select the type of database you wish to run:</td>
>       <td><select id="dbType" jwcid="dbType" name="select"/>
>                         </td>
>     </tr>
>     <tr>
>       <td>&nbsp;</td>
>       <td>&nbsp;</td>
>     </tr>
>   </table>
>   <p>&nbsp; </p>
>         <div jwcid="mssqlserver">
>                 <table border="0">
>                         <tr>
>                                 <td>Host Name: </td>
>                                 <td><input type="text" 
> jwcid="hostName"/></td>
>                         </tr>
>                         <tr>
>                                 <td>Port: </td>
>                                 <td><input type="text" 
> jwcid="port"/></td>
>                         </tr>
>                         <tr>
>                                 <td>Database: </td>
>                                 <td><input type="text" 
> jwcid="database"/></td>
>                         </tr>
>                         <tr>
>                                 <td>Username: </td>
>                                 <td><input type="text" 
> jwcid="username"/></td>
>                         </tr>
>                         <tr>
>                                 <td>Password:</td>
>                                 <td><input type="password" 
> jwcid="password"/></td>
>                         </tr>
>                 </table>
>         </div>
>   <p>&nbsp;  </p>
>   <p><input value="Submit" type="submit"></p>
> </form>
> --------------8<-------------------
>
>
>
>
>
>
> 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