RE: Problem with swapping panels using Ajax links
What do you mean by swapping panels? Are you using Component.replace()? And why would you when you could do all this in-line (the same way as the new version of Jira does it)? Try this live example: 1) Log on to http://Wicket.Apache.org 2) From under the "Learn" left navigation menu select the "Examples" link 3) Then the "live action" link on the page that come up You will be redirected to http://www.wicket-library.com/ 4) Now select the "ajax" link for examples using wicket's built-in AJAX 5) Select the "Editable Label Example" link that shows a label that can be edited inline via ajax 6) Click the "Source code" from the upper right-corner and enjoy the simple example Remember that you can always use the AjaxFallback*** counterpart components if you would like to support browsers that don't have JS turned on (isn't this the de-facto now-a-day anyhow?). Have fun! -Original Message- From: Chris Whitcomb [mailto:cwhitc...@osc.state.ny.us] Sent: Thursday, July 11, 2013 1:50 PM To: users@wicket.apache.org Subject: Problem with swapping panels using Ajax links I have a page that I swap 2 panels - read and edit. On the read panel, the edit button is an AjaxFallbackLink. In the onClick, I replace the read panel with the edit panel. This button works correctly - the panel gets swapped out. On the edit panel, I have 2 buttons - cancel which is an AjaxFallbackLink and save which is an AjaxSubmitLink. Both these buttons after doing the business logic display the read panel. I have a sandbox WebSphere server (ver 6.1) that the cancel and save buttons work on. When I deploy to our development server (WebSphere 6.1), the cancel and save buttons don't work. I have added logging to the onClick to see where they fail, but all the logging gets output, so all the code runs, but the read panel never shows on the page. I am using IE, but this happens the same way in FireFox. A am using the wicket filter, not the servlet (I know there are issues with WebSphere 6.1). The setting: com.ibm.ws.webcontainer.invokefilterscompatibility is set to true on both servers. The panel swapping works as expected if I switch to the servlet, but that causes other errors (see below). Using the filter, all functionality works in my sandbox, just not in our development region. To my knowledge, the 2 servers are configured the same (but apparently not). In the development region, I have looked at the AJAX Debug window. First, I clicked on edit document button. Then I clicked on cancel. There is an error when I click the cancel button: ERROR: Received Ajax response with code: 404 I see this when I click on edit: INFO: Initiating Ajax GET request on ?wicket:interface=:8:documentProperties:editDocument::IBehaviorListener:0:&r andom=0.3593767262126522 I see this when I click on cancel: INFO: Initiating Ajax GET request on ?wicket:interface=:8:documentProperties:editDocumentProperties:cancelChanges ::IBehaviorListener:0:-1&random=0.9291661442409403 -- In this project, I also have a web service using cxf. If I switch the wicket to use the servlet, the web service no longer works. I'm thinking that my servlet mappings are conflicting, but no matter which order I put them in, it doesn't work. I don't care which problem gets fixed (panel swapping using the filter setting or the multiple servlets). I do have a PMR open with IBM, because I have 2 environments with different results when they should be exactly the same. I thought I would post here as well hoping that someone may know what configuration may be causing this problem. I am using Wicket 1.4.22. I didn't post any of the code because I didn't know what you would want to see. I also don't think it is a code issue. I can post my web.xml if you want to look at my servlet mapping. Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-swapping-panels-usin g-Ajax-links-tp4660211.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: Problem with swapping panels using Ajax links
I like the inline editing - that's pretty nice. However, I'm not sure my users would. I swap the panels usng replaceWith: Page page = getPage(); EditPanel editPanel = new EditPanel(ReadPanel.this.getId(), selectedDocumentModel); ReadPanel.this.replaceWith(editPanel); if(target != null){ target.addComponent(editPanel); } else { setResponsePage(page); } There are also 2 level of edit access. Depending on what group (active directory) they are in, they may be able to edit all fields or only some. I have created 2 edit panels and depending on their group membership, determine which edit panel to display. Thanks, Chris Paul Bors wrote > What do you mean by swapping panels? > > Are you using Component.replace()? > And why would you when you could do all this in-line (the same way as the > new version of Jira does it)? > > Try this live example: > 1) Log on to http://Wicket.Apache.org > 2) From under the "Learn" left navigation menu select the "Examples" link > 3) Then the "live action" link on the page that come up >You will be redirected to http://www.wicket-library.com/ > 4) Now select the "ajax" link for examples using wicket's built-in AJAX > 5) Select the "Editable Label Example" link that shows a label that can be > edited inline via ajax > 6) Click the "Source code" from the upper right-corner and enjoy the > simple > example > > Remember that you can always use the AjaxFallback*** counterpart > components > if you would like to support browsers that don't have JS turned on (isn't > this the de-facto now-a-day anyhow?). > > Have fun! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-swapping-panels-using-Ajax-links-tp4660211p4660229.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: Problem with swapping panels using Ajax links
Okay but in-line editing doesn't necessary mean you need to edit a single field at a time. You could have the user hit an Edit button and toggle a bunch of components from labels to form fields and even toggle the Cancel button's visibility. As for your code snippet, don't you have to add to the Ajax target the parent of the panel that was switched out? target.addComponent(editPanel.getParent()); ~ Thank you, Paul Bors -Original Message- From: Chris Whitcomb [mailto:cwhitc...@osc.state.ny.us] Sent: Friday, July 12, 2013 7:30 AM To: users@wicket.apache.org Subject: RE: Problem with swapping panels using Ajax links I like the inline editing - that's pretty nice. However, I'm not sure my users would. I swap the panels usng replaceWith: Page page = getPage(); EditPanel editPanel = new EditPanel(ReadPanel.this.getId(), selectedDocumentModel); ReadPanel.this.replaceWith(editPanel); if(target != null){ target.addComponent(editPanel); } else { setResponsePage(page); } There are also 2 level of edit access. Depending on what group (active directory) they are in, they may be able to edit all fields or only some. I have created 2 edit panels and depending on their group membership, determine which edit panel to display. Thanks, Chris Paul Bors wrote > What do you mean by swapping panels? > > Are you using Component.replace()? > And why would you when you could do all this in-line (the same way as > the new version of Jira does it)? > > Try this live example: > 1) Log on to http://Wicket.Apache.org > 2) From under the "Learn" left navigation menu select the "Examples" > link > 3) Then the "live action" link on the page that come up >You will be redirected to http://www.wicket-library.com/ > 4) Now select the "ajax" link for examples using wicket's built-in > AJAX > 5) Select the "Editable Label Example" link that shows a label that > can be edited inline via ajax > 6) Click the "Source code" from the upper right-corner and enjoy the > simple example > > Remember that you can always use the AjaxFallback*** counterpart > components if you would like to support browsers that don't have JS > turned on (isn't this the de-facto now-a-day anyhow?). > > Have fun! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-swapping-panels-usin g-Ajax-links-tp4660211p4660229.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: Problem with swapping panels using Ajax links
It seems that on the server that works (WAS 6.1.0.29), it can find the wicket-event.js: [7/22/13 13:58:34:585 EDT] 001c SessionContex > SessionContext.encodeURL Entry resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js On the servers that don't work (WAS 6.1.0.25), it cannot find that file: [7/18/13 6:55:44:703 EDT] 001f DefaultExtens 3 handleRequest stripping leading slashes pathInfo ---> resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js [7/18/13 6:55:44:703 EDT] 001f DefaultExtens 3 file does not exist :/usr/WebSphere/AppServer/profiles/AppSrv01/installedApps/Cell/app.ear/app.war/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js On the servers that don't work, it is looking for the file in the wrong location. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-swapping-panels-using-Ajax-links-tp4660211p4660418.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