Re: [Wicket-user] AJAX Button on my Form inside a Panel needs 2 clicks to do a search
Great Jim, thanks a bunch. I'll try it out and let you know. Thanks again, f(t) On 6/8/07, James McLaughlin [EMAIL PROTECTED] wrote: I think some of the older versions of wicket would sometimes omit header contributions. When the error happens, check to see if wicket-ajax.js is included in the page. Also, you might want to upgrade to 1.2.6 and see if that fixes the issue. best, jim On 6/8/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: James, sorry I took so long to respond. I tried to put PageLinks in the menu. And I could swear that the frequency of error drop, but some times it still happens. I am using wicket 1.2.5. f(t) On 6/6/07, James McLaughlin [EMAIL PROTECTED] wrote: Looks good. What version of wicket are you using? And the second time you click DossierSearch, the time when no wicket ajax debug shows up, do a view source and see if the proper wicket-ajax js files are in the head section. Another thing I would suggest is using Bookmarkable links in your menu for Dossier search. You are using regular links, and that is why your url changes. best, jim On 6/6/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Here is the video. It is .AVI file made with CamStudio, an Open-source project. and it is inside a rar. f(t) On 6/6/07, James McLaughlin [EMAIL PROTECTED] wrote: Hi Francisco, I can't see anything logically wrong with your code, all though there are things I would have done differently. What is the output of the wicket ajax debug panel when you click on the ajax submit button? If you want some advice, I would suggest not using a pageablelistview and not keeping your search results as an instance member (unless they are very expensive to create). Instead, look into using DefaultDataTable or extending DataTable. That way you can put all your search logic in your IDataProvider (such as SortableDataProvider), and retrieve only the results you will display in the current page, and not carry them around in the session after the request is over. Hope this helps. best, jim On 6/6/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Sorry but I cannot find what the problem is. I've search Nabble. - Hello every one, I have a page that uses a panel (code ahead) that has a form with an AJAX button, it works fine, but some times I have to click on the Search button 2 times to make it work. I think it has to do with URLs or something because when it happens it changes the url. The code for the page that uses the following panel I don't include because it only has a statement saying add(new SearchPanel(etc... Here is the code, can some one help? ps: If any other comments like, your code sucks, please also include them. thanks a bunch f(t) and here is the code: package ch.logismata.wicket.panels.ajax; import ch.logismata.serverwrapper.DossierSearch ; import ch.logismata.serverwrapper.DossierSearchResult ; import ch.logismata.serverwrapper.DossierSearchResultList; import ch.logismata.wicket.pages.NewDossier ; import ch.logismata.wicket.panels.BasePanel; import java.io.Serializable; import java.util.ArrayList ; import wicket.AttributeModifier; import wicket.Component; import wicket.PageParameters; import wicket.ajax.AjaxRequestTarget; import wicket.ajax.markup.html.form.AjaxSubmitButton ; import wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator ; import wicket.markup.html.WebMarkupContainer; import wicket.markup.html.basic.Label ; import wicket.markup.html.form.Form ; import wicket.markup.html.form.TextField; import wicket.markup.html.link.Link; import wicket.markup.html.list.ListItem ; import wicket.markup.html.list.PageableListView; import wicket.markup.html.panel.FeedbackPanel ; import wicket.model.AbstractReadOnlyModel; import wicket.model.CompoundPropertyModel ; import wicket.model.Model; import wicket.model.ResourceModel; /** * Panel to make a Dossier Search and display the results * * @author gm */ public class DossierSearchPanel extends BasePanel { private SearchDossierModel m_cSearchDossierModel = new SearchDossierModel(); private ArrayListDossierSearchResult m_cSearchResults= new ArrayListDossierSearchResult(); public DossierSearchPanel(String id) { //Call super base panel super(id); // create feedback panel to show errors final FeedbackPanel feedback = new FeedbackPanel(searchFeedback); //add feedback panel
Re: [Wicket-user] AJAX Button on my Form inside a Panel needs 2 clicks to do a search
James, sorry I took so long to respond. I tried to put PageLinks in the menu. And I could swear that the frequency of error drop, but some times it still happens. I am using wicket 1.2.5. f(t) On 6/6/07, James McLaughlin [EMAIL PROTECTED] wrote: Looks good. What version of wicket are you using? And the second time you click DossierSearch, the time when no wicket ajax debug shows up, do a view source and see if the proper wicket-ajax js files are in the head section. Another thing I would suggest is using Bookmarkable links in your menu for Dossier search. You are using regular links, and that is why your url changes. best, jim On 6/6/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Here is the video. It is .AVI file made with CamStudio, an Open-source project. and it is inside a rar. f(t) On 6/6/07, James McLaughlin [EMAIL PROTECTED] wrote: Hi Francisco, I can't see anything logically wrong with your code, all though there are things I would have done differently. What is the output of the wicket ajax debug panel when you click on the ajax submit button? If you want some advice, I would suggest not using a pageablelistview and not keeping your search results as an instance member (unless they are very expensive to create). Instead, look into using DefaultDataTable or extending DataTable. That way you can put all your search logic in your IDataProvider (such as SortableDataProvider), and retrieve only the results you will display in the current page, and not carry them around in the session after the request is over. Hope this helps. best, jim On 6/6/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Sorry but I cannot find what the problem is. I've search Nabble. - Hello every one, I have a page that uses a panel (code ahead) that has a form with an AJAX button, it works fine, but some times I have to click on the Search button 2 times to make it work. I think it has to do with URLs or something because when it happens it changes the url. The code for the page that uses the following panel I don't include because it only has a statement saying add(new SearchPanel(etc... Here is the code, can some one help? ps: If any other comments like, your code sucks, please also include them. thanks a bunch f(t) and here is the code: package ch.logismata.wicket.panels.ajax; import ch.logismata.serverwrapper.DossierSearch; import ch.logismata.serverwrapper.DossierSearchResult ; import ch.logismata.serverwrapper.DossierSearchResultList; import ch.logismata.wicket.pages.NewDossier; import ch.logismata.wicket.panels.BasePanel; import java.io.Serializable; import java.util.ArrayList ; import wicket.AttributeModifier; import wicket.Component; import wicket.PageParameters; import wicket.ajax.AjaxRequestTarget; import wicket.ajax.markup.html.form.AjaxSubmitButton ; import wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator ; import wicket.markup.html.WebMarkupContainer; import wicket.markup.html.basic.Label; import wicket.markup.html.form.Form ; import wicket.markup.html.form.TextField; import wicket.markup.html.link.Link; import wicket.markup.html.list.ListItem; import wicket.markup.html.list.PageableListView; import wicket.markup.html.panel.FeedbackPanel ; import wicket.model.AbstractReadOnlyModel; import wicket.model.CompoundPropertyModel ; import wicket.model.Model; import wicket.model.ResourceModel; /** * Panel to make a Dossier Search and display the results * * @author gm */ public class DossierSearchPanel extends BasePanel { private SearchDossierModel m_cSearchDossierModel = new SearchDossierModel(); private ArrayListDossierSearchResult m_cSearchResults= new ArrayListDossierSearchResult(); public DossierSearchPanel(String id) { //Call super base panel super(id); // create feedback panel to show errors final FeedbackPanel feedback = new FeedbackPanel(searchFeedback); //add feedback panel feedback.setOutputMarkupId(true); add(feedback); // create form with markup id setter so it can be updated via ajax Form form = new Form(dossierSearchForm, new CompoundPropertyModel(m_cSearchDossierModel)); form.setOutputMarkupId(true); form.add(new Label(legend, new ResourceModel(fields.legend))); form.add(new Label(nameLabel, new ResourceModel( fields.name))); //Construct TextFields TextField cNameTextField= new TextField(name); TextField cLastNameTextField= new TextField(lastName); //add Fields to the form form.add(cNameTextField); form.add(new
Re: [Wicket-user] AJAX Button on my Form inside a Panel needs 2 clicks to do a search
I think some of the older versions of wicket would sometimes omit header contributions. When the error happens, check to see if wicket-ajax.js is included in the page. Also, you might want to upgrade to 1.2.6 and see if that fixes the issue. best, jim On 6/8/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: James, sorry I took so long to respond. I tried to put PageLinks in the menu. And I could swear that the frequency of error drop, but some times it still happens. I am using wicket 1.2.5. f(t) On 6/6/07, James McLaughlin [EMAIL PROTECTED] wrote: Looks good. What version of wicket are you using? And the second time you click DossierSearch, the time when no wicket ajax debug shows up, do a view source and see if the proper wicket-ajax js files are in the head section. Another thing I would suggest is using Bookmarkable links in your menu for Dossier search. You are using regular links, and that is why your url changes. best, jim On 6/6/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Here is the video. It is .AVI file made with CamStudio, an Open-source project. and it is inside a rar. f(t) On 6/6/07, James McLaughlin [EMAIL PROTECTED] wrote: Hi Francisco, I can't see anything logically wrong with your code, all though there are things I would have done differently. What is the output of the wicket ajax debug panel when you click on the ajax submit button? If you want some advice, I would suggest not using a pageablelistview and not keeping your search results as an instance member (unless they are very expensive to create). Instead, look into using DefaultDataTable or extending DataTable. That way you can put all your search logic in your IDataProvider (such as SortableDataProvider), and retrieve only the results you will display in the current page, and not carry them around in the session after the request is over. Hope this helps. best, jim On 6/6/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Sorry but I cannot find what the problem is. I've search Nabble. - Hello every one, I have a page that uses a panel (code ahead) that has a form with an AJAX button, it works fine, but some times I have to click on the Search button 2 times to make it work. I think it has to do with URLs or something because when it happens it changes the url. The code for the page that uses the following panel I don't include because it only has a statement saying add(new SearchPanel(etc... Here is the code, can some one help? ps: If any other comments like, your code sucks, please also include them. thanks a bunch f(t) and here is the code: package ch.logismata.wicket.panels.ajax; import ch.logismata.serverwrapper.DossierSearch ; import ch.logismata.serverwrapper.DossierSearchResult ; import ch.logismata.serverwrapper.DossierSearchResultList; import ch.logismata.wicket.pages.NewDossier ; import ch.logismata.wicket.panels.BasePanel; import java.io.Serializable; import java.util.ArrayList ; import wicket.AttributeModifier; import wicket.Component; import wicket.PageParameters; import wicket.ajax.AjaxRequestTarget; import wicket.ajax.markup.html.form.AjaxSubmitButton ; import wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator ; import wicket.markup.html.WebMarkupContainer; import wicket.markup.html.basic.Label ; import wicket.markup.html.form.Form ; import wicket.markup.html.form.TextField; import wicket.markup.html.link.Link; import wicket.markup.html.list.ListItem ; import wicket.markup.html.list.PageableListView; import wicket.markup.html.panel.FeedbackPanel ; import wicket.model.AbstractReadOnlyModel; import wicket.model.CompoundPropertyModel ; import wicket.model.Model; import wicket.model.ResourceModel; /** * Panel to make a Dossier Search and display the results * * @author gm */ public class DossierSearchPanel extends BasePanel { private SearchDossierModel m_cSearchDossierModel = new SearchDossierModel(); private ArrayListDossierSearchResult m_cSearchResults= new ArrayListDossierSearchResult(); public DossierSearchPanel(String id) { //Call super base panel super(id); // create feedback panel to show errors final FeedbackPanel feedback = new FeedbackPanel(searchFeedback); //add feedback panel feedback.setOutputMarkupId(true); add(feedback); // create form with markup id setter so it can be updated via ajax
Re: [Wicket-user] AJAX Button on my Form inside a Panel needs 2 clicks to do a search
Looks good. What version of wicket are you using? And the second time you click DossierSearch, the time when no wicket ajax debug shows up, do a view source and see if the proper wicket-ajax js files are in the head section. Another thing I would suggest is using Bookmarkable links in your menu for Dossier search. You are using regular links, and that is why your url changes. best, jim On 6/6/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Here is the video. It is .AVI file made with CamStudio, an Open-source project. and it is inside a rar. f(t) On 6/6/07, James McLaughlin [EMAIL PROTECTED] wrote: Hi Francisco, I can't see anything logically wrong with your code, all though there are things I would have done differently. What is the output of the wicket ajax debug panel when you click on the ajax submit button? If you want some advice, I would suggest not using a pageablelistview and not keeping your search results as an instance member (unless they are very expensive to create). Instead, look into using DefaultDataTable or extending DataTable. That way you can put all your search logic in your IDataProvider (such as SortableDataProvider), and retrieve only the results you will display in the current page, and not carry them around in the session after the request is over. Hope this helps. best, jim On 6/6/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Sorry but I cannot find what the problem is. I've search Nabble. - Hello every one, I have a page that uses a panel (code ahead) that has a form with an AJAX button, it works fine, but some times I have to click on the Search button 2 times to make it work. I think it has to do with URLs or something because when it happens it changes the url. The code for the page that uses the following panel I don't include because it only has a statement saying add(new SearchPanel(etc... Here is the code, can some one help? ps: If any other comments like, your code sucks, please also include them. thanks a bunch f(t) and here is the code: package ch.logismata.wicket.panels.ajax; import ch.logismata.serverwrapper.DossierSearch; import ch.logismata.serverwrapper.DossierSearchResult ; import ch.logismata.serverwrapper.DossierSearchResultList; import ch.logismata.wicket.pages.NewDossier; import ch.logismata.wicket.panels.BasePanel; import java.io.Serializable; import java.util.ArrayList ; import wicket.AttributeModifier; import wicket.Component; import wicket.PageParameters; import wicket.ajax.AjaxRequestTarget; import wicket.ajax.markup.html.form.AjaxSubmitButton ; import wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator ; import wicket.markup.html.WebMarkupContainer; import wicket.markup.html.basic.Label; import wicket.markup.html.form.Form ; import wicket.markup.html.form.TextField; import wicket.markup.html.link.Link; import wicket.markup.html.list.ListItem; import wicket.markup.html.list.PageableListView; import wicket.markup.html.panel.FeedbackPanel ; import wicket.model.AbstractReadOnlyModel; import wicket.model.CompoundPropertyModel ; import wicket.model.Model; import wicket.model.ResourceModel; /** * Panel to make a Dossier Search and display the results * * @author gm */ public class DossierSearchPanel extends BasePanel { private SearchDossierModel m_cSearchDossierModel = new SearchDossierModel(); private ArrayListDossierSearchResult m_cSearchResults= new ArrayListDossierSearchResult(); public DossierSearchPanel(String id) { //Call super base panel super(id); // create feedback panel to show errors final FeedbackPanel feedback = new FeedbackPanel(searchFeedback); //add feedback panel feedback.setOutputMarkupId(true); add(feedback); // create form with markup id setter so it can be updated via ajax Form form = new Form(dossierSearchForm, new CompoundPropertyModel(m_cSearchDossierModel)); form.setOutputMarkupId(true); form.add(new Label(legend, new ResourceModel(fields.legend))); form.add(new Label(nameLabel, new ResourceModel( fields.name))); //Construct TextFields TextField cNameTextField= new TextField(name); TextField cLastNameTextField= new TextField(lastName); //add Fields to the form form.add(cNameTextField); form.add(new Label(lastNameLabel, new ResourceModel(fields.lastName))); form.add(cLastNameTextField); ///Add pageable table final WebMarkupContainer datacontainer = new WebMarkupContainer(data);
Re: [Wicket-user] AJAX Button on my Form inside a Panel needs 2 clicks to do a search
Right, I'll try that and tell you how it went. f(t) On 6/6/07, James McLaughlin [EMAIL PROTECTED] wrote: Looks good. What version of wicket are you using? And the second time you click DossierSearch, the time when no wicket ajax debug shows up, do a view source and see if the proper wicket-ajax js files are in the head section. Another thing I would suggest is using Bookmarkable links in your menu for Dossier search. You are using regular links, and that is why your url changes. best, jim On 6/6/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Here is the video. It is .AVI file made with CamStudio, an Open-source project. and it is inside a rar. f(t) On 6/6/07, James McLaughlin [EMAIL PROTECTED] wrote: Hi Francisco, I can't see anything logically wrong with your code, all though there are things I would have done differently. What is the output of the wicket ajax debug panel when you click on the ajax submit button? If you want some advice, I would suggest not using a pageablelistview and not keeping your search results as an instance member (unless they are very expensive to create). Instead, look into using DefaultDataTable or extending DataTable. That way you can put all your search logic in your IDataProvider (such as SortableDataProvider), and retrieve only the results you will display in the current page, and not carry them around in the session after the request is over. Hope this helps. best, jim On 6/6/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Sorry but I cannot find what the problem is. I've search Nabble. - Hello every one, I have a page that uses a panel (code ahead) that has a form with an AJAX button, it works fine, but some times I have to click on the Search button 2 times to make it work. I think it has to do with URLs or something because when it happens it changes the url. The code for the page that uses the following panel I don't include because it only has a statement saying add(new SearchPanel(etc... Here is the code, can some one help? ps: If any other comments like, your code sucks, please also include them. thanks a bunch f(t) and here is the code: package ch.logismata.wicket.panels.ajax; import ch.logismata.serverwrapper.DossierSearch; import ch.logismata.serverwrapper.DossierSearchResult ; import ch.logismata.serverwrapper.DossierSearchResultList; import ch.logismata.wicket.pages.NewDossier; import ch.logismata.wicket.panels.BasePanel; import java.io.Serializable; import java.util.ArrayList ; import wicket.AttributeModifier; import wicket.Component; import wicket.PageParameters; import wicket.ajax.AjaxRequestTarget; import wicket.ajax.markup.html.form.AjaxSubmitButton ; import wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator ; import wicket.markup.html.WebMarkupContainer; import wicket.markup.html.basic.Label; import wicket.markup.html.form.Form ; import wicket.markup.html.form.TextField; import wicket.markup.html.link.Link; import wicket.markup.html.list.ListItem; import wicket.markup.html.list.PageableListView; import wicket.markup.html.panel.FeedbackPanel ; import wicket.model.AbstractReadOnlyModel; import wicket.model.CompoundPropertyModel ; import wicket.model.Model; import wicket.model.ResourceModel; /** * Panel to make a Dossier Search and display the results * * @author gm */ public class DossierSearchPanel extends BasePanel { private SearchDossierModel m_cSearchDossierModel = new SearchDossierModel(); private ArrayListDossierSearchResult m_cSearchResults= new ArrayListDossierSearchResult(); public DossierSearchPanel(String id) { //Call super base panel super(id); // create feedback panel to show errors final FeedbackPanel feedback = new FeedbackPanel(searchFeedback); //add feedback panel feedback.setOutputMarkupId(true); add(feedback); // create form with markup id setter so it can be updated via ajax Form form = new Form(dossierSearchForm, new CompoundPropertyModel(m_cSearchDossierModel)); form.setOutputMarkupId(true); form.add(new Label(legend, new ResourceModel(fields.legend))); form.add(new Label(nameLabel, new ResourceModel( fields.name))); //Construct TextFields TextField cNameTextField= new TextField(name); TextField cLastNameTextField= new TextField(lastName); //add Fields to the form form.add(cNameTextField); form.add(new Label(lastNameLabel, new ResourceModel(fields.lastName))); form.add(cLastNameTextField); ///Add pageable table