When I supply Integer as the type, i get an error cannot cast "Long" to "Integer"
D/ On Jul 22, 2010, at 5:01 PM, Josh Glassman wrote: > There is also a constructor that will take a Class type as a parameter. > > On Thu, Jul 22, 2010 at 3:11 PM, T Ames <tamesw...@gmail.com> wrote: > >> I think you have to use the setType(Integer.class) method on the TextField >> object. >> >> setType >> >> public final FormComponent >> >> <file:///C:/Downloads/Java/wicket/apache-wicket-1.4.1/apidocs/org/apache/wicket/markup/html/form/FormComponent.html><T >> >> <file:///C:/Downloads/Java/wicket/apache-wicket-1.4.1/apidocs/org/apache/wicket/markup/html/form/FormComponent.html>> >> *setType*(java.lang.Class<?> type) >> >> Sets the type that will be used when updating the model for this component. >> If no type is specified String type is assumed. >> >> *Parameters:*type - *Returns:*this for chaining >> >> On Thu, Jul 22, 2010 at 1:50 PM, Douglas Ferguson < >> doug...@douglasferguson.us> wrote: >> >>> Has anybody succesfully used TextField<Integer>? >>> >>> I get an runtime exception trying to cast String to Integer. >>> >>> If supply (Integer.class) to the constructor then it is trying to case >> Long >>> to Integer. >>> >>> D/ >>> >> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org