Example usage for org.apache.wicket Component getMarkupId

List of usage examples for org.apache.wicket Component getMarkupId

Introduction

In this page you can find the example usage for org.apache.wicket Component getMarkupId.

Prototype

public String getMarkupId() 

Source Link

Document

Retrieves id by which this component is represented within the markup.

Usage

From source file:com.visural.wicket.behavior.beautytips.BeautyTipBehavior.java

License:Apache License

@Override
public void bind(Component component) {
    componentIds.add(component.getMarkupId());
    component.setOutputMarkupId(true);
}

From source file:com.visural.wicket.behavior.dateinput.DateInputBehavior.java

License:Apache License

private String getJS() {
    StringBuilder js = new StringBuilder();
    for (Component com : bound) {
        js.append("jQuery(\"#").append(com.getMarkupId()).append("\").date_input(").append(getOptionMap())
                .append(");");
    }/* www  .j  a v  a 2  s  .  c  o  m*/
    return js.toString();
}

From source file:com.visural.wicket.behavior.inputhint.InputHintBehavior.java

License:Apache License

private String getInitJS() {
    StringBuilder js = new StringBuilder();
    for (Component com : bound) {
        js.append("visural_inputHints['visural_ih_").append(com.getMarkupId())
                .append("'] = new VisuralInputHint('").append(com.getMarkupId()).append("','")
                .append(hintText.replace("'", "\\'")).append("','").append(hintStyle.replace("'", "\\'"))
                .append("', '").append(entryStyle.replace("'", "\\'")).append("');");
    }//from  ww w.  j a v a2s.c o m
    return js.toString();
}

From source file:com.visural.wicket.behavior.inputhint.InputHintBehavior.java

License:Apache License

private String getDomJS() {
    StringBuilder js = new StringBuilder();
    for (Component com : bound) {
        js.append("visural_inputHints['visural_ih_").append(com.getMarkupId()).append("'].handleBlur();");
    }/*from w  ww.  j  av  a  2 s .c  o  m*/
    return js.toString();
}

From source file:com.visural.wicket.behavior.inputhint.InputHintBehavior.java

License:Apache License

@Override
public void bind(Component component) {
    bound.add(component);//  w ww. j  a  v  a  2  s. c om
    component.setOutputMarkupId(true);
    form.add(new InputHintFormBehavior(component.getMarkupId()));
}

From source file:com.visural.wicket.behavior.inputhint.InputHintBehavior.java

License:Apache License

@Override
public void onComponentTag(Component component, ComponentTag tag) {
    String focus = tag.getAttribute("onfocus");
    String blur = tag.getAttribute("onblur");
    tag.put("onfocus", "visural_inputHints['visural_ih_" + component.getMarkupId() + "'].handleFocus();"
            + (StringUtil.isNotBlankStr(focus) ? focus : ""));
    tag.put("onblur", "visural_inputHints['visural_ih_" + component.getMarkupId() + "'].handleBlur();"
            + (StringUtil.isNotBlankStr(blur) ? blur : ""));
}

From source file:com.visural.wicket.component.submitters.IndicateRefreshAjaxLink.java

License:Apache License

private String getAjaxImageReplaceScript() {
    Collection<? extends Component> containers = getIndicateRefreshContainers();
    StringBuffer result = new StringBuffer();
    if (containers != null) {
        // TODO: refactor JS - fix namespacing across all components
        result.append(/*from   w  w w  .  ja v a2 s . com*/
                "VISURAL" + this.getMarkupId() + "Complete = false; window.setTimeout(function() { if (!VISURAL"
                        + this.getMarkupId() + "Complete) { ");
        for (Component container : containers) {
            result.append("jQuery('#" + container.getMarkupId() + "').hide();");
            result.append("jQuery('#" + container.getMarkupId() + "').after('<span class=\"visuralajaxind_"
                    + this.getId() + "\">" + getIndicatorHTML(container) + "</span>');");
        }
        result.append("} }, " + getIndicatorDisplayThresholdMillis() + ");");
    }
    return result.toString();
}

From source file:com.visural.wicket.component.submitters.IndicateRefreshAjaxLink.java

License:Apache License

private String getAjaxImageUnreplaceScript() {
    Collection<? extends Component> containers = getIndicateRefreshContainers();
    StringBuffer result = new StringBuffer();
    if (containers != null) {
        // TODO: refactor JS - fix namespacing across all components
        result.append("VISURAL" + IndicateRefreshAjaxLink.this.getMarkupId() + "Complete = true;");
        for (Component container : containers) {
            result.append("jQuery('#" + container.getMarkupId() + "').show();");
            result.append("jQuery('.visuralajaxind_" + this.getId() + "').remove();");
        }/*from   w w  w .j ava  2  s . com*/
    }
    return result.toString();
}

From source file:com.visural.wicket.component.submitters.IndicateRefreshAjaxSubmitLink.java

License:Apache License

private String getAjaxImageUnreplaceScript() {
    Collection<? extends Component> containers = getIndicateRefreshContainers();
    StringBuffer result = new StringBuffer();
    if (containers != null) {
        // TODO: refactor JS - fix namespacing across all components
        result.append("VISURAL" + IndicateRefreshAjaxSubmitLink.this.getMarkupId() + "Complete = true;");
        for (Component container : containers) {
            result.append("jQuery('#" + container.getMarkupId() + "').show();");
            result.append("jQuery('.visuralajaxind_" + this.getId() + "').remove();");
        }/* ww w .  ja v  a2  s  .co  m*/
    }
    return result.toString();
}

From source file:com.wiquery.plugins.jqgrid.component.XMLDataRequestTarget.java

License:Apache License

/**
 * Adds a component to the list of components to be rendered
 * /*from   ww w  . j  a v a2s .  c om*/
 * @param component
 *            component to be rendered
 */
public void addComponent(Component component) {
    if (component == null) {
        throw new IllegalArgumentException("component cannot be null");
    }
    if (component.getOutputMarkupId() == false) {
        throw new IllegalArgumentException(
                "cannot update component that does not have setOutputMarkupId property set to true. Component: "
                        + component.toString());
    }
    addComponent(component, component.getMarkupId());
}