Example usage for org.apache.wicket.ajax.markup.html AjaxLink setMarkupId

List of usage examples for org.apache.wicket.ajax.markup.html AjaxLink setMarkupId

Introduction

In this page you can find the example usage for org.apache.wicket.ajax.markup.html AjaxLink setMarkupId.

Prototype

final void setMarkupId(Component comp) 

Source Link

Document

Copy markupId

Usage

From source file:org.alienlabs.hatchetharry.view.page.HomePage.java

License:Open Source License

private void buildCombatLink() {
    final WebMarkupContainer combatPlaceholder = new WebMarkupContainer("combatPlaceholder");
    combatPlaceholder.setMarkupId("combatPlaceholder");
    combatPlaceholder.setOutputMarkupId(true);

    final AjaxLink<Void> combatLink = new IndicatingAjaxLink<Void>("combatLink") {
        private static final long serialVersionUID = 1L;

        @Override/*  ww  w  .j a  v  a2  s  .c  om*/
        public void onClick(final AjaxRequestTarget target) {
            HomePage.LOGGER.info("clicked on declare combat");
            HomePage.this.session
                    .setCombatInProgress(!HomePage.this.session.isCombatInProgress().booleanValue());
            final Long _gameId = HomePage.this.session.getGameId();
            final List<BigInteger> allPlayersInGame = HomePage.this.persistenceService
                    .giveAllPlayersFromGame(_gameId);

            final NotifierCometChannel ncc = new NotifierCometChannel(NotifierAction.COMBAT_IN_PROGRESS_ACTION,
                    null, null, HomePage.this.session.getPlayer().getName(), "", "",
                    HomePage.this.session.isCombatInProgress(), "");
            final ConsoleLogStrategy logger = AbstractConsoleLogStrategy.chooseStrategy(ConsoleLogType.COMBAT,
                    null, null, HomePage.this.session.isCombatInProgress(), null,
                    HomePage.this.session.getPlayer().getName(), null, null, null, Boolean.FALSE, _gameId);

            EventBusPostService.post(allPlayersInGame, ncc, new ConsoleLogCometChannel(logger));
        }
    };
    combatLink.setMarkupId("combatLink");
    combatLink.setOutputMarkupId(true);

    combatPlaceholder.add(combatLink);

    this.add(combatPlaceholder);
}

From source file:org.obiba.onyx.quartz.core.wicket.wizard.QuestionnaireWizardForm.java

License:Open Source License

private void createBeginAndEndButtons() {
    AjaxLink beginLink = new AjaxLink("beginLink") {

        private static final long serialVersionUID = 1L;

        @Override// w  w w  .j  av a2  s . c om
        public void onClick(AjaxRequestTarget target) {
            onBegin(target);
        }

    };
    beginLink.setMarkupId("beginButton");
    beginLink.add(new AttributeAppender("class", new Model("begin"), " "));
    add(beginLink);

    AjaxButton endLink = new AjaxButton("endLink", this) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form form) {
            onEnd(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target, Form form) {
            showFeedbackWindow(target);
        }
    };
    endLink.setMarkupId("endButton");
    endLink.add(new AttributeAppender("class", new Model("end"), " "));
    add(endLink);
}