Author: ivaynberg Date: Tue Nov 16 20:54:59 2010 New Revision: 1035809 URL: http://svn.apache.org/viewvc?rev=1035809&view=rev Log:
Issue: WICKET-3167 Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Page.java wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Check.java wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Radio.java Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Page.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Page.java?rev=1035809&r1=1035808&r2=1035809&view=diff ============================================================================== --- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Page.java (original) +++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Page.java Tue Nov 16 20:54:59 2010 @@ -203,6 +203,8 @@ public abstract class Page extends Marku /** Used to create page-unique numbers */ private short autoIndex; + private int autoIndex2; + /** Numeric version of this page's id */ private int numericId; @@ -466,6 +468,23 @@ public abstract class Page extends Marku } /** + * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL IT. + * + * Get a page unique number, which will be increased with each call. + * + * In some extreme cases it is possible to run out of short values, so this is the {...@code int} + * version of {...@link #autoIndex} which will hopefully not run out. It does not replace the + * original in order to preserve API backwards compat. + * + * @return A page unique number + */ + public final int getAutoIndex2() + { + return autoIndex2++; + } + + + /** * @return The current version number of this page. If the page has been changed once, the * return value will be 1. If the page has not yet been revised, the version returned * will be 0, indicating that the page is still in its original state. Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Check.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Check.java?rev=1035809&r1=1035808&r2=1035809&view=diff ============================================================================== --- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Check.java (original) +++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Check.java Tue Nov 16 20:54:59 2010 @@ -62,7 +62,7 @@ public class Check<T> extends LabeledWeb * page-scoped uuid of this check. this property must not be accessed directly, instead * {...@link #getValue()} must be used */ - private short uuid = -1; + private int uuid = -1; private final CheckGroup<T> group; @@ -120,7 +120,7 @@ public class Check<T> extends LabeledWeb { if (uuid < 0) { - uuid = getPage().getAutoIndex(); + uuid = getPage().getAutoIndex2(); } return "check" + uuid; } Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Radio.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Radio.java?rev=1035809&r1=1035808&r2=1035809&view=diff ============================================================================== --- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Radio.java (original) +++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Radio.java Tue Nov 16 20:54:59 2010 @@ -59,7 +59,7 @@ public class Radio<T> extends LabeledWeb * page-scoped uuid of this check. this property must not be accessed directly, instead * {...@link #getValue()} must be used */ - private short uuid = -1; + private int uuid = -1; private final RadioGroup<T> group; @@ -116,7 +116,7 @@ public class Radio<T> extends LabeledWeb { if (uuid < 0) { - uuid = getPage().getAutoIndex(); + uuid = getPage().getAutoIndex2(); } return "radio" + uuid; }