You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by kshitiz <k....@gmail.com> on 2012/06/09 21:56:14 UTC

Panel not getting refreshed...

Hi,

I want to refresh a panel :

*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) { 

                                listItem.add(userName); 
                        } 

                }; 

                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) { 

                        } 

                }; 

                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); 
                        } 
                }); 
        } 

} 

I am refreshing it like this:

AjaxFallbackButton ajaxSearchButton = new AjaxFallbackButton(
				"searchButton", searchForm) {
			@Override
			public void onSubmit(AjaxRequestTarget target, final Form<?> form) {

				if (target != null) {

					try {
                                               
searchResultPanel.setOutputMarkupId(true);
						target.add(searchResultPanel);
					} catch (Exception exception) {
						error(exception.getMessage());
						error = true;
					}

				}
			}

		};

		searchForm.add(ajaxSearchButton);

		searchContainer.add(searchForm);
		searchContainer.add(searchResultPanel);
		add(searchContainer);


*But panel is not getting refreshed..what can be the problem?? Is it because
I am passing searchDomain in panel class and forming 2 views from that
object domain ??*

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Panel not getting refreshed...

Posted by kshitiz <k....@gmail.com>.
It is working....   Thank you very much for your continuous help....

As I compared mine with urs...what I was doing wrong in initializing
resultPanel...Instead of :

final SearchResultPanel searchResultPanel = new SearchResultPanel(
				"searchResultPanel", *searchForm.getModel()*, true);

*I was passing searchDomain instance directly in the panel constructor...*

Thank you ..:)

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807p4649879.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Panel not getting refreshed...

Posted by Sebastien <se...@gmail.com>.
Hi,

I put the new code in a quick start and it works, the panel is refreshed.
Here is the code I used... Maybe you can copy/paste the code in a
quickstart too to make sure it is working too...
I used Wicket 1.5.6

Regards,
Sebastien.

public class HomePage extends WebPage {
    private static final long serialVersionUID = 1L;

    public HomePage() {
        final SearchDomain searchDomain = new SearchDomain();
        Form<SearchDomain> searchForm = new Form<SearchDomain>("searchForm",
                new Model<SearchDomain>(searchDomain));

        final SearchResultPanel searchResultPanel = new SearchResultPanel(
                "searchResultPanel", searchForm.getModel(), true);
        searchResultPanel.setOutputMarkupId(true);

        final RequiredTextField<String> searchTextField = new
RequiredTextField<String>(
                "search", new PropertyModel<String>(searchDomain,
"search"));

        AjaxFallbackButton ajaxSearchButton = new AjaxFallbackButton(
                "searchButton", searchForm) {

            private static final long serialVersionUID = 1L;

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

                if (target != null) {

                    try {
                        target.add(searchResultPanel);

                    } catch (Exception exception) {
                        error(exception.getMessage());
                    }

                }
            }

            @Override
            protected void onError(AjaxRequestTarget target, Form<?> form) {
                // TODO Auto-generated method stub

            }
        };

        searchForm.add(searchTextField);
        searchForm.add(searchResultPanel);
        searchForm.add(ajaxSearchButton);

        add(searchForm);
    }
}

class SearchDomain implements Serializable {
    private static final long serialVersionUID = 1L;
    private String search;

    public String getSearch() {
        return search;
    }

    public void setSearch(String search) {
        this.search = search;
    }
}

<html xmlns:wicket="http://wicket.apache.org">
    <head>
        <meta charset="utf-8" />
        <title>Apache Wicket Quickstart</title>
    </head>
    <body>
        <form wicket:id="searchForm">
            <input wicket:id="search" type="text" />
            <input wicket:id="searchButton" type="submit"
value="Submit"></input>
            <div wicket:id="searchResultPanel"></div>
        </form>
    </body>
</html>

public class SearchResultPanel extends Panel {
    private static final long serialVersionUID = 1L;

    SearchResultPanel(String id, final IModel<SearchDomain> model,
            final boolean error) {
        super(id);
        // System.out.println("temp is " + temp);
        Label label = new Label("temp", new PropertyModel<String>(
                model.getObject(), "search"));
        // temp++;
        add(label);
    }
}

