Re: Ajax refresh not working in a case .... while working in similar other cases!!!

2012-06-09 Thread Martin Makundi
Did you look at wicket ajax debugin browser? It usually gives quite
good clues about what's missing ...

2012/6/9 kshitiz k.agarw...@gmail.com:
 Hi,

 I am trying to refresh ajax container after firing an event. The code is:

 *final WebMarkupContainer searchContainer = new WebMarkupContainer(
                                searchContainer);
                searchContainer.setOutputMarkupId(true);*


 AjaxFallbackButton ajaxSearchButton = new AjaxFallbackButton(
                                searchButton, searchForm) {

                        @Override
                        public void onSubmit(AjaxRequestTarget target, final 
 Form? form) {
                                if (target != null) {

                                        try {
                                                 // some actions...
                                        } catch (Exception exception) {
                                        }
                                        *target.add(searchContainer);*
                                }
                        }
 }


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

                final PageableListViewUserDomain userDomainListView = new
 PageableListViewUserDomain(
                                user, userDomainList, resultsPerPage) {
                        private static final long serialVersionUID = 1L;

                        @Override
                        protected void populateItem(final ListItemUserDomain 
 listItem) {
                        // populating list
                        }

                };

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

                searchContainer.add(userLabel);
                searchContainer.add(userDomainListView);
                searchContainer.add(numberOfUserLabel);
 *

 But the list view is not getting refreshed? I am using the same technique in
 other pages and it is working.. what be the reason..?? Any suggestion can
 work for me...

 --
 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-tp4649794.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


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Ajax refresh not working in a case .... while working in similar other cases!!!

2012-06-09 Thread kshitiz
I have never tried out that beforeI have enabled debug mode but I to
debug the ajax part? Can you please tell me ??

--
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-tp4649794p4649797.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



Re: Ajax refresh not working in a case .... while working in similar other cases!!!

2012-06-09 Thread Martin Makundi
Ajax debug is a small hover window visible in browser when you have
application configuration in development mode.

**
Martin


2012/6/9 kshitiz k.agarw...@gmail.com:
 I have never tried out that beforeI have enabled debug mode but I to
 debug the ajax part? Can you please tell me ??

 --
 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-tp4649794p4649797.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


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Ajax refresh not working in a case .... while working in similar other cases!!!

2012-06-09 Thread kshitiz
I got the problem atleast...what is happening that it is using the same
search object (where results are being stored and then displayed in
container) and not creating the new one for new searches. Actually what I
want is when user searches anything, the results are refreshed only. I am
storing the results in an object and displaying them using listview which is
again a part of container. Can you suggest me anything out here?

--
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-tp4649794p4649799.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



Re: Ajax refresh not working in a case .... while working in similar other cases!!!

2012-06-09 Thread Martin Makundi
Listview has this parameter reuseitems, if you set it to false it will
rebuild when its container is refreshed.

2012/6/9 kshitiz k.agarw...@gmail.com:
 I got the problem atleast...what is happening that it is using the same
 search object (where results are being stored and then displayed in
 container) and not creating the new one for new searches. Actually what I
 want is when user searches anything, the results are refreshed only. I am
 storing the results in an object and displaying them using listview which is
 again a part of container. Can you suggest me anything out here?

 --
 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-tp4649794p4649799.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


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Ajax refresh not working in a case .... while working in similar other cases!!!

2012-06-09 Thread kshitiz
Okk...actually when I analysed more, what  I found is that when I enter new
value in text field, the event takes the old value only. Even I am now
refreshing the form too. Then I found that the field sets its value to old
one after getting refreshed. My field is of final  type. But that should not
be the problem as I am using the same technique in other pages too...

--
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-tp4649794p4649802.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



Re: Ajax refresh not working in a case .... while working in similar other cases!!!

2012-06-09 Thread Martin Makundi
clearinput can be used with forms when submit is not done but model is changed

**
Martin

2012/6/9 kshitiz k.agarw...@gmail.com:
 Okk...actually when I analysed more, what  I found is that when I enter new
 value in text field, the event takes the old value only. Even I am now
 refreshing the form too. Then I found that the field sets its value to old
 one after getting refreshed. My field is of final  type. But that should not
 be the problem as I am using the same technique in other pages too...

 --
 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-tp4649794p4649802.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


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Ajax refresh not working in a case .... while working in similar other cases!!!

2012-06-09 Thread kshitiz
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);

ListUserDomain userDomainList = new ArrayListUserDomain();
ListOrganizationDomain organizationDomainList = new
ArrayListOrganizationDomain();

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 PageableListViewUserDomain userDomainListView = new
PageableListViewUserDomain(
user, userDomainList, resultsPerPage) {
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(final ListItemUserDomain 
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 ListViewOrganizationDomain organizationDomainListView = 
new
ListViewOrganizationDomain(
organization, organizationDomainList) {
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(
final ListItemOrganizationDomain 
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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org