Re: AjaxSubmitLink not working
This may not be the issue, but it's good practice to always include an onError method in the anonymous class. Once you add that, put a break point there & see what turns up. From: Entropy To: users@wicket.apache.org Date: 02/15/2017 11:55 AM Subject:AjaxSubmitLink not working This email originated from outside of the company. Please use discretion if opening attachments or clicking on links. I have a header links section in my header that must build in a dynamic way. AjaxSubmitLink link = new AjaxSubmitLink(linkName, formToSubmit) { @Override public void onSubmit(AjaxRequestTarget target, Form form) { //control never gets here. } }; That is being built in a function call that is called from a loop (though I don't think that matters). The HTML (of one example):Contact Information In the wicket ajax debug window, I am getting this: INFO: focus removed from INFO: focus set on startLinkc INFO: Received ajax response (69 characters) INFO: INFO: Response processed successfully. INFO: refocus last focused component not needed/allowed Implying that it ran, but did nothing? There are no validators in place (yet) on the form. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-not-working-tp4677120.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: New window blocked by popup blocker
If you control the popup blocker, just disable it. If you DON'T control the popup blocker, you need to (1) Train users to allow popups for your app or (2) re-design the app to not use use popups. _ “Measuring software productivity by lines of code is like measuring progress on an airplane by how much it weighs.” Bill Gates From: Pratibha To: users@wicket.apache.org Date: 10/26/2016 05:14 AM Subject:New window blocked by popup blocker This email originated from outside of the company. Please use discretion if opening attachments or clicking on links. Hi team, I need to open window using Ajax Target The below code opens url in new tab but is blocked by pop up target.appendJavaScript("window.open('"+url.toString()+"','_blank');"); getRequestCycle().scheduleRequestHandlerAfterCurrent(target); Thankyou -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/New-window-blocked-by-popup-blocker-tp4675878.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Jsession Test Question
The short answer is no. The session ID is not part of the URL. The long answer is, you can test for the session ID if you have access to the HTTP request object. From: Lois GreeneHernandez To: "users@wicket.apache.org" Date: 12/10/2015 01:50 PM Subject:Jsession Test Question This email originated from outside of the company. Please use discretion if opening attachments or clicking on links. Hi All, Is it possible to write a unit test or a pojo that tests an request url for the presence of a jsessionid? My application Is java/wicket. Our test system is testNG and wicket tester. Thanks Lois ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Wicket+Spring 4 integration
FYI, we use Spring 4.0.5 with Wicket 1.7.5 & have not encountered any issues. Your mileage may vary. From: Sandor Feher To: users@wicket.apache.org Date: 09/24/2015 01:37 PM Subject:Re: Wicket+Spring 4 integration This email originated from outside of the company. Please use discretion if opening attachments or clicking on links. I tried to do but I experienced some problems. They might be related to Spring but I'm not sure. I use spring security. Default login page has changed in 4 so I set my wicket app's login page. Then login page appeared but there was no action made when I clicked submit button. I dig Springs migration guide but did not found any clue related to my issue. I reverted back to 3.2.5 and everything worked like expected. So this is the whole story. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Spring-4-integration-tp4672031p4672037.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: How do I get the current page?
Not inclined to click on untrusted links, for security reasons. When you say "get the current page", where do you want to get it FROM? If you're in the page code itself, it's just "this." If you want it from somewhere else, describe what you're trying to achieve. From: K To: users@wicket.apache.org Date: 12/30/2014 09:58 AM Subject:Re: How do I get the current page? Hi i am working on the same thing and i have not been able to achieve the desired outcome. i would appericiate any suggestions. i have posted complete details here http://apache-wicket.1842946.n4.nabble.com/current-page-highlighting-td4668902.html < http://apache-wicket.1842946.n4.nabble.com/current-page-highlighting-td4668902.html > Thanks. - K -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-do-I-get-the-current-page-tp1851661p4668903.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Can't Get IAuthorizationStrategy Working
I guess we're out of luck. Component#canCallListenerInterface() doesn't exist in 1.4.x & AbstractLink#isLinkEnabled() is final, so we can't override it. Will have to redesign our form class. Sigh. From: Martin Grigorov To: "users@wicket.apache.org" Date: 12/08/2014 03:55 PM Subject:Re: Can't Get IAuthorizationStrategy Working Hi, Not certain about 1.4.x but in 6.x if a parent component is disabled then all its children are disabled as well. For AbstractLink there is a special #isLinkEnabled() method which combined with Component#canCallListenerInterface(Method) can make the link enabled even if any of its parents is disabled. Good luck! Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Dec 8, 2014 at 10:16 PM, Richard W. Adams wrote: > We have a use case which requires an enabled link inside a disabled form. > The form being disabled is based on user's security role, but the link > being enabled depends on the results returned from a separate database > query. Thus, we might have a disabled form, but an enabled link, or vice > versa. Our link class (below) implements IAuthorizationStrategy, but for > some reason, when the parent form is disabled, and the link is enabled, > the onClick() method is not called. > > Can anyone see what we're doing wrong? > > We use Wicket 1.4.17 (no option to upgrade due to corporate framework > constraints). > __ > > package com.uprr.enm.web.track.detail; > > import org.apache.wicket.Component; > import org.apache.wicket.ajax.AjaxRequestTarget; > import org.apache.wicket.ajax.markup.html.AjaxLink; > import org.apache.wicket.authorization.Action; > import org.apache.wicket.authorization.IAuthorizationStrategy; > > import com.uprr.eni.commons.util.ApiLog; > import com.uprr.eni.valid.tracks.TrackAttribute; > import com.uprr.enm.dao.jdbc.track.history.TrackHistoryReadDAO; > import com.uprr.enm.web.track.history.HistoryModal; > import > com.uprr.ui.wicket.components.ajax.listener.RemovePleaseWaitAjaxListener; > import com.uprr.ui.wicket.components.behavior.PleaseWaitBehavior; > > > //--- > /** > * A link to open a track history modal. This class lets us have a working > history link even if > * the parent form is disabled. > */ > class TrackHistoryLink extends AjaxLink implements > IAuthorizationStrategy { > > private static final long serialVersionUID = 4693199534296169911L; > > private TrackAttribute attribute; > private HistoryModal modal ; > private Integer track ; > > > //--- > /** > * Constructor. > * @param id Markup ID. > * @param track Track system number. > * @param attribute The track attribute for which history is desired. > * @param dao Data access object to provide track history. > * @param modal Dialog to display the history data. > */ > public TrackHistoryLink(final String id, final Integer track, final > TrackAttribute attribute, > final TrackHistoryReadDAO dao, final HistoryModal modal) { > > super(id); > if (dao.historyExists(track, attribute)) { // If track has > history records > setEnabled(true); > add(new PleaseWaitBehavior()); > this.track = track; > this.modal = modal; > this.attribute = attribute; > } else { > setEnabled(false); > } > ApiLog.debug("%s history link is %s%n", attribute, isEnabled() ? > "enabled" : "disabled"); > } > > //--- > @Override public boolean isActionAuthorized(final Component component, > final Action action) { > return true; > } > > //--- > @Override public boolean isInstantiationAuthorized > (final Class componentClass) { > return true; > } > > //--- > @Override public void onClick(final AjaxRequestTarget ajax) { > ajax.addListener(RemovePleaseWaitAjaxListener.getInstance()); > modal.show(track, attribute, ajax); > } > > //--- > } > > > ** >
Can't Get IAuthorizationStrategy Working
We have a use case which requires an enabled link inside a disabled form. The form being disabled is based on user's security role, but the link being enabled depends on the results returned from a separate database query. Thus, we might have a disabled form, but an enabled link, or vice versa. Our link class (below) implements IAuthorizationStrategy, but for some reason, when the parent form is disabled, and the link is enabled, the onClick() method is not called. Can anyone see what we're doing wrong? We use Wicket 1.4.17 (no option to upgrade due to corporate framework constraints). __ package com.uprr.enm.web.track.detail; import org.apache.wicket.Component; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.authorization.Action; import org.apache.wicket.authorization.IAuthorizationStrategy; import com.uprr.eni.commons.util.ApiLog; import com.uprr.eni.valid.tracks.TrackAttribute; import com.uprr.enm.dao.jdbc.track.history.TrackHistoryReadDAO; import com.uprr.enm.web.track.history.HistoryModal; import com.uprr.ui.wicket.components.ajax.listener.RemovePleaseWaitAjaxListener; import com.uprr.ui.wicket.components.behavior.PleaseWaitBehavior; //--- /** * A link to open a track history modal. This class lets us have a working history link even if * the parent form is disabled. */ class TrackHistoryLink extends AjaxLink implements IAuthorizationStrategy { private static final long serialVersionUID = 4693199534296169911L; private TrackAttribute attribute; private HistoryModal modal ; private Integer track ; //--- /** * Constructor. * @param id Markup ID. * @param track Track system number. * @param attribute The track attribute for which history is desired. * @param dao Data access object to provide track history. * @param modal Dialog to display the history data. */ public TrackHistoryLink(final String id, final Integer track, final TrackAttribute attribute, final TrackHistoryReadDAO dao, final HistoryModal modal) { super(id); if (dao.historyExists(track, attribute)) { // If track has history records setEnabled(true); add(new PleaseWaitBehavior()); this.track = track; this.modal = modal; this.attribute = attribute; } else { setEnabled(false); } ApiLog.debug("%s history link is %s%n", attribute, isEnabled() ? "enabled" : "disabled"); } //--- @Override public boolean isActionAuthorized(final Component component, final Action action) { return true; } //--- @Override public boolean isInstantiationAuthorized (final Class componentClass) { return true; } //--- @Override public void onClick(final AjaxRequestTarget ajax) { ajax.addListener(RemovePleaseWaitAjaxListener.getInstance()); modal.show(track, attribute, ajax); } //--- } ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: DiskDataStore errors in production
Hard to know without seeing code, but the message seems to indicate app is failing to close files after it's finished with them. In other words, an operating system problem, rather than Tomcat or Wicket. From: eaglei22 To: users@wicket.apache.org Date: 05/15/2014 02:02 AM Subject:DiskDataStore errors in production Hi, my application in production often gets this error: May 14 09:12:27 ERROR DiskDataStore-/opt/ssa/tomcat/apache-tomcat-7.0.29/work/Catalina/localhost/SSA/wicket.ssa-webapp-filestore/4729/2939/909EAC3343856968BA7B1864B71CEA85/data (Too many open files) java.io.FileNotFoundException: /opt/ssa/tomcat/apache-tomcat-7.0.29/work/Catalina/localhost/SSA/wicket.ssa-webapp-filestore/4729/2939/909EAC3343856968BA7B1864B71CEA85/data (Too many open files) at java.io.RandomAccessFile.open(Native Method) at java.io.RandomAccessFile.(RandomAccessFile.java:233) at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.getFileChannel(DiskDataStore.java:425) at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.savePage(DiskDataStore.java:343) at org.apache.wicket.pageStore.DiskDataStore.storeData(DiskDataStore.java:181) at org.apache.wicket.pageStore.AsynchronousDataStore.storeData(AsynchronousDataStore.java:228) at org.apache.wicket.pageStore.DefaultPageStore.storePageData(DefaultPageStore.java:120) at org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:154) at org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.storeTouchedPages(PageStoreManager.java:412) at org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:181) and now I am getting this error for every page opened making the log file extremely large: May 14 11:36:31 WARN DiskDataStore-Cannot save page with id '866' because the data file cannot be opened. May 14 11:36:31 ERROR DiskDataStore-/opt/ssa/tomcat/apache-tomcat-7.0.29/work/Catalina/localhost/SSA/wicket.ssa-webapp-filestore/3943/9005/A851AC58C741B566C0E40BE1791649E1/data (Permission denied) java.io.FileNotFoundException: /opt/ssa/tomcat/apache-tomcat-7.0.29/work/Catalina/localhost/SSA/wicket.ssa-webapp-filestore/3943/9005/A851AC58C741B566C0E40BE1791649E1/data (Permission denied) at java.io.RandomAccessFile.open(Native Method) at java.io.RandomAccessFile.(RandomAccessFile.java:233) at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.getFileChannel(DiskDataStore.java:425) at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.savePage(DiskDataStore.java:343) at org.apache.wicket.pageStore.DiskDataStore.storeData(DiskDataStore.java:181) at org.apache.wicket.pageStore.AsynchronousDataStore$PageSavingRunnable.run(AsynchronousDataStore.java:355) at java.lang.Thread.run(Thread.java:722) May 14 11:36:31 WARN DiskDataStore-Cannot save page with id '0' because the data file cannot be opened. May 14 11:36:32 ERROR DiskDataStore-/opt/ssa/tomcat/apache-tomcat-7.0.29/work/Catalina/localhost/SSA/wicket.ssa-webapp-filestore/3943/9005/A851AC58C741B566C0E40BE1791649E1/data (Permission denied) java.io.FileNotFoundException: /opt/ssa/tomcat/apache-tomcat-7.0.29/work/Catalina/localhost/SSA/wicket.ssa-webapp-filestore/3943/9005/A851AC58C741B566C0E40BE1791649E1/data (Permission denied) at java.io.RandomAccessFile.open(Native Method) at java.io.RandomAccessFile.(RandomAccessFile.java:233) at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.getFileChannel(DiskDataStore.java:425) at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.savePage(DiskDataStore.java:343) at org.apache.wicket.pageStore.DiskDataStore.storeData(DiskDataStore.java:181) at org.apache.wicket.pageStore.AsynchronousDataStore$PageSavingRunnable.run(AsynchronousDataStore.java:355) at java.lang.Thread.run(Thread.java:722) May 14 11:36:32 WARN DiskDataStore-Cannot save page with id '0' because the data file cannot be opened. What can be causing these errors? is this more of a Tomcat thing or Wicket? Thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DiskDataStore-errors-in-production-tp4665839.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: AjaxSelfUpdatingTimerBehavior.onPostProcessTarget() Never Called
I tried simplifying the design by extending AbstractAjaxTimerBehavior instead, but still can't get it to do anything. In the following class, the onTimer() method is never called: import org.apache.wicket.Component; import org.apache.wicket.ajax.AbstractAjaxTimerBehavior; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.util.time.Duration; import com.uprr.eni.commons.util.progress.Progress; import com.uprr.eni.commons.util.progress.ProgressReporter; import com.uprr.eni.commons.util.progress.ProgressScript; //-- /** * Periodically sends JavaScript to the client to update the progress bar. */ public class ProgressUpdateBehavior extends AbstractAjaxTimerBehavior { private static final long serialVersionUID = 6685938921228093681L; private final ProgressReporter reporter; private final Component parent; //-- /** * Constructor. * @param reporter The object we will query for progress. * @param parent The component to which this behavior is attached. The behavior will remove * itself from the parent when {@code reporter.getProgress()} returns {@code null}. */ public ProgressUpdateBehavior(final ProgressReporter reporter, final Component parent) { super(Duration.seconds(2)); this.reporter = reporter; this.parent = parent; } //-- @Override protected void onTimer(final AjaxRequestTarget ajax) { final Progress progress = reporter.getProgress(); final String script = ProgressScript.build(progress); ajax.appendJavascript(script); if (progress == null) { parent.remove(this); } } //-- } I add the above behavior to the page when the user clicks a button to begin a long running task. I can see the background thread executing as expected, but the timer behavior's onTimer() is never executed. //-- private Component createButton() { return new AjaxButton("start-button") { private static final long serialVersionUID = -1; @Override protected void onSubmit(final AjaxRequestTarget ajax, final Form form) { final ExecutorService service = Executors.newSingleThreadExecutor(); try { final ProgressBarTestPage page = ProgressBarTestPage.this; final TransactionData data = new TransactionData(page.getId(), false); final TestExecutor executor = new TestExecutor(data, getPermissions()); executor.addListener(page); // Request notification final Future future =// When/if task completes service.submit(executor); // Begin background thread BACKGROUND_TASKS.put(currentUserName, future);// Record what we're doing add(new ProgressUpdateBehavior(executor, this));// Start polling for progress } catch (final Exception ex) { throw new RuntimeException(ex); } service.shutdown(); } }; } From: Sven Meier To: users@wicket.apache.org Date: 05/06/2014 04:37 PM Subject:Re: AjaxSelfUpdatingTimerBehavior.onPostProcessTarget() Never Called By overriding #onRender() you're preventing the component tag to be written into the response. Since wicket-ajax cannot find the markuo id in the DOM, it will not perform the Ajax request. Sven On 05/06/2014 08:28 PM, Richard W. Adams wrote: > The onPostProcessTarget() method of my AjaxSelfUpdatingTimerBehavior is > not being called for some reason. Here's the code. I can see the start() > method being called (when the user clicks my "Start" button), but > onPostProcessTarget() is never invoked. What am I doing wrong? Do I need > to use some different sort of timer? > > //-- > @Override protected void onRender(final MarkupStream stream) { > /* > * Does nothing. This component has no markup of its own. > * It exists only to update the progress bar. > */ > System.out.println("In ProgressBarUpdater.onRender()"); >
Re: AjaxSelfUpdatingTimerBehavior.onPostProcessTarget() Never Called
Some further info: I changed my class to extend Label instead of Component , and removed the onRender() override. But onPostProcessTarget() is still not called. Any suggestions would be greatly appreciated! From: Sven Meier To: users@wicket.apache.org Date: 05/06/2014 04:37 PM Subject:Re: AjaxSelfUpdatingTimerBehavior.onPostProcessTarget() Never Called By overriding #onRender() you're preventing the component tag to be written into the response. Since wicket-ajax cannot find the markuo id in the DOM, it will not perform the Ajax request. Sven On 05/06/2014 08:28 PM, Richard W. Adams wrote: > The onPostProcessTarget() method of my AjaxSelfUpdatingTimerBehavior is > not being called for some reason. Here's the code. I can see the start() > method being called (when the user clicks my "Start" button), but > onPostProcessTarget() is never invoked. What am I doing wrong? Do I need > to use some different sort of timer? > > //-- > @Override protected void onRender(final MarkupStream stream) { > /* > * Does nothing. This component has no markup of its own. > * It exists only to update the progress bar. > */ > System.out.println("In ProgressBarUpdater.onRender()"); > stream.next(); // Keep Wicket from complaining about not > advancing the markup stream > } > //-- > /** > * Opens the Ricola progress bar & begins the polling. We don't start > the polling until > * explicitly told to so do, for efficiency purposes. > * @param ajax The Ajax request wrapper. > * @param reporter The object to query for progress data. > */ > public void start(final AjaxRequestTarget ajax, final ProgressReporter > reporter) { > > final AjaxSelfUpdatingTimerBehavior behavior = new > AjaxSelfUpdatingTimerBehavior(Duration.seconds(2)) { > private static final long serialVersionUID = 1L; > > @Override protected void onPostProcessTarget(final > AjaxRequestTarget ajax) { > > System.out.printf("In onPostProcessTarget()"); > super.onPostProcessTarget(ajax); > final Progress progress = reporter.getProgress(); > final String script = // Build > script to update > ProgressScript.build(progress); // > progress bar > ajax.appendJavascript(script); > if (progress == null) { // > If operation is finished > final ProgressBarUpdater updater = > ProgressBarUpdater.this; > updater.remove(this); // > Stop timer to prevent > ajax.addComponent(updater); // pointless > polling > } > } > }; > add(behavior); > ajax.addComponent(this); > } > //-- > > Here's the markup for the ProgressBarUpdater, the component to which these > methods belong: > > > > > > From: Martin Grigorov > To: "users@wicket.apache.org" > Date: 05/05/2014 03:32 PM > Subject:Re: Progress Bar > > > > Hi, > > > On Mon, May 5, 2014 at 7:18 PM, Richard W. Adams wrote: > >> We have a requirement to implement a progress bar for long-running > server >> operations. We can't use the code at >> https://github.com/wicketstuff/core/wiki/Progressbar, because it doesn't >> meet our corporate user interface look-and-feel standards. >> > Have you considered providing your own .css ? > https://github.com/wicketstuff/core/blob/wicket-6.x/jdk-1.6-parent/progressbar-parent/progressbar/src/main/java/org/wicketstuff/progressbar/ProgressBar.java#L109 > > > >> So, we started our own implementation. Our test page contains these >> methods below (the TestExecutor below class implements >> Callable). >> >> >> > //-- >> private Component createButton() { >> return new AjaxButton("start-button") { >> private static final long serialVersionUID = -1; >> >> @Override protected void onSubmit(final > AjaxRequestTarget >>
Re: AjaxSelfUpdatingTimerBehavior.onPostProcessTarget() Never Called
I finally got the onTimer() to execute. Had to change my button onclick() code to this: add(new ProgressUpdateBehavior(executor)); ajax.addComponent(this); It began working when I added the second line above. Without that, the client didn't receive the updated component with the new timer script. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: AjaxSelfUpdatingTimerBehavior.onPostProcessTarget() Never Called
Fair enough. But I have use a Component, since AjaxSelfUpdatingTimerBehavioronly works on a component. Which means I have to implement the abstract onRender() method. What's the minimum action my onRender() needs to do, considering I just want an invisible component? Or is there some other way to accomplish this automatic push of JavaScript without re-rendering the entire page on every update? From: Sven Meier To: users@wicket.apache.org Date: 05/06/2014 04:37 PM Subject:Re: AjaxSelfUpdatingTimerBehavior.onPostProcessTarget() Never Called By overriding #onRender() you're preventing the component tag to be written into the response. Since wicket-ajax cannot find the markuo id in the DOM, it will not perform the Ajax request. Sven On 05/06/2014 08:28 PM, Richard W. Adams wrote: > The onPostProcessTarget() method of my AjaxSelfUpdatingTimerBehavior is > not being called for some reason. Here's the code. I can see the start() > method being called (when the user clicks my "Start" button), but > onPostProcessTarget() is never invoked. What am I doing wrong? Do I need > to use some different sort of timer? > > //-- > @Override protected void onRender(final MarkupStream stream) { > /* > * Does nothing. This component has no markup of its own. > * It exists only to update the progress bar. > */ > System.out.println("In ProgressBarUpdater.onRender()"); > stream.next(); // Keep Wicket from complaining about not > advancing the markup stream > } > //-- > /** > * Opens the Ricola progress bar & begins the polling. We don't start > the polling until > * explicitly told to so do, for efficiency purposes. > * @param ajax The Ajax request wrapper. > * @param reporter The object to query for progress data. > */ > public void start(final AjaxRequestTarget ajax, final ProgressReporter > reporter) { > > final AjaxSelfUpdatingTimerBehavior behavior = new > AjaxSelfUpdatingTimerBehavior(Duration.seconds(2)) { > private static final long serialVersionUID = 1L; > > @Override protected void onPostProcessTarget(final > AjaxRequestTarget ajax) { > > System.out.printf("In onPostProcessTarget()"); > super.onPostProcessTarget(ajax); > final Progress progress = reporter.getProgress(); > final String script = // Build > script to update > ProgressScript.build(progress); // > progress bar > ajax.appendJavascript(script); > if (progress == null) { // > If operation is finished > final ProgressBarUpdater updater = > ProgressBarUpdater.this; > updater.remove(this); // > Stop timer to prevent > ajax.addComponent(updater); // pointless > polling > } > } > }; > add(behavior); > ajax.addComponent(this); > } > //-- > > Here's the markup for the ProgressBarUpdater, the component to which these > methods belong: > > > > > > From: Martin Grigorov > To: "users@wicket.apache.org" > Date: 05/05/2014 03:32 PM > Subject:Re: Progress Bar > > > > Hi, > > > On Mon, May 5, 2014 at 7:18 PM, Richard W. Adams wrote: > >> We have a requirement to implement a progress bar for long-running > server >> operations. We can't use the code at >> https://github.com/wicketstuff/core/wiki/Progressbar, because it doesn't >> meet our corporate user interface look-and-feel standards. >> > Have you considered providing your own .css ? > https://github.com/wicketstuff/core/blob/wicket-6.x/jdk-1.6-parent/progressbar-parent/progressbar/src/main/java/org/wicketstuff/progressbar/ProgressBar.java#L109 > > > >> So, we started our own implementation. Our test page contains these >> methods below (the TestExecutor below class implements >> Callable). >> >> >> > //-- >> private Component createButton() { >> return new Ajax
AjaxSelfUpdatingTimerBehavior.onPostProcessTarget() Never Called
The onPostProcessTarget() method of my AjaxSelfUpdatingTimerBehavior is not being called for some reason. Here's the code. I can see the start() method being called (when the user clicks my "Start" button), but onPostProcessTarget() is never invoked. What am I doing wrong? Do I need to use some different sort of timer? //-- @Override protected void onRender(final MarkupStream stream) { /* * Does nothing. This component has no markup of its own. * It exists only to update the progress bar. */ System.out.println("In ProgressBarUpdater.onRender()"); stream.next(); // Keep Wicket from complaining about not advancing the markup stream } //-- /** * Opens the Ricola progress bar & begins the polling. We don't start the polling until * explicitly told to so do, for efficiency purposes. * @param ajax The Ajax request wrapper. * @param reporter The object to query for progress data. */ public void start(final AjaxRequestTarget ajax, final ProgressReporter reporter) { final AjaxSelfUpdatingTimerBehavior behavior = new AjaxSelfUpdatingTimerBehavior(Duration.seconds(2)) { private static final long serialVersionUID = 1L; @Override protected void onPostProcessTarget(final AjaxRequestTarget ajax) { System.out.printf("In onPostProcessTarget()"); super.onPostProcessTarget(ajax); final Progress progress = reporter.getProgress(); final String script = // Build script to update ProgressScript.build(progress); // progress bar ajax.appendJavascript(script); if (progress == null) { // If operation is finished final ProgressBarUpdater updater = ProgressBarUpdater.this; updater.remove(this); // Stop timer to prevent ajax.addComponent(updater); // pointless polling } } }; add(behavior); ajax.addComponent(this); } //-- Here's the markup for the ProgressBarUpdater, the component to which these methods belong: From: Martin Grigorov To: "users@wicket.apache.org" Date: 05/05/2014 03:32 PM Subject: Re: Progress Bar Hi, On Mon, May 5, 2014 at 7:18 PM, Richard W. Adams wrote: > We have a requirement to implement a progress bar for long-running server > operations. We can't use the code at > https://github.com/wicketstuff/core/wiki/Progressbar, because it doesn't > meet our corporate user interface look-and-feel standards. > Have you considered providing your own .css ? https://github.com/wicketstuff/core/blob/wicket-6.x/jdk-1.6-parent/progressbar-parent/progressbar/src/main/java/org/wicketstuff/progressbar/ProgressBar.java#L109 > > So, we started our own implementation. Our test page contains these > methods below (the TestExecutor below class implements > Callable). > > > //-- > private Component createButton() { > return new AjaxButton("start-button") { > private static final long serialVersionUID = -1; > > @Override protected void onSubmit(final AjaxRequestTarget > ajax, final Form form) { > > final ExecutorService service = Executors. > newSingleThreadExecutor(); > try { > final ProgressBarTestPage page = > ProgressBarTestPage.this; > final TransactionData data = new > TransactionData (page.getId(), false); > final TestExecutor executor = new > TestExecutor(data, getPermissions()); > > executor.addListener(page); // Request > notification when done > future = service.submit(executor); // > Begin execution > progressBarUpdater.start(ajax, executor); > // Start polling for progress > > } catch (final Exception ex) { > throw new RuntimeException(ex);
Re: Background Threading
Well for starters, the example seems to require Hibernate (which our organization doesn't allow us to use). This correct? Second, I don't have the flexibility implement a service. I have to send Javascript back to the client, and the corporate Javascript framework then renders the progress bar. What is the 'context' class you refer to? Where is it instantiated and where is it stored? From: Ernesto Reinaldo Barreiro To: "users@wicket.apache.org" Date: 05/06/2014 07:52 AM Subject:Re: Background Threading Hi, On Tue, May 6, 2014 at 2:11 PM, Richard W. Adams wrote: > Interesting approach. Our use case is more complex, as it runs a > background task in a separate thread. Our task has three basic > requirements. It must: > > 1. Be cancellable. > > 2. Report its outcome (success/failure/warning). > > 3. Report incremental progress. > > Our fundamental problem is not how to display the progress bar, it's how > to determine the outcome of the background thread. That's an unexpectedly > a tough nut to crack. The vast majority of examples we've seen use the > Runnable interface (which doesn't help us, as it can't be canceled or > return a value), rather than Callable interface (which meets our needs, > but doesn't seem to play well with Wicket) > Really? Is it that hard? 1-Create a "context" class to pass information to/from WEB threads/background thread. 2-Both threads keep a copy of it: so you can report progress, cancel generation and so on. I have implemented something like that ages ago https://code.google.com/p/antilia/wiki/OSGiPowered > > > > > From: Colin Rogers > To: "users@wicket.apache.org" > Date: 05/05/2014 08:14 PM > Subject:RE: Progress Bar > > > > There is a pretty nifty, jquery based progress bar, in wicket-jquery-ui > library... > > http://www.7thweb.net/wicket-jquery-ui/progressbar/DefaultProgressBarPage > > Cheers, > Col. > > -Original Message- > From: Richard W. Adams [mailto:rwada...@up.com] > Sent: Tuesday, 6 May 2014 3:19 AM > To: users@wicket.apache.org > Subject: Progress Bar > > We have a requirement to implement a progress bar for long-running server > operations. We can't use the code at > https://github.com/wicketstuff/core/wiki/Progressbar, because it doesn't > meet our corporate user interface look-and-feel standards. > > So, we started our own implementation. Our test page contains these > methods below (the TestExecutor below class implements > Callable). > > > //-- > private Component createButton() { > return new AjaxButton("start-button") { > private static final long serialVersionUID = -1; > > @Override protected void onSubmit(final AjaxRequestTarget > ajax, final Form form) { > > final ExecutorService service = Executors. > newSingleThreadExecutor(); > try { > final ProgressBarTestPage page = > ProgressBarTestPage.this; > final TransactionData data = new > TransactionData (page.getId(), false); > final TestExecutor executor = new > TestExecutor(data, getPermissions()); > > executor.addListener(page); // Request > notification when done > future = service.submit(executor); // > Begin execution > progressBarUpdater.start(ajax, executor); > // Start polling for progress > > } catch (final Exception ex) { > throw new RuntimeException(ex); > } > service.shutdown(); // Terminate gracefully > (VM probably > } // won't exit if we fail to do this) > }; > } > > //-- > /** >Observer Pattern method to let us know when the task is done so we can > check how things went. > */ > @Override public void executionComplete(final EnmCallableExecutor > executor) { > > try { > if (!future.isCancelled()) { // > Unless execution was canceled > final ExecutorResult result = future.get(); // > Get the outcome > System.out.println(result); > /* > * TODO: Show success or error message >
Re: Application Scope
I assume that means we can't store non-serializable objects in the session? This is sounding like a serious deficiency in Wicket's architecture... From: Francois Meillet To: users@wicket.apache.org Date: 05/06/2014 08:48 AM Subject:Re: Application Scope sessions are serialised François Meillet Formation Wicket - Développement Wicket Le 6 mai 2014 à 15:28, Richard W. Adams a écrit : > One more question: Since each task is associated with a single user, would > it make more sense to create a task map in Session scope? Or will Wicket > try to serialize a map we put into the session? > > > > > From: Martin Grigorov > To: "users@wicket.apache.org" > Date: 05/06/2014 08:06 AM > Subject:Re: Application Scope > > > > Please don't change the thread subject for all your answers. This confuses > the threading support in some mail clients. > > I meant *My*Application, i.e. *Your*Application. > Add this method and map/associate all tasks that your run to some id/key. > Serialize the key and later get a reference to the FutureTask with > something like: > YourApp.get().getTasks().get(theKey).isDone()/.isCanceled()/... > > Martin Grigorov > Wicket Training and Consulting > > > On Tue, May 6, 2014 at 2:50 PM, Richard W. Adams wrote: > >> Are you referring to org.apache.wicket.Application? I don't see a >> getTasksMap() method there. We use Wicket 1.4.17 & our company will not >> allow us to upgrade to newer versions). If getTasksMap() is unavailable > in >> 1.4.17, could Application.getSharedResources() be used in a similar way? >> >> >> >> >> From: Martin Grigorov >> To: "users@wicket.apache.org" >> Date: 05/06/2014 07:26 AM >> Subject:Re: Background Threading >> >> >> >> Hi, >> >> You can put the tasks in an application scoped structure (e.g. >> MyApplication.get().getTasksMap()) and use a serializable key. >> >> Martin Grigorov >> Wicket Training and Consulting >> >> >> On Tue, May 6, 2014 at 2:11 PM, Richard W. Adams > wrote: >> >>> Interesting approach. Our use case is more complex, as it runs a >>> background task in a separate thread. Our task has three basic >>> requirements. It must: >>> >>> 1. Be cancellable. >>> >>> 2. Report its outcome (success/failure/warning). >>> >>> 3. Report incremental progress. >>> >>> Our fundamental problem is not how to display the progress bar, it's > how >>> to determine the outcome of the background thread. That's an >> unexpectedly >>> a tough nut to crack. The vast majority of examples we've seen use the >>> Runnable interface (which doesn't help us, as it can't be canceled or >>> return a value), rather than Callable interface (which meets our > needs, >>> but doesn't seem to play well with Wicket) >>> >>> >>> >>> >>> From: Colin Rogers >>> To: "users@wicket.apache.org" >>> Date: 05/05/2014 08:14 PM >>> Subject:RE: Progress Bar >>> >>> >>> >>> There is a pretty nifty, jquery based progress bar, in > wicket-jquery-ui >>> library... >>> >>> >> > http://www.7thweb.net/wicket-jquery-ui/progressbar/DefaultProgressBarPage >>> >>> Cheers, >>> Col. >>> >>> -Original Message- >>> From: Richard W. Adams [mailto:rwada...@up.com] >>> Sent: Tuesday, 6 May 2014 3:19 AM >>> To: users@wicket.apache.org >>> Subject: Progress Bar >>> >>> We have a requirement to implement a progress bar for long-running >> server >>> operations. We can't use the code at >>> https://github.com/wicketstuff/core/wiki/Progressbar, because it > doesn't >>> meet our corporate user interface look-and-feel standards. >>> >>> So, we started our own implementation. Our test page contains these >>> methods below (the TestExecutor below class implements >>> Callable). >>> >>> >>> >> >> > //-- >>> private Component createButton() { >>>return new AjaxButton("start-button") { >>>private static final long serialVersionUID = -1; >>> >>>@
Re: Application Scope
The Javadocs for setMetaData() & MetaDataKey are somewhat unclear (to me). It says the meta data key has to be a singleton. This seems to imply you can only store only one piece of metadata for a given component (e.g., a page)? If so, that's not helpful, since I have to to store many potentially many (similar) pieces of data (read FutureTask) for the same page in a multi-user environment: That is, one for each user who's running the background task thread. This would be much easier if I could store something non-serializeable in session scope. Storing things in application scope is beginning to sound like an extremely awkward work around. Can WebSession store things that are not serializable? I'm guessing not, since WebSession itself implements Serializable. From: Francois Meillet To: users@wicket.apache.org Date: 05/06/2014 08:06 AM Subject:Re: Application Scope You can use MyApp.get().setMetaData() and MyApp.get().getMetaData() François Meillet Formation Wicket - Développement Wicket Le 6 mai 2014 à 14:50, Richard W. Adams a écrit : > Are you referring to org.apache.wicket.Application? I don't see a > getTasksMap() method there. We use Wicket 1.4.17 & our company will not > allow us to upgrade to newer versions). If getTasksMap() is unavailable in > 1.4.17, could Application.getSharedResources() be used in a similar way? > > > > > From: Martin Grigorov > To: "users@wicket.apache.org" > Date: 05/06/2014 07:26 AM > Subject:Re: Background Threading > > > > Hi, > > You can put the tasks in an application scoped structure (e.g. > MyApplication.get().getTasksMap()) and use a serializable key. > > Martin Grigorov > Wicket Training and Consulting > > > On Tue, May 6, 2014 at 2:11 PM, Richard W. Adams wrote: > >> Interesting approach. Our use case is more complex, as it runs a >> background task in a separate thread. Our task has three basic >> requirements. It must: >> >> 1. Be cancellable. >> >> 2. Report its outcome (success/failure/warning). >> >> 3. Report incremental progress. >> >> Our fundamental problem is not how to display the progress bar, it's how >> to determine the outcome of the background thread. That's an > unexpectedly >> a tough nut to crack. The vast majority of examples we've seen use the >> Runnable interface (which doesn't help us, as it can't be canceled or >> return a value), rather than Callable interface (which meets our needs, >> but doesn't seem to play well with Wicket) >> >> >> >> >> From: Colin Rogers >> To: "users@wicket.apache.org" >> Date: 05/05/2014 08:14 PM >> Subject:RE: Progress Bar >> >> >> >> There is a pretty nifty, jquery based progress bar, in wicket-jquery-ui >> library... >> >> > http://www.7thweb.net/wicket-jquery-ui/progressbar/DefaultProgressBarPage >> >> Cheers, >> Col. >> >> -Original Message- >> From: Richard W. Adams [mailto:rwada...@up.com] >> Sent: Tuesday, 6 May 2014 3:19 AM >> To: users@wicket.apache.org >> Subject: Progress Bar >> >> We have a requirement to implement a progress bar for long-running > server >> operations. We can't use the code at >> https://github.com/wicketstuff/core/wiki/Progressbar, because it doesn't >> meet our corporate user interface look-and-feel standards. >> >> So, we started our own implementation. Our test page contains these >> methods below (the TestExecutor below class implements >> Callable). >> >> >> > //-- >> private Component createButton() { >>return new AjaxButton("start-button") { >>private static final long serialVersionUID = -1; >> >>@Override protected void onSubmit(final > AjaxRequestTarget >> ajax, final Form form) { >> >>final ExecutorService service = Executors. >> newSingleThreadExecutor(); >>try { >>final ProgressBarTestPage page = >> ProgressBarTestPage.this; >>final TransactionData data = new >> TransactionData (page.getId(), false); >>final TestExecutor executor = new >> TestExecutor(data, getPermissions()); >> >>
Re: Application Scope
One more question: Since each task is associated with a single user, would it make more sense to create a task map in Session scope? Or will Wicket try to serialize a map we put into the session? From: Martin Grigorov To: "users@wicket.apache.org" Date: 05/06/2014 08:06 AM Subject:Re: Application Scope Please don't change the thread subject for all your answers. This confuses the threading support in some mail clients. I meant *My*Application, i.e. *Your*Application. Add this method and map/associate all tasks that your run to some id/key. Serialize the key and later get a reference to the FutureTask with something like: YourApp.get().getTasks().get(theKey).isDone()/.isCanceled()/... Martin Grigorov Wicket Training and Consulting On Tue, May 6, 2014 at 2:50 PM, Richard W. Adams wrote: > Are you referring to org.apache.wicket.Application? I don't see a > getTasksMap() method there. We use Wicket 1.4.17 & our company will not > allow us to upgrade to newer versions). If getTasksMap() is unavailable in > 1.4.17, could Application.getSharedResources() be used in a similar way? > > > > > From: Martin Grigorov > To: "users@wicket.apache.org" > Date: 05/06/2014 07:26 AM > Subject:Re: Background Threading > > > > Hi, > > You can put the tasks in an application scoped structure (e.g. > MyApplication.get().getTasksMap()) and use a serializable key. > > Martin Grigorov > Wicket Training and Consulting > > > On Tue, May 6, 2014 at 2:11 PM, Richard W. Adams wrote: > > > Interesting approach. Our use case is more complex, as it runs a > > background task in a separate thread. Our task has three basic > > requirements. It must: > > > > 1. Be cancellable. > > > > 2. Report its outcome (success/failure/warning). > > > > 3. Report incremental progress. > > > > Our fundamental problem is not how to display the progress bar, it's how > > to determine the outcome of the background thread. That's an > unexpectedly > > a tough nut to crack. The vast majority of examples we've seen use the > > Runnable interface (which doesn't help us, as it can't be canceled or > > return a value), rather than Callable interface (which meets our needs, > > but doesn't seem to play well with Wicket) > > > > > > > > > > From: Colin Rogers > > To: "users@wicket.apache.org" > > Date: 05/05/2014 08:14 PM > > Subject: RE: Progress Bar > > > > > > > > There is a pretty nifty, jquery based progress bar, in wicket-jquery-ui > > library... > > > > > http://www.7thweb.net/wicket-jquery-ui/progressbar/DefaultProgressBarPage > > > > Cheers, > > Col. > > > > -Original Message- > > From: Richard W. Adams [mailto:rwada...@up.com] > > Sent: Tuesday, 6 May 2014 3:19 AM > > To: users@wicket.apache.org > > Subject: Progress Bar > > > > We have a requirement to implement a progress bar for long-running > server > > operations. We can't use the code at > > https://github.com/wicketstuff/core/wiki/Progressbar, because it doesn't > > meet our corporate user interface look-and-feel standards. > > > > So, we started our own implementation. Our test page contains these > > methods below (the TestExecutor below class implements > > Callable). > > > > > > > > //-- > > private Component createButton() { > > return new AjaxButton("start-button") { > > private static final long serialVersionUID = -1; > > > > @Override protected void onSubmit(final > AjaxRequestTarget > > ajax, final Form form) { > > > > final ExecutorService service = Executors. > > newSingleThreadExecutor(); > > try { > > final ProgressBarTestPage page = > > ProgressBarTestPage.this; > > final TransactionData data = new > > TransactionData (page.getId(), false); > > final TestExecutor executor = new > > TestExecutor(data, getPermissions()); > > > > executor.addListener(page); // > Request > > notification when done > > future = service.submit(executor); // > > Begin execution > > progressBarUpdater.start(ajax, > executor); &g
Re: Application Scope
To clarify: Are you saying that we should add our own setTask() & getTask() methods to our application class? And then maintain a task map as a member variable of our application class? From: Martin Grigorov To: "users@wicket.apache.org" Date: 05/06/2014 08:06 AM Subject:Re: Application Scope Please don't change the thread subject for all your answers. This confuses the threading support in some mail clients. I meant *My*Application, i.e. *Your*Application. Add this method and map/associate all tasks that your run to some id/key. Serialize the key and later get a reference to the FutureTask with something like: YourApp.get().getTasks().get(theKey).isDone()/.isCanceled()/... Martin Grigorov Wicket Training and Consulting On Tue, May 6, 2014 at 2:50 PM, Richard W. Adams wrote: > Are you referring to org.apache.wicket.Application? I don't see a > getTasksMap() method there. We use Wicket 1.4.17 & our company will not > allow us to upgrade to newer versions). If getTasksMap() is unavailable in > 1.4.17, could Application.getSharedResources() be used in a similar way? > > > > > From: Martin Grigorov > To: "users@wicket.apache.org" > Date: 05/06/2014 07:26 AM > Subject:Re: Background Threading > > > > Hi, > > You can put the tasks in an application scoped structure (e.g. > MyApplication.get().getTasksMap()) and use a serializable key. > > Martin Grigorov > Wicket Training and Consulting > > > On Tue, May 6, 2014 at 2:11 PM, Richard W. Adams wrote: > > > Interesting approach. Our use case is more complex, as it runs a > > background task in a separate thread. Our task has three basic > > requirements. It must: > > > > 1. Be cancellable. > > > > 2. Report its outcome (success/failure/warning). > > > > 3. Report incremental progress. > > > > Our fundamental problem is not how to display the progress bar, it's how > > to determine the outcome of the background thread. That's an > unexpectedly > > a tough nut to crack. The vast majority of examples we've seen use the > > Runnable interface (which doesn't help us, as it can't be canceled or > > return a value), rather than Callable interface (which meets our needs, > > but doesn't seem to play well with Wicket) > > > > > > > > > > From: Colin Rogers > > To: "users@wicket.apache.org" > > Date: 05/05/2014 08:14 PM > > Subject:RE: Progress Bar > > > > > > > > There is a pretty nifty, jquery based progress bar, in wicket-jquery-ui > > library... > > > > > http://www.7thweb.net/wicket-jquery-ui/progressbar/DefaultProgressBarPage > > > > Cheers, > > Col. > > > > -Original Message- > > From: Richard W. Adams [mailto:rwada...@up.com] > > Sent: Tuesday, 6 May 2014 3:19 AM > > To: users@wicket.apache.org > > Subject: Progress Bar > > > > We have a requirement to implement a progress bar for long-running > server > > operations. We can't use the code at > > https://github.com/wicketstuff/core/wiki/Progressbar, because it doesn't > > meet our corporate user interface look-and-feel standards. > > > > So, we started our own implementation. Our test page contains these > > methods below (the TestExecutor below class implements > > Callable). > > > > > > > > //-- > > private Component createButton() { > > return new AjaxButton("start-button") { > > private static final long serialVersionUID = -1; > > > > @Override protected void onSubmit(final > AjaxRequestTarget > > ajax, final Form form) { > > > > final ExecutorService service = Executors. > > newSingleThreadExecutor(); > > try { > > final ProgressBarTestPage page = > > ProgressBarTestPage.this; > > final TransactionData data = new > > TransactionData (page.getId(), false); > > final TestExecutor executor = new > > TestExecutor(data, getPermissions()); > > > > executor.addListener(page); // > Request > > notification when done > > future = service.submit(executor); // > > Begin execution > > progressBarUpdater.start(ajax, > executor); >
Application Scope
Are you referring to org.apache.wicket.Application? I don't see a getTasksMap() method there. We use Wicket 1.4.17 & our company will not allow us to upgrade to newer versions). If getTasksMap() is unavailable in 1.4.17, could Application.getSharedResources() be used in a similar way? From: Martin Grigorov To: "users@wicket.apache.org" Date: 05/06/2014 07:26 AM Subject:Re: Background Threading Hi, You can put the tasks in an application scoped structure (e.g. MyApplication.get().getTasksMap()) and use a serializable key. Martin Grigorov Wicket Training and Consulting On Tue, May 6, 2014 at 2:11 PM, Richard W. Adams wrote: > Interesting approach. Our use case is more complex, as it runs a > background task in a separate thread. Our task has three basic > requirements. It must: > > 1. Be cancellable. > > 2. Report its outcome (success/failure/warning). > > 3. Report incremental progress. > > Our fundamental problem is not how to display the progress bar, it's how > to determine the outcome of the background thread. That's an unexpectedly > a tough nut to crack. The vast majority of examples we've seen use the > Runnable interface (which doesn't help us, as it can't be canceled or > return a value), rather than Callable interface (which meets our needs, > but doesn't seem to play well with Wicket) > > > > > From: Colin Rogers > To: "users@wicket.apache.org" > Date: 05/05/2014 08:14 PM > Subject:RE: Progress Bar > > > > There is a pretty nifty, jquery based progress bar, in wicket-jquery-ui > library... > > http://www.7thweb.net/wicket-jquery-ui/progressbar/DefaultProgressBarPage > > Cheers, > Col. > > -Original Message- > From: Richard W. Adams [mailto:rwada...@up.com] > Sent: Tuesday, 6 May 2014 3:19 AM > To: users@wicket.apache.org > Subject: Progress Bar > > We have a requirement to implement a progress bar for long-running server > operations. We can't use the code at > https://github.com/wicketstuff/core/wiki/Progressbar, because it doesn't > meet our corporate user interface look-and-feel standards. > > So, we started our own implementation. Our test page contains these > methods below (the TestExecutor below class implements > Callable). > > > //-- > private Component createButton() { > return new AjaxButton("start-button") { > private static final long serialVersionUID = -1; > > @Override protected void onSubmit(final AjaxRequestTarget > ajax, final Form form) { > > final ExecutorService service = Executors. > newSingleThreadExecutor(); > try { > final ProgressBarTestPage page = > ProgressBarTestPage.this; > final TransactionData data = new > TransactionData (page.getId(), false); > final TestExecutor executor = new > TestExecutor(data, getPermissions()); > > executor.addListener(page); // Request > notification when done > future = service.submit(executor); // > Begin execution > progressBarUpdater.start(ajax, executor); > // Start polling for progress > > } catch (final Exception ex) { > throw new RuntimeException(ex); > } > service.shutdown(); // Terminate gracefully > (VM probably > } // won't exit if we fail to do this) > }; > } > > //-- > /** >Observer Pattern method to let us know when the task is done so we can > check how things went. > */ > @Override public void executionComplete(final EnmCallableExecutor > executor) { > > try { > if (!future.isCancelled()) { // > Unless execution was canceled > final ExecutorResult result = future.get(); // > Get the outcome > System.out.println(result); > /* > * TODO: Show success or error message > */ > } > } catch (final Exception ex) { > ex.printStackTrace(); > } > } > > The ProgessBarUpdater class has this method: > > > //--
Background Task in Separate Thread
I was probably overly wordy & not very clear on the details of our problem. The client side isn't the issue: We display the client progress bar via JavaScript & it's been working fine for a number of years. Our challenge is on the server side: Managing the background task in a separate thread. We have three basic requirements for the background task. It must: 1. Be cancellable. 2. Report its outcome (success/failure/warning). 3. Report incremental progress. Graceful handling of the thread outcome is an unexpectedly a tough nut to crack. The vast majority of examples we've seen use the Runnable interface (which doesn't help us, as it can't be canceled or return a value), rather than Callable interface (which meets our needs, but doesn't seem to play well with Wicket, since java.util.concurrent.FutureTask isn't Serializable). From: Martin Grigorov To: "users@wicket.apache.org" Date: 05/05/2014 03:32 PM Subject:Re: Progress Bar Hi, On Mon, May 5, 2014 at 7:18 PM, Richard W. Adams wrote: > We have a requirement to implement a progress bar for long-running server > operations. We can't use the code at > https://github.com/wicketstuff/core/wiki/Progressbar, because it doesn't > meet our corporate user interface look-and-feel standards. > Have you considered providing your own .css ? https://github.com/wicketstuff/core/blob/wicket-6.x/jdk-1.6-parent/progressbar-parent/progressbar/src/main/java/org/wicketstuff/progressbar/ProgressBar.java#L109 > > So, we started our own implementation. Our test page contains these > methods below (the TestExecutor below class implements > Callable). > > > //-- > private Component createButton() { > return new AjaxButton("start-button") { > private static final long serialVersionUID = -1; > > @Override protected void onSubmit(final AjaxRequestTarget > ajax, final Form form) { > > final ExecutorService service = Executors. > newSingleThreadExecutor(); > try { > final ProgressBarTestPage page = > ProgressBarTestPage.this; > final TransactionData data = new > TransactionData (page.getId(), false); > final TestExecutor executor = new > TestExecutor(data, getPermissions()); > > executor.addListener(page); // Request > notification when done > future = service.submit(executor); // > Begin execution > progressBarUpdater.start(ajax, executor); > // Start polling for progress > > } catch (final Exception ex) { > throw new RuntimeException(ex); > } > service.shutdown(); // Terminate gracefully > (VM probably > } // won't exit if we fail to do this) > }; > } > > //-- > /** >Observer Pattern method to let us know when the task is done so we can > check how things went. > */ > @Override public void executionComplete(final EnmCallableExecutor > executor) { > > try { > if (!future.isCancelled()) { // > Unless execution was canceled > final ExecutorResult result = future.get(); // > Get the outcome > System.out.println(result); > /* > * TODO: Show success or error message > */ > } > } catch (final Exception ex) { > ex.printStackTrace(); > } > } > > The ProgessBarUpdater class has this method: > > > //-- > /** > * Displays the progress bar & begins the polling. We don't start the > polling until > * explicitly told to do, for efficiency purposes. > * @param ajax The Ajax request wrapper. > * @param reporter The object to query for progress data. > */ > public void start(final AjaxRequestTarget ajax, final ProgressReporter > reporter) { > > add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(2)) { > private static final long serialVersionUID = 1L; > > @Override protected void onPostProcessTarget(final > AjaxRequestTarget ajax) { > >
Background Threading
Interesting approach. Our use case is more complex, as it runs a background task in a separate thread. Our task has three basic requirements. It must: 1. Be cancellable. 2. Report its outcome (success/failure/warning). 3. Report incremental progress. Our fundamental problem is not how to display the progress bar, it's how to determine the outcome of the background thread. That's an unexpectedly a tough nut to crack. The vast majority of examples we've seen use the Runnable interface (which doesn't help us, as it can't be canceled or return a value), rather than Callable interface (which meets our needs, but doesn't seem to play well with Wicket) From: Colin Rogers To: "users@wicket.apache.org" Date: 05/05/2014 08:14 PM Subject:RE: Progress Bar There is a pretty nifty, jquery based progress bar, in wicket-jquery-ui library... http://www.7thweb.net/wicket-jquery-ui/progressbar/DefaultProgressBarPage Cheers, Col. -----Original Message- From: Richard W. Adams [mailto:rwada...@up.com] Sent: Tuesday, 6 May 2014 3:19 AM To: users@wicket.apache.org Subject: Progress Bar We have a requirement to implement a progress bar for long-running server operations. We can't use the code at https://github.com/wicketstuff/core/wiki/Progressbar, because it doesn't meet our corporate user interface look-and-feel standards. So, we started our own implementation. Our test page contains these methods below (the TestExecutor below class implements Callable). //-- private Component createButton() { return new AjaxButton("start-button") { private static final long serialVersionUID = -1; @Override protected void onSubmit(final AjaxRequestTarget ajax, final Form form) { final ExecutorService service = Executors. newSingleThreadExecutor(); try { final ProgressBarTestPage page = ProgressBarTestPage.this; final TransactionData data = new TransactionData (page.getId(), false); final TestExecutor executor = new TestExecutor(data, getPermissions()); executor.addListener(page); // Request notification when done future = service.submit(executor); // Begin execution progressBarUpdater.start(ajax, executor); // Start polling for progress } catch (final Exception ex) { throw new RuntimeException(ex); } service.shutdown(); // Terminate gracefully (VM probably } // won't exit if we fail to do this) }; } //-- /** Observer Pattern method to let us know when the task is done so we can check how things went. */ @Override public void executionComplete(final EnmCallableExecutor executor) { try { if (!future.isCancelled()) {// Unless execution was canceled final ExecutorResult result = future.get(); // Get the outcome System.out.println(result); /* * TODO: Show success or error message */ } } catch (final Exception ex) { ex.printStackTrace(); } } The ProgessBarUpdater class has this method: //-- /** * Displays the progress bar & begins the polling. We don't start the polling until * explicitly told to do, for efficiency purposes. * @param ajax The Ajax request wrapper. * @param reporter The object to query for progress data. */ public void start(final AjaxRequestTarget ajax, final ProgressReporter reporter) { add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(2)) { private static final long serialVersionUID = 1L; @Override protected void onPostProcessTarget(final AjaxRequestTarget ajax) { final Progress progress = reporter.getProgress(); final String script = // Build script to update ProgressScript.build(progress); // progress bar ajax.appendJavascript(script); if (progress == null) { // If operation is finished final ProgressBarUpdater updater = ProgressBarUpdater.this;
Progress Bar
We have a requirement to implement a progress bar for long-running server operations. We can't use the code at https://github.com/wicketstuff/core/wiki/Progressbar, because it doesn't meet our corporate user interface look-and-feel standards. So, we started our own implementation. Our test page contains these methods below (the TestExecutor below class implements Callable). //-- private Component createButton() { return new AjaxButton("start-button") { private static final long serialVersionUID = -1; @Override protected void onSubmit(final AjaxRequestTarget ajax, final Form form) { final ExecutorService service = Executors. newSingleThreadExecutor(); try { final ProgressBarTestPage page = ProgressBarTestPage.this; final TransactionData data = new TransactionData (page.getId(), false); final TestExecutor executor = new TestExecutor(data, getPermissions()); executor.addListener(page); // Request notification when done future = service.submit(executor); // Begin execution progressBarUpdater.start(ajax, executor); // Start polling for progress } catch (final Exception ex) { throw new RuntimeException(ex); } service.shutdown(); // Terminate gracefully (VM probably } // won't exit if we fail to do this) }; } //-- /** Observer Pattern method to let us know when the task is done so we can check how things went. */ @Override public void executionComplete(final EnmCallableExecutor executor) { try { if (!future.isCancelled()) {// Unless execution was canceled final ExecutorResult result = future.get(); // Get the outcome System.out.println(result); /* * TODO: Show success or error message */ } } catch (final Exception ex) { ex.printStackTrace(); } } The ProgessBarUpdater class has this method: //-- /** * Displays the progress bar & begins the polling. We don't start the polling until * explicitly told to do, for efficiency purposes. * @param ajax The Ajax request wrapper. * @param reporter The object to query for progress data. */ public void start(final AjaxRequestTarget ajax, final ProgressReporter reporter) { add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(2)) { private static final long serialVersionUID = 1L; @Override protected void onPostProcessTarget(final AjaxRequestTarget ajax) { final Progress progress = reporter.getProgress(); final String script = // Build script to update ProgressScript.build(progress); // progress bar ajax.appendJavascript(script); if (progress == null) { // If operation is finished final ProgressBarUpdater updater = ProgressBarUpdater.this; updater.remove(this); // Stop timer to prevent ajax.addComponent(updater); // pointless polling } } }); ajax.addComponent(this); } The page also contains a Future object so we can check the result after the thread finishes: private Future future; __ Having said all that, here's the problem: When I click the page's button, Wicket throws this error: Unable to serialize class: java.util.concurrent.FutureTask The FutureTask object, I believe, is coming from the service.submit call whose return value we store in our Future variable. Does anyone know how to get around this roadblock? ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete th
Restful Services
Does anyone know what version of Wicket is required to use the REST annotations? I was reading the article at http://java.dzone.com/articles/working-rest-wicket, but unfortunately the links in the article seem to be broken. Our corporate framework locks us into Wicket 1.4.17 with no option to upgrade. Are we out of luck with regards to Wicket & REST? ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Fw: Generating Dynamic PDF using AjaxFallbackButton
Please blacklist this spammer. - Forwarded by Richard W. Adams/UPC on 02/25/2014 06:58 AM - From: Abigail To: users@wicket.apache.org Date: 02/24/2014 08:01 PM Subject:Re: Generating Dynamic PDF using AjaxFallbackButton HI there In modern enterprise's document management system, people often need to process and handle large volumes of multi-page PDF document files. Therefore, a professional PDF document page processing <http://www.rasteredge.com/how-to/csharp-imaging/pdf-processing/> utility will bring much convenience for users to manipulate and manage those PDF files, especially when they are processing some PDF document files that have over 500+ pages. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generating-Dynamic-PDF-using-AjaxFallbackButton-tp4272343p4664660.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Apache wicket project as osgi compoments
It's just a normal "if" statement, like: if (some_condition_is_met) { ClassA.doSomething(); } else { ClassB.doSomethingElse(); } Where either ClassA or ClassB is in the module you want to enable/disable. From: Shengche Hsiao To: Wicket User Mailinglist Date: 02/04/2014 08:51 AM Subject:Re: Apache wicket project as osgi compoments Hello Our team developed a web application using php, it's original idea was from XOOPS. As you know XOOPS's modules can dynamic install in or drop out, can wicket project do the same thing? And as you said "You could dynamically decide not to call them", would you please give me some instruction? On Tue, Feb 4, 2014 at 10:44 PM, Richard W. Adams wrote: > Depends what you mean by "disable." You could dynamically decide not to > call them, if that's what you want. > > > > > From: Shengche Hsiao > To: Wicket User Mailinglist > Date: 02/04/2014 08:42 AM > Subject:Apache wicket project as osgi compoments > > > > Hello > > I have a web application comprised of several modules, can I dynamically > enable/disable these modules in runtime? > > > -- > > ---> > We do this not because it is easy. We do this because it is hard. > ---> > ShengChe Hsiao > ---> > front...@gmail.com > front...@tc.edu.tw > ---> > VoIP : 070-910-2450 > ---> > > > > ** > > This email and any attachments may contain information that is > confidential and/or privileged for the sole use of the intended recipient. > Any use, review, disclosure, copying, distribution or reliance by others, > and any forwarding of this email or its contents, without the express > permission of the sender is strictly prohibited by law. If you are not the > intended recipient, please contact the sender immediately, delete the > e-mail and destroy all copies. > ** > -- ---> We do this not because it is easy. We do this because it is hard. ---> ShengChe Hsiao ---> front...@gmail.com front...@tc.edu.tw ---> VoIP : 070-910-2450 ---> ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Apache wicket project as osgi compoments
Depends what you mean by "disable." You could dynamically decide not to call them, if that's what you want. From: Shengche Hsiao To: Wicket User Mailinglist Date: 02/04/2014 08:42 AM Subject:Apache wicket project as osgi compoments Hello I have a web application comprised of several modules, can I dynamically enable/disable these modules in runtime? -- ---> We do this not because it is easy. We do this because it is hard. ---> ShengChe Hsiao ---> front...@gmail.com front...@tc.edu.tw ---> VoIP : 070-910-2450 ---> ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Fwd: Wicket and embedded tomcat
What do yo mean by "embed"? You want to include Tomcat as part of your distribution? From: bangaly sangare To: users@wicket.apache.org Date: 01/13/2014 09:22 AM Subject:Fwd: Wicket and embedded tomcat Hello, I want to embed tomcat with my wicket application. I use maven to deploy my application. Can somebody tell how I have to do that ? Thanks. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Rationale for Converting to AngularJS/Spring MVC
Whether the reasons are valid or not irrelevant. I only passed along what I have heard; don't necessarily agree with the rationales. As I said, I was not consulted (and probably never will be). From: Paul Bors To: "users@wicket.apache.org" Date: 01/03/2014 12:16 PM Subject:Re: Rationale for Converting to AngularJS/Spring MVC Both reasons provided don't carry much wight. 1) Dificulty of maintanance/upgrading between major releases Our webapp was our reporting tool which morphed into a system administative tool currently with 54k lines of code in well over 1k public classes (conform Sonar). I migrated the webapp from Wicket 1.3.x to 6.x by myself in under 2 weeks simply by following the migration tutorials one by one. 2) Cost of tranning new developers Wicket itself is model much after the Java's Swing and it promotes fast adaptation for new developers (they teach Swing in college). Perhaps the new staff should consider spending 1 to 2 weeks reading one of the many books avaialble on Wicket, see: http://wicket.apache.org/learn/books/ I spent a good 3-4 weeks reading over Andreas' free guide whcih took so long because I was reading it a chpater a day on the subway ride to work while at the same time proof reading his new material. You can print the free guide via: http://wicket.apache.org/start/userguide.html I don't know AngualrJS too much as I never worked with it. To me it looks like another JS framework out there in the mixture of many that can very easily be integrated with Wicket. Perhaps you should suggest that to your upper management. Anyhow, that's my two cents. On Fri, Jan 3, 2014 at 12:12 PM, Richard W. Adams wrote: > I don't have first hand knowledge of the decision making process, but I > understand there were two main factors: > > 1. Difficulty in changing/maintaining the intermediate corporate > libraries, especially when considering whether to make the leap from > Wicket 1.4.17 to 6.x. > > 2. A perception of excessive cost in training new developers to use > Wicket. I myself am fairly comfortable with Wicket now (after 2 years > experience), but have to admit the leaning curve was pretty steep. > > > > > From: Ernesto Reinaldo Barreiro > To: users@wicket.apache.org > Date: 01/03/2014 10:58 AM > Subject:Re: Converting Wicket to AngularJS/Spring MVC > > > > May I ask what was the rationale of choosing Angular JS + Spring MVC over > Wicket? I have been using Backbone + Spring MVC in a project, imposed by > client, for the last month and to be honest I'm not impressed with > productivity you achieve using the combination: not to mention that > developers need to know both JavaScript + Java server side to be > completely > productive. IMHO this will impact your productivity in a negative way. The > only "reason" I could see to make that move is if scalability is an issue. > > Best regards, > > Ernesto > > > > ** > > This email and any attachments may contain information that is > confidential and/or privileged for the sole use of the intended recipient. > Any use, review, disclosure, copying, distribution or reliance by others, > and any forwarding of this email or its contents, without the express > permission of the sender is strictly prohibited by law. If you are not the > intended recipient, please contact the sender immediately, delete the > e-mail and destroy all copies. > ** > ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Rationale for Converting to AngularJS/Spring MVC
As to "How was it difficult?" Don't know. Nothing official came out. I'm so low on the food chain I don't have many details. All I know is what leaks out through the grapevine. In any case, whether the new frameworks will be better worse. I have no influence over what course the corporation takes. The high level architects & budgeteers have already decided our course, apparently. From: Ernesto Reinaldo Barreiro To: users@wicket.apache.org Date: 01/03/2014 12:59 PM Subject:Re: Rationale for Converting to AngularJS/Spring MVC Hi, On Fri, Jan 3, 2014 at 6:12 PM, Richard W. Adams wrote: > I don't have first hand knowledge of the decision making process, but I > understand there were two main factors: > > 1. Difficulty in changing/maintaining the intermediate corporate > libraries, especially when considering whether to make the leap from > Wicket 1.4.17 to 6.x. > How was it difficult? > > 2. A perception of excessive cost in training new developers to use > Wicket. I myself am fairly comfortable with Wicket now (after 2 years > experience), but have to admit the leaning curve was pretty steep. > IMHO this is not going to improve with Angular.SJ+ Spring MVC: its is going to be worse. 1-With wicket you might hire a very good wicket developer that creates the components / widgets you need and the rest of the team just use those components and be "shielded" form JavaScript and mostly just do "server side". With Angular you will need more developers covering the whole stack (sever side and client side). 2-You can also reuse code at a maximum and if you have a lot of applications/similar screen you can roll out "meta components" covering those use cases... Not sure you will be able to achieve the same so easily with Angular.JS + Spring MVC. As I mentioned before I was working last three weeks with an application built with Backbone.JS (similar to Angular but less high level) + Spring MVC. All the "complexities" of this application would be mostly trivial using wicket. One thing that stoke me the most if the non DRYNESS of development: you change one thing at a place and you have to manually hunt down in all layers how this trivial change will impact application. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Rationale for Converting to AngularJS/Spring MVC
I don't have first hand knowledge of the decision making process, but I understand there were two main factors: 1. Difficulty in changing/maintaining the intermediate corporate libraries, especially when considering whether to make the leap from Wicket 1.4.17 to 6.x. 2. A perception of excessive cost in training new developers to use Wicket. I myself am fairly comfortable with Wicket now (after 2 years experience), but have to admit the leaning curve was pretty steep. From: Ernesto Reinaldo Barreiro To: users@wicket.apache.org Date: 01/03/2014 10:58 AM Subject:Re: Converting Wicket to AngularJS/Spring MVC May I ask what was the rationale of choosing Angular JS + Spring MVC over Wicket? I have been using Backbone + Spring MVC in a project, imposed by client, for the last month and to be honest I'm not impressed with productivity you achieve using the combination: not to mention that developers need to know both JavaScript + Java server side to be completely productive. IMHO this will impact your productivity in a negative way. The only "reason" I could see to make that move is if scalability is an issue. Best regards, Ernesto ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Converting Wicket to AngularJS/Spring MVC
My corporation has decided to change its standard Web framework from Wicket to AngularJS/Spring MVCC (not my decision; was not asked for input). I am faced with the expensive prospect of having to convert a large app (runs on Jboss with about 250 Wicket/Web related classes). 1. Does anyone have experience in this kind of conversion, or know of Web resources that could provide insight into best practices? 2. My management is asking is if the conversion can be done incrementally (because we still have to support the existing app until it's retired). I interpret that to mean "Can an app have both Wicket & AngularJS/Spring MVC pages at the same time?" From what I've read so far, Spring MVC & Wicket can't coexist in the same app. (Though I'm hoping I'm wrong!) ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
RE: Form Reset Problems
Our use case is probably more complex than most. We have a form that does a lot Ajax field updates that appear to break the reset function on some browsers. That's why resorted to doing the reset via Ajax. From: Paul Bors To: Date: 09/30/2013 09:41 AM Subject:RE: Form Reset Problems I'll like to hear more about Richard's use-case as to me using Ajax to perform a form reset that could be done by the browser is a bit of an overkill. Unless some sort of a user workflow through the app happens in stages for which I would recommend using a Wizard. ~ Thank you, Paul Bors -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, September 30, 2013 9:57 AM To: users@wicket.apache.org Subject: Re: Form Reset Problems Hi, I'm going to write a blog article about Form component's input vs. model. I've been asked few times about this last two weeks by colleagues of mine. It would be good to have it in the official guide though ( https://issues.apache.org/jira/browse/WICKET-5321). To reset a form you should: 1) use a button with default processing == false, to prevent form validation (or just AjaxLink) 2) call form.clearInput() 3) and to set the "default" model for each form component. Each application should know what "default" means for its form components. On Mon, Sep 30, 2013 at 3:46 PM, Richard W. Adams wrote: > We're having trouble making our form reset button work. It's defined > thusly: > > AjaxButton button = new AjaxButton("reset-button"); ... > > _ > > Here's our reset code, executed when the button is clicked. The main > form seems to re-render OK, but a FormComponentPanel that is part of > the form does not. I see a lot of discussion on Wicket form resets on > the Web, but most is several years old. Is there an "officially" > endorsed pattern or example for doing Ajax form resets? > _ > > public void onReset(final AjaxRequestTarget target) { > > final Component.IVisitor> visitor = new > Component.IVisitor>() { > > @Override public Object component(final > FormComponent > formComponent) { > > if (formComponent.getDefaultModel() != null) { > // Must have a model for the component > final Object currentValue = > formComponent.getDefaultModelObject(); // Save model value > formComponent.clearInput(); // > Clear out > formComponent.setDefaultModelObject(currentValue); // Add the value back > } > if (target != null) { > target.addComponent(formComponent); > } > return Component.IVisitor.CONTINUE_TRAVERSAL; > } > }; > visitChildren(FormComponent.class, visitor); > } > > > ** > > This email and any attachments may contain information that is > confidential and/or privileged for the sole use of the intended recipient. > Any use, review, disclosure, copying, distribution or reliance by > others, and any forwarding of this email or its contents, without the > express permission of the sender is strictly prohibited by law. If > you are not the intended recipient, please contact the sender > immediately, delete the e-mail and destroy all copies. > ** > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Form Reset Problems
We're having trouble making our form reset button work. It's defined thusly: AjaxButton button = new AjaxButton("reset-button"); ... _ Here's our reset code, executed when the button is clicked. The main form seems to re-render OK, but a FormComponentPanel that is part of the form does not. I see a lot of discussion on Wicket form resets on the Web, but most is several years old. Is there an "officially" endorsed pattern or example for doing Ajax form resets? _ public void onReset(final AjaxRequestTarget target) { final Component.IVisitor> visitor = new Component.IVisitor>() { @Override public Object component(final FormComponent formComponent) { if (formComponent.getDefaultModel() != null) { // Must have a model for the component final Object currentValue = formComponent.getDefaultModelObject(); // Save model value formComponent.clearInput(); // Clear out formComponent.setDefaultModelObject(currentValue); // Add the value back } if (target != null) { target.addComponent(formComponent); } return Component.IVisitor.CONTINUE_TRAVERSAL; } }; visitChildren(FormComponent.class, visitor); } ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Dynamic generation of HMI components
Short answer: You must write *some* HTML. Not-so-short-answer: The minimum required HTML is pretty small. From: brasmouk To: users@wicket.apache.org Date: 09/24/2013 08:14 AM Subject:Dynamic generation of HMI components Hello everyone, I am trying to study framewok wicket for the creation of a new JEE application. The need is to generate dynamic pages as the representation of my pages is stored in a database. My question: Is there a way to generate a page dynamically without having to add html tags in a static page. I do not want to create a html code to a StringBuffer and swing in a static component because I also want to take bricks form / validation event handler. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-generation-of-HMI-components-tp4661471.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Cancel Button Conundrum
I need to create a Cancel button that warns the user about saved data on a form before leaving the page. Thus, I can't call setDefaultFormProcessing (false), since that would cause the data not be transferred to the model. But I ALSO don't want the page to complain about missing or invalid fields. What's the best way to accomplish these goals? ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: FormComponent independent from the Model/Model object
Well, one approach is create it as a normal HTML control & not render it via Wicket. You can just attach a standard Javascript event (such as onclick) to get the behavior you want. Bottom line: You don't have to "Wicketize" everything on your page. Just because you have a hammer, it doesn't mean everything is a nail. From: Dmitriy Neretin To: users@wicket.apache.org Date: 07/09/2013 12:58 PM Subject:FormComponent independent from the Model/Model object Hi everyone, I have a dummy question: If I have a panel with a form (not everything is my code) -> public class MyPanel{ public MyPanel(id, IModel model){ super(id, new CompoundPropertyModel(model); Form form = new Form("id", model); form.add(new AjaxCheckBox("anyStupidId"); add(form); } } And I want to add a Component (AjaxCheckBox) to the form above, but this component shouldn't have anything to do with a model object. It's purpose is just a change the state of the input fields. If I check the box the field should be deactivated and vice versa. Nothing more. My problem is, that Wicket thinks (and I even know why :)) the "anyStupidId" is a field of MyObj and tries to change the value... Well, the checkbox should be inside of the form, but I don't know if is it possible to make this checkbox independent from the Model handling... How can I tell wicket, "hey dude, anyStupidId has nothing to do with MyObj, it is really just a stupid id" Regards, Dmitriy ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
RE: Graying Out Disabled Buttons/Controls
I have egg on my face. After delving into this more deeply, I discovered our corporate framework "helpfully" removes disabled buttons before they get to the browser. Don't agree with the approach, but it is what it is. (slinks away with tail between legs...) From: Paul Bors To: Date: 06/26/2013 11:18 AM Subject:RE: Graying Out Disabled Buttons/Controls Create a quick-start attach it to your e-mail and we'll look it over. Feel free to use drop box or some other file sharing server. You're doing something wrong... ~ Thank you, Paul Bors -Original Message----- From: Richard W. Adams [mailto:rwada...@up.com] Sent: Wednesday, June 26, 2013 11:41 AM To: users@wicket.apache.org Subject: RE: Graying Out Disabled Buttons/Controls Wow. Now it gets even stranger. I modified the code as follows: public DisabledButtonPage() { final Form form = new Form("myForm"); add(form); final Button enabledButton = new Button("enabled-button"); boolean visible = enabledButton.isVisibleInHierarchy(); System.out.printf("Enabled button visible? %s%n", visible ? "Yes" : "No"); System.out.printf("Enabled button's ID: %s%n", enabledButton.getMarkupId()); final Button disabledButton = createDisabledButton(); visible = disabledButton.isVisibleInHierarchy(); System.out.printf("Disabled button visible? %s%n", visible ? "Yes" : "No"); System.out.printf("Disabled button's ID: %s%n", disabledButton.getMarkupId()); form.add(enabledButton); form.add(disabledButton); } private Button createDisabledButton() { final Button button = new Button("disabled-button") ; button.setVisibilityAllowed(true); button.setVisible(true); button.setEnabled(false); return button; } Strangely, the output says: Enabled button visible? Yes Enabled button's ID: id5 Disabled button visible? Yes Disabled button's ID: id6 But the generated HTML (snippet below) does NOT show the disabled button; it SHOULD be right after the enabled button http://wicket.apache.org";>Enabled Button From: Paul Bors To: Date: 06/26/2013 09:48 AM Subject:RE: Graying Out Disabled Buttons/Controls Button -> FormComponent -> WebMarkupContainer -> WebMarkupContainer -> MarkupContainer -> Component Inside Component: /** * Gets whether this component and any children are visible. * * WARNING: this method can be called multiple times during a request. If you override this * method, it is a good idea to keep it cheap in terms of processing. Alternatively, you can * call {@link #setVisible(boolean)}. * * * @return True if component and any children are visible */ public boolean isVisible() { return getFlag(FLAG_VISIBLE); } So calling isVisible() on any component would only report the current state for the visible flag but not that of the parent. Try calling isVisibleInHierarchy() instead: /** * Checks if the component itself and all its parents are visible. * * @return true if the component and all its parents are visible. */ public final boolean isVisibleInHierarchy() { Component parent = getParent(); if (parent != null && !parent.isVisibleInHierarchy()) { return false; } else { return determineVisibility(); } } Second, why would you have a button attached to a page directly? Isn't that invalid HTML? I through all form components should be inside a (even w/o a wicket:id) otherwise the browser might choke on it... ~ Thank you, Paul Bors -Original Message- From: Richard W. Adams [mailto:rwada...@up.com] Sent: Wednesday, June 26, 2013 9:42 AM To: users@wicket.apache.org Subject: Re: Graying Out Disabled Buttons/Controls I believe the parent component (the page itself) is visible. My test page is very simple, with only two buttons, one enabled & the other disabled; both buttons are children of the page itself. However, only the enabled button appears in the generated HTML. I've tried changing the order of the various method calls in createDisabledButton(), tried overr
RE: Graying Out Disabled Buttons/Controls
Wow. Now it gets even stranger. I modified the code as follows: public DisabledButtonPage() { final Form form = new Form("myForm"); add(form); final Button enabledButton = new Button("enabled-button"); boolean visible = enabledButton.isVisibleInHierarchy(); System.out.printf("Enabled button visible? %s%n", visible ? "Yes" : "No"); System.out.printf("Enabled button's ID: %s%n", enabledButton.getMarkupId()); final Button disabledButton = createDisabledButton(); visible = disabledButton.isVisibleInHierarchy(); System.out.printf("Disabled button visible? %s%n", visible ? "Yes" : "No"); System.out.printf("Disabled button's ID: %s%n", disabledButton.getMarkupId()); form.add(enabledButton); form.add(disabledButton); } private Button createDisabledButton() { final Button button = new Button("disabled-button") ; button.setVisibilityAllowed(true); button.setVisible(true); button.setEnabled(false); return button; } Strangely, the output says: Enabled button visible? Yes Enabled button's ID: id5 Disabled button visible? Yes Disabled button's ID: id6 But the generated HTML (snippet below) does NOT show the disabled button; it SHOULD be right after the enabled button http://wicket.apache.org";>Enabled Button From: Paul Bors To: Date: 06/26/2013 09:48 AM Subject:RE: Graying Out Disabled Buttons/Controls Button -> FormComponent -> WebMarkupContainer -> WebMarkupContainer -> MarkupContainer -> Component Inside Component: /** * Gets whether this component and any children are visible. * * WARNING: this method can be called multiple times during a request. If you override this * method, it is a good idea to keep it cheap in terms of processing. Alternatively, you can * call {@link #setVisible(boolean)}. * * * @return True if component and any children are visible */ public boolean isVisible() { return getFlag(FLAG_VISIBLE); } So calling isVisible() on any component would only report the current state for the visible flag but not that of the parent. Try calling isVisibleInHierarchy() instead: /** * Checks if the component itself and all its parents are visible. * * @return true if the component and all its parents are visible. */ public final boolean isVisibleInHierarchy() { Component parent = getParent(); if (parent != null && !parent.isVisibleInHierarchy()) { return false; } else { return determineVisibility(); } } Second, why would you have a button attached to a page directly? Isn't that invalid HTML? I through all form components should be inside a (even w/o a wicket:id) otherwise the browser might choke on it... ~ Thank you, Paul Bors -Original Message- From: Richard W. Adams [mailto:rwada...@up.com] Sent: Wednesday, June 26, 2013 9:42 AM To: users@wicket.apache.org Subject: Re: Graying Out Disabled Buttons/Controls I believe the parent component (the page itself) is visible. My test page is very simple, with only two buttons, one enabled & the other disabled; both buttons are children of the page itself. However, only the enabled button appears in the generated HTML. I've tried changing the order of the various method calls in createDisabledButton(), tried overriding isVisible() with return true, etc. No matter what I do, though, the the generated HTML does not include the disabled button. I'm out of ideas. Does this work in a later version of Wicket (after 1.14.17)? _ The source HTML (extends a generic page type, whose header/footer display correctly): http://wicket.apache.org";> This page demonstrates the inability to make disabled buttons visible, but grayed out. _ The source code: _ public DisabledButtonPage() { add(new Button("enabled-button")); add(createDisabledButton()); } private Button createDisabledButton() { final Button button = new Button("disabled-button");
Re: Graying Out Disabled Buttons/Controls
I believe the parent component (the page itself) is visible. My test page is very simple, with only two buttons, one enabled & the other disabled; both buttons are children of the page itself. However, only the enabled button appears in the generated HTML. I've tried changing the order of the various method calls in createDisabledButton(), tried overriding isVisible() with return true, etc. No matter what I do, though, the the generated HTML does not include the disabled button. I'm out of ideas. Does this work in a later version of Wicket (after 1.14.17)? _ The source HTML (extends a generic page type, whose header/footer display correctly): http://wicket.apache.org";> This page demonstrates the inability to make disabled buttons visible, but grayed out. _ The source code: _ public DisabledButtonPage() { add(new Button("enabled-button")); add(createDisabledButton()); } private Button createDisabledButton() { final Button button = new Button("disabled-button"); button.setVisibilityAllowed(true); button.setVisible(true); button.setEnabled(false); return button; } From: Paul Bors To: users@wicket.apache.org Date: 06/26/2013 08:30 AM Subject:Re: Graying Out Disabled Buttons/Controls You need to make sure all of your component parents are also visible. Remeber that wicket uses a component tree (you can see it in your DebugToolbar if you add it to your pages). The inspector looks something like this: http://www.wicket-library.com/wicket-examples-6.0.x/spring/wicket/bookmarkable/org.apache.wicket.devutils.inspector.InspectorPage;jsessionid=76EE1D9ED70B7660542E78B4C1333951?0&pageId=0 On Wed, Jun 26, 2013 at 9:16 AM, Richard W. Adams wrote: > We tried that (code below), but the button does not appear in the > generated HTML. We're using Wicket 1.4.17. Do later versions of Wicket > render a grayed out (vice invisible) button? > > private Button createDisabledButton() { > > final Button button = new Button("disabled-button"); > button.setEnabled(false); > button.setVisible(true); > return button; > } > > > > > From: Thomas Matthijs > To: users@wicket.apache.org > Date: 06/26/2013 07:45 AM > Subject:Re: Graying Out Disabled Buttons/Controls > > > > On Wed, Jun 26, 2013 at 2:30 PM, Richard W. Adams wrote: > > > We have a customer requirement that disabled form buttons be grayed out > > rather than Wicket's default behavior of making them invisible. Google > has > > a lot of discussion on the topic, but I didn't see a "best practice" > > solution. Does Wicket provide a way to gray out buttons (or any form > > control, for that matter)? > > > > > Use setEnabled(false) instead of setVisible() > > > > ** > > This email and any attachments may contain information that is > confidential and/or privileged for the sole use of the intended recipient. > Any use, review, disclosure, copying, distribution or reliance by others, > and any forwarding of this email or its contents, without the express > permission of the sender is strictly prohibited by law. If you are not the > intended recipient, please contact the sender immediately, delete the > e-mail and destroy all copies. > ** > ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Graying Out Disabled Buttons/Controls
We tried that (code below), but the button does not appear in the generated HTML. We're using Wicket 1.4.17. Do later versions of Wicket render a grayed out (vice invisible) button? private Button createDisabledButton() { final Button button = new Button("disabled-button"); button.setEnabled(false); button.setVisible(true); return button; } From: Thomas Matthijs To: users@wicket.apache.org Date: 06/26/2013 07:45 AM Subject:Re: Graying Out Disabled Buttons/Controls On Wed, Jun 26, 2013 at 2:30 PM, Richard W. Adams wrote: > We have a customer requirement that disabled form buttons be grayed out > rather than Wicket's default behavior of making them invisible. Google has > a lot of discussion on the topic, but I didn't see a "best practice" > solution. Does Wicket provide a way to gray out buttons (or any form > control, for that matter)? > Use setEnabled(false) instead of setVisible() ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Graying Out Disabled Buttons/Controls
We have a customer requirement that disabled form buttons be grayed out rather than Wicket's default behavior of making them invisible. Google has a lot of discussion on the topic, but I didn't see a "best practice" solution. Does Wicket provide a way to gray out buttons (or any form control, for that matter)? If we have to override something like onRender(), onBeforeRender(), etc. where would be the best place to do this? ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
AjaxSubmitLink Errors
When AjaxSubmitLink.onError() is called, how does one determine what the error was? Calling getFeedbackMessage() (tried on both the link & on the form) is returning null, & I can't see any other way to determine what the error was... ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Validator Can't Find Form Submitting Component
[Re-sending, as I noticed my previous send was an accidental forward, so probably ended up in the wrong thread. Also adding some more info] I have a form inside a panel. The form is nested inside another form that includes the panel. The panel form has a validator which is supposed to validate only conditionally, depending on how the form was submitted. When I submit the panel form via an AjaxSubmitLink, the call to findSubmittingButton() inside the validator returns null, even though I called panelForm.add(theLiink). Is this expected behavior? I know the findSubmittingButton() method says "button," but it returns an IFormSubmittingComponent, so I would expect it could return either a button or a submitting link. I need to distinguish between the various links/buttons that can submit the form. Is this not possible with an AjaxSubmitLink? I'm using Wicket 1.4.17. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Form Submitting Component
When I submit a form via an AjaxSubmitLink, form.findSubmittingButton() returns null, even though I called form.add(theLlink). Is this expected behavior? I know the findSubmittingButton() method says "button," but it returns an IFormSubmittingComponent, so I would expect it could return either a button or a submitting link. I need to distinguish between the various links/buttons that can submit the form. Is this not possible with an AjaxSubmitLink? I'm using Wicket 1.4.17. From: Sven Meier To: users@wicket.apache.org Date: 06/13/2013 07:53 AM Subject:Re: wicket and JPA Please read "9.6 Detachable models" of the Wicket Free Guide and come back with your questions. Sven On 06/13/2013 01:20 PM, Boris Brinza wrote: > Hello to all, > I have some fundamental issues with integration of jpa into wicket. > I develop web application using wicket 6 and JPA (eclipselink). Maybe > next question is more JPA oriented, but nevertheless: > > Lets say i have > class BaseDetailPage extends WebPage { > protected dbEntity; > > } > > where dbEntity is instance of jpa persisted object. > BaseDetail page contains form for editing db entity using > CompoundPropertyModel. > > After i open detail page, entity is read from DB and page is displayed > (if edit button is pressed) or i create new instance of object (if add > button is pressed). > > After submit, if i want to add new record, everything is clear, i call > beginTX(), entityManager.persist(dbEntity), commitTX(). > > But what about updating existing record? > > Every example for JPA shows some basic code like this: > beginTX() > dbObject.setXXX(); > dbObject.setYYY(); > commitTX() > > > But how to integrate this into wicket form using compound property model? > There is no such code for setting properties of db object, and jpa > does not have anything like entityManager.update(). > > Now i use hack (by my opinion it';s a hack) > > beginTX() > entityManaget.detach(dbObject); > entityManager.merge(dbObject) > commitTX() > > but i am not sure, if it's right solution (or i'm almost sure it's not > right attitude) > > Is there any tutorial how to integrate these frameworks, or some > simple opensource project to check how it's solved? > > Thanks for any advice, > Boris > > > > > - > 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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Getting Form Data Without Submitting Form
Well, first, HTML doesn't allow nested forms, per the w3.org site. Second, the search fields need to be part of the overall form, because they (along with the other fields) are persisted if the user presses the Save button. From: Sven Meier To: users@wicket.apache.org Date: 06/12/2013 02:15 PM Subject:Re: Getting Form Data Without Submitting Form Why not use two different forms, one for searching and the other for the "save" fields? You can even nest the first one into the other. Sven On 06/12/2013 09:09 PM, Richard W. Adams wrote: > I have a FormComponentPanel with an AjaxLink. The link's onClick() method > runs a database search based on criteria that are found in a half dozen > form fields (string, drop downs, etc.). My problem is that the form's > model is not updated because the link does not submit the form. And I > can't submit the form because then OTHER data is saved which should NOT > be. In other words, the full form data should be saved only when user > presses another, separate, Save button, NOT the lookup link.. > > How can I access the current form field values that make up my search > criteria, without submitting the form? Ideally, I'm looking for some > technique that would update the model in a way that where I can tell it's > just a search request, not a save request. I looked at the Javadocs for > AjaxFormChoiceComponentUpdatingBehavior, because its name implied that it > MIGHT be a solution, but I couldn't figure to how to use it. > > I'm using Wicket 1.4.17 (using a later version is not an option due to our > a corporate framework). > > ** > > This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. > ** > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Getting Form Data Without Submitting Form
I have a FormComponentPanel with an AjaxLink. The link's onClick() method runs a database search based on criteria that are found in a half dozen form fields (string, drop downs, etc.). My problem is that the form's model is not updated because the link does not submit the form. And I can't submit the form because then OTHER data is saved which should NOT be. In other words, the full form data should be saved only when user presses another, separate, Save button, NOT the lookup link.. How can I access the current form field values that make up my search criteria, without submitting the form? Ideally, I'm looking for some technique that would update the model in a way that where I can tell it's just a search request, not a save request. I looked at the Javadocs for AjaxFormChoiceComponentUpdatingBehavior, because its name implied that it MIGHT be a solution, but I couldn't figure to how to use it. I'm using Wicket 1.4.17 (using a later version is not an option due to our a corporate framework). ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
RE: DropDownChoice in FormComponentPanel
I'm not finished investigating this yet, but my preliminary findings indicate that the solution (at least in my case) is to call dropdown.getModelObject() instead of dropdown.convertInput(). In the use cases I've tested so far, getModelObject() returns the correct value. From: Paul Bors To: Date: 05/20/2013 11:35 AM Subject:RE: DropDownChoice in FormComponentPanel Simplest way I can think of is something like: @Override protected void onBeforeRender() { if(isValid()) { dropDown.getFormField().setDefaultModel(getDefaultModel()); } ... super.onBeforeRender(); } @Override protected void convertInput() { if(dropdown != null) { setConvertedInput(dropDown.getConvertedInput()); } ... } But it really depends on what your FormComponentPanel is wrapping and how you share its model among the child components. Refer to the Wicket Users Guide section 1.8 "Creating comples form components with FormComponentPanel": http://wicket.apache.org/learn/books/freeguide.html Or search the wiki pages: https://cwiki.apache.org/WICKET/creating-custom-formcomponentpanels-to-build -valid-objects-using-wickets-form-validation-logic.html ~ Thank you, Paul Bors -Original Message----- From: Richard W. Adams [mailto:rwada...@up.com] Sent: Monday, May 20, 2013 8:10 AM To: users@wicket.apache.org Subject: DropDownChoice in FormComponentPanel I have a FormComponentPanel with both string fields & DropDownChoice controls. How do I get the drop downs' current selections from inside my override of convertInput()? I can get the string fields' values by calling the fields' convertInput() methods, but when I call convertInput() on the drop downs, I get the ORIGINAL value of the drop down, not the CURRENT value. I'm using Wicket 1.4.17 (version imposed by our corporate framework). I've looked at several different Wicket references, including Wicket in Action, Apache Wicket Cookbook & the new online free Wicket guide, but could not find this issue discussed. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. ** - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
DropDownChoice in FormComponentPanel
I have a FormComponentPanel with both string fields & DropDownChoice controls. How do I get the drop downs' current selections from inside my override of convertInput()? I can get the string fields' values by calling the fields' convertInput() methods, but when I call convertInput() on the drop downs, I get the ORIGINAL value of the drop down, not the CURRENT value. I'm using Wicket 1.4.17 (version imposed by our corporate framework). I've looked at several different Wicket references, including Wicket in Action, Apache Wicket Cookbook & the new online free Wicket guide, but could not find this issue discussed. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Call me page wicket from in page.jsp
It's unclear what your issue is. By definition, different applications (& different users) have separate sessions. From: Alis To: users@wicket.apache.org Date: 05/16/2013 03:45 PM Subject:Re: Call me page wicket from in page.jsp Thank you! How do I keep the same session even if aplicaiones different? To be placed in each web.xml, help me -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Call-me-page-wicket-from-iframe-in-page-jsp-tp4658716p4658869.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Wicket in other application
What do you mean by "unify"? Do you want to merge them into a single application with only one code base? Or do you mean something else? If you intend to keep them as two separate applications, there are number of techniques for inter-process communication. From: Alis To: users@wicket.apache.org Date: 05/16/2013 08:55 AM Subject:Wicket in other application Hello! Currently, I have two applications: one wicket and one in struts jsp. Both need to interact. I keep the same HttpServletRequest and HttpSession in both apliacaiones. The solution I thought is to unify the wicket application in another application. How do I? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-in-other-application-tp4658859.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Detecting Page Re-Display
That did it! Thanks! From: Andrea Del Bene To: users@wicket.apache.org Date: 05/13/2013 10:42 AM Subject:Re: Detecting Page Re-Display Do you disable/enable the button on server side (i.e. invoking setEnabled)? You should use page's onConfigure to place your configuration code (for example the code to disable the button). > How can I detect when a page is about to be re-displayed? > > In my app, some pages have "OK" buttons that are enabled once the user has > entered certain data. When the user then clicks OK, he taken to another > page where some actions are performed. When he then RETURNS from the > action page to the data entry page, he has the opportunity to enter > different data and perform the action again. > > My problem is this: Once the user returns to the data entry page, the OK > button is still enabled, even though he hasn't entered any new data yet. > How can I detect that the page is being displayed a second time so I can > disable the OK button before the page is displayed? > > > ** > > This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. > ** > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Detecting Page Re-Display
How can I detect when a page is about to be re-displayed? In my app, some pages have "OK" buttons that are enabled once the user has entered certain data. When the user then clicks OK, he taken to another page where some actions are performed. When he then RETURNS from the action page to the data entry page, he has the opportunity to enter different data and perform the action again. My problem is this: Once the user returns to the data entry page, the OK button is still enabled, even though he hasn't entered any new data yet. How can I detect that the page is being displayed a second time so I can disable the OK button before the page is displayed? ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: [wicket 6] Create/Register Spring Bean in wicket ?
Not sure exactly what the issue is. You can create beans any time you want. All you need to do is get an application context object based on a Spring config file. You can do that in init() or wherever is appropriate for your app. From: smallufo To: users@wicket.apache.org Date: 05/10/2013 02:34 PM Subject:[wicket 6] Create/Register Spring Bean in wicket ? Hi , I wonder if it possible to programmatically create / register a spring bean in wicket? maybe in Application.init() ... Most documents about spring are "making use of existent beans" , and inject to WebPage or Panel via @SpringBean , and it indeed works well. But my interface implementations are depend on wicket-component , such as getting absolute URL of a page or a DynamicImageResource So these beans should be initialized and register to Spring in init() (correct me if I am wrong) Any way to achieve this ? Thanks. (I am using wicket 6.7 ) ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: AjaxSubmitLink.onSubmit() Not Called in FormComponentPanel
Yikes! You're right. OnError() was called instead of onSubmit(). (Hides red face & slinks away...) From: Sven Meier To: users@wicket.apache.org Date: 03/01/2013 12:24 PM Subject:Re: AjaxSubmitLink.onSubmit() Not Called in FormComponentPanel Do you have unrendered feedback messages? Override #onError() and see if it gets invoked. Sven On 03/01/2013 06:53 PM, Richard W. Adams wrote: > I created an AjaxSubmitLink in a FormComponent Panel, and set a break > point in its onSubmit() method. For some reason, the breakpoint never gets > hit when I click the link. I've used an AjaxSubmitLink on a normal, > non-panel page successfully, and modeled the panelized link after that, so > am not sure where the problem lies. > > Here's the code where I create the link. The non-functioning break point > is on the System.out.println() statement. > > private Component createTrackLookupLink(final Form form) { > > final AjaxSubmitLink link = new AjaxSubmitLink("track-lookup", > form) { > private static final long serialVersionUID = > 6256611774949674998L; > @Override protected void onSubmit(final AjaxRequestTarget > target, final Form form) { > > System.out.println("User clicked lookup icon"); > } > }; > link.add(new Icon("track-lookup-icon", IconType.LOOKUP)); > return link; > } > > I create the link from inside the panel constructor: > > public PointLocationPanel(final String id, final > IModel model, final > boolean box, final Collapsible collapsible, final boolean > editable, final Form form) { > > super(id, model); > setType(PointFacilityLocation.class); > setOutputMarkupId(true); > final MarkupContainer container = box ? new Box(CONTAINER_ID, > "Location", collapsible) : > new WebMarkupContainer(CONTAINER_ID); > add(container); > ... > container.add(createTrackLookupLink(form)); > > I create the link from inside the panel constructor: > > final PointLocationPanel panel = new PointLocationPanel( > SWITCH_LOCATION, propertyModel, > true, Collapsible.EXPANDED, userCanEditData, form); > > form.add(panel).add(createDetailsBox()); > > The enclosing form has its own onSubmit() method. It wouldn't prevent the > link's onSubmit() method from beign called, would it? > > When I click the link, I see this output in the Wicket Ajax debug window: > > INFO: focus set on track_lookup20 > INFO: Using XMLHttpRequest transport > INFO: > INFO: > Initiating Ajax POST request on ?wicket:interface=:4:switch-form:switchLocation:container:track-lookup::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true&random=0.7709037117446776 > INFO: Invoking pre-call handler(s)... > INFO: Received ajax response (69 characters) > INFO: > > INFO: Response parsed. Now invoking steps... > INFO: Response processed successfully. > INFO: Invoking post-call handler(s)... > > ** > > This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. > ** > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
AjaxSubmitLink.onSubmit() Not Called in FormComponentPanel
I created an AjaxSubmitLink in a FormComponent Panel, and set a break point in its onSubmit() method. For some reason, the breakpoint never gets hit when I click the link. I've used an AjaxSubmitLink on a normal, non-panel page successfully, and modeled the panelized link after that, so am not sure where the problem lies. Here's the code where I create the link. The non-functioning break point is on the System.out.println() statement. private Component createTrackLookupLink(final Form form) { final AjaxSubmitLink link = new AjaxSubmitLink("track-lookup", form) { private static final long serialVersionUID = 6256611774949674998L; @Override protected void onSubmit(final AjaxRequestTarget target, final Form form) { System.out.println("User clicked lookup icon"); } }; link.add(new Icon("track-lookup-icon", IconType.LOOKUP)); return link; } I create the link from inside the panel constructor: public PointLocationPanel(final String id, final IModel model, final boolean box, final Collapsible collapsible, final boolean editable, final Form form) { super(id, model); setType(PointFacilityLocation.class); setOutputMarkupId(true); final MarkupContainer container = box ? new Box(CONTAINER_ID, "Location", collapsible) : new WebMarkupContainer(CONTAINER_ID); add(container); ... container.add(createTrackLookupLink(form)); I create the link from inside the panel constructor: final PointLocationPanel panel = new PointLocationPanel( SWITCH_LOCATION, propertyModel, true, Collapsible.EXPANDED, userCanEditData, form); form.add(panel).add(createDetailsBox()); The enclosing form has its own onSubmit() method. It wouldn't prevent the link's onSubmit() method from beign called, would it? When I click the link, I see this output in the Wicket Ajax debug window: INFO: focus set on track_lookup20 INFO: Using XMLHttpRequest transport INFO: INFO: Initiating Ajax POST request on ?wicket:interface=:4:switch-form:switchLocation:container:track-lookup::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true&random=0.7709037117446776 INFO: Invoking pre-call handler(s)... INFO: Received ajax response (69 characters) INFO: INFO: Response parsed. Now invoking steps... INFO: Response processed successfully. INFO: Invoking post-call handler(s)... ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: org.apache.wicket.util.convert.ConversionException: Cannot parse 'abcdef' using format java.text.DecimalFormat@674dc
Clearly you're not detecting the non-numeric format before trying to parse it. Tracing the execution path with the debugger ought to show where you can capture that?? From: Pratibha To: users@wicket.apache.org Date: 03/01/2013 07:20 AM Subject:org.apache.wicket.util.convert.ConversionException: Cannot parse 'abcdef' using format java.text.DecimalFormat@674dc Hi team, My converter is working perfectly if i enter double value but when i enter any String value it throws me error, i am unable to catch this error in feedbackpanel. Here's my converter code @Override public Object convertToObject(String value, java.util.Locale locale) { try{ if (Strings.isEmpty(value)) { return null; } else { if (Double.class.isAssignableFrom(value.getClass())) { return value; } if (value.equals(String.class)) { return convertToString((T)value, locale); } } } catch(Exception e){ error(value,"format"); } return value; } private void error(String value, String errorKey) { ConversionException e = new ConversionException("'" + value + "' is not a valid Double"); e.setSourceValue(value); e.setVariable("format", value); e.setResourceKey(getClass().getSimpleName() + "." + errorKey); throw e; } and my java code final TextField field = new TextField("field", new PropertyModel(field, "fieldNumber")){ @Override public IConverter getConverter(Class clazz) { return new LocaleConverter(); } }; field.setType(Double.class); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/org-apache-wicket-util-convert-ConversionException-Cannot-parse-abcdef-using-format-java-text-Decimac-tp4656895.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Eclipse or IntelliJ
If you do software development for a living (as opposed to a hobby), one thing to consider is what tools are used at prospective employers. I work at a large (40,000+) company where Eclipse is the standard tool. Partly because it's open source (read "free," no budget impact) & has such a large support community. Plus it meets all our needs. I've used Eclipse for years (both home & work), and have been satisfied with it. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: FormComponentPanel.convertInput()
You're right: The "later in #updateModel()" was the piece I wasn't considering. Tks. From: Sven Meier To: users@wicket.apache.org Date: 02/13/2013 08:48 AM Subject:Re: FormComponentPanel.convertInput() Hi, #convertInput() should not modify the current model object, because form submission might still fail with a conversion error on another field. Pushing the new input in the FormComponent's model is done later in #updateModel(). Hope this helps Sven On 02/13/2013 03:33 PM, Richard W. Adams wrote: > I'm writing my first FormComponentPanel, and have a couple of books > showing how to do this. Most of it seems straightforward, except one > point: In the books' examples, FormComopnentPanel.convertInput() creates a > new model object and populates it from a series of calls to > getConvertedInput() on the panel fields. The examples then call > setConvertedInput() to store the newly populated model object. > > The part I don't understand is this: Why create a NEW model object? Why > not just call getModelObject() to get the ORIGINAL model, and populate IT > with the new values? That would avoid the caller having to call > getConvertedInput() on the panel component: The ORIGINAL model would be > "magically" updated with the user-entered values when the form is > submitted. That requires less work on the caller's part, and (IMHO) seems > more consistent with the way other property model paradigms work in > Wicket. (This, of course, assumes the original model is mutable, which > mine is.) > > Anyone have any thoughts on the pros & cons of these two approaches? > > > ** > > This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. > ** > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
FormComponentPanel.convertInput()
I'm writing my first FormComponentPanel, and have a couple of books showing how to do this. Most of it seems straightforward, except one point: In the books' examples, FormComopnentPanel.convertInput() creates a new model object and populates it from a series of calls to getConvertedInput() on the panel fields. The examples then call setConvertedInput() to store the newly populated model object. The part I don't understand is this: Why create a NEW model object? Why not just call getModelObject() to get the ORIGINAL model, and populate IT with the new values? That would avoid the caller having to call getConvertedInput() on the panel component: The ORIGINAL model would be "magically" updated with the user-entered values when the form is submitted. That requires less work on the caller's part, and (IMHO) seems more consistent with the way other property model paradigms work in Wicket. (This, of course, assumes the original model is mutable, which mine is.) Anyone have any thoughts on the pros & cons of these two approaches? ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: HP Fortify & Critical Security Issues
From: sthomps To: users@wicket.apache.org Date: 02/05/2013 12:44 PM Subject:HP Fortify & Critical Security Issues We use Fortify at our company. I'm please to note that it found no vulnerability in my Wicket app, though it did numerous issues with ColdFusion apps (no surprise). I'm not in our security department, so am by no means an expert, but at least some Fortune 500 companies use it. Hello, As part of an evaluation of web frameworks, one of the checkboxes to tick is security vulnerabilities. In this case the tool being used to scan for those vulnerabilities is HP Fortify < http://www8.hp.com/us/en/software-solutions/software.html?compURI=1349399#.URFMM6WbR2o > I wanted to get the communities feedback on critical security issues that were presented based on this tool (I'll leave my opinion out of it for now) and if other teams are using are using this software - what is their process for evaluating/fixing/etc these kinds of issues in open-source software. Appreciate your input. Issue 1 - wicket-ajax-jquery.js:651 (Open Redirect) *Abstract:* The file wicket-ajax-jquery.js passes unvalidated data to an HTTP redirect function on line 651. Allowing unvalidated input to control the URL used in a redirect can aid phishing attacks. *Explanation*: Redirects allow web applications to direct users to different pages within the same application or to external sites. Applications utilize redirects to aid in site navigation and, in some cases, to track how users exit the site. Open redirect vulnerabilities occur when a web application redirects clients to any arbitrary URL that can be controlled by an attacker. Attackers can utilize open redirects to trick users into visiting a URL to a trusted site and redirecting them to a malicious site. By encoding the URL, an attacker can make it more difficult for end-users to notice the malicious destination of the redirect, even when it is passed as a URL parameter to the trusted site. Open redirects are often abused as part of phishing scams to harvest sensitive end-user data. *Recommendations*: Unvalidated user input should not be allowed to control the destination URL in a redirect. Instead, a level of indirection should be introduced: create a list of legitimate URLs that users are allowed to specify, and only allow users to select from the list. With this approach, input provided by users is never used directly to specify a URL for redirects. Issue 2 - FileUpload:253 (Path Manipulation) *Abstract:* Attackers can control the filesystem path argument to createTempFile() at FileUpload.java line 253, which allows them to access or modify otherwise protected files. *Explanation*: Path manipulation errors occur when the following two conditions are met: 1. An attacker can specify a path used in an operation on the filesystem. 2. By specifying the resource, the attacker gains a capability that would not otherwise be permitted. For example, the program may give the attacker the ability to overwrite the specified file or run with a configuration controlled by the attacker. In this case, the attacker can specify the value that enters the program at getId() in FileUpload.java at line 251, and this value is used to access a filesystem resource at createTempFile() in FileUpload.java at line 253. *Recommendations:* The best way to prevent path manipulation is with a level of indirection: create a list of legitimate resource names that a user is allowed to specify, and only allow the user to select from the list. With this approach the input provided by the user is never used directly to specify the resource name. In some situations this approach is impractical because the set of legitimate resource names is too large or too hard to keep track of. Programmers often resort to blacklisting in these situations. Blacklisting selectively rejects or escapes potentially dangerous characters before using the input. However, any such list of unsafe characters is likely to be incomplete and will almost certainly become out of date. A better approach is to create a white list of characters that are allowed to appear in the resource name and accept input composed exclusively of characters in the approved set. Issue 3 - WicketServlet:327 (Race Condition: Singleton Member Field) *Abstract:* The class WicketServlet is a singleton, so the member field wicketFilter is shared between users. The result is that one user could see another user's data. *Explanation:* Many Servlet developers do not understand that a Servlet is a singleton. There is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result of this misunderstanding is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields
Re: No Ajax Model Update in FormComponentPanel
You were right, Sven. It was that simple! Sometimes I can't see the forest for the trees. From: Sven Meier To: users@wicket.apache.org Date: 11/15/2012 03:41 PM Subject:Re: No Ajax Model Update in FormComponentPanel > final Integer newSubdivision = getModelObject().getSubdivision(); You're using the wrong model object, this should be: final Integer newSubdivision = dropdown.getModelObject(); or: final Integer newSubdivision = PointLocationPanel.this.subdivision Sven On 11/15/2012 09:13 PM, Richard W. Adams wrote: > I have a drop down choice in a FormComponentPanel, and & need to update > other parts of the panel when the user changes the selected value in the > drop down. My panel class is defined as: > > PointLocationPanel extends FormComponentPanel > > Its constructor begins like this: > > public PointLocationPanel(final String id, final IModel > model, > final String boxTitle, final MapURL mapURL) { > > super(id, model); > setType(PointLocation.class); > ... > > This is the method where I create the drop down. > > private SubdivisionDropDown createSubdivisionDropdown() { > > final SubdivisionDropDown dropdown = new SubdivisionDropDown > (SUBDIVISION, new PropertyModel(this, SUBDIVISION > )); > dropdown.add(new AjaxFormComponentUpdatingBehavior(ONCHANGE) { > private static final long serialVersionUID = > -1285532100134482101L; > /* > * When the user picks a different subdivision, update the > segment > * drop down list to show segments in the newly chosen > subdivision. > */ > @Override protected void onUpdate(final AjaxRequestTarget > target) { > final Integer newSubdivision = > getModelObject().getSubdivision(); > smrDropdown.update(newSubdivision); > target.addComponent(smrDropdown); > } > }); > return dropdown; > } > > However, when the onUpdate() method is called & I call > getModelObject.getSubdivision(), it returns the old value, not the newly > selected one. Can anyone see what I'm doing wrong? > > Our app runs under Wicket 1.4.17. > > ** > > This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. > ** > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
No Ajax Model Update in FormComponentPanel
I have a drop down choice in a FormComponentPanel, and & need to update other parts of the panel when the user changes the selected value in the drop down. My panel class is defined as: PointLocationPanel extends FormComponentPanel Its constructor begins like this: public PointLocationPanel(final String id, final IModel model, final String boxTitle, final MapURL mapURL) { super(id, model); setType(PointLocation.class); ... This is the method where I create the drop down. private SubdivisionDropDown createSubdivisionDropdown() { final SubdivisionDropDown dropdown = new SubdivisionDropDown (SUBDIVISION, new PropertyModel(this, SUBDIVISION )); dropdown.add(new AjaxFormComponentUpdatingBehavior(ONCHANGE) { private static final long serialVersionUID = -1285532100134482101L; /* * When the user picks a different subdivision, update the segment * drop down list to show segments in the newly chosen subdivision. */ @Override protected void onUpdate(final AjaxRequestTarget target) { final Integer newSubdivision = getModelObject().getSubdivision(); smrDropdown.update(newSubdivision); target.addComponent(smrDropdown); } }); return dropdown; } However, when the onUpdate() method is called & I call getModelObject.getSubdivision(), it returns the old value, not the newly selected one. Can anyone see what I'm doing wrong? Our app runs under Wicket 1.4.17. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Finding HTML Markup in External JARs
Well, as usual, it's never what you think of. We have two experienced (?) developers looking at this all morning, & no one noticed that the extension was "hml" instead of "html". (Hides red face & slinks away). From: Sven Meier To: users@wicket.apache.org Date: 11/14/2012 12:12 PM Subject:Re: Finding HTML Markup in External JARs I'd recommend putting a proper xml header with explicit encoding into each markup, but you can also specify a default encoding with IMarkupSettings#defaultMarkupEncoding. However you do it, it shouldn't have any effect on Wicket *finding* the markup. Sven On 11/14/2012 07:07 PM, Richard W. Adams wrote: > I've been digging into this all morning, and my current theory is that > it's a file encoding problem. After adding the Maven resource plugin to my > POM to force copying in UTF-8, I now get the identical error running on my > Jetty on my workstation (which worked fine earlier this morning). Does > wicket have special encoding requirements? Anyone know what the encoding > best practices are for Wicket? > > > org.apache.maven.plugins > maven-resources-plugin > 2.6 > >UTF-8 > > > > _ > > I have yet to meet a C compiler that is more friendly and easier to use > than eating soup with a knife. > > > > > From: Eric Jablow > To: users@wicket.apache.org > Date: 11/14/2012 11:22 AM > Subject:Re: Finding HTML Markup in External JARs > > > > On Wed, Nov 14, 2012 at 11:35 AM, Sven Meier wrote: >> Depending on what your *PathLocator *does, it might not serve the usual >> markup from beside components. >> >> >>> Wicket is finding HTML files in *other* JARs. This is a puzzler. > Could this be a ClassLoader issue? The two JAR files' ClassLoaders may > be different and unrelated. > > Eric > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > ** > > This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. > ** > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Finding HTML Markup in External JARs
I've been digging into this all morning, and my current theory is that it's a file encoding problem. After adding the Maven resource plugin to my POM to force copying in UTF-8, I now get the identical error running on my Jetty on my workstation (which worked fine earlier this morning). Does wicket have special encoding requirements? Anyone know what the encoding best practices are for Wicket? org.apache.maven.plugins maven-resources-plugin 2.6 UTF-8 _ I have yet to meet a C compiler that is more friendly and easier to use than eating soup with a knife. From: Eric Jablow To: users@wicket.apache.org Date: 11/14/2012 11:22 AM Subject:Re: Finding HTML Markup in External JARs On Wed, Nov 14, 2012 at 11:35 AM, Sven Meier wrote: > Depending on what your *PathLocator *does, it might not serve the usual > markup from beside components. > > >> Wicket is finding HTML files in *other* JARs. This is a puzzler. Could this be a ClassLoader issue? The two JAR files' ClassLoaders may be different and unrelated. Eric - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Finding HTML Markup in External JARs
I double checked, & the html & class files are indeed in the folder (see image below): Heres the error message: 2012-11-14 09:50:31,875 [ajp-10002-3] ERROR - Markup of type 'html' for component 'com.uprr.ecm.wicket.components.panels.location.PointLocationPanel' not found. Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried.: [MarkupContainer [Component id = switch-location]] org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html' for component 'com.uprr.ecm.wicket.components.panels.location.PointLocationPanel' not found. Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried.: [MarkupContainer [Component id = switch-location]] at org.apache.wicket.markup.MarkupCache.getMarkupStream(MarkupCache.java:227) at org.apache.wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:351) at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:654) at org.apache.wicket.markup.html.form.FormComponentPanel.onComponentTagBody(FormComponentPanel.java:223) at org.apache.wicket.Component.renderComponent(Component.java:2690) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1539) at org.apache.wicket.Component.render(Component.java:2521) Though I don't think it's significant, but our main app does have some code (below) that tells Wicket to look in an additional location for HTML files. But I don't that's causing the problem, because Wicket is finding HTML files in *other* JARs. This is a puzzler. final IResourceSettings resourceSettings = getResourceSettings(); resourceSettings.addResourceFolder("WEB-INF/html"); resourceSettings.setResourceStreamLocator(new PathLocator()); From: Martin Grigorov To: users@wicket.apache.org Date: 11/14/2012 09:29 AM Subject:Re: Finding HTML Markup in External JARs Hi, I'm 99% certain that the .html files are not in the .jar. Double check that they are actually packed with the .class files. On Wed, Nov 14, 2012 at 5:26 PM, Richard W. Adams wrote: > We're enhancing a Wicket app which has been running in production for many > months. One of the enhancements was adding a panel to a JAR (which we > wrote) used by our app. The new panel works fine on the local workstation > under Eclipse/Jetty, but fails when we deploy it to our JBOSS server. > Cause: Wicket says it can't find the HTML associated with the Java class, > even though the HTML & .class file are in the same folder. If finds HTML > markup in *other* JARs, but not the JAR with our new panel. (This panel is > the first class with markup we've attempted in this JAR.) > > > Is there some special configuration or initialization that is required to > let Wicket find the HTML inside an external JAR? > > Version info: Our app uses Wicket 1.4.17 & wicket-extensions 1.4.17. The > versions are dictated by our corporate framework, so upgrading to newer > versions is not an option for now. > > ** > > This email and any attachments may contain information that is > confidential and/or privileged for the sole use of the intended recipient. > Any use, review, disclosure, copying, distribution or reliance by others, > and any forwarding of this email or its contents, without the express > permission of the sender is strictly prohibited by law. If you are not the > intended recipient, please contact the sender immediately, delete the > e-mail and destroy all copies. > ** > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com <http://jweekend.com/> ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Finding HTML Markup in External JARs
We're enhancing a Wicket app which has been running in production for many months. One of the enhancements was adding a panel to a JAR (which we wrote) used by our app. The new panel works fine on the local workstation under Eclipse/Jetty, but fails when we deploy it to our JBOSS server. Cause: Wicket says it can't find the HTML associated with the Java class, even though the HTML & .class file are in the same folder. If finds HTML markup in *other* JARs, but not the JAR with our new panel. (This panel is the first class with markup we've attempted in this JAR.) Is there some special configuration or initialization that is required to let Wicket find the HTML inside an external JAR? Version info: Our app uses Wicket 1.4.17 & wicket-extensions 1.4.17. The versions are dictated by our corporate framework, so upgrading to newer versions is not an option for now. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
RE: [Building Sakai] Wicket-Sakai archetype Add page in other page
Not sure exactly what you're asking, but have you looked at Wicket panels? _ I have yet to meet a C compiler that is more friendly and easier to use than eating soup with a knife. From: Antonio muñoz alonso To: "users@wicket.apache.org" Date: 11/07/2012 11:22 AM Subject:RE: [Building Sakai] Wicket-Sakai archetype Add page in other page how to join 2 classes (page1.java, page.java) in one page1.html (javascript?) From: antoniovalenciasp...@hotmail.com To: users@wicket.apache.org Subject: FW: [Building Sakai] Wicket-Sakai archetype Add page in other page Date: Wed, 7 Nov 2012 14:24:00 +0100 From: antoniovalenciasp...@hotmail.com To: steve.swinsb...@gmail.com Date: Wed, 7 Nov 2012 13:46:52 +0100 CC: sakai-...@collab.sakaiproject.org Subject: Re: [Building Sakai] Wicket-Sakai archetype Add page in other page Yes, what you say is doing. My first page has a dropchoice and button.I want the second page appears below.But always keeping the first page to keep doing more consultations. thanks Subject: Re: [Building Sakai] Wicket-Sakai archetype Add page in other page From: steve.swinsb...@gmail.com Date: Wed, 7 Nov 2012 23:37:50 +1100 CC: sakai-...@collab.sakaiproject.org To: antoniovalenciasp...@hotmail.com Hi, Not quite sure what you are asking. Do you want to open a new page in the tool when you click a button/link? If so, in the onSubmit/onClick handler of the button or link: setResponsePage(new SomeOtherPage()); You can also do this with AJAX but it invokes replacing panels using the AjaxRequestTarget target that Wicket gives you access to. I would recommend the first one until you are more comfortable with it. cheers,Steve On 07/11/2012, at 10:19 PM, Antonio muñoz alonso wrote:Hi how to run a page in another by pressing the button.I can run 2 as a single page(JAvascript???). thanks___sakai-dev mailing listsakai-dev@collab.sakaiproject.orghttp://collab.sakaiproject.org/mailman/listinfo/sakai-devTO UNSUBSCRIBE: send email to sakai-dev-unsubscr...@collab.sakaiproject.org with a subject of "unsubscribe" ___ sakai-dev mailing list sakai-...@collab.sakaiproject.org http://collab.sakaiproject.org/mailman/listinfo/sakai-dev TO UNSUBSCRIBE: send email to sakai-dev-unsubscr...@collab.sakaiproject.org with a subject of "unsubscribe" ___ sakai-dev mailing list sakai-...@collab.sakaiproject.org http://collab.sakaiproject.org/mailman/listinfo/sakai-dev TO UNSUBSCRIBE: send email to sakai-dev-unsubscr...@collab.sakaiproject.org with a subject of "unsubscribe" ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Image source location problems, examples did not help
Perhaps I misunderstand the question, but is not valid HTML. Perhaps you want something like this? _ I have yet to meet a C compiler that is more friendly and easier to use than eating soup with a knife. From: Delange To: users@wicket.apache.org Date: 11/06/2012 03:20 PM Subject:Image source location problems, examples did not help Maybe it's easy but I struggle to long with it. In my webapplication I have this structure myapplication css images WEB-INF classes etc etc My Html looks like this My Java is: StaticImage imageTest = new StaticImage("imagetest",new Model("/opdrachten/284/P1010841.JPG")); form.add(imageTest); Then on my page the link is I also tried Image but that didn't work either. What's wrong? And what to do when the location in another directory on the same system? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Image-source-location-problems-examples-did-not-help-tp4653664.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Clueless on this error
Just a guess, but based on ClassNotFoundException: com.campingawaits.CampingAwaitsApp, it sounds like something changed your classpath so the class loader can no longer find this class. _ I have yet to meet a C compiler that is more friendly and easier to use than eating soup with a knife. From: Stephen Walsh To: "users@wicket.apache.org" Date: 10/17/2012 02:21 PM Subject:Clueless on this error Randomly got this today. Tried upgrading to 6.1.1, a fresh install of JBoss and still didn't have any luck fixing it… Thoughts? 13:23:15,991 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/campingawaits-1.0-SNAPSHOT]] (MSC service thread 1-3) Exception starting filter wicket.campingawaits: org.apache.wicket.WicketRuntimeException: Unable to create application of class com.campingawaits.CampingAwaitsApp at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.createApplication(ContextParamWebApplicationFactory.java:86) [wicket-core-6.0.0.jar:6.0.0] at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.createApplication(ContextParamWebApplicationFactory.java:50) [wicket-core-6.0.0.jar:6.0.0] at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:339) [wicket-core-6.0.0.jar:6.0.0] at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:314) [wicket-core-6.0.0.jar:6.0.0] at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:447) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3269) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.StandardContext.start(StandardContext.java:3865) [jbossweb-7.0.13.Final.jar:] at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_35] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_35] at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_35] Caused by: java.lang.ClassNotFoundException: com.campingawaits.CampingAwaitsApp from [Module "deployment.campingawaits-1.0-SNAPSHOT.war:main" from Service Module Loader] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) at java.lang.Class.forName0(Native Method) [classes.jar:1.6.0_35] at java.lang.Class.forName(Class.java:247) [classes.jar:1.6.0_35] at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.createApplication(ContextParamWebApplicationFactory.java:72) [wicket-core-6.0.0.jar:6.0.0] ... 12 more 13:23:16,169 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-3) Error filterStart 13:23:16,170 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-3) Context [/campingawaits-1.0-SNAPSHOT] startup failed due to previous errors 13:23:16,509 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC1: Failed to start service jboss.web.deployment.default-host."/campingawaits-1.0-SNAPSHOT": org.jboss.msc.service.StartException in service jboss.web.deployment.default-host."/campingawaits-1.0-SNAPSHOT": JBAS018040: Failed to start context at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [cl
RE: Boolean DropDownChoice
Even better, why are you using a drop down at all? Check boxes are normally used for true-false choices. From: Paul Bors To: Date: 08/01/2012 07:51 PM Subject:RE: Boolean DropDownChoice Instead of going to the extent of overriding a class because your model value is not updated, why not fix the problem? Take a look at the component reference wicket-example project: http://www.wicket-library.com/wicket-examples/compref/ More precisely at the DropDownChoice: http://www.wicket-library.com/wicket-examples/compref/wicket/bookmarkable/or g.apache.wicket.examples.compref.DropDownChoicePage?0 -Original Message- From: Lawrence, Sean [mailto:sean.lawre...@mantech.com] Sent: Wednesday, August 01, 2012 7:19 PM To: users@wicket.apache.org Subject: Boolean DropDownChoice Hi, I'm trying to create a custom form component that extends a DropDownChoice. The reason I'm doing this is because I need a form component that forces a user to select a choice. However, I'm unable to get the model to update. What am I not overriding properly? I'm all ears for suggestions if there is a better way to do this as well. /** * A Boolean form component that uses a drop down choice so that * a user is forced to choose between "Yes" or "No". * */ public class YesNoDropDownChoice extends DropDownChoice { private static final long serialVersionUID = 1L; public YesNoDropDownChoice(String id, IModel model) { super(id, model, Arrays.asList( Choice.YES.getBoolean(), Choice.NO.getBoolean())); onModelChanged(); } @Override protected void onModelChanged() { super.onModelChanged(); setModelObject(getModelObject()); } /** * {@inheritDoc} */ @Override protected void convertInput() { Boolean b = getModelObject(); setConvertedInput(b); } } Thanks in advance, Sean Lawrence This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Where to add javascript in html pages which follow inheritance relationship.
I assume the " entities aren't really there in the code? From: kshitiz To: users@wicket.apache.org Date: 07/30/2012 09:16 AM Subject:Re: Where to add javascript in html pages which follow inheritance relationship. hi, Sorry to disturb you again but I am trying out this code but it is not working: *Page1:* http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en" xmlns:wicket=" http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";> *JS code here...* Page2: http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en" xmlns:wicket=" http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";> *JS code is not being called...:(. I have tried out all combinations like removing head tags from Page2 or enclosing wicket:head tags with head tags in Page1* -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Where-to-add-javascript-in-html-pages-which-follow-inheritance-relationship-tp4650855p4650871.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Ajax Timeouts
Great! That means I don't have to waste time tracking down non-existent timeouts & can focus elsewhere. Thanks for the quick feedback. From: Martin Grigorov To: users@wicket.apache.org Date: 07/26/2012 09:56 AM Subject:Re: Ajax Timeouts On Thu, Jul 26, 2012 at 5:50 PM, Richard W. Adams wrote: > Yes, it is my code. My server code will eventually reply. What I can't > control is how long a database operation will take. Typically the database > work finishes under 10 seconds, but sometimes can run up to a minute or > longer. > > If I understand you correctly, even if takes 5 minutes (an extreme > example), the client will still patiently wait until it gest the reply, > correct? To say it another way: As long as the server code eventually > replies (in less than the session timeout, which is currently 60 minutes, > I think), the client will still get the reply. Is that accurate? If so, > then my problem is probably something other than an Ajax timeout. Yes, the Ajax call will wait. In that timeframe no other request can access the same page instance too. Wicket 6 supports Ajax call timeout by org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setRequestTimeout(). It just delegates to jQuery#ajax()'s timeout mechanism. I haven't tried it with your use case though. > > > > > From: Martin Grigorov > To: users@wicket.apache.org > Date: 07/26/2012 09:41 AM > Subject: Re: Ajax Timeouts > > > > On Thu, Jul 26, 2012 at 5:35 PM, Richard W. Adams wrote: >> So once the client request gets access to the page instance, it will > wait >> forever for a reply? > > this is your code, no ? > > once the Ajax call gets access to the page Wicket executes > onEvent(AjaxRequestTarget). Here it is your job to not block forever > >> >> >> >> >> From: Martin Grigorov >> To: users@wicket.apache.org >> Date: 07/26/2012 09:27 AM >> Subject:Re: Ajax Timeouts >> >> >> >> Hi, >> >> The timeout is to get access to the page instance. It is for both Ajax >> and normal requests. >> See org.apache.wicket.settings.IRequestCycleSettings#getTimeout >> >> You must have some exceptions in the logs if this is the reason. >> >> But even if Ajax request fails to get access to the page then it will >> end by calling its failure handler. >> >> On Wed, Jul 25, 2012 at 7:50 PM, Richard W. Adams > wrote: >>> My Wicket app occasionally "freezes" on making an Ajax submit that >> invokes >>> a potentially lengthy database operation. My theory is that the > database >>> work is taking longer than Wicket allows, & the Ajax call times out. > I'm >>> guessing that the browser does not detect this timeout, so my "Please >>> Wait" message continues to be displayed, making the user think he will >>> eventually get an answer from the server. However, in these cases, no >>> matter long he waits (up to many minutes), no reply is ever > forthcoming. >>> >>> Before I invest a lot of time trying to FIX this problem, is there a > way >>> to determine that an Ajax timeout actually IS the problem? Also, does >>> anyone know what Wicket's default Ajax timeout interval is? >>> >>> I looked over the Javadocs for the various Wicket Ajax classes, but > none >>> of them seemed to address this particular issue. Any advice or pointers >>> would be greatly appreciated! >>> >>> >>> >>> >>> >>> ** >>> >>> This email and any attachments may contain information that is >> confidential and/or privileged for the sole use of the intended > recipient. >> Any use, review, disclosure, copying, distribution or reliance by > others, >> and any forwarding of this email or its contents, without the express >> permission of the sender is strictly prohibited by law. If you are not >> the intended recipient, please contact the sender immediately, delete > the >> e-mail and destroy all copies. >>> ** >> >> >> >> -- >> Martin Grigorov >> jWeekend >> Training, Consulting, Development >> http://jWeekend.com >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> >> >> ** >> >> This email and any attachments may contain information that is > confidential and/or privileged for the sole use o
Re: Ajax Timeouts
Yes, it is my code. My server code will eventually reply. What I can't control is how long a database operation will take. Typically the database work finishes under 10 seconds, but sometimes can run up to a minute or longer. If I understand you correctly, even if takes 5 minutes (an extreme example), the client will still patiently wait until it gest the reply, correct? To say it another way: As long as the server code eventually replies (in less than the session timeout, which is currently 60 minutes, I think), the client will still get the reply. Is that accurate? If so, then my problem is probably something other than an Ajax timeout. From: Martin Grigorov To: users@wicket.apache.org Date: 07/26/2012 09:41 AM Subject:Re: Ajax Timeouts On Thu, Jul 26, 2012 at 5:35 PM, Richard W. Adams wrote: > So once the client request gets access to the page instance, it will wait > forever for a reply? this is your code, no ? once the Ajax call gets access to the page Wicket executes onEvent(AjaxRequestTarget). Here it is your job to not block forever > > > > > From: Martin Grigorov > To: users@wicket.apache.org > Date: 07/26/2012 09:27 AM > Subject:Re: Ajax Timeouts > > > > Hi, > > The timeout is to get access to the page instance. It is for both Ajax > and normal requests. > See org.apache.wicket.settings.IRequestCycleSettings#getTimeout > > You must have some exceptions in the logs if this is the reason. > > But even if Ajax request fails to get access to the page then it will > end by calling its failure handler. > > On Wed, Jul 25, 2012 at 7:50 PM, Richard W. Adams wrote: >> My Wicket app occasionally "freezes" on making an Ajax submit that > invokes >> a potentially lengthy database operation. My theory is that the database >> work is taking longer than Wicket allows, & the Ajax call times out. I'm >> guessing that the browser does not detect this timeout, so my "Please >> Wait" message continues to be displayed, making the user think he will >> eventually get an answer from the server. However, in these cases, no >> matter long he waits (up to many minutes), no reply is ever forthcoming. >> >> Before I invest a lot of time trying to FIX this problem, is there a way >> to determine that an Ajax timeout actually IS the problem? Also, does >> anyone know what Wicket's default Ajax timeout interval is? >> >> I looked over the Javadocs for the various Wicket Ajax classes, but none >> of them seemed to address this particular issue. Any advice or pointers >> would be greatly appreciated! >> >> >> >> >> >> ** >> >> This email and any attachments may contain information that is > confidential and/or privileged for the sole use of the intended recipient. > Any use, review, disclosure, copying, distribution or reliance by others, > and any forwarding of this email or its contents, without the express > permission of the sender is strictly prohibited by law. If you are not > the intended recipient, please contact the sender immediately, delete the > e-mail and destroy all copies. >> ** > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.com > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > ** > > This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. > ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Ajax Timeouts
So once the client request gets access to the page instance, it will wait forever for a reply? From: Martin Grigorov To: users@wicket.apache.org Date: 07/26/2012 09:27 AM Subject:Re: Ajax Timeouts Hi, The timeout is to get access to the page instance. It is for both Ajax and normal requests. See org.apache.wicket.settings.IRequestCycleSettings#getTimeout You must have some exceptions in the logs if this is the reason. But even if Ajax request fails to get access to the page then it will end by calling its failure handler. On Wed, Jul 25, 2012 at 7:50 PM, Richard W. Adams wrote: > My Wicket app occasionally "freezes" on making an Ajax submit that invokes > a potentially lengthy database operation. My theory is that the database > work is taking longer than Wicket allows, & the Ajax call times out. I'm > guessing that the browser does not detect this timeout, so my "Please > Wait" message continues to be displayed, making the user think he will > eventually get an answer from the server. However, in these cases, no > matter long he waits (up to many minutes), no reply is ever forthcoming. > > Before I invest a lot of time trying to FIX this problem, is there a way > to determine that an Ajax timeout actually IS the problem? Also, does > anyone know what Wicket's default Ajax timeout interval is? > > I looked over the Javadocs for the various Wicket Ajax classes, but none > of them seemed to address this particular issue. Any advice or pointers > would be greatly appreciated! > > > > > > ** > > This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. > ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Ajax Timeouts
My Wicket app occasionally "freezes" on making an Ajax submit that invokes a potentially lengthy database operation. My theory is that the database work is taking longer than Wicket allows, & the Ajax call times out. I'm guessing that the browser does not detect this timeout, so my "Please Wait" message continues to be displayed, making the user think he will eventually get an answer from the server. However, in these cases, no matter long he waits (up to many minutes), no reply is ever forthcoming. Before I invest a lot of time trying to FIX this problem, is there a way to determine that an Ajax timeout actually IS the problem? Also, does anyone know what Wicket's default Ajax timeout interval is? I looked over the Javadocs for the various Wicket Ajax classes, but none of them seemed to address this particular issue. Any advice or pointers would be greatly appreciated! ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: modify Date in model from 3 inputs?
It is possible, and very common. In fact, if you set up your model correctly, you don't have to change it at all. Wicket does it for you. From: Dan12321 To: users@wicket.apache.org Date: 06/25/2012 11:47 AM Subject:modify Date in model from 3 inputs? Hi, I have got 3 html elements: day, month, year. In model class I have got attribute "java.util.Date sameDate;". This date should be created from elements day, month, year. I would like to ask, if there is possible: when I change input or select, I want to change Date in model. Is it possible? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/modify-Date-in-model-from-3-inputs-tp4650220.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
No Warning of Missing HTML File
I just spent two and a half hours wondering why my modal dialog would open, but have no content (just an empty background). I finally discovered the HTML file for the content had its name misspelled (missing a letter). Surprisingly (at least to me), Wicket generated no errors or warning, even though it clearly knew the HTML file was missing. This is in contrast the errors Wicket DOES throw when the HTML file is correctly named, but has component ID's that aren't mentioned in the corresponding Java file. Is there a way to make Wicket issue warnings about missing HTML files? I'd REALLY like never to go through all this frustration again in the future. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: wicket & ajax push
What do you mean by "push stuff"? From: Douglas Ferguson To: Wicket Mailing List List Date: 05/30/2012 03:19 PM Subject:wicket & ajax push Anybody doing any ajax push stuff using wicket? Douglas - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: AJAX-swappable bookmarkable unversioned tabs
Don't have much to offer re. menus, but if you're starting a new project, I'd recommend you use the latest version of Wicket (1.5.6) if at all possible. "There are three kinds of lies: lies, damn lies, and statistics." Benjamin Disraeli "Then there was the man who drowned crossing a stream with an average depth of six inches." W. I. E. Gates From: Alec Swan To: users@wicket.apache.org Date: 05/22/2012 07:29 PM Subject:Re: AJAX-swappable bookmarkable unversioned tabs Thoughts, anybody? On Mon, May 21, 2012 at 4:21 PM, Alec Swan wrote: > Hello, > > We are starting a new project where we need to implement a simple menu > using Wicket 1.4.17. In my previous project I implemented tabbing > using ajax-swappable panels. I really liked the smooth tab transition > you get with this approach. The two things I disliked were versionable > pages and that tabs were not bookmarkable. > > Is it possible to have the ajax-swappable bookmarkable tabs without > versioned pages? > > Thanks, > > Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: How to save the selected radio choice option in wicket
Just like anything else: You put the desired value in your model & Wicket handles "selecting" the correct button. From: chaitanya b To: users@wicket.apache.org Date: 05/17/2012 06:06 AM Subject:Re: How to save the selected radio choice option in wicket how can i set the property value then? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-save-the-selected-radio-choice-option-in-wicket-tp4642586p4642832.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: How to save the selected radio choice option in wicket
Conceptually, it's no different than any other form control. You associate the control with a named property in your model, & when the form is submitted that property will be populated with the chosen value. If the user hasn't chosen ANY value, yes, you can get null. From: chaitanya b To: users@wicket.apache.org Date: 05/17/2012 12:57 AM Subject:How to save the selected radio choice option in wicket Hi, I am new to Apache wicket. Can you please help me how to get the selected radio choice option in wicket.I have to save the some recruitment form with some fileds which we have to give dynamically .I have a static dropdown with list of form fileds like text filed, text area, radio button, check box. when i select the textbox and text area , the values are saved successfully with the correct values which i have given. Now requirement is when i select the radio button in the static drop down, by clicking the submit i have created the radio buttons with list of input values for the radio button options which i have given dynamically. But i didnt get the value which i have selected when saving that form. Am getting the null value when saving the form I did not get what the exact problem -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-save-the-selected-radio-choice-option-in-wicket-tp4642586.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Ajax Error in MSIE 8
We finally dug deep enough to find the root cause of the problem. We have a corporate framework that adds a layer to Wicket for company-specific functionality. I discovered this morning that my Maven POM declared dependencies for both Wicket AND our corporate layer. This caused my app to use a different version of Wicket than our corporate layer, which caused inconsistencies. The solution was to remove the Wicket dependency from my Maven POM, thus inheriting the Wicket version our corporate layer uses. And (surprise!) the problems went away. So, not Wicket's fault. Thought you'd like to know. Thanks for the help & insight. (Slinks away with red face...) From: "Richard W. Adams" To: users@wicket.apache.org Date: 05/11/2012 11:46 AM Subject:Re: Ajax Error in MSIE 8 I just found a key difference between the IE8 & IE9 behaviors in this code: f (typeof(window.XMLHttpRequest) != "undefined" && typeof(DOMParser) != "undefined") { var parser = new DOMParser(); xmldoc = parser.parseFromString(responseAsText, "text/xml"); } else if (window.ActiveXObject) { xmldoc = t.responseXML; } On our desktops, IE9 always goes into the first part of the if block, but IE8 always goes into the second part (after the elseif). Based on Google checks, it appears this might be due to browser security settings. Do you know if any special settings are required to make IE8 work correctly? From: Martin Grigorov To: users@wicket.apache.org Date: 05/11/2012 09:56 AM Subject:Re: Ajax Error in MSIE 8 I'm not sure why this fails for you. And why it fails only from time to time. But looking at this Javascript code I think it can be improved. File a ticket with a failing test case if possible. On Fri, May 11, 2012 at 5:46 PM, Richard W. Adams wrote: > We dug into wicket-ajax.js using this version of MSIE 8: > > > > We discovered the problem occurs in this code: > > > > *Wicket.Ajax.Request.prototype = {* > > ** > *// Method that processes the request states* > *stateChangeCallback: function() {* > > *.* > > *if (status == 200 || status == "") { // as > stupid as it seems, IE7 sets status to "" on ok* > *// response came without error* > *var responseAsText = t.responseText;* > ** > > *// parse the response if the callback > needs a DOM tree* > *if (this.parseResponse == true) {* > *var xmldoc; >* > *if > (typeof(window.XMLHttpRequest) != "undefined" && typeof(DOMParser) != > "undefined") { >var parser = new DOMParser();* > *xmldoc = > parser.parseFromString(responseAsText, "text/xml"); >* > *} else if > (window.ActiveXObject) {* > *xmldoc = > t.responseXML;* > *}* > *// invoke the loaded > callback with an xml document* > * > this.loadedCallback(xmldoc); * > *} else {* > *// invoke the loaded > callback with raw string* > * > this.loadedCallback(responseAsText);* > *}* > *if (this.suppressDone == false)* > *this.done();* > *}* > > > The offending code is: > > * xmldoc = t.responseXML;* > > Looking at the contents of t (a transport object), the*transport.responseText > * field is set to the expected xml message, but* transport.responseXML*is empty and has no XML message. Unfortunately, we could not see where > transport.responseXML variable should have been set. > > Does IE8 have known ajax bugs? Or is there a configuration setting we > should be using to make this work? Or something else? We're willing to dig > into the script more, but don't know where to look, as the Ajax processing > is asynchronous & we can't simply step through the code execution. > > > > > > > From:Martin Grigorov > To:users@wicket.apache.org > Date:05/11/2012 07:26 AM > > Subject:Re: Ajax Error in MSIE 8 > ---
Re: Ajax Error in MSIE 8
I just found a key difference between the IE8 & IE9 behaviors in this code: f (typeof(window.XMLHttpRequest) != "undefined" && typeof(DOMParser) != "undefined") { var parser = new DOMParser(); xmldoc = parser.parseFromString(responseAsText, "text/xml"); } else if (window.ActiveXObject) { xmldoc = t.responseXML; } On our desktops, IE9 always goes into the first part of the if block, but IE8 always goes into the second part (after the elseif). Based on Google checks, it appears this might be due to browser security settings. Do you know if any special settings are required to make IE8 work correctly? From: Martin Grigorov To: users@wicket.apache.org Date: 05/11/2012 09:56 AM Subject:Re: Ajax Error in MSIE 8 I'm not sure why this fails for you. And why it fails only from time to time. But looking at this Javascript code I think it can be improved. File a ticket with a failing test case if possible. On Fri, May 11, 2012 at 5:46 PM, Richard W. Adams wrote: > We dug into wicket-ajax.js using this version of MSIE 8: > > > > We discovered the problem occurs in this code: > > > > *Wicket.Ajax.Request.prototype = {* > > ** > *// Method that processes the request states* > *stateChangeCallback: function() {* > > *.* > > *if (status == 200 || status == "") { // as > stupid as it seems, IE7 sets status to "" on ok* > *// response came without error* > *var responseAsText = t.responseText;* > ** > > *// parse the response if the callback > needs a DOM tree* > *if (this.parseResponse == true) {* > *var xmldoc; >* > *if > (typeof(window.XMLHttpRequest) != "undefined" && typeof(DOMParser) != > "undefined") { >var parser = new DOMParser();* > *xmldoc = > parser.parseFromString(responseAsText, "text/xml"); >* > *} else if > (window.ActiveXObject) {* > *xmldoc = > t.responseXML;* > *}* > *// invoke the loaded > callback with an xml document* > * > this.loadedCallback(xmldoc); * > *} else {* > *// invoke the loaded > callback with raw string* > * > this.loadedCallback(responseAsText);* > *}* > *if (this.suppressDone == false)* > *this.done();* > *}* > > > The offending code is: > > * xmldoc = t.responseXML;* > > Looking at the contents of t (a transport object), the*transport.responseText > * field is set to the expected xml message, but* transport.responseXML*is empty and has no XML message. Unfortunately, we could not see where > transport.responseXML variable should have been set. > > Does IE8 have known ajax bugs? Or is there a configuration setting we > should be using to make this work? Or something else? We're willing to dig > into the script more, but don't know where to look, as the Ajax processing > is asynchronous & we can't simply step through the code execution. > > > > > > > From:Martin Grigorov > To:users@wicket.apache.org > Date:05/11/2012 07:26 AM > > Subject:Re: Ajax Error in MSIE 8 > -- > > > > Don't see anything suspicious. > You'll have to debug what happens in wicket-ajax.js ... > > On Fri, May 11, 2012 at 3:07 PM, Richard W. Adams wrote: > > Sorry. Should have provided more details: > > > > Wicket Version: 1.4.20 > > > > Operating System: Windows XP > > > > Scenario: Users clicks an icon with an Ajax onclick event. In the event > > handler on the server, we copy the value of one String variable to > another > > String variable in the model, then we call AjaxRequestTarget.addComponent > > twice, to update (1) the receiving text field, and (2) an associated > radio > > button. > > __ > > > > "There
Re: Ajax Error in MSIE 8
We dug into wicket-ajax.js using this version of MSIE 8: We discovered the problem occurs in this code: Wicket.Ajax.Request.prototype = { // Method that processes the request states stateChangeCallback: function() { . if (status == 200 || status == "") { // as stupid as it seems, IE7 sets status to "" on ok // response came without error var responseAsText = t.responseText; // parse the response if the callback needs a DOM tree if (this.parseResponse == true) { var xmldoc; if (typeof (window.XMLHttpRequest) != "undefined" && typeof(DOMParser) != "undefined" ) { var parser = new DOMParser(); xmldoc = parser.parseFromString(responseAsText, "text/xml"); } else if (window.ActiveXObject) { xmldoc = t.responseXML; } // invoke the loaded callback with an xml document this .loadedCallback(xmldoc); } else { // invoke the loaded callback with raw string this .loadedCallback(responseAsText); } if (this.suppressDone == false) this.done(); } The offending code is: xmldoc = t.responseXML; Looking at the contents of t (a transport object), the transport.responseText field is set to the expected xml message, but transport.responseXML is empty and has no XML message. Unfortunately, we could not see where transport.responseXML variable should have been set. Does IE8 have known ajax bugs? Or is there a configuration setting we should be using to make this work? Or something else? We're willing to dig into the script more, but don't know where to look, as the Ajax processing is asynchronous & we can't simply step through the code execution. From: Martin Grigorov To: users@wicket.apache.org Date: 05/11/2012 07:26 AM Subject:Re: Ajax Error in MSIE 8 Don't see anything suspicious. You'll have to debug what happens in wicket-ajax.js ... On Fri, May 11, 2012 at 3:07 PM, Richard W. Adams wrote: > Sorry. Should have provided more details: > > Wicket Version: 1.4.20 > > Operating System: Windows XP > > Scenario: Users clicks an icon with an Ajax onclick event. In the event > handler on the server, we copy the value of one String variable to another > String variable in the model, then we call AjaxRequestTarget.addComponent > twice, to update (1) the receiving text field, and (2) an associated radio > button. > __ > > "There are three kinds of lies: lies, damn lies, and statistics." > Benjamin Disraeli > > "Then there was the man who drowned crossing a stream with an average > depth of six inches." > W. I. E. Gates > > > > > From: Martin Grigorov > To: users@wicket.apache.org > Date: 05/11/2012 02:26 AM > Subject:Re: Ajax Error in MSIE 8 > > > > Hi, > > Which version of Wicket ? > In what conditions this happen ? I.e. do you click on a link or do you > submit a form or ... > > On Thu, May 10, 2012 at 11:33 PM, Richard W. Adams > wrote: >> I'm getting Ajax errors that seems to occur only in Internet Explorer 8 >> (same code works fine in IE9 & Firefox). I'm in a corporate environment >> where IE8 support is a requirement, so wanted to see if anyone has seen >> this before & knows of a fix. The Wicket Ajax trace is below; the parser >> says it can't find the root element in the Ajax response. We've seen > this >> same error on various pages, though it doesn't ALWAYS occur: >> >> >> INFO: focus removed from wicket-generated-id-18 >> INFO: >> INFO: Initiating Ajax GET request on >> > ?wicket:interface=:6:form:main-box:mp-form:primary-track-box:primary-icon::IBehaviorListener:1:&random=0.9122150377237917 >> INFO: Invoking pre-call handler(s)... >> INFO: Received ajax response (4130 characters) >> INFO: >> > id="successFeedback91" >>> id="errorFeedback94"
Re: Ajax Error in MSIE 8
Sorry. Should have provided more details: Wicket Version: 1.4.20 Operating System: Windows XP Scenario: Users clicks an icon with an Ajax onclick event. In the event handler on the server, we copy the value of one String variable to another String variable in the model, then we call AjaxRequestTarget.addComponent twice, to update (1) the receiving text field, and (2) an associated radio button. __ "There are three kinds of lies: lies, damn lies, and statistics." Benjamin Disraeli "Then there was the man who drowned crossing a stream with an average depth of six inches." W. I. E. Gates From: Martin Grigorov To: users@wicket.apache.org Date: 05/11/2012 02:26 AM Subject:Re: Ajax Error in MSIE 8 Hi, Which version of Wicket ? In what conditions this happen ? I.e. do you click on a link or do you submit a form or ... On Thu, May 10, 2012 at 11:33 PM, Richard W. Adams wrote: > I'm getting Ajax errors that seems to occur only in Internet Explorer 8 > (same code works fine in IE9 & Firefox). I'm in a corporate environment > where IE8 support is a requirement, so wanted to see if anyone has seen > this before & knows of a fix. The Wicket Ajax trace is below; the parser > says it can't find the root element in the Ajax response. We've seen this > same error on various pages, though it doesn't ALWAYS occur: > > > INFO: focus removed from wicket-generated-id-18 > INFO: > INFO: Initiating Ajax GET request on > ?wicket:interface=:6:form:main-box:mp-form:primary-track-box:primary-icon::IBehaviorListener:1:&random=0.9122150377237917 > INFO: Invoking pre-call handler(s)... > INFO: Received ajax response (4130 characters) > INFO: > id="successFeedback91" >>>> encoding="wicket1" >> encoding="wicket1" >> > ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Could not > find root element > INFO: Invoking post-call handler(s)... > INFO: Invoking failure handler(s)... > > > ** > > This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. > ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Persistence.
Gosh, you can use Hibernate if you want, but I write plain DAO classes with JDBC & Wicket & they work just fine. No fuss, no muss. Just my take on it, though. I know there are some that like Hibernate. But try as I might, I've never been able to justify yet another third party library for my needs. "There are three kinds of lies: lies, damn lies, and statistics." Benjamin Disraeli "Then there was the man who drowned crossing a stream with an average depth of six inches." W. I. E. Gates From: JASON HOLT To: Date: 05/08/2012 03:37 PM Subject:Persistence. I'll repeat my plea for patience as I'm new to Java and Wicket, but have some minimal experience with ASP.net forms (not MVC). I've reached that point in the learning process where I want to interact with a database and I wish to use entities and Hibernate to make it easier. From what I've seen in various blogs and forums, some say you shouldn't use entities as models, yet others do it with LDMs. Since I'm taking baby steps, I want to start by using entities as models, unless someone convinces me I'm wasting my time. Following the basic Hibernate tutorials for persisting simple classes, I've managed to make the following work in Wicket. In the LDM load... @Override public Person load() { Session session = WicketApp.sessionFactory.openSession(); session.beginTransaction(); Person person = (Person) session.get(Person.class, 1L); session.getTransaction().commit(); session.close(); return person; } In the form I update the evil entity model with text boxes, using a CPM containing the LDM. In the submit button... public void onSubmit() { Session session = WicketApp.sessionFactory.openSession(); session.beginTransaction(); session.update(ldm.getObject()); session.getTransaction().commit(); session.close(); this.setResponsePage(EndPage.class); } The sessionFactory is a static member of the WicketApp application class, initialized in the init() method. This seems to work, but I suppose there are all kinds of faulty design patterns used here. My main concern is... how can I do this without opening a new Hibernate session in onSubmit()? During postback, I think I should be able to reuse the same session opened at ldm.load() in onSubmit() also, as it all occurs in the same request. Is this possible? Thanks for your assistance. Please feel free to point out every flaw. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Calling wicket from javascript
Hard to say without details. Are you not getting the behavior you expect (and what is that behavior?). Are you getting an error message? "RAM /abr./: Rarely Adequate Memory." From: jcf1974 To: users@wicket.apache.org Date: 05/07/2012 07:07 AM Subject:Calling wicket from javascript Hello, I'm new in this forum, and i love wicket!!! My question is: What wrong with this code? @Override protected IAjaxCallDecorator getAjaxCallDecorator() { return new AjaxPreprocessingCallDecorator(super.getAjaxCallDecorator()) { private static final long serialVersionUID = 1L; @Override public CharSequence preDecorateScript(CharSequence script) { return "function callWicket(){" + script + "}; $('.search-div').slideDown('slow',callWicket());"; } }; } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Calling-wicket-from-javascript-tp4614627.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Unusual problem is coming in rendering component
It means it's looking for a method called getPostTextField() in your model, but not finding one. From: kshitiz To: users@wicket.apache.org Date: 05/02/2012 02:08 PM Subject:Unusual problem is coming in rendering component Hi, I am trying to render a text field : Java code: *final RequiredTextField postTextField = new RequiredTextField( "postTextField"); *postForm.add(postTextField);* Html code ** But I am gettin the error: Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class domain.PostDomain expression: postTextField at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:499) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:341) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:244) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:97) at org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:134) at org.apache.wicket.Component.getDefaultModelObject(Component.java:1668) at org.apache.wicket.Component.getDefaultModelObjectAsString(Component.java:1695) at org.apache.wicket.markup.html.form.FormComponent.getModelValue(FormComponent.java:1211) at org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:837) at org.apache.wicket.markup.html.form.TextField.onComponentTag(TextField.java:108) at org.apache.wicket.Component.internalRenderComponent(Component.java:2510) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1534) at org.apache.wicket.Component.internalRender(Component.java:2369) at org.apache.wicket.Component.render(Component.java:2297) Now, when I replace *postTextField* with *post*, no error comes...!!! That is, if my java code is: *final RequiredTextField postTextField = new RequiredTextField( "post"); and Html code is: ** The code runs fine... What can be the problem...? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Unusual-problem-is-coming-in-rendering-component-tp4604163.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Radio Choice Weirdness
Oops. Got it figured out. The page class was trying to store the choice in a String variable instead of a MilepostModel variable. All is well now. Thanks! "RAM /abr./: Rarely Adequate Memory." From: "Richard W. Adams" To: users@wicket.apache.org Cc: cdsch...@up.com Date: 04/25/2012 10:24 AM Subject:Re: Radio Choice Weirdness Ok, I tried changing it to RadioChoice (code below). However, the onSelectionChanged() method STILL gets a String argument, as verified by the printf() output "New selection is a class java.lang.String: End (538.200)." But following that output, an exception is now thrown. I REALLY don't understand what's going on here. I've studied the Javadocs for RadioChoice, but they seem awfully sketchy, and don't shed any light on this. Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to com.uprr.enm.web.track.mend.MilepostModel at com.uprr.enm.web.track.mend.MendStepChooseMP$4.getIdValue( MendStepChooseMP.java:1) at org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue( AbstractSingleSelectChoice.java:166) at org.apache.wicket.markup.html.form.FormComponent.getValue( FormComponent.java:911) at org.apache.wicket.markup.html.form.RadioChoice.onComponentTagBody( RadioChoice.java:422) at org.apache.wicket.Component.renderComponent(Component.java:2725 ) ... 198 more == //-- private RadioChoice createTestChoice(final String id, final TrackModel track) { final List choices = new ArrayList(); choices.add(new MilepostModel(track.getStartMP(), "Start")); choices.add(new MilepostModel(track.getEndMP(), "End")); choices.add(new MilepostModel("Other")); final ChoiceRenderer renderer = new ChoiceRenderer() { private static final long serialVersionUID = 1L; @Override public String getIdValue(final MilepostModel model, final int index) { final Milepost mp = model.getObject(); return mp == null ? "" : mp.toString(); } }; final RadioChoice choice = new RadioChoice(id, choices, renderer) { private static final long serialVersionUID = 1L; @Override protected void onSelectionChanged(final Object newSelection) { System.out.printf("New selection is a %s: %s%n", newSelection.getClass(), newSelection); } @Override protected boolean wantOnSelectionChangedNotifications() { return true; } }; return choice; } The milepost model class: package com.uprr.enm.web.track.mend; import org.apache.wicket.model.IModel; import com.uprr.eni.read.vo.mp.Milepost; //-- /** * Data model for milepost values. * @author Dick Adams * @.copyright Union Pacific 2012 */ class MilepostModel implements IModel { private static final long serialVersionUID = 1L; private final String text; private Milepost mp; //-- /** * Constructor. * @param value The milepost value. * @param text The textual description of the value. For example, if it represents the end * of a milepost range, the text might be {@code End}. */ public MilepostModel(final Milepost value, final String text) { mp = value; this.text = text; } //-- /** * Constructor with no value. * @param text The textual description of a {@code null} value. */ public MilepostModel(final String text) { this(null, text); } //-- @Override public void detach() { mp = null; } //-- @Override public Milepost getObject() { return mp; } //-- @Override public void setObject(final Milepost object) { mp = object; } //-- @Override public String toString() { return mp == null ? text : String.format("%s (%s)", text, mp.toString()); } //-- } From: Sven Meier To: users@wicket.apache.org Date: 04/25/2012 09:55 AM Subject:
Re: Radio Choice Weirdness
Ok, I tried changing it to RadioChoice (code below). However, the onSelectionChanged() method STILL gets a String argument, as verified by the printf() output "New selection is a class java.lang.String: End (538.200)." But following that output, an exception is now thrown. I REALLY don't understand what's going on here. I've studied the Javadocs for RadioChoice, but they seem awfully sketchy, and don't shed any light on this. Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to com.uprr.enm.web.track.mend.MilepostModel at com.uprr.enm.web.track.mend.MendStepChooseMP$4.getIdValue( MendStepChooseMP.java:1) at org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue( AbstractSingleSelectChoice.java:166) at org.apache.wicket.markup.html.form.FormComponent.getValue( FormComponent.java:911) at org.apache.wicket.markup.html.form.RadioChoice.onComponentTagBody( RadioChoice.java:422) at org.apache.wicket.Component.renderComponent(Component.java:2725 ) ... 198 more == //-- private RadioChoice createTestChoice(final String id, final TrackModel track) { final List choices = new ArrayList(); choices.add(new MilepostModel(track.getStartMP(), "Start")); choices.add(new MilepostModel(track.getEndMP(), "End")); choices.add(new MilepostModel("Other")); final ChoiceRenderer renderer = new ChoiceRenderer() { private static final long serialVersionUID = 1L; @Override public String getIdValue(final MilepostModel model, final int index) { final Milepost mp = model.getObject(); return mp == null ? "" : mp.toString(); } }; final RadioChoice choice = new RadioChoice(id, choices, renderer) { private static final long serialVersionUID = 1L; @Override protected void onSelectionChanged(final Object newSelection) { System.out.printf("New selection is a %s: %s%n", newSelection.getClass(), newSelection); } @Override protected boolean wantOnSelectionChangedNotifications() { return true; } }; return choice; } The milepost model class: package com.uprr.enm.web.track.mend; import org.apache.wicket.model.IModel; import com.uprr.eni.read.vo.mp.Milepost; //-- /** * Data model for milepost values. * @author Dick Adams * @.copyright Union Pacific 2012 */ class MilepostModel implements IModel { private static final long serialVersionUID = 1L; private final String text; private Milepost mp; //-- /** * Constructor. * @param value The milepost value. * @param text The textual description of the value. For example, if it represents the end * of a milepost range, the text might be {@code End}. */ public MilepostModel(final Milepost value, final String text) { mp = value; this.text = text; } //-- /** * Constructor with no value. * @param text The textual description of a {@code null} value. */ public MilepostModel(final String text) { this(null, text); } //-- @Override public void detach() { mp = null; } //-- @Override public Milepost getObject() { return mp; } //-- @Override public void setObject(final Milepost object) { mp = object; } //-- @Override public String toString() { return mp == null ? text : String.format("%s (%s)", text, mp.toString()); } //-- } From: Sven Meier To: users@wicket.apache.org Date: 04/25/2012 09:55 AM Subject:Re: Radio Choice Weirdness >When Wicket calls my onSelectionChanged(), the argument is the display string, not the id value. Your RadioChoice is working on string choices so it will hand you the selected string. I'd suggest to let your RadioChoice work with ints or preferably directly on the Milepost objects: final RadioChoice choice = new RadioChoice(...
Radio Choice Weirdness
My understanding of this class must be faulty. When Wicket calls my onSelectionChanged(), the argument is the display string, not the id value. For example, I'm expecting a milepost value like "123.456", but instead I get "End (123.456)" (the display value). Here's the code. can anyone see what I'm doing wrong? private RadioChoice createMilepostChoice(final String id, final TrackModel track) { final Milepost startMP = track.getStartMP(); final Milepost endMP = track.getEndMP (); final List choices = Arrays.asList(new String[]{format(START, startMP), format(END, endMP), OTHER}); final ChoiceRenderer renderer = new ChoiceRenderer() { private static final long serialVersionUID = 1L; @Override public Object getDisplayValue(final String model) { return model; } @Override public String getIdValue(final String model, final int index) { String value; switch (index) { case 0: value = startMP.toString(); break; case 1 : value = endMP.toString(); break; default : value = ""; } return value; } }; final RadioChoice choice = new RadioChoice(id, choices, renderer) { private static final long serialVersionUID = 1L; @Override protected void onSelectionChanged(final Object new selection) { final String selection = (String)newSelection; if (track == primaryTrack) { primaryMpChoice = selection; } else { secondaryMpChoice = selection; } } @Override protected boolean wantOnSelectionChangedNotifications() { return true; } }; return choice; } ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
RadioChoice vs. RadioGroup
Can someone explain the important differences (besides the API) between RadioChoice & RadioGroup? What scenarios/factors would make one use one instead of the other? What are the tradeoffs? Etc. From my quick (perhaps naive) reading, they seem like equally plausible ways of doing the same thing. I looked at the javadocs, but they didn't give any useful information to help me choose between the two classes. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: "It is a better practice to push changes to state rather than pull"
I'm no Wicket expert, but as a general rule it's almost always better to be notified of an event or state change than to constantly poll for it (think of the child in the back seat on a long trip constantly asking "Are we there yet?") From: Andrew Geery To: users@wicket.apache.org Date: 04/16/2012 01:45 PM Subject:"It is a better practice to push changes to state rather than pull" In the Javadoc for the Component#onConfigure() method, it states (in a paragraph dealing with setting whether a component is visible and/or enabled): "It is a better practice to push changes to state rather than pull." [ http://wicket.apache.org/apidocs/1.5/org/apache/wicket/Component.html#onConfigure() ]. My reading of this sentence is that it is contrasting state change, where changes should be pushed to the component, with data change, where changes are pulled by the component from the model (i.e, change the model, not the component). Does that sound correct? Are there state changes other than being visible and being enabled that should be done in onConfigure? Thanks Andrew ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: field values
If you can detect the tab switch event, it should be a simple matter to copy the field values from one location to the other. From: mnish tosh To: users@wicket.apache.org Date: 04/05/2012 02:01 PM Subject:field values Hi, This is the situation: I have a page with two tabs, on each of these tabs there are form fields. Some of the fields are the same on both the tabs. What I want to be able to do is when I click on the tabs back and forth the values of the fields be automatically taken to the other tab. Is this possible to do in wicket or is it too much to ask :). Thank you. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: how to make a div containing ajax link clickable
add(new AjaxEventBehavior("onclick") "RAM /abr./: Rarely Adequate Memory." From: jason To: users@wicket.apache.org Date: 04/03/2012 03:02 PM Subject:how to make a div containing ajax link clickable Hi, What is the best way to make a div clickable? I'd like to use an AjaxLink such that whenever a user clicks within the outerdiv I can handle it within the onClick method of AjaxLink some text Thanks, Jason -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-make-a-div-containing-ajax-link-clickable-tp4530016p4530016.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
RE: Accessing .properties file
This is really a Maven question, not Wicket. You'll probably get better answers from a Maven forum. From: SudeepShakya To: users@wicket.apache.org Date: 03/30/2012 07:15 AM Subject:RE: Accessing .properties file I mean that if sample.properties is the required file, then how to define in the pom.xml The sample.properties file is in the folder src/java. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Accessing-properties-file-tp4518748p4518872.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: log4j.properties
This is a log4j issue, not Wicket. However, if memory serves, you can set a system property before starting Tomcat. Something like: -Dlog4j.configuration=name.and.location.of.your.log4j.properties.file A log4j forum is probably the best place to query the current "best practice" on this. From: JASON HOLT To: Date: 03/28/2012 12:49 PM Subject:log4j.properties I'm new to Java, Tomcat, and Wicket. I apologize in advance for asking the obvious. Tomcat logs complain that log4j is not properly configured. I placed my log4j.properties file in the /WEB-INF/classes folder and errors stop. I would like ALL Wicket applications to share a single log4j.properties file so I don't have to remember to include it in every application I deploy. Can I configure Tomcat to accomplish this? If so, how? Using Tomcat 7.026, JDK 7u3, and Wicket 1.5.5 Thanks. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Creating a submit form which takes date and a string as input and displays the data from database(mysql) using simple jdbc
Just parse the date string into a Timestamp. That's Java, not Wicket. "RAM /abr./: Rarely Adequate Memory." From: SudeepShakya To: users@wicket.apache.org Date: 03/26/2012 11:03 PM Subject:Re: Creating a submit form which takes date and a string as input and displays the data from database(mysql) using simple jdbc I want to know how to input date into database using form. I am using Timestamp in mysql. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Creating-a-submit-form-which-takes-date-and-a-string-as-input-and-displays-the-data-from-database-myc-tp4505124p4507896.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Hide Table Rows in Column 1 when displaying the table
Easily done with style sheets. From: karthik To: users@wicket.apache.org Date: 03/26/2012 08:02 AM Subject:Hide Table Rows in Column 1 when displaying the table Hi , I would like to have a table with 3 columns and 5 rows. The first Column is a Category , and the other columns are types and availability Is there a way to achieve this kind of a Table , where the Column1 only first row is visible, the other rows are invisible. Thanks in advance. Example Column 1 | Column 2 | Column 3 FruitMango Available Apple Available GrapesNA OrangeNA Papaya Available Color RedStrong Blue Light Green Moderate YellowStrong Black Moderate -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Hide-Table-Rows-in-Column-1-when-displaying-the-table-tp4505703p4505703.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: AjaxLink.onClick() Not Triggered
Hm.. more mystery. I put a break point on wicketAjaxGet. But it never gets executed. Clicking the link, apparently does absolutely nothing. Doesn't even cause the Javascript to be called. Anyone have any ideas? From: Andrea Del Bene To: users@wicket.apache.org Date: 02/19/2012 07:26 AM Subject:Re: AjaxLink.onClick() Not Triggered Hi, at first glance I can't say what's wrong with your code, but you should try debugging wicketAjaxGet function with FireBug or some other dev tool. In this way you should find why there's no AJAX call. > I have an Ajax link in a drop down menu, created like this: > > final MenuChoice item = new MenuChoice("Delete") { > private static final long serialVersionUID = 1L; > > @Override protected AbstractLink newLink(final > String id) { > final AjaxLink link = new > AjaxLink(id) { > private static final long > serialVersionUID = 1L; > @Override public void > onClick(final AjaxRequestTarget > target) { > confirmer.confirm(model.getTrack(), target); > } > }; > return link; > } > }; > > The generated HTML looks like this: > > Delete > > However, when I click the link, the onClick() handler is not called. The > Wicket Ajax debug window shows no Ajax activity occurring. > > Can anyone see what I'm doing wrong? > > ** > > This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. > ** > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **