Dynamic Form Best Architecture
Hello, I'm a new user of Wicket and I would like to have your opinion. Here is what I'm trying to do : Step 1 : My application calls a web service to retrieve some data. Step 2 : Based on these data the application must build a big web form, this form ask the user many questions (15-20 for instance, most of the time yes/no questions (without submit button), sometimes new inputs may appear etc). Each time a response is given a new question appears (conditions of appearance can be the previous response and / or data retrieved by the web service). At the beginning all the questions are invisible. I have multiple options to architecture this : - Initialize all the panels for each question and make them invisible at the beginning. Use Ajax on each Radio Button (yes / no), checkbox etc and make them appear. The problem as see with this solution is that it forces me to add all the panels to the form and the logic of appearance is fragmented in each panel which handle the question. The other problem is that we need the server (Ajax for each response) even though it isn't needed once we retrieved the data from the web service. The last problem I see is that how do I manage to hide all the children of a panel if the user decide to go back and change his response to a previous question. - Same as previous but I add dynamically the panel / question for each response. However once again the logic of appearance is fragmented in each question and it is difficult to maintain. - Same as previous but all in JavaScript. I will need to convert all the data from the web service to JavaScript variables not really the wicket Way... - Maybe I could use Nested Forms but I lack the required distance to be a good judge. I don't really know if is really the best response to my problem. - Finally What about the form Component panel ? Note : There are in fact many big forms depending on the user profile. If you could give me your take on this I will be really grateful. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-Form-Best-Architecture-tp4666065.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
Ajax exception handling on client side
Hi, How can I handle exceptions occurred at the server side on the client side (with Ajax requests)? At the client side, the javascript event ' /ajax/call/failure' is only fired when the connection fails (I think), but when the there's an unhandled exception on the server side, the events ' /ajax/call/success' and '/ajax/call/complete' fired with a redirect message. I know I can just try...catch each ajax component, but I was looking for something more global to the whole application. Can anyone help me? -- André Camilo Software Architect Premium Minds Av. Marquês de Tomar nº69, 1º Andar 1050-154 Lisboa www.premium-minds.comhttp://www.premium-minds.com/ Geral: +351 217 817 555 Tlm: +351 914 515 010 andre.cam...@premium-minds.commailto:andre.cam...@premium-minds.com
Re: Ajax exception handling on client side
Hi, See org.apache.wicket.settings.IExceptionSettings#setAjaxErrorHandlingStrategy Martin Grigorov Wicket Training and Consulting On Fri, May 30, 2014 at 12:46 PM, Andre Camilo andre.cam...@premium-minds.com wrote: Hi, How can I handle exceptions occurred at the server side on the client side (with Ajax requests)? At the client side, the javascript event ' /ajax/call/failure' is only fired when the connection fails (I think), but when the there's an unhandled exception on the server side, the events ' /ajax/call/success' and '/ajax/call/complete' fired with a redirect message. I know I can just try...catch each ajax component, but I was looking for something more global to the whole application. Can anyone help me? -- André Camilo Software Architect Premium Minds Av. Marquês de Tomar nº69, 1º Andar 1050-154 Lisboa www.premium-minds.comhttp://www.premium-minds.com/ Geral: +351 217 817 555 Tlm: +351 914 515 010 andre.cam...@premium-minds.commailto:andre.cam...@premium-minds.com
WebSocket with InitParameter
Hello Wickets, I am doing some extensive testing with the native-websocket implementation in preparation for wicket-7 conversion of my apps. The websocket part is going to be used for an internal messaging system which sends/broadcasts system notifications to the logedin users. This all works thanks to the magic of wicket really well implementing the WebSocketBehavior, but Ok the problem I got is how to change the maxIdleTime for an implementation with Jetty-9.1 due to timout problesm. Normally you have an InitParameter in the web.xml, but the WebSocketUpgradeFilter is actually not initialized by reading the web.xml but by the WicketServerApplicationConfig d uring class reading as specified in the javax.websocket.api. So there are actually no initparameters passed to the filter! The only way I figured out how to set the maxIdleTime would be in the jetty general configuration for all applications, but i really would like to be able to set it just for one application only. Any idea how to set these parameter? By the way this also applies to the other parameters like MaxBinaryMessageBufferSize, setMaxTextMessageBufferSize etc. which are part of the javax.websocket.Session API. Thanks a lot for the help Jan Moxter
Re: WebSocket with InitParameter
Hi, See https://issues.apache.org/jira/browse/WICKET-5453 Martin Grigorov Wicket Training and Consulting On Fri, May 30, 2014 at 4:18 PM, Jan Moxter jan.mox...@innobix.com wrote: Hello Wickets, I am doing some extensive testing with the native-websocket implementation in preparation for wicket-7 conversion of my apps. The websocket part is going to be used for an internal messaging system which sends/broadcasts system notifications to the logedin users. This all works thanks to the magic of wicket really well implementing the WebSocketBehavior, but Ok the problem I got is how to change the maxIdleTime for an implementation with Jetty-9.1 due to timout problesm. Normally you have an InitParameter in the web.xml, but the WebSocketUpgradeFilter is actually not initialized by reading the web.xml but by the WicketServerApplicationConfig d uring class reading as specified in the javax.websocket.api. So there are actually no initparameters passed to the filter! The only way I figured out how to set the maxIdleTime would be in the jetty general configuration for all applications, but i really would like to be able to set it just for one application only. Any idea how to set these parameter? By the way this also applies to the other parameters like MaxBinaryMessageBufferSize, setMaxTextMessageBufferSize etc. which are part of the javax.websocket.Session API. Thanks a lot for the help Jan Moxter
Re: WebSocket with InitParameter
Thanks for the indication, best list ever! Jan - Original Message - From: Martin Grigorov mgrigo...@apache.org To: users@wicket.apache.org, Jan Moxter jan.mox...@innobix.com Sent: Friday, May 30, 2014 9:27:51 AM Subject: Re: WebSocket with InitParameter Hi, See https://issues.apache.org/jira/browse/WICKET-5453 Martin Grigorov Wicket Training and Consulting On Fri, May 30, 2014 at 4:18 PM, Jan Moxter jan.mox...@innobix.com wrote: Hello Wickets, I am doing some extensive testing with the native-websocket implementation in preparation for wicket-7 conversion of my apps. The websocket part is going to be used for an internal messaging system which sends/broadcasts system notifications to the logedin users. This all works thanks to the magic of wicket really well implementing the WebSocketBehavior, but Ok the problem I got is how to change the maxIdleTime for an implementation with Jetty-9.1 due to timout problesm. Normally you have an InitParameter in the web.xml, but the WebSocketUpgradeFilter is actually not initialized by reading the web.xml but by the WicketServerApplicationConfig d uring class reading as specified in the javax.websocket.api. So there are actually no initparameters passed to the filter! The only way I figured out how to set the maxIdleTime would be in the jetty general configuration for all applications, but i really would like to be able to set it just for one application only. Any idea how to set these parameter? By the way this also applies to the other parameters like MaxBinaryMessageBufferSize, setMaxTextMessageBufferSize etc. which are part of the javax.websocket.Session API. Thanks a lot for the help Jan Moxter
[ANNOUNCE] Wicket Bootstrap 0.9.3 is released
Hi, Wicket Bootstrap 0.9.3 has been released and soon will be available at Maven Central. The major change is the upgrade of Bootstrap to 3.1.1. The Git short log is: David Beer (5): Added FontAwsome CDN Reference Changed the Class to extend UrlResourceReference and pass the CDN url in the constructor Added support for a BootstrapStateless Form Added JavaDoc to class definition. Change the constructor layout o chain the constructor. Ernesto Reinaldo Barreiro (32): At a stateless pure JavaScript/client side component. wrap models to be able to user resource models add an example fo client side tabs get rid of extra iteration of tabs. introduce isActive rename model make tabs dynamic get rid of un-needed space improve text improve java doc rename some methods index start counting at 0 to be compatible with classical TabeedPanel add a test unit for client side tabs add more tests and add CSS class specific to each tab get rid of compilation warnings get rid of warnings get rid of unused import get rid of generic warning and un used import get rid of unused import get rit of unused import and generic warnings use Void for links fix a missing Void link another void link fix eclipse warning about missing default case modal model is limited to be IModeString and this is not needed. generify modal and add close and show methods. get rid of unused import get rid of generic warnings a convenient Icon behavior Revert a convenient Icon behavior white space not shown even with label not empty. add factory methods for AJAX link: same as BootstrapAjaxButton setRenderBodyOnly not needed Javadoc fix Martin Tzvetanov Grigorov (49): Code formatting (tabs - spaces) and Javadoc. Fixes #316 - Check all buttons until an active one is found Update to wicket-webjars 0.4.1 Fix the used versions of TB and Bootswatch Closes #324 - Upgrade Bootstrap Tour to latest stable - 0.9.0 Allow .css.map in dev mode. Library updates Closes #322 - Add the menu divider in onInitialize() only when: Upgrade Less4j to 1.3.0 Upgrade TB and Bootswatch themes to 3.1.1 Issue #322 - Fix the condition when the divider CSS class should be set in case of a ListView Remove a debug statement Remove the pattern for *.css.map for the samples https://github.com/twbs/bootstrap/issues/10884 Closes #330 - Modal sizes Issue #330 Upgrade datepicker JS and CSS from https://raw2.github.com/eternicode/bootstrap-datepicker/master/css/datepicker3.css Closes #332 - use higher zIndex Small improvements suggested by FindBugs: Issue #339 - Minor restructuring of SessionThemeProvider class. Calculate the cdnUrl lazily to give chance the Bootstrap settings to be installed Render the theme's css reference Fix test expectation - source maps are disabled Upgrade to Wicket 6.14 Remove deprecated field that is not used since several releases Upgrade Less4j to 1.5.1 Remove unused property for lesscss-engine Update Less4j to 1.5.2 (scripting support) Fixes #360 - set a default size for the Modal Issue #340 - rework ProgressBar to support non-upload scenaria and stacks Issue #340 - add javadocs and make it easier to have a ProgressBar with a single (default) stack Issue #340 - Add tests for ProgressBar Issue #340 - Minor cleanup before PR review Issue #340 - Make UpdatableProgressBar a specialization of ProgressBar Issue #340 - Simplify UploadProgressBar to duplicate the logic from ProgressBar as less as possible Issue #340 - Move #createLabelModel() to be a method of the Stack itself. Issue #340 - add checks for the value of the progress Issue #340 - extract Stack as a proper class. Fixes #367 - Do not contribute the CSS reference - it will be contributed by the ITheme in use. Minor javadoc improvements Use wicket-jquery-selectors 0.0.4-SNAPSHOT because of https://github.com/l0rdn1kk0n/wicket-bootstrap/issues/365 https://github.com/l0rdn1kk0n/wicket-bootstrap/issues/365 - Use utility methods Strings2.getMarkupId() and Strings2.escapeMarkupId() Use spaces instead of tabs for consistency Issue #364 - Fallback to the labelModel when there is no explicit default label in the i18n resources for this id Fixes #369 - Upgrade Font Awesome to 4.1.0 Upgrade dependencies Merge branch 'master' into dependencies-upgrade Michael Haitz (19): [maven-release-plugin] prepare for next development iteration Update README.md Update README.md upgrade to 3.1.0 and add updated bootswatch themes (there are two new themes: superhero, lumen) upgrade to 3.1.0 and add updated
ComponentFeedbackPanel near radio group not working
I am mystified. I have an error panel at the top of my page that show the errors for the page, but near each control is ALSO a ComponentFeedbackPanel to show the error near the control. These work fine for every control except this radio group. The error shows up top, has the right label, but does not show near the control. The tag is there, the component is added to the hierarchy. I looked a view source and could see the error messages near the other controls, but not this one. I scanned to see if I accidentally hide the thing anywhere, and it does not appear so. HTML: div wicket:id=taskForceContainer class=checks wall of text deleted for brevity wicket:container wicket:id=taskForceRadio ul id=taskForceRadio li input wicket:id=taskForceRadioYes type=radio name=adtype /labelYes/label /li li input wicket:id=taskForceRadioNo type=radio name=adtype /labelNo/label /li /ul /wicket:container /div Java: //TASK FORCE WebMarkupContainer taskForceContainer = new WebMarkupContainer(taskForceContainer){ @Override public boolean isVisible() { return isEnabledInHierarchy() super.isVisible(); } }; oagForm.add(taskForceContainer); RadioGroupShareRequest group = new RadioGroupShareRequest(taskForceRadio, new PropertyModelShareRequest(request, sharingTAAgreement)){ @Override public boolean isVisible() { return isEnabledInHierarchy(); } }; group.setRequired(true); group.setLabel(new ModelString(Task Force Agreement)); taskForceContainer.add(group); taskForceContainer.setVisible(!isFCF()); group.add(new RadioString(taskForceRadioYes, new ModelString(Y))); group.add(new RadioString(taskForceRadioNo, new ModelString(N))); taskForceContainer.add(new Label(taskForceRadioReadOnly, new ModelString(decodeYesNo(request.getSharingTAAgreement( { @Override public boolean isVisible() { return !this.getParent().get(taskForceRadio).isEnabledInHierarchy(); } }); taskForceContainer.add(new ComponentFeedbackPanel(errTaskForce, group).setEscapeModelStrings(false)); You can see that I am adding the group to the componentfeedbackpanel and so forth. Any idea why this control isn't whoing the messages? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ComponentFeedbackPanel-near-radio-group-not-working-tp4666077.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