CVS: Tapestry/framework/src/net/sf/tapestry TapestryStrings.properties,1.36.2.9,1.36.2.10 IForm.java,1.4,1.4.2.1

Howard Lewis Ship <[email protected]>
Newsgroups gmane.comp.java.tapestry.cvs
Message-ID <[email protected]>
Update of /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry
In directory sc8-pr-cvs1:/tmp/cvs-serv8557/framework/src/net/sf/tapestry

Modified Files:
      Tag: hship-2-3
	TapestryStrings.properties IForm.java 
Log Message:
Change Form to record allocated element ids as a hidden field, and compare against it when the form is submitted.
Change StaleLink page to display the message from the StaleLinkException.

Index: TapestryStrings.properties
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/TapestryStrings.properties,v
retrieving revision 1.36.2.9
retrieving revision 1.36.2.10
diff -C2 -d -r1.36.2.9 -r1.36.2.10
*** TapestryStrings.properties	19 Dec 2002 12:26:59 -0000	1.36.2.9
--- TapestryStrings.properties	21 Dec 2002 13:05:47 -0000	1.36.2.10
***************
*** 176,181 ****
  
  Form.forms-may-not-nest=Forms may not be nested.
- Form.bad-element-count=Incorrect number of elements within form {0}.
  Form.needs-body-for-event-handlers=A Form with event handlers must be wrapped by a Body component.
  
  ListEdit.unable-to-convert-value=Unable to convert {0} to an external string in ListEdit component.
--- 176,183 ----
  
  Form.forms-may-not-nest=Forms may not be nested.
  Form.needs-body-for-event-handlers=A Form with event handlers must be wrapped by a Body component.
+ Form.too-many-ids=Rewind of form {0} expected only {1} form elements, but an additional id was requested by component {2}.
+ Form.too-few-ids=Rewind of form {0} expected {1} more form elements, starting with id ''{2}''.
+ Form.id-mismatch=Rewind of form {0} expected allocated id #{1} to be ''{2}'', but was ''{3}'' (requested by component {4}).
  
  ListEdit.unable-to-convert-value=Unable to convert {0} to an external string in ListEdit component.

Index: IForm.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/IForm.java,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -d -r1.4 -r1.4.2.1
*** IForm.java	27 Nov 2002 17:58:45 -0000	1.4
--- IForm.java	21 Dec 2002 13:05:48 -0000	1.4.2.1
***************
*** 60,64 ****
       **/
  
!     public String getElementId(IComponent component);
  
      /**
--- 60,64 ----
       **/
  
!     public String getElementId(IComponent component) throws RequestCycleException;
  
      /**
***************
*** 70,73 ****
--- 70,78 ----
       *  ({@link net.sf.tapestry.form.ImageSubmit}) have more specific control over
       *  their names.
+      * 
+      *  @throws StaleLinkException if, when the form itself is rewinding, the
+      *  element id allocated does not match the expected id (as allocated when the form rendered).
+      *  This indicates that the state of the application has changed between the time the
+      *  form renderred and the time it was submitted.
       *
       *  @since 1.0.5
***************
*** 75,79 ****
       **/
  
!     public String getElementId(String baseId);
  
      /**
--- 80,84 ----
       **/
  
!     public String getElementId(IComponent component, String baseId) throws RequestCycleException;
  
      /**



-------------------------------------------------------
This SF.NET email is sponsored by: Order your Holiday Geek Presents Now!
Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap,
MP3 Players,  XBox Games,  Flying Saucers,  WebCams,  Smart Putty.
T H I N K G E E K . C O M       http://www.thinkgeek.com/sf/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.