Examples of AjaxFallbackLink


Examples of org.apache.wicket.ajax.markup.html.AjaxFallbackLink

                Helper.twitterIntentFav(tweet.getTwitterId())));

        add(new ExternalLink("tweetReply",
                Helper.twitterIntentReply(tweet.getTwitterId())));

        add(new AjaxFallbackLink("tweetRetweet") {

            @Override
            public void onClick(AjaxRequestTarget target) {
                onRetweet(tweet, target);
            }
        });
        IndicatingAjaxFallbackLink inReplyOfButton = new IndicatingAjaxFallbackLink("inreplyof") {

            @Override
            public void onClick(AjaxRequestTarget target) {
                if (target != null) {
                    subTweets.clear();
                    target.addComponent(OneTweet.this);
                    if (!inReplyOfClicked)
                        subTweets.addAll(onInReplyOfClick(tweet.getInReplyTwitterId()));

                    inReplyOfClicked = !inReplyOfClicked;
                }
            }
        };

        add(inReplyOfButton);
        if (JTweet.isDefaultInReplyId(tweet.getInReplyTwitterId()))
            inReplyOfButton.setVisible(false);

        IndicatingAjaxFallbackLink rtLink = new IndicatingAjaxFallbackLink("retweeters") {

            @Override
            public void onClick(AjaxRequestTarget target) {
                if (target != null) {
                    subTweets.clear();
                    target.addComponent(OneTweet.this);
                    if (!rtClicked)
                        subTweets.addAll(onReplyClick(tweet.getTwitterId(), true));

                    rtClicked = !rtClicked;
                }
            }
        };

        add(rtLink.add(new Label("retweetersLabel", "retweets " + tweet.getRetweetCount())));
        if (tweet.getRetweetCount() == 0)
            rtLink.setVisible(false);

        IndicatingAjaxFallbackLink replyLink = new IndicatingAjaxFallbackLink("replies") {

            @Override
            public void onClick(AjaxRequestTarget target) {
                if (target != null) {
                    subTweets.clear();
                    target.addComponent(OneTweet.this);
                    if (!rpClicked)
                        subTweets.addAll(onReplyClick(tweet.getTwitterId(), false));

                    rpClicked = !rpClicked;
                }
            }
        };

        add(replyLink.add(new Label("repliesLabel", "replies " + (tweet.getReplyCount() - tweet.getRetweetCount()))));
        if (tweet.getReplyCount() == tweet.getRetweetCount())
            replyLink.setVisible(false);

        add(new AjaxFallbackLink("similarLink") {

            @Override
            public void onClick(AjaxRequestTarget target) {
                onFindSimilarClick(tweet, target);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.