This is my submitCommentPanel:

public SubmitCommentPanel(String id, final PostDomain postDomain,
                        final UserDomain userDomain) {

                super(id);

                this.setOutputMarkupId(true);

AjaxFallbackButton ajaxCommentSubmitButton = new AjaxFallbackButton(
                                "commentSubmitButton", commentForm) {
                        /**
                         * 
                         */
                        private static final long serialVersionUID = 1L;

                        @Override
                        public void onSubmit(AjaxRequestTarget target, final 
Form<?> form) {

                                /*
                                 * Populating commentDomain instance for 
submitting comment.
                                 * This instance is then passed to 
CommentService class
                                 */

                                if (target != null) {

                                        try {
                                                // some processing

                                        } catch (Exception exception) {
                                                error(exception.getMessage());
                                        }
                                        target.add(submitCommentFeedbackPanel);
                                        *target.add(SubmitCommentPanel.this);*
                                }
                        }
};


* here, I am adding one more panel which should not be visible in a
situation ...
ShowCommentPanel showCommentPanel = new ShowCommentPanel(
                                "showCommentPanel", postDomain, userDomain);
                
showCommentPanel.setVisible(!postDomain.getCommentDomainList().isEmpty());
                add(showCommentPanel);*
}
Now ShowCommentPanel is:


public ShowCommentPanel(final String id,
                        final PostDomain postDomain,
                        final UserDomain userDomain) {
                super(id);
                // TODO Auto-generated constructor stub


        *       @SuppressWarnings("rawtypes")
                Label numberOfCommentLabel = new Label("numberOfCommentLabel",
                                new PropertyModel(postDomain, 
"numberOfComments"));
add(numberOfCommentLabel);*
}

Now what is happening that when showCommentPanel visibility is initially
false but later becomes true after ajax refresh, even then
*numberOfCommentLabel * does not appear. I have to refresh the whole page to
make them appear. After that they refresh properly by ajax.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-refresh-component-with-initial-setVisible-false-tp4650171p4650196.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