You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by bad boy <ba...@yahoo.com> on 2011/10/03 18:54:20 UTC

Wicket Wizard -- how to force a wizardstep to redraw or refresh

Hi

I have a wicket wizard with 5 steps and in the confirmation  step, I have a panel which contains 3 Fragments.

This panel will render one of these fragments based on the  state of the Model. The problem is the that this panel is getting cached wen the wizard model is initialized .

Is it possible to force the wizard step which contains this panel to reload or refresh.


// this is the wizard step
  */
    public AlertQryConfirmationStep(final IModel<AlertBean> abModel) {
        setDefaultModel(abModel);
        
        
        setTitleModel(new ResourceModel("confirmation.title"));
       add(new QryDisplayPanel("qryDisplayPanel", abModel));
        
       


    }



// this is the pane code
   public QryDisplayPanel(String idm, IModel<AlertBean> abModel) {

        super(idm);
        logger.info("QryDisplayPanel -- -- QryType : " + abModel.getObject().getQryType());
        setDefaultModel(abModel);

        if (abModel.getObject().getQryType() == 1) {
            add(new EasyQueryFragment("querySpan", "easyQueryFragment", abModel));
        } else if (abModel.getObject().getQryType() == 2) {
            add(new AdvancedQueryFragment("querySpan", "advancedQueryFragment", abModel));
        } else if (abModel.getObject().getQryType() == 3) {
            add(new LuQueryFragment("querySpan", "luQueryFragment", abModel));
        } else {
            add(new EmptyPanel("querySpan"));
        }
    }


Thanks for your hep

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


Re: Wicket Wizard -- how to force a wizardstep to redraw or refresh

Posted by bad boy <ba...@yahoo.com>.
Hi Sven
Thanks a lot for your help. That worked !!

Regards



----- Original Message -----
From: Sven Meier &lt;sven@meiers.net&gt;
To: users@wicket.apache.org
Cc: 
Sent: Monday, October 3, 2011 3:18 PM
Subject: Re: Wicket Wizard -- how to force a wizardstep to redraw or refresh

Hi,

you could move you fragment setup into onBeforeRender():

  if (abModel.getObject().getQryType() == 1 &amp;&amp;
!(EasyQueryFragment.class.isInstance(get(&quot;querySpan&quot;))) {
     addOrReplace(new EasyQueryFragment(&quot;querySpan&quot;,
&quot;easyQueryFragment&quot;, abModel));
  } else ...

Sven

On 10/03/2011 06:54 PM, bad boy wrote:
&gt;         if (abModel.getObject().getQryType() == 1) {
&gt;             add(new EasyQueryFragment(&quot;querySpan&quot;, &quot;easyQueryFragment&quot;, abModel));
&gt;         } else if (abModel.getObject().getQryType() == 2) {
&gt;             add(new AdvancedQueryFragment(&quot;querySpan&quot;, &quot;advancedQueryFragment&quot;, abModel));
&gt;         } else if (abModel.getObject().getQryType() == 3) {
&gt;             add(new LuQueryFragment(&quot;querySpan&quot;, &quot;luQueryFragment&quot;, abModel));
&gt;         } else {
&gt;             add(new EmptyPanel(&quot;querySpan&quot;));
&gt;         }

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

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


Re: Wicket Wizard -- how to force a wizardstep to redraw or refresh

Posted by Sven Meier <sv...@meiers.net>.
Hi,

you could move you fragment setup into onBeforeRender():

  if (abModel.getObject().getQryType() == 1 &&
!(EasyQueryFragment.class.isInstance(get("querySpan"))) {
     addOrReplace(new EasyQueryFragment("querySpan",
"easyQueryFragment", abModel));
  } else ...

Sven

On 10/03/2011 06:54 PM, bad boy wrote:
>         if (abModel.getObject().getQryType() == 1) {
>             add(new EasyQueryFragment("querySpan", "easyQueryFragment", abModel));
>         } else if (abModel.getObject().getQryType() == 2) {
>             add(new AdvancedQueryFragment("querySpan", "advancedQueryFragment", abModel));
>         } else if (abModel.getObject().getQryType() == 3) {
>             add(new LuQueryFragment("querySpan", "luQueryFragment", abModel));
>         } else {
>             add(new EmptyPanel("querySpan"));
>         }

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