I had a serialization problem (when redeploying the application in Tomcat) that I can't understand... Basically, I had this on my Page.onBeforeRender:
---------------
           visitChildren(TextField.class, new Visitor<TextField<?>>() {
               private static final long serialVersionUID = 1L;

               public Object component(TextField<?> textField)
               {
                   textField.add(new AjaxEventBehavior("onchange") {
                       private static final long serialVersionUID = 1L;

                       @Override
                       protected void onEvent(AjaxRequestTarget target)
                       {
                           if (mode == Mode.NAVIGATE)
                           {
                               mode = Mode.EDIT;
                               setupMode();
                               target.addComponent(buttonPanel);
                           }
                       }
                   });

                   setupValidators(textField);
                   return IVisitor.CONTINUE_TRAVERSAL;
               }
           });
---------------

The non-serializable class was the one created by "new Visitor<TextField<?>> () { ... }". Creating MyVisitor and replacing this call solved the problem:
---------------
   private abstract class MyVisitor<X extends Component>
       implements IVisitor<X>, Serializable
   {
       private static final long serialVersionUID = 1L;
   }
---------------

Why should a non-serializable Visitor could case this problem? Does (why?) it get cached on the page?


Adriano


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to