In my method I call this

protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
                                form.add(new Veil());
                                target.addComponent(form);
                                
                        --      method to be execute ---

                                form.add(new DisabledVeil());
                                target.addComponent(form);

The class viel :

public class Veil extends VeilResources {
        private static final long serialVersionUID = 8017992550548909810L;
        private Component component;
        private String cssClassName;

        public Veil() {
        }

        public Veil(String cssClassName) {
                if (!Strings.isEmpty(cssClassName))
                        this.cssClassName = cssClassName;
        }

        public void bind(Component component) {
                super.bind(component);
                if (this.component != null) {
                        throw new IllegalStateException(
                                        "This behavior is already bound to 
component. An instance of this
behavior cannot be reused between components. Bound component: "
                                                        + 
this.component.toString());
                }

                this.component = component;
        }

        private String getCssClassName() {
                return (this.cssClassName != null) ? this.cssClassName : 
"wicket-veil";
        }

        public void renderHead(IHeaderResponse response) {
                super.renderHead(response);
        
response.renderOnDomReadyJavascript(VeilResources.Javascript.show(this.component));
        }

The class disable viel
public class DisabledVeil extends Veil {
        private static final long serialVersionUID = 66447383785577749L;

        public DisabledVeil() {
        }

        public DisabledVeil(String cssClassName) {
                super(cssClassName);
        }


        public boolean isEnabled(Component component) {
                return (super.isEnabled(component)) && (component.isEnabled()) 
&&
(component.isEnableAllowed());
        }
}


the class resource:

public class VeilResources extends AbstractBehavior implements
IHeaderContributor {
        private static final long serialVersionUID = -4054673989711649496L;

        private static final ResourceReference JS = new
JavascriptResourceReference(VeilResources.class, "wicket-veil.js");

        private static final ResourceReference CSS = new
ResourceReference(VeilResources.class, "wicket-veil.css");
        public static final String DEFAULT_CSS_CLASS_NAME = "wicket-veil";

        @Override
        public void bind(Component component) {
                super.bind(component);
                component.setOutputMarkupId(true);
        }

        @Override
        public void renderHead(IHeaderResponse response) {
                super.renderHead(response);
                response.renderJavascriptReference(JS);
                response.renderCSSReference(CSS);
        }

        public static class Javascript {
                public static String hide(Component component) {
                        return Generic.hide(component.getMarkupId());
                }

                public static String show(Component component) {
                        return Generic.show(component.getMarkupId());
                }

                public static String show(Component component, String 
className) {
                        return Generic.show(component.getMarkupId(), className);
                }

                public static String toggle(Component component) {
                        return Generic.toggle(component.getMarkupId());
                }

                public static String toggle(Component component, String 
className) {
                        return Generic.toggle(component.getMarkupId(), 
className);
                }

                public static class Generic {
                        public static String hide(String markupId) {
                                return "Wicket.Veil.toggle('" + markupId + 
"');";
                        }

                        public static String show(String markupId) {
                                return show(markupId, "wicket-veil");
                        }

                        public static String show(String markupId, String 
className) {
                                return "Wicket.Veil.show('" + markupId + "', 
{className:'" + className +
"'});";
                        }

                        public static String toggle(String markupId) {
                                return toggle(markupId, "wicket-veil");
                        }

                        public static String toggle(String markupId, String 
className) {
                                return "Wicket.Veil.toggle('" + markupId + "', 
{className:'" + className
+ "'});";
                        }
                }
        }
}

when i call the class disable viel its not work..


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Veil-behavior-of-wicketstuff-minis-tp2228127p4330145.html
Sent from the Users forum mailing list archive at Nabble.com.

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

Reply via email to