<html xmlns:wicket="http://wicket.apache.org">
    <head>
        <meta charset="utf-8" />
        <title>Apache Wicket Quickstart</title>
    </head>
    <body>
        <wicket:panel>
            <div wicket:id="temp"></div>
        </wicket:panel>
    </body>
</html>

Re: Panel not getting refreshed...

Posted by kshitiz <k....@gmail.com>.
This is the new code now:

public class Search extends WebPage {

public Search(final PageParameters pageParameters) {
super(pageParameters);

	final SearchDomain searchDomain = new SearchDomain();
*Form<SearchDomain> searchForm = new Form<SearchDomain>("searchForm",
				new 
				Model<SearchDomain>(searchDomain));
*
	
		final SearchResultPanel searchResultPanel = new SearchResultPanel(
				"searchResultPanel", *(Model)searchForm.getModel()*, true);
		searchResultPanel.setOutputMarkupId(true);

final RequiredTextField<String> searchTextField = new
RequiredTextField<String>(
				"search", *new PropertyModel<String>(searchDomain, "search")*);


AjaxFallbackButton ajaxSearchButton = new AjaxFallbackButton(
				"searchButton", searchForm) {
			@Override
			public void onSubmit(AjaxRequestTarget target, final Form<?> form) {

				if (target != null) {

					try {
						target.add(searchResultPanel);
					
					} catch (Exception exception) {
						error(exception.getMessage());
						error = true;
					}


				}
			}

searchForm.add(searchTextField);
searchForm.add(searchResultPanel);
		searchForm.add(ajaxSearchButton);

add(searchForm);
}

And resulTPanel is:

public SearchResultPanel(String id, final Model<SearchDomain> model,
			final boolean error) {
		super(id);
		System.out.println("temp is " + temp);
*		Label label = new Label("temp", new 
PropertyModel<String>(model.getObject(), "search")); 
*		temp++;
		add(label);
}



My SearchDomain is:


public class SearchDomain implements Serializable {

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

	public String getSearch() {
		return search;
	}

	public void setSearch(String search) {
		this.search = search;
	}
}

I am going to search page directly. Now again the problem is there...even
sysout is not getting printed which is inside the result panel. What can be
the other issues?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807p4649865.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Panel not getting refreshed...

Posted by Sebastien <se...@gmail.com>.
Hi,

I see some problem/inconsistencies in your code.

1/
Model.of(searchDomain.getSearch()) is not accurate. You better have to use
'new PropertyModel<String>(searchDomain, "search")'.
You already defined the getSearch() method, be sure to also have
setSearch(String text) method for the property model to work as expected
(so it can set the value!).
This is the most important point I think.

2/
In the same way, it is not needed - in your case - to have a LDM in your
SearchResultPanel/Label. I would have changed the panel by:
public SearchResultPanel(String id, final Model<SearchDomain> model) {
               super(id);

               add(new Label("temp", new
PropertyModel<String>(model.getObject(), "search"))
}

3/
As I changed the Panel constructor above, we need to change to call. But, I
will prefer to pass the form's model. Thus, a CompoundPropertyModel is not
(yet?) needed. So:

Form<SearchDomain> searchForm = new Form<SearchDomain>("searchForm", new
Model<SearchDomain>(searchDomain));
final SearchResultPanel searchResultPanel = new
SearchResultPanel("searchResultPanel", form.getModel());

4/
searchResultPanel.setOutputMarkupId(true);
searchResultPanel.setOutputMarkupPlaceholderTag(true);

setOutputMarkupPlaceholderTag already sets the outputMarkupId to true. So,
use the one or the other. setOutputMarkupPlaceholderTag is needed if the
panel start in a not visible state. It will create an anchor for the ajax
call to be able to attach the visible component.

5/
searchForm.setModelObject(searchDomain);

Also not needed, you already sets the model object at the form's creation.


That's about all I see. Hope this helps.
Sebastien.


On Mon, Jun 11, 2012 at 8:29 PM, kshitiz <k....@gmail.com> wrote:

> Please help me ....I am really not able to understand why it is
> happening....The form is really simple now:
>
>
> public Search(final PageParameters pageParameters) {
>
>                super(pageParameters);
>
>                Form<SearchDomain> searchForm = new
> Form<SearchDomain>("searchForm",
>                                new
> CompoundPropertyModel<SearchDomain>(searchDomain));
>
> *               final SearchResultPanel searchResultPanel = new
> SearchResultPanel(
>                                 "searchResultPanel", searchDomain);
>                 searchResultPanel.setOutputMarkupId(true);
>                searchResultPanel.setOutputMarkupPlaceholderTag(true);
> *
>                searchForm.setModelObject(searchDomain);
>
>                // defining text field for user to search
>                final RequiredTextField<String> searchTextField = new
> RequiredTextField<String>(
>                                "search",
> Model.of(searchDomain.getSearch()));
>
>                AjaxFallbackButton ajaxSearchButton = new
> AjaxFallbackButton(
>                                "searchButton", searchForm) {
>
>                        @Override
>                        public void onSubmit(AjaxRequestTarget target,
> final Form<?> form) {
>                                if (target != null) {
>
>                                        try {
>                                 *
> target.add(searchResultPanel);*
>
>                                        } catch (Exception exception) {
>
>  error(exception.getMessage());
>                                        }
>
>
>                                }
>                        }
>
>                };
>
> *               searchForm.add(searchTextField);
>                searchForm.add(searchResultPanel);
>                searchForm.add(ajaxSearchButton);
>                add(searchForm);
> *       }
>
> And SearchResultPanel is:
>
>
> *public SearchResultPanel(String id, final SearchDomain searchDomain) {
>                super(id);
>                Label label = new Label("temp", new
>                                LoadableDetachableModel() { @Override
>                                protected Object load() { return
>                                searchDomain.getSearch(); }});
>                add(label);
> }
> *
>
> /But still, resultPanel is not displaying search text after being
> refreshed..that is the panel is not getting refreshed...!!! In every
> example
> I have seen in forums, it is done in the same manner...then why it is not
> happening..!!!!!!!  I am using wicket 1.5...
> /
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807p4649857.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Panel not getting refreshed...

Posted by kshitiz <k....@gmail.com>.
Please help me ....I am really not able to understand why it is
happening....The form is really simple now:


public Search(final PageParameters pageParameters) {

		super(pageParameters);

		Form<SearchDomain> searchForm = new Form<SearchDomain>("searchForm",
				new CompoundPropertyModel<SearchDomain>(searchDomain));

*		final SearchResultPanel searchResultPanel = new SearchResultPanel(
				"searchResultPanel", searchDomain);
		searchResultPanel.setOutputMarkupId(true);
		searchResultPanel.setOutputMarkupPlaceholderTag(true);
*
		searchForm.setModelObject(searchDomain);

		// defining text field for user to search
		final RequiredTextField<String> searchTextField = new
RequiredTextField<String>(
				"search", Model.of(searchDomain.getSearch()));

		AjaxFallbackButton ajaxSearchButton = new AjaxFallbackButton(
				"searchButton", searchForm) {
		
			@Override
			public void onSubmit(AjaxRequestTarget target, final Form<?> form) {
                   		if (target != null) {

					try {
				*		target.add(searchResultPanel);*

					} catch (Exception exception) {
						error(exception.getMessage());
					}


				}
			}

		};

*		searchForm.add(searchTextField);
		searchForm.add(searchResultPanel);
		searchForm.add(ajaxSearchButton);
         	add(searchForm);
*	}

And SearchResultPanel is:


*public SearchResultPanel(String id, final SearchDomain searchDomain) {
		super(id);
		Label label = new Label("temp", new 
				LoadableDetachableModel() { @Override
				protected Object load() { return 
				searchDomain.getSearch(); }}); 
		add(label);
}
*

/But still, resultPanel is not displaying search text after being
refreshed..that is the panel is not getting refreshed...!!! In every example
I have seen in forums, it is done in the same manner...then why it is not
happening..!!!!!!!  I am using wicket 1.5...
/

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807p4649857.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Panel not getting refreshed...

Posted by kshitiz <k....@gmail.com>.
Hi,

I have removed almost everything...resultPanel contains only sysout:

public class SearchResultPanel extends BasePanel {

	private static int temp = 0;

	@Override
	protected void onBeforeRender() {
		super.onBeforeRender();
		System.out.println("I am here.....");
	}
*	public SearchResultPanel(String id) {
		super(id);
		System.out.println("temp is " + temp);
		temp++;
*}

*And there is no container now. Search page where result panel is :*


public Search(final PageParameters pageParameters) {

		super(pageParameters);

		Form<SearchDomain> searchForm = new Form<SearchDomain>("searchForm",
				new CompoundPropertyModel<SearchDomain>(searchDomain));

		final Panel searchFeedbackPanel = new FeedbackPanel(
				"searchFeedbackPanel");
		searchFeedbackPanel.setOutputMarkupId(true);
		searchFeedbackPanel.setOutputMarkupPlaceholderTag(true);

*		final SearchResultPanel searchResultPanel = new SearchResultPanel(
				"searchResultPanel");
		searchResultPanel.setOutputMarkupId(true);
		searchResultPanel.setOutputMarkupPlaceholderTag(true);
*
		searchForm.setModelObject(searchDomain);

		// defining text field for user to search
		final RequiredTextField<String> searchTextField = new
RequiredTextField<String>(
				"search", Model.of(searchDomain.getSearch()));

		AjaxFallbackButton ajaxSearchButton = new AjaxFallbackButton(
				"searchButton", searchForm) {

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

				if (target != null) {

					try {
                                               
target.add(searchResultPanel);
						target.add(searchFeedbackPanel);
					} catch (Exception exception) {
						error(exception.getMessage());
						error = true;
					}


				}
			}


		};

		searchForm.add(searchTextField);
*		searchForm.add(searchFeedbackPanel);
		searchForm.add(searchResultPanel);
*		searchForm.add(ajaxSearchButton);


		add(searchForm);

	}

*Actually what is happening, when I refresh the whole page manually, it
enters the resultPanel and temp value is displayed in console. But nothing
happens when that panel is refreshed...!!*



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807p4649838.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Panel not getting refreshed...

Posted by Sebastien <se...@gmail.com>.
What I see in the ajax-debug is that you are going to refresh 2 components
(the feedback and the panel?) and... there are empty!
This could be explained for the feedback if there is no message but for the
other one... that's another story.

What I will suggest to you is to temporary replace you complex panel with a
simple one. Then, you can re-add child by child to that panel until you see
what is wrong...
I am also a lit surprised with your use of 'searchContainer'. I do see the
use case but I will be surprise that you cannot achieve what you are trying
to do by *not* passing the 'searchContainer' to SearchResultPanel (meaning,
add the SearchResultPanel instance to the container outside the
SearchResultPanel class itself).

Hope this helps,
Sebastien.


On Sun, Jun 10, 2012 at 10:14 PM, kshitiz <k....@gmail.com> wrote:

> *u are right...it is entering onBeforeRender method but it is not going in
> the panel portion. As far as debug part is concern...I dont see any error:*
>
> INFO:
> <?xml version="1.0" encoding="UTF-8"?><ajax-response><header-contribution
> encoding="wicket1" ></header-contribution><component id="id9c"
> ></component><component id="id9b" ></component></ajax-response>
> INFO: Response parsed. Now invoking steps...
> INFO: Response processed successfully.
> INFO: Invoking post-call handler(s)...
> INFO: refocus last focused component not needed/allowed
>
>
> *Do you see any error..?*
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807p4649836.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Panel not getting refreshed...

Posted by kshitiz <k....@gmail.com>.
*u are right...it is entering onBeforeRender method but it is not going in
the panel portion. As far as debug part is concern...I dont see any error:*

INFO: 
<?xml version="1.0" encoding="UTF-8"?><ajax-response><header-contribution
encoding="wicket1" ></header-contribution><component id="id9c"
></component><component id="id9b" ></component></ajax-response>
INFO: Response parsed. Now invoking steps...
INFO: Response processed successfully.
INFO: Invoking post-call handler(s)...
INFO: refocus last focused component not needed/allowed


*Do you see any error..?*

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807p4649836.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Panel not getting refreshed...

Posted by Sebastien <se...@gmail.com>.
> but result panel is not getting refreshed. It is not even entering in
that panel as I have some sysouts in that panel to check...

Try to put one sysout in searchResultPanel#onBeforeRender, to check whether
the panel is going to be refreshed.
Additionally, look at the ajax debug window to see if there is no error and
if you see the panel in the result of the call...


On Sun, Jun 10, 2012 at 1:34 PM, kshitiz <k....@gmail.com> wrote:

> I have tried that out...*no luck till now...:(....*
>
> Just for the info..what I am doing is that a search form is there which is
> populating result in domain object. I am passing that object in
> searchResultPanel to get displayed. Now, *form and panel...both are part of
> a container.* I want to refresh that panel only when users submits for
> search. I am not able to understand what can be the issue. *Feedback panel
> is getting refreshed properly in case of no search found but result panel
> is
> not getting refreshed. It is not even entering in that panel as I have some
> sysouts in that panel to check...*
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807p4649818.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Panel not getting refreshed...

Posted by kshitiz <k....@gmail.com>.
I have tried that out...*no luck till now...:(....*

Just for the info..what I am doing is that a search form is there which is
populating result in domain object. I am passing that object in
searchResultPanel to get displayed. Now, *form and panel...both are part of
a container.* I want to refresh that panel only when users submits for
search. I am not able to understand what can be the issue. *Feedback panel
is getting refreshed properly in case of no search found but result panel is
not getting refreshed. It is not even entering in that panel as I have some
sysouts in that panel to check...*

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807p4649818.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Panel not getting refreshed...

Posted by Sebastien <se...@gmail.com>.
Hi,

Yes, that's what I mean.
You can also change this, in order for the feedback panel to be re-rendered
even in case of error:

if (target != null) {

    try {
            target.add(searchResultPanel);
    } catch (Exception exception) {
            error(exception.getMessage());
            error = true;
    }

*    target.add(searchFeedbackPanel);
}

Regards,
Sebastien.

On Sun, Jun 10, 2012 at 8:48 AM, kshitiz <k....@gmail.com> wrote:

> Did u mean this:
>
>
> final SearchResultPanel searchResultPanel = new
> SearchResultPanel("searchResultPanel",
>                                searchDomain, error, searchContainer);
> *               searchResultPanel.setOutputMarkupId(true);*
>
>
>
> AjaxFallbackButton ajaxSearchButton = new AjaxFallbackButton(
>                                "searchButton", searchForm) {
>                         /*
>                                 *
>                                 */
>                        private static final long serialVersionUID = 1L;
>
>                        @Override
>                         public void onSubmit(AjaxRequestTarget target,
> final Form<?> form) {
>
>                                 /*
>                                 * Populating postDomain instance for
> submitting post. This
>                                 * instance is then passed to PostService
> class
>                                 */
>                                 if (target != null) {
>
>                                        try {
> *
> target.add(searchFeedbackPanel);
>
>  target.add(searchResultPanel);*
>                                         } catch (Exception exception) {
>
>  error(exception.getMessage());
>                                                error = true;
>                                        }
>
>                                }
>                        }
>
>                };
>
> Actually the above change is also not working..:(
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807p4649810.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Panel not getting refreshed...

Posted by kshitiz <k....@gmail.com>.
Did u mean this:


final SearchResultPanel searchResultPanel = new
SearchResultPanel("searchResultPanel",
				searchDomain, error, searchContainer);
*		searchResultPanel.setOutputMarkupId(true);*



AjaxFallbackButton ajaxSearchButton = new AjaxFallbackButton(
				"searchButton", searchForm) {
			/*
				 * 
				 */
			private static final long serialVersionUID = 1L;

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

				/*
				 * Populating postDomain instance for submitting post. This
				 * instance is then passed to PostService class
				 */
				if (target != null) {

					try {
*						target.add(searchFeedbackPanel);
						target.add(searchResultPanel);*
					} catch (Exception exception) {
						error(exception.getMessage());
						error = true;
					}

				}
			}

		};

Actually the above change is also not working..:(


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807p4649810.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Panel not getting refreshed...

Posted by Sebastien <se...@gmail.com>.
re-redner > re-render

On Sat, Jun 9, 2012 at 10:01 PM, Sebastien <se...@gmail.com> wrote:

> Hi,
>
> It's to late to have
> searchResultPanel.setOutputMarkupId(true);
> in onSubmit()
>
> You need to set this before the first rendering, because ajax need it in
> order to know how to re-redner the panel.
>
> Regards,
> Sebastien.
>
>
> On Sat, Jun 9, 2012 at 9:56 PM, kshitiz <k....@gmail.com> wrote:
>
>> Hi,
>>
>> I want to refresh a panel :
>>
>> *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) {
>>
>>                                listItem.add(userName);
>>                        }
>>
>>                };
>>
>>                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) {
>>
>>                        }
>>
>>                };
>>
>>                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);
>>                        }
>>                });
>>        }
>>
>> }
>>
>> I am refreshing it like this:
>>
>> AjaxFallbackButton ajaxSearchButton = new AjaxFallbackButton(
>>                                "searchButton", searchForm) {
>>                        @Override
>>                        public void onSubmit(AjaxRequestTarget target,
>> final Form<?> form) {
>>
>>                                if (target != null) {
>>
>>                                        try {
>>
>> searchResultPanel.setOutputMarkupId(true);
>>
>>  target.add(searchResultPanel);
>>                                        } catch (Exception exception) {
>>
>>  error(exception.getMessage());
>>                                                error = true;
>>                                        }
>>
>>                                }
>>                        }
>>
>>                };
>>
>>                searchForm.add(ajaxSearchButton);
>>
>>                searchContainer.add(searchForm);
>>                searchContainer.add(searchResultPanel);
>>                add(searchContainer);
>>
>>
>> *But panel is not getting refreshed..what can be the problem?? Is it
>> because
>> I am passing searchDomain in panel class and forming 2 views from that
>> object domain ??*
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

