It does...

  private static final ThreadLocal<Boolean> STRIP_TAGS_LOCAL = new 
ThreadLocal<Boolean>();

  @Override
  protected void onBeforeRender () {

    super.onBeforeRender();

    
STRIP_TAGS_LOCAL.set(Application.get().getMarkupSettings().getStripWicketTags());
    Application.get().getMarkupSettings().setStripWicketTags(true);
  }

  @Override
  protected void onAfterRender () {

    
Application.get().getMarkupSettings().setStripWicketTags(STRIP_TAGS_LOCAL.get());

    super.onAfterRender();
  }

...using these methods to strip wicket tags for the rendering of this panel 
only. But, both onBeforeRender() and onAfterRender() are calling the same 
methods on their super class, which is Panel, and I'm not touching any models.

David 


-----Original Message-----
From: Andrea Del Bene [mailto:adelb...@ciseonweb.it] 
Sent: Wednesday, October 26, 2011 1:13 AM
To: users@wicket.apache.org
Subject: Re: Problem with Panel default model

Hi,

does your page override onBeforeRender method? Can you show the code?
> Thank you. Upgrade to 1.5.2 did seem to resolve the issue with the last ajax 
> request parameters being pushed onto the base url. However, testing that 
> resolution exposed a further problem. I'm using a 
> org.apache.wicket.markup.html.panel.Panel into which I'm handing the a 
> org.apache.wicket.model.Model and setting it as the default model via the 
> constructor...
>
>    public class MyPanel extends Panel {
>
>      public MyPanel (final String id, final IModel<>  model) {
>
>        super(id, model);
>      }
>    }
>
>
> The model in question stores a java Enum, call it MyEnum...
>
>    public enum MyEnum {
>
>      ONE, TWO, THREE
>    }
>
>    new MyPanel("panelId", new Model<MyEnum>(MyEnum.values()[0]));
>
>
> On an ajax callback I update the model on this panel...
>
>    public class MyPanel extends Panel {
>
>      ...
>
>      public void setValue (String value) {
>
>        setDefaultModelObject(MyEnum.value(value));
>      }
>    }
>
> ...all of which works fine. The problem is that the value which is set at the 
> time of the first page reload is the value that will be reset upon any 
> subsequent page reload. The model updates correctly on the MyPanel instance 
> responding to each ajax callback. Not a problem. But when I reload the page, 
> the value of the model will revert to whatever value it had after the *first* 
> page reload. I notice that the default model instance changes upon page 
> reload. So, for example...
>
> 1) MyPanel holds Model@1234
> 2) set Model@1234 to value MyEnum.TWO, no problem
> 3) page reload...
> 4) MyPanel now holds Model@2345 which holds MyEnum.TWO... this is correct, 
> but the Model instance has changed.
> 5) set Model@2345 to value MyEnum.THREE, no problem
> 6) page reload...
> 7) MyPanel now holds Model@3456 which holds MyEnum.TWO, where did MyEnum.TWO 
> come from?
> 8) I can now continue to set the model value via ajax callbacks, and all is 
> well, and the Model@3456 holds its values just fine
> 9) page reload...
> 10) No matter what the value of the Model@3456 was last set to, MyPanel now 
> holds new instance Model@4567 which *will* hold MyEnum.TWO
>
> Anyone know what's going on?
>
> Thank you,
> David
>
>
> -----Original Message-----
> From: Martin Grigorov [mailto:mgrigo...@apache.org]
> Sent: Monday, October 24, 2011 10:24 PM
> To: users@wicket.apache.org
> Subject: Re: Problem with ajax base url
>
> Hi
>
> Try with 1.5.2.
> This is fixed with https://issues.apache.org/jira/browse/WICKET-4109
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to