Example usage for org.apache.wicket MarkupContainer getMarkupId

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

Introduction

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

Prototype

public String getMarkupId() 

Source Link

Document

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

Usage

From source file:com.aplombee.RepeaterUtil.java

License:Apache License

/**
 * {@inheritDoc}//  w w  w  .j a  v a  2 s.  co m
 */
@Override
public String prepend(MarkupContainer component, MarkupContainer parent) {
    String script = prepend(getComponentTag(component).getName(), component.getMarkupId(),
            parent.getMarkupId());
    return script;
}

From source file:com.aplombee.RepeaterUtil.java

License:Apache License

/**
 * {@inheritDoc}//from w w w .  j ava  2s .c o m
 */
@Override
public String append(MarkupContainer c, MarkupContainer parent) {
    return append(getComponentTag(c).getName(), c.getMarkupId(), parent.getMarkupId());
}

From source file:com.aplombee.RepeaterUtil.java

License:Apache License

/**
 * {@inheritDoc}/*from   w  w w.  j  a  v a 2s . co m*/
 */
@Override
public String isComponentScrollBarAtBottom(MarkupContainer component) {
    return String.format("QuickView.isComponentScrollBarAtBottom('%s');", component.getMarkupId());
}

From source file:org.apache.isis.viewer.wicket.ui.panels.PromptFormAbstract.java

License:Apache License

private void rebuildGuiAfterInlinePromptDone(final AjaxRequestTarget target) {
    // replace// ww  w  .  ja  v a 2s.c om
    final String id = parentPanel.getId();
    final MarkupContainer parent = parentPanel.getParent();

    final WebMarkupContainer replacementPropertyEditFormPanel = new WebMarkupContainer(id);
    replacementPropertyEditFormPanel.setVisible(false);

    parent.addOrReplace(replacementPropertyEditFormPanel);

    // change visibility of inline components
    formExecutorContext.getInlinePromptContext().onCancel();

    // redraw
    MarkupContainer scalarTypeContainer = formExecutorContext.getInlinePromptContext().getScalarTypeContainer();

    if (scalarTypeContainer != null) {
        String markupId = scalarTypeContainer.getMarkupId();
        target.appendJavaScript(
                String.format("Wicket.Event.publish(Isis.Topic.FOCUS_FIRST_PROPERTY, '%s')", markupId));
    }

    target.add(parent);
}

From source file:org.wicketstuff.jquery.dnd.DnDSortableBehavior.java

License:Apache License

/**
 * Call when a component has been moved on client side. The default implementation log (as
 * debug) the incomming parameters, search the component and forward to onDnD(AjaxRequestTarget
 * target, String itemId, String srcContainerId, int srcPos, String destContainerId, int
 * destPos)./* w ww . j a  v  a2s. c  o m*/
 * 
 * @param target
 *            a target, provide if a response,
 * @param srcContainerId
 *            the html id of source container from where item come, (null if not previously
 *            registered by via registerContainer(...)).
 * @param srcPos
 *            the position/index of item into srcContainer before moving.
 * @param destContainerId
 *            the html id of destination container where item is, (null if not previously
 *            registered by via registerContainer(...)).
 * @param destPos
 *            the position/index of item into srcContainer after moving.
 */
public void onDnD(AjaxRequestTarget target, String srcContainerId, int srcPos, String destContainerId,
        int destPos) {
    if (logger().isDebugEnabled()) {
        logger().debug("srcContainerId={}, srcPos={}, destContainerId={}, destPos={}",
                new Object[] { srcContainerId, srcPos, destContainerId, destPos });
    }
    MarkupContainer srcContainer = null;
    MarkupContainer destContainer = null;
    for (MarkupContainer container : containers_) {
        if ((srcContainerId != null) && srcContainerId.equals(container.getMarkupId())) {
            srcContainer = container;
        }
        if ((destContainerId != null) && destContainerId.equals(container.getMarkupId())) {
            destContainer = container;
        }
        if ((srcContainer != null) && (destContainer != null)) {
            break;
        }
    }
    // if (srcContainer != null) {
    // item = findByMarkupId(srcContainer, itemId);
    // }
    // if ((item == null) && (destContainer != null)) {
    // item = findByMarkupId(destContainer, itemId);
    // }
    boolean updateContainers = onDnD(target, srcContainer, srcPos, destContainer, destPos);
    if (updateContainers && (target != null)) {
        // target is null in testcase
        // (optional) if you need to keep in sync component, markupId on serverside and client
        // side
        target.add(srcContainer);
        if (srcContainer != destContainer) {
            target.add(destContainer);
        }
        target.appendJavaScript(getJSFunctionName4Start() + "();");
    }
}