Re: Panel not getting refreshed...

Posted by Sebastien <se...@gmail.com>.
Hi,

It's to late to have
searchResultPanel.setOutputMarkupId(true);
in onSubmit()

You need to set this before the first rendering, because ajax need it in
order to know how to re-redner the panel.

Regards,
Sebastien.

On Sat, Jun 9, 2012 at 9:56 PM, kshitiz <k....@gmail.com> wrote:

> Hi,
>
> I want to refresh a panel :
>
> *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) {
>
>                                listItem.add(userName);
>                        }
>
>                };
>
>                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) {
>
>                        }
>
>                };
>
>                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);
>                        }
>                });
>        }
>
> }
>
> I am refreshing it like this:
>
> AjaxFallbackButton ajaxSearchButton = new AjaxFallbackButton(
>                                "searchButton", searchForm) {
>                        @Override
>                        public void onSubmit(AjaxRequestTarget target,
> final Form<?> form) {
>
>                                if (target != null) {
>
>                                        try {
>
> searchResultPanel.setOutputMarkupId(true);
>
>  target.add(searchResultPanel);
>                                        } catch (Exception exception) {
>
>  error(exception.getMessage());
>                                                error = true;
>                                        }
>
>                                }
>                        }
>
>                };
>
>                searchForm.add(ajaxSearchButton);
>
>                searchContainer.add(searchForm);
>                searchContainer.add(searchResultPanel);
>                add(searchContainer);
>
>
> *But panel is not getting refreshed..what can be the problem?? Is it
> because
> I am passing searchDomain in panel class and forming 2 views from that
> object domain ??*
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Panel-not-getting-refreshed-tp4649807.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>