I am able to solve this field related problem...just container is not getting
refreshed...

here is the code, I have modified a bit as per requirement:

public Search(String id) {

searchContainer.add(searchForm);
                searchContainer.add(new SearchResultPanel("searchResultPanel",
                                searchDomain, error, searchContainer));
                add(searchContainer);
}

        public SearchResultPanel(String id, SearchDomain searchDomain, final
WebMarkupContainer searchContainer) {
                super(id);
                
                List<UserDomain> userDomainList = new ArrayList<UserDomain>();
                List<OrganizationDomain> organizationDomainList = new
ArrayList<OrganizationDomain>();

                userDomainList = searchDomain.getUserDomainList();

                organizationDomainList = 
searchDomain.getOrganizationDomainList();
                
                int numberOfUsers = searchDomain.getNumberOfUsers();

                Label userLabel = new Label("userLabel", "List of Users");
                Label numberOfUserLabel = new Label("numberOfUserLabel", new 
Integer(
                                numberOfUsers).toString());

                final PageableListView<UserDomain> userDomainListView = new
PageableListView<UserDomain>(
                                "user", userDomainList, resultsPerPage) {
                        private static final long serialVersionUID = 1L;

                        @Override
                        protected void populateItem(final ListItem<UserDomain> 
listItem) {

                                String name = ((UserDomain) 
listItem.getModelObject())
                                                .getName();
                                Label userName = new Label("userName", name);
                                listItem.add(userName);
                        }

                };

                userDomainListView.setVisible(!userDomainList.isEmpty());
                userLabel.setVisible(!userDomainList.isEmpty());
                numberOfUserLabel.setVisible(!userDomainList.isEmpty());

                add(userLabel);
                add(userDomainListView);
                add(numberOfUserLabel);

                int numberOfOrganization = 
searchDomain.getNumberOfOrganizations();

                Label organizationLabel = new Label("organizationLabel",
                                "List of Organizations");
                Label numberOfOrganizationLabel = new Label(
                                "numberOfOrganizationLabel",
                                new Integer(numberOfOrganization).toString());

                final ListView<OrganizationDomain> organizationDomainListView = 
new
ListView<OrganizationDomain>(
                                "organization", organizationDomainList) {
                        private static final long serialVersionUID = 1L;

                        @Override
                        protected void populateItem(
                                        final ListItem<OrganizationDomain> 
listItem) {

                                String organization = ((OrganizationDomain) 
listItem
                                                
.getModelObject()).getOrganization();
                                Label organizationName = new 
Label("organizationName",
                                                organization);
                                listItem.add(organizationName);
                        }

                };

                organizationDomainListView
                                .setVisible(!organizationDomainList.isEmpty());
                organizationLabel.setVisible(!organizationDomainList.isEmpty());
                
numberOfOrganizationLabel.setVisible(!organizationDomainList.isEmpty());

                add(organizationLabel);
                add(organizationDomainListView);
                add(numberOfOrganizationLabel);

                add(new AjaxPagingNavigator("navigator",
                                userDomainListView) {

                        /**
                                 * 
                                 */
                        private static final long serialVersionUID = 1L;

                        @Override
                        protected void onAjaxEvent(AjaxRequestTarget target) {
                                target.addComponent(searchContainer);
                        }
                });
        }

}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-refresh-not-working-in-a-case-while-working-in-similar-other-cases-tp4649794p4649806.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to