Hi,

I have fragment inside wicket:enclosure. When ajax submit takes place, it
tries to re-render fragment, but does not succeed, since wicket:enclosure is
still invisible, even though isVisible method returns true.



<div class="largeinput-required">
        <h2>Password</h2>
        <input wicket:id="password" type="text" />
</div>
<div class="submitarea"><a wicket:id="submit" href="#"
class="button">SUBMIT</a></div>

<wicket:enclosure child="fragment">
   <span wicket:id="fragment">fragments contents come here</span>
   <wicket:fragment wicket:id="fragmentid">
....

   </wicket:fragment>
</wicket:enclosure>




boolean authenticated=false;
final Model<String> m = new Model<String>();
form.add(new RequiredTextField<String>("password", m));

AjaxSubmitLink submitbutton = new AjaxSubmitLink("submit") {

            private static final long serialVersionUID = 1L;

            protected void onSubmit(AjaxRequestTarget target, Form<?> form)
{

                authenticated = true;

                target.addComponent(f);
            }
};
form.add(submitbutton);

f = new Fragment("fragment", "fragmentid", form) {

            private static final long serialVersionUID =
2612235776527846442L;

            public boolean isVisible() {
                  if (authenticated)
                       return true;

                  return false;
            }
};
 f.setOutputMarkupId(true);
 form.add(f);


Thanks
Anna

Reply via email to