Lessons from Wicket Cookbook
While clearing out my drafts folder I found this. While reading through the Wicket cookbook by Igor ( http://www.packtpub.com/apache-wicket-cookbook/book) I noticed that I was learning a ton of new interesting stuff about the Wicket way of doing things, so I kept notes. This draft is from over a year ago (Mar 2011), but the information is still accurate for the book.* I highly recommend this book.* -Clint - Form override onValidate input.getConvetedInput() gets value before its been stored in the input's model pg 11 - Single validator displaying multiple messages: pg 16 - Better way to set custom variables for error messages: pg 17 (error.setVariable(max, max);) - FormComponents automatically know how to convert to the model object because the implement IObjectClassAwareModel, otherwise formField.setType(Class) is required pg 31 - DropDownChoice wantOnSelectionChange (pg 38) makes a select box autosubmitting - wicket:container / (pg 42) is the same as adding a component to a div and calling setRenderBodyOnly(true) - getConvertedInput can return a new instance of an object, and in updateModel you would copy the values over into the existing object, if you wanted to update the existing object (pg 45), be sure not to call super.updateModel() though - We can use Wicket's metadata facility to store data in the Wicket session without forcing a specific sub-class of session (pg 52) - aTextField.clearInput() forces a value= on a text field ensuring that it is blanked out even if the user had typed something before (pg 57) Validation failure would otherwise retain the value and keep displaying it. - The AttributeAppender behavior doesn't allow for the replace model to be set after the constructor, and getReplaceModel is final so the implementation as listed on pg 62 is the best way to update a FormComponent's class when checking isValid() - Page 64 - remember to add form.visitChildren calls after all children have been added to the form. Making the call in onInitialize isn't wise since that call actually happens as part of the 'add()' call in it's parent! - Question: Would separate components in separate app sessions cause feedback messages in each other's pages? pg 71 - IAjaxRegionMarkupIdProvider can be used with a behavior to clean up extra surrounding markup around components pg 74 - Example using MicroMap (map that holds a single value and is populated in its constructor, and MiniMap) and the Model.ofMap() factory usage, finally using getString(keyInPropFile,mapmodel) for manually getting a property message and displaying it. pg82
Re: AjaxPayload equivalent in Wicket 1.4
Right Martin, so your code allows me to select the children to refresh via Ajax. My question was how can trigger the logic processing in the ParentClass automatically. As you noted in the code, the child panels will have to remember to call the parent.update(t) line. I'm fine with that solution, but I was wondering if there was another way. For example would that page's onBeforeRender get called automatically if a link's onClick is called? The more I think about it it feels like I'll use: parent.update(ajaxReqTarg, PayloadType.MONITOR). Then each child panel will implement an interface like: 'getPayloadSubscriptions()' and if any report that they care about 'MONITOR'ing payload they would get added to the AjaxRequestTarget since each render needs to report what type of payload update we are looking for.. -Clint On Wed, Nov 30, 2011 at 1:36 AM, Martin Grigorov mgrigo...@apache.orgwrote: Hi Clint, I'd recommend to look in AjaxRequestTarget itself. It has addChildren(parentInstance, Child.class) method with update all children with type Child of this parent. Check also AjaxRequestTarget.IListener. Or add ParentClass#update(AjaxRequestTarget) so you can do: AnotherClass#onEvent(ART t) {...; parent.update(t);...} On Wed, Nov 30, 2011 at 7:51 AM, Clint Checketts checke...@gmail.com wrote: I want to create a parent panel that will have several child panels. I'm making it so the parent panel will automatically add child components to the AjaxRequestTarget via its logic and detecting which ones it detects need to update. I can see how to make it work great if the AjaxLink calls the parent panel in it's onClick, but is there any method or hook I can put in the parent panel itself that would be able to detect that a request is happening and decide to add the child components automatically? I know 1.5 has this, I'm just trying to make it work in 1.4.x for now since the planned upgrade to 1.5 is a ways away for this project. Is there a solution without overriding anything in the application class? If it isn't possible, what is the minimum application class changes required? (WebRequestCycleProcessor?) Thanks, -Clint Checketts -- 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
AjaxPayload equivalent in Wicket 1.4
I want to create a parent panel that will have several child panels. I'm making it so the parent panel will automatically add child components to the AjaxRequestTarget via its logic and detecting which ones it detects need to update. I can see how to make it work great if the AjaxLink calls the parent panel in it's onClick, but is there any method or hook I can put in the parent panel itself that would be able to detect that a request is happening and decide to add the child components automatically? I know 1.5 has this, I'm just trying to make it work in 1.4.x for now since the planned upgrade to 1.5 is a ways away for this project. Is there a solution without overriding anything in the application class? If it isn't possible, what is the minimum application class changes required? (WebRequestCycleProcessor?) Thanks, -Clint Checketts
Re: Can't Reset Form After DropDownChoice OnChange Handled
Yes, you can reset the form quite easily, with or without Ajax. I haven't read the rest of the thread, but if you just reset the object that the form is referencing all the fields would stay in sync and be 'reset'. -Clint On Mon, Nov 21, 2011 at 3:30 PM, Richard W. Adams rwada...@up.com wrote: I've been doing a lot of Googling on this topic found this page, which seems to describe exactly the problem I'm having: http://www.jaxtut.com/Navigation.jsp It suggests calling resetFromSession(), though it doesn't give an implementation this method doesn't seem to be part of Wicket. Has anyone found a way to reset the form after the model has changed the form re-rendered thru Ajax? If there isn't a way to do this in Wicket, is there a Wicket wish list to add it to? From: Igor Vaynberg igor.vaynb...@gmail.com To: users@wicket.apache.org Date: 11/21/2011 02:18 PM Subject:Re: Can't Reset Form After DropDownChoice OnChange Handled I don't think the browser reset button supports ajax.. -igor On Nov 21, 2011 5:08 AM, Richard W. Adams rwada...@up.com wrote: The form just has a standard HTML reset button: input wicket:id=reset-button type=reset value=Reset / There's no special code associated with the button. Should there be? I looked at Wicket in Action, but it doesn't seem to address this issue. RAM /abr./: Rarely Adequate Memory. From: Igor Vaynberg igor.vaynb...@gmail.com To: users@wicket.apache.org Date: 11/17/2011 03:42 PM Subject:Re: Can't Reset Form After DropDownChoice OnChange Handled what does your reset code look like? -igor On Thu, Nov 17, 2011 at 9:00 AM, aksarben rwada...@up.com wrote: I have a drop down choice component, and when the selection changes, I udpate various form fields by Ajax, in the form as follows: *public HistoryDropDown(final String id, final MapK, ? map, final Component dateField, final TrackDetailModel model, final TrackAttribute attribute) { super(id, map); final String originalValue = model.getOriginalValue(attribute); add(new AjaxFormComponentUpdatingBehavior(onchange) { private static final long serialVersionUID = -1; @Override protected void onUpdate(final AjaxRequestTarget target) { // When selection changes final String newValue = model.getAttributeValue(attribute); // What the new choice? if (newValue.equals(originalValue)) { // If back to original value dateField.setEnabled(false); // Disable date field model.restoreOriginalDateAndUser(attribute);// Restore original data } else { // If changing to new value dateField.setEnabled(true); // Enable date field model.setDefaultDateAndUser(attribute); // Effective date = today } // User = current user target.addComponent(dateField.getParent()); // Re-render fields } }); } * The updates work fine (the screen re-renders properly), but if I then click the form's Reset button, nothing happens. I saw some other posts that said I have to do a form.modelchanged(), but that didn't any effect. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Can-t-Reset-Form-After-DropDownChoice-OnChange-Handled-tp4080685p4080685.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** 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
Re: How to build a hudson/jenkins like live log viewer?
I'd need to look at Tailer to see how it operates. But here is how I'd try it (it is quick and I don't like the markup, but we'll optimize it later: Create a panel that looks like so (we'll call it LoggingPanel): wicket:panel div wicket:id=logDatalog contents/div div wicket:id=nextLognext log call/div /wicket:panel Add a self updating timer behavior so the panel check the Tailer for output, if there is data, then update the logData label with it, make the nextLog component be another LoggingPanel with a SelfUpdatingTImerBehavior, and stop the timerbehavior on the current panel. Drawbacks are: the divs keep getting nested, so the markup isn't the most beautiful, so setRenderBodyOnly(true) might make it nicer. -Clint On Sun, Nov 20, 2011 at 9:27 PM, James james.eliye...@gmail.com wrote: Thanks Steve. I'll look into the commons-io Tailer. But any idea on how to use this with wicket? On Mon, Nov 21, 2011 at 11:10 AM, Steve Swinsburg steve.swinsb...@gmail.com wrote: I've done something similar to this using the Tailer class from commons-io. cheers, Steve On 21/11/2011, at 12:59 PM, James wrote: Dear wicket community, In a project that I'm working on, I need to build a live log viewer or dynamic log viewer or refreshable log viewer. Much like how hudson/jenkins displays the console output. The idea is to dynamically display the new data added to a log file along with the existing content. How to go about doing this? Please throw some light on this. I searched about this in the web, mailing lists but couldn't find what I was looking for, so I'm posting it here. If this is asked elsewhere, kindly re-direct me to the respective resource. -- Thanks Regards, James A happy Wicket user - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Thanks Regards, James
Re: What is the difference between Model , PropertyModel,CompoundPropertyModel?
Model is like a box. It is just a container. Put your object in and get it back out. PropertyModel lets you put an object in the box and always lookup a value on that object, and set that value CompoundPropertyModel merely removes the string setting which value is pointing to the object and uses the Wicket:id of the corresponding component to reference the property The examples Steve linked in the wiki are great. -Clint On Thu, Nov 10, 2011 at 10:33 PM, raju.ch raju.challagun...@gmail.comwrote: Could someone please explain me the difference between Model , PropertyModel,CompoundPropertyModel? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/What-is-the-difference-between-Model-PropertyModel-CompoundPropertyModel-tp4030452p4030452.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Orders of CSS files
You can manually add in the autocomplete's CSS file yourself, and wicket won't re-add it in. That way you can add in your custom CSS after it. -Clint On Thu, Nov 3, 2011 at 9:43 AM, Илья Нарыжный phan...@ydn.ru wrote: Hello, Is there some way to specify final CSS file which will be used by browsers at the end - and that's why can rewrite some CSS rules? We have following case: we use wicketstuff tagit autocomplite component. This component contribute some CSS to the header. But we need to overwrite some css rules: the best solution for this to place some overwriting rules at the end of list of CSS files. But the problem is in that fact, that Wicket adds all contributed to the header things at the end of the HEAD file. Thanks, Ilia
Re: Community tools
So what is the best way (official? permanent?) to link to a previous response? In 6 months when someone has a similar question, what is the official way to link to previous answers? Equally, what is the best way to improve those answers if the answer 6 months back worked at that time, but now is invalid and a 'bad practice' due to wicket improvements? Folks so rarely use the mailing list archives ( http://wicket.apache.org/help/email.html), (not easily searched!) I doubt that is the solution. -Clint On Fri, Oct 7, 2011 at 7:32 AM, manuelbarzi manuelba...@gmail.com wrote: it sounds great, but why not fully concentrate on wicket. apache will adopt whatever magic-solution asa it'll be licence compliant, and affordable by resources and directives. for the moment this mailing list has been a very successful machine, and still has much to bring. outside, whatever wrapper (wicket-based or not, may be assembled to pull all posts, order and make them as far confortable-searcheable as low-patience eager-brains demand). as other expressed: markmail and nabble are pretty enough, and managing issues by mail - on smart or not phones - is simply a pleasure. . On Fri, Oct 7, 2011 at 12:43 PM, Josh Kamau joshnet2...@gmail.com wrote: On a light note: we can build our version of stackoverflow as a Q/A for wicket. We can build it in wicket and let everyone access the code. We can use it as a demo wicket application. Josh. On Fri, Oct 7, 2011 at 1:40 PM, Gaetan Zoritchak g.zoritc...@moncoachfinance.com wrote: I fully understand the risk of relying on an external and uncontrolled party. The best of breed solution would be to have SO like a Q A for wicket based on an open source implementation like Bert mentionned. For the mailing list, I think the advantage of reading the messages on his phone is less important than the gate of a partially closed system that requires a subscription by email. See on http://softwareandsilicon.com/chapter:2 # toc2 - Freedom of Access and - Weak Group Identity Markmail: The traffic is constantly increasing from 1999 until late 2009 early 2010 before being reduced significantly. I think the reason is due to the tool a little bit old. Even if the interface allows to search for messages, ergonomics and the quality of responses is not equivalent to what is available on intenet today. My point is not to criticize but to point out that this is negative for the adoption of wicket. Today when I choose a technology for a project, even though I prefer Wicket for its design, I have to sell the framework to a team that does not necessarily find it very sexy. Gaetan 2011/10/7 Martijn Dashorst martijn.dasho...@gmail.com The biggest issue with moving to Stack Overflow is that we deliver our community to an external party which can do anything with the questions, show stupid ads, etc. Have no mistake: stack exchange is a commercial venture. So one criterium is to be able to pull the plug on it whenever it goes sour. While the content of stack overflow is publicly available, it is not licensed with an Apache friendly license (http://creativecommons.org/licenses/by-sa/2.5/). This issue was the biggest hurdle SO needs to take to become a viable alternative for the user list at Apache. As for this list not being visible, you can always shop around for list archive providers. Nabble has a nice forum like interface, Mark mail provides awesome search tooling. Martijn On Fri, Oct 7, 2011 at 8:49 AM, Bert taser...@gmail.com wrote: I had a discussion about this with martin dashorst when we meet this year at a conference. Apparently, he does like the idea of a SO like QA site for wicket. But wicket being an Apache project, there are certain requirement if i recall our discussion correctly. One of the problems is the hosting of such a side. The mailing list, bugtracker, wicki,... are all hosted and maintained by the apache admins. Getting a new tool into there is not easy. One could host a solution outside of apache, but this opens questions about long term support of the infrastructure, privacy issues and so forth. There are a few opensource implementations available: http://gitorious.org/shapado (used by debian at http://ask.debian.net/ ) http://www.osqa.net/ I do like the SO style (never been a fan of mailing lists), but on the other side registering here is not much of a hassle. My 2 cent Bert On Fri, Oct 7, 2011 at 07:25, Josh Kamau joshnet2...@gmail.com wrote: I like the mail. Atleast i can get the answers even on my not so smart phone. Josh. On Fri, Oct 7, 2011 at 6:43 AM, Chris Colman chr...@stepaheadsoftware.comwrote: Source management and bugs are also outdated. The version on github is much better. I
Re: Display HTML in Label with validation
Add your own html header and footer tags when validating, (htmlbody/body/html) but don't include them when outputting the fragment. On Fri, Sep 16, 2011 at 6:05 AM, manuelbarzi manuelba...@gmail.com wrote: sure, but you can try customizing it. inside it you can find interesting things like HtmlDocumentParser, which you can modify to accomplish your needs. it works with a raw html string document, as you may need. . On Fri, Sep 16, 2011 at 12:17 PM, Daniel Stoch daniel.st...@gmail.com wrote: Thanks for your suggestion. But I need to validate a fragment of HTML, but it seems that HtmlDocumentValidator validates only whole documents. From my point of view the following texts are valid HTML fragments: - This is sample text - bThis is/b sample pparagraph/p -- Daniel On Thu, Sep 15, 2011 at 5:31 PM, manuelbarzi manuelba...@gmail.com wrote: may HtmlDocumentValidator help you. . On Thu, Sep 15, 2011 at 5:05 PM, Daniel Stoch daniel.st...@gmail.com wrote: Hi, How to display dynamic HTML content on page which can be invalid (because this HTML is entered by a user). I can use Label.setEscapeModelStrings(false), but with invalid HTML content the page will not be rendered (because of HTML parsing error). So maybe I can use some of standard Wicket mechanisms to parse this HTML first to check if I can display it on page? There are some parsers within framework... -- Daniel - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ultra strange behaviour AjaxButton - Form
Are you using a custom object? A converter could be failing to do the conversion. As in you have a 'User' object tied to your field and Wicket doesn't know by default how to convert the text 'Bob' into a new User object. On Fri, Sep 2, 2011 at 11:02 AM, martin.ase...@mail.bg wrote: Thanks, this is the case. However, I've no idea why the form does validation, since I have no required fields in it, nor have specified any validator. Best regards, Martin - Цитат от Ernesto Reinaldo Barreiro (reier...@gmail.com), на 02.09.2011 в 18:55 - maybe you have validation errors and in that case onError will be called instead. Regards, Ernesto On Fri, Sep 2, 2011 at 5:50 PM, wrote: Hello, guys, I'm experiencing some very strange problem - an AjaxButton's onSubmit never gets called. Here are snippets of what I have: HTML: ... some fields... in code: Form form = new Form(form); AjaxButton submitButton = new AjaxButton(submit) { public void onSubmit(ART target, Form form) { System.out.println(clicked); // never printed ... some logic ... } }; form.add(submitButton); add(form); The above statement and logic are never reached. The Ajax debugger prints nothing. Any help is appreciated. Thanks, Martin - Mail.bg: Безплатен e-mail адрес. Най-добрите характеристики на българския пазар - 10 GB пощенска кутия, 20 MB прикрепен файл, безплатен POP3, мобилна версия, SMS известяване и други. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - Mail.bg: Безплатен e-mail адрес. Най-добрите характеристики на българския пазар - 10 GB пощенска кутия, 20 MB прикрепен файл, безплатен POP3, мобилна версия, SMS известяване и други.
Re: CheckGroup updateModel + setrequired (Bug?)
Even if you can't upgrade the production version its worth testing it against the newer version of Wicket to see if the bug is resolved. On Thu, Aug 11, 2011 at 12:43 PM, delta lsgpimen...@gmail.com wrote: I can't, we must work with this version, because of the company. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/CheckGroup-updateModel-setrequired-Bug-tp3736032p3736594.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: dynamic DataTable
Sorry for taking 2 weeks. Here is a quick and dirty implementation: https://github.com/checketts/wicket-datasource-table It needs a bit of cleanup. 2 points that I like to note is 1) the use of a datasource instead of a java.sql.Connection will allow automatically opening and closing connections (so the table provider will manage itself and 2) the use of the ResultSetMetaData to grab the column names and count. I'll try to get around to cleaning it up (patches are welcome!) but since I hadn't improved it in the last 5 days I figured I should just get it out there in it rough cut glory. Its using H2 right now for the JDBC backend, but you'd be able to switch out any equivalent driver. -Clint On Sat, Jul 23, 2011 at 10:18 AM, davut uysal dauy...@gmail.com wrote: Thanks for the tip Bertrand, I understand SQLResultRow better now. I will try that Regards, On Saturday, 23 July 2011, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Hi, SQLResultRow is a type I made up. I didn't know what type you received from your SQL query, so I used that. I assumed that your result set is composed of rows where each row can be used as a map with key=column name and value=column value. With that in hand, you could iterate over the keys to build the list of datatable columns. Each column would hold its key value and would use it to access the proper column value from a result row. On 23/07/2011 10:12 AM, davut uysal wrote: Hi Bertrand, What is SQLResultRow, is it a Wicket Type? Or should I create a custom class named SQLResultRow? The problem is, I can't create a custom SQLResultRow because I can't be sure of its member fields. User can run any SQL, so the type must be compatible with any result. For example: 1) select firstname, lastname from employees; = ReturnsEmployee 2) select locationcode, locationname from locations; = ReturnsLocation ... (any SQL can return any unpredictable object) So it is impossible to create a custom SQLResultRow Anyway, I have solved the problem in the complex, hard way which is about to use 2 nested repeaters (ListView). 1 for table column names loop, 1 for table rows loop. And, I got the answer: There is no easy way in wicket to do that kind of dynamic thing. Thanks, On 22 July 2011 18:03, Bertrand Guay-Paquetber...@step.polymtl.ca wrote: Hi, Here is the outline of a possible implementation : Execute SQL String Create a ListIColumnSQLResultRow for each SQL result column: add a column to the list that displays one column of a SQLResultRow Create a very simple ISortableDataProvider that returns the SQL result from above (make it more complex to implement sorting) Create a DataTable using the column list and the data provider On 22/07/2011 2:05 AM, davut uysal wrote: Someone in another forum advised me this: *** Maybe in latest Wicket something changed but in 1.4.16 you can't change Columns in DataTable. So it's immutable in some sense. But you may replace whole DataTable component instead when your sql statement changes: form.add(new Button(sqlSubmit) { void onSubmit() { String sql = ...; form.replace(createDataTable(**myDataTable, sql)); } }) form.add(createDataTable(**myDataTable, null)); Where createDataTable() creates DataTable using provided id and sql string. Also there is a convenient method Component.replaceWith(). Maybe it'll fit better to your coding style. *** I think this is what I need, but I dont know how to do. Can someone please help me to create below method? *createDataTable(wicketId, SQL)* Thanks, On 21 July 2011 21:05, Andrew Fieldenandrew.fielden@power-** oasis.com andrew.fiel...@power-oasis.com wrote: I see your problem Davut, but I really don't think Wicket can solve it in the way you want it to. As Martin said, you need anentity to populate the models used by the various Wicket components. Could you somehow parse the SQL statement to extract the table name, and find its meta data? -- View this message in context: http://apache-wicket.1842946. http://apache-wicket.1842946.** n4.nabble.com/dynamic-** DataTable-tp3683514p3684513.**html http://apache-wicket.1842946.n4.nabble.com/dynamic-DataTable-tp3683514p3684513.html Sent from the Users forum mailing list archive at Nabble.com. --**--** - To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DropDownChoice updates onchange event.
Show the code for savedReportsDropDownList. I suspect you aren't using a Model. Also a couple of tweaks to your code. Your calls to 'setChoices' indicate a 'pushing data' approach. Like you are setting the lists in those components instead of using models there to. I think that is where you are hitting your snag. Include the html for your 'displaySortingPanel' please. -Clint On Wed, Jul 27, 2011 at 4:19 PM, Archana archanaacharya.adhik...@gmail.comwrote: private DropDownChoiceSelectedTrackProfileVO savedReportsDropDown;savedReportsDropDown = new DropDownChoiceSelectedTrackProfileVO(profileDropDown,savedReportsDropDownList); savedReportsDropDown.setChoiceRenderer(new ChoiceRendererSelectedTrackProfileVO(reportName, cstmReportId)); savedReportsDropDown.setOutputMarkupId(true); savedReportsDropDown.setOutputMarkupPlaceholderTag(true); savedReportsDropDown.add(new AjaxFormComponentUpdatingBehavior(onchange){ private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { try { TrackingProfileVO trackingProfileVOFromDB = gets the value from DB. trackingProfileVO.setReportLabel(trackingProfileVOFromDB.getReportLabel()); trackingProfileVO.setProfileDesc(trackingProfileVOFromDB.getProfileDesc()); trackingProfileVO.setShipmentSearch(trackingProfileVOFromDB.getShipmentSearch()); trackingProfileVO.getLstSelectedSHVReportColumn().clear(); trackingProfileVO.getLstSelectedSHVReportColumn().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); trackingProfileVO.getSortFirstColumnList().clear(); trackingProfileVO.getSortSecondColumnList().clear(); trackingProfileVO.getSortThirdColumnList().clear(); trackingProfileVO.getSortFirstColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); trackingProfileVO.getSortSecondColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); trackingProfileVO.getSortThirdColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); trackingProfileVO.setShareFlag(trackingProfileVOFromDB.isShareFlag()); shareFlag.setDefaultModel(new ModelBoolean(trackingProfileVOFromDB.isShareFlag())); if(trackingProfileVOFromDB.getResultsPerPage() != null){ trackingProfileVO.setResultsPerPage(trackingProfileVOFromDB.getResultsPerPage()); resultsPerPage.setModel(new ModelDDChoice(trackingProfileVOFromDB.getResultsPerPage())); } trackingProfileVO.getLstSHVReportColumn().removeAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); displaySortingPanel.getSortFirst().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); displaySortingPanel.getSortSecond().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); displaySortingPanel.getSortThird().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); trackingProfileVO.setSortFirst(trackingProfileVOFromDB.getSortFirst()); trackingProfileVO.setSortSecond(trackingProfileVOFromDB.getSortSecond()); trackingProfileVO.setSortThird(trackingProfileVOFromDB.getSortThird()); displaySortingPanel.getSortFirst().setDefaultModel(new ModelSHVReportColumnGridVO(trackingProfileVO.getSortFirst())); displaySortingPanel.getSortSecond().setDefaultModel(new ModelSHVReportColumnGridVO(trackingProfileVO.getSortSecond())); displaySortingPanel.getSortThird().setDefaultModel(new ModelSHVReportColumnGridVO(trackingProfileVO.getSortThird())); displaySortingPanel.setDefaultModel(new ModelTrackingProfileVO(trackingProfileVO)); target.appendJavascript(Ricola.init( '# + displaySortingPanel.getMarkupId()+ ' );); target.appendJavascript(Ricola.init( '# + displaySortingPanel.getSortFirst().getMarkupId()+ ' );); target.appendJavascript(Ricola.init( '# + displaySortingPanel.getSortSecond().getMarkupId()+ ' );); target.appendJavascript(Ricola.init( '# + displaySortingPanel.getSortThird().getMarkupId()+ ' );); target.addComponent(displaySortingPanel.getSortFirst()); target.addComponent(displaySortingPanel.getSortSecond()); target.addComponent(displaySortingPanel.getSortThird()); target.addComponent(displaySortingPanel); target.addComponent(form); } catch (SHVServiceException e) { LOG.error(createSavedReportsDropDown() : Exception,e); } } @Override protected IAjaxCallDecorator getAjaxCallDecorator() { return new AjaxCallDecorator() { private static final long serialVersionUID = 1L; @Override public CharSequence decorateScript(CharSequence script) { final StringBuffer scriptBuffer = new StringBuffer();
Re: RFC: Ten things every Wicket programmer must know?
My Top 10 (some already mentioned): 1. Use LoadableDetachableModels 2. DefaultModels get detached otherwise you need to detach your model manually (as Dan mentioned) 3. Setup components to pull in their data and state, typically via models. This includes pulling in a components isVisible/enables/list entries 4. Feel comfortable with anonymous inner classes, the inline code helps readability, just don't get so comfortable you never refactor it into its own separate class once it gets large (if it doesn't fit on your screen anymore) 5. Make sure your component hierarchy matches your markup hierarchy: did you add the component in your java code? Did you add it to the correct parent (form, repeater, page)? 6. Understand the Form processing lifecycle: Check required, converter, validation, update models, onSubmit/onError. 7. Using Ajax? Understand the difference between AjaxEventBehavior and AjaxFormComponentUpdatingBehavior (the second triggers form processing on the field) 8. Clean up your page layout using markup inheritance 9. The covariant get() methods for WebApplication and Session are super useful, create your own version in your own Application and Session to clean up your class casts. 10. Speaking of cleaning up casts... using Generics on your components (and models) are worth it. And feel free to use Void if there is no underlying model or object (I typically do that with Links, Buttons and simple Forms that I'm not setting a specific model on). These things are all fresh in my mind since I'm teaching Wicket this week. ;) Good luck on the article Jeremy! -Clint On Wed, Jul 27, 2011 at 8:46 PM, Dan Retzlaff dretzl...@gmail.com wrote: 1. Wicket's IOC integrations are really easy to get started with, but there are some gotchas. Since they inject serializable proxies* *to dependencies instead of the dependencies themselves, the dependency gets retrieved/created from Guice/Spring each time a page is deserialized. Therefore, it's very important that you never inject anything that's meant to maintain state across requests. This took a while for us to learn. 2. Also related to serialization, after one year of working with Wicket I have a new fear/respect for the final keyword on local variables. Generally speaking, any non-trivial, non-Component object should not be serialized and should therefore not be marked final and used by an anonymous inner class. Alarm bells start going off for me when I see that a developer has made such an object final. 3. Setting a default model on a component means it will get detached for you. If you have a model that isn't any component's default model, you need to detach it yourself. Good luck with your article! Dan On Wed, Jul 27, 2011 at 4:30 PM, Ben Tilford b...@tilford.info wrote: 1. How static resources work. For a newcomer this can be shocking/frustrating. 2. Models are a context that holds a reference to a model. On Wed, Jul 27, 2011 at 5:21 PM, Scott Swank scott.sw...@gmail.com wrote: Jeremy, I just threw together the following, which indicates that at least to me Models are worth 3 of your 10 items. 1. Most components have a backing object of some sort. This object is referenced via a Model. Significantly, the type of the component and the model match (e.g. LabelInteger has an IModelInteger). 2. These objects live in the session and are managed in the session by wicket, so that when the component goes out of scope the object is removed from the session by wicket. 3. Because domain objects are often too large to store in the session there is a LoadableDetachableModel that is responsible for loading the object whenever it is needed in a request and then flushing it at the end of the request via detach(). Cheers, Scott On Wed, Jul 27, 2011 at 3:29 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Hello all, I'm writing an article for a Java magazine and would like to include in it a list of ten things every Wicket programmer must know. Of course, I have my list, but I'd be very curious to see what you think should be on that list from your own experience. Or, put another way, maybe the question would be what I wished I knew when I started Wicket - what tripped you up or what made you kick yourself later? Please reply back if you have input. Please note that by replying, you are granting me full permission to use your response as part of my article without any attribution or payment. If you disagree with those terms, please respond anyway but in your response mention your own terms. Best regards, -- Jeremy Thomerson http://wickettraining.com *Need a CMS for Wicket? Use Brix! http://brixcms.org* -
Re: Avoid doing lot of Ajax request
I'm not sure I understood your response. Are you saying you don't want to set the throttle for every link you do? If so, sub-class it and reuse your special subclass that always throttles. On Sat, Jul 23, 2011 at 2:06 AM, coincoinfou olivierandr...@gmail.comwrote: But I have to throttle delay for a set of same type links not only one -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Avoid-doing-lot-of-Ajax-request-tp3687472p3688488.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEventBehavior(onchange) and AjaxFormComponentUpdatingBehavior(onchange) on same DropDownChoice
Why not put everything in the AjaxFormComponentUpdatingBehavior? As in: dropDownChoice.add(new AjaxFormComponentUpdatingBehavior(onchange) { @Override protected void onUpdate(AjaxRequestTarget target) { LOG.debug(New updated value: + this.getComponent().getDefaultModelObjectAsString()); target.addComponent(this.getComponent()); * //This code was in the AjaxEventBehavior before LOG.debug(DroDownChoice's parent + IntegrityLevelDropDownPanel.* *this.getParent().getParent().**getParent()); target.addComponent(* *IntegrityLevelDropDownPanel.** this.getParent().getParent().**getParent());* } }); On Fri, Jul 22, 2011 at 6:32 AM, Rodrigo Heffner rodrigo.heff...@gmail.comwrote: Hi guys, I'm very new to Wicket, and I came across this: What I want to do: - I have a DropDownChoice component and I'd like to update it's model when it changes through AJAX. Also, I want to refresh (repaint, reload) this dropdown's parent when a value is changed, also though AJAX. My approach: - Adding an AjaxEventBehavior(onchange) AND an AjaxFormComponentUpdatingBehavior(onchange). Here's the code: dropDownChoice.add(new AjaxEventBehavior(onchange) { protected void onEvent(AjaxRequestTarget target) { LOG.debug(DroDownChoice's parent + IntegrityLevelDropDownPanel.this.getParent().getParent().getParent()); target.addComponent(IntegrityLevelDropDownPanel.this.getParent().getParent().getParent()); } }); dropDownChoice.add(new AjaxFormComponentUpdatingBehavior(onchange) { @Override protected void onUpdate(AjaxRequestTarget target) { LOG.debug(New updated value: + this.getComponent().getDefaultModelObjectAsString()); target.addComponent(this.getComponent()); } }); The Problem: - Unfortunately both onchange events don't work together. Depending on the order of my code, the AjaxFormComponentUpdatingBehavior or the AjaxEventBehavior are executed, but not both. I've changed one of them to happen onblur and then they're both executed, but this is not a solution to my issue. Does anybody have any tips for this? I've been searching for a while but couldn't find anything that solves this. Thank you in advance, -- Rodrigo H M Bezerra - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Avoid doing lot of Ajax request
You can throttle events. See setThrottleDelay() on your behavior. On Fri, Jul 22, 2011 at 1:31 PM, coincoinfou olivierandr...@gmail.comwrote: I have alot of onmouseover ajax request in one panel. How to avoid queuing all request when mouse move is too fast and ideally only do the last ? I tried with a thread but i'm out of the context : no application is defined Thank you -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Avoid-doing-lot-of-Ajax-request-tp3687472p3687472.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Forward to Bookmarkable
What do you mean by 'hide the url'? Do you mean obfuscate the URL? BybridUrlEncodingStrategy will let you display a bookmarkable URL that is stateful (so it isn't the actual bookmarkable page) For example: /mayapp/welcome.0 Note the .0 on the end. If the user's session expires, I believe it will attempt to reload the page, but it will create a new one if the expected version isn't in session. -Clint On Thu, Jul 21, 2011 at 5:44 AM, Lurtz Nazgul lu...@ymail.com wrote: Hi Hans; Thanks for your answer But still url can be seen by the user. I need to forward in order to hide the url from user. Any idea ? Thanks. From: Hans Lesmeister hans.lesmeis...@lessy-software.de To: Wicket Users users@wicket.apache.org Sent: Thu, July 21, 2011 12:35:21 PM Subject: Re: Forward to Bookmarkable You can setResponePage or throw one of the RestartResponse*-Exceptions Regards Hans Am 21.07.11 11:19 schrieb Lurtz Nazgul unter lu...@ymail.com: I also tried WebRequestCycle cycle = (WebRequestCycle) RequestCycle.get(); ServletRequest httpRequest = cycle.getWebRequest().getHttpServletRequest(); ServletResponse httpResponse = cycle.getWebResponse().getHttpServletResponse(); ServletContext context = ((WebApplication) Application.get()).getServletContext(); context.getRequestDispatcher(/mywelcome).forward(httpRequest, httpResponse); where mywelcome url is BookmarkablePage, in MyWebApplication.java this.mountBookmarkablePageWithUrlCoding(/mywelcome, Welcome.class); Thanks. From: Lurtz Nazgul lu...@ymail.com To: users@wicket.apache.org Sent: Thu, July 21, 2011 12:15:19 PM Subject: Forward to Bookmarkable Hi; How can i forward user to a BookmarkablePage. I don't need redirection. I don't want user to see url. Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxLink onclick being called twice
So you click the link and the modal displays, you dismiss the modal, click the link again and nothing happens? Is the behavior consistent across browsers? -Clint On Tue, Jul 19, 2011 at 4:18 PM, wic...@geofflancaster.com wic...@geofflancaster.com wrote: Has anyone had any problems using an AjaxLink where the onclick method is being called twice? I'm trying to use an AjaxLink to load a ModalWindow but the second time it's being called, the ModalWindow thinks that the window has already loaded so it returns nothing. mail2web.com – What can On Demand Business Solutions do for you? http://link.mail2web.com/Business/SharePoint - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to change the em tag proceduced by wicket:link
Mount your page to give it a custom URL. Not sure if you wanted an answer to your email subject since this email isn't related to the email subject(maybe I'm missing some previous messages and context?) -Clint On Sun, Jul 17, 2011 at 9:44 AM, mrblobby simon_ho...@hotmail.com wrote: I cant get this to work. The maven dir structure is : src/main/java/com/mydomain/myweb/pages So what should I put instead of package1? I have tried: pages/MyPage.html I dont want to have to put: com/mydomain/myweb/pages/MyPage.thml because on the production system, the webapp will be renamed to ROOT before deployment to tomcat. and the example dont do this. any ideas? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-change-the-em-tag-proceduced-by-wicket-link-tp1870756p3673524.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketStuff artifacts naming strategy
I seem to recall the Maven guys recommending against periods in artifactIds. Can't find the link for the info though... maybe it was just soething they mentioned in the class. The purpose was to reduce confusion between artifactIds and groupIds. -Clint On Thu, Jun 30, 2011 at 11:14 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: i think the groupid/artifactid do matter because some containers have bundle deployers that pull things from the maven repo...i think -igor On Thu, Jun 30, 2011 at 8:38 AM, Martin Grigorov mgrigo...@apache.org wrote: The Maven artifact id is not important. The name of the produced .jar is what matters, right ? Harald just said that there is a convention in OSGi world to work with such named .jars (com.acme.blah) On Thu, Jun 30, 2011 at 6:31 PM, James Carman jcar...@carmanconsulting.com wrote: And repetitive Sent from my Android device. Please excuse typos and brevity. On Jun 30, 2011 11:12 AM, Bruno Borges bruno.bor...@gmail.com wrote: Yes, me neither. That's why I asked. The preffix I'm using is wicketstuff-, but Harald mentioned org.wicketstuff. I don't want to use that, it's too verbose. *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Thu, Jun 30, 2011 at 12:06 PM, James Carman ja...@carmanconsulting.comwrote: I haven't seen that syntax before of having the group id in the artifact id, at least not with the longer group ids (reverse domain). On Thu, Jun 30, 2011 at 11:02 AM, Bruno Borges bruno.bor...@gmail.com wrote: The preffix is 'wicketstuff-', not 'org.wicketstuff.' Is this ok? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jun 29, 2011 at 4:01 AM, Harald Wellmann harald.wellm...@gmx.de wrote: For Maven OSGi bundle artifacts, there is a quasi-convention to have artifactId = Bundle-Symbolic name, so you would have groupId: org.wicketstuff artifactId: org.wicketstuff.foo.bar version: 1.5 Bundle-Symbolic-Name: org.wicketstuff.foo.bar JAR name: org.wicketstuff.foo.bar-1.5.**jar Apache Servicemix and Apache Aries use this convention, while Apache Commons sticks with the old names. Having this naming scheme and the one Bruno suggested in parallel would help to distinguish OSGi bundles from plain old JARs. Then again, that would mean you'd have to rename artifacts, once you osgify them. Regards, Harald --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org 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 -- 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketStuff artifacts naming strategy
Why not just just use wicket- as the prefix? The groupId shows that it is org.wicketstuff. -Clint On Tue, Jun 28, 2011 at 4:27 PM, Bruno Borges bruno.bor...@gmail.comwrote: I started to modify all JAR poms to have the wicketstuff- preffix. Is anybody against this? Why? :-) *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Sat, Mar 26, 2011 at 9:22 PM, Bruno Borges bruno.bor...@gmail.com wrote: We could simply rename the artifactId property of projects, prepending with wicketstuff-, like wicket does with their modules. Still, I agree that this is will take some time and effort. Bruno Borges www.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld On Sat, Mar 26, 2011 at 12:36 PM, Michael O'Cleirigh michael.ocleir...@rivulet.ca wrote: This is more complicated than I first thought. See this issue: http://jira.codehaus.org/browse/MDEPLOY-93 Essentially it seems that the deploy plugin does not honour the finalName option and uploads in the original format when deploying. I will investigate this further but it won't be part of the next point releases unfortunately. Mike I'm planning on doing point releases this weekend for 1.4.16.1 and 1.5-rc2.1 and I'll make sure the artifacts generate using the longer name. Thanks, Mike In the most parent wicketstuff pom.xml: build finalName${project.groupId}-${project.artifactId}-${project.version}.jar/finalName On Fri, Mar 25, 2011 at 9:31 AM, Wilhelmsen Tor Iver toriv...@arrive.no wrote: - jasperreports-1.4.16.jar - jasperreports-3.7.2.jar The first one is from WicketStuff, but still, it is confusing to see this. This one of my biggest peeves with Maven: It has this concept of a groupId to namespace artifacts in the repository, but this is of no consequence when the jar files appear in the classpath, since the groupId namespace is not part of the actual file name. A workaround could be to prefix the jar file name with the groupId namespace somehow. - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketStuff artifacts naming strategy
You convinced me. ;) On Tue, Jun 28, 2011 at 4:45 PM, Bruno Borges bruno.bor...@gmail.comwrote: because the JAR file does not come with the groupId, and some projects have some very short names, like dojo, or yui. If I look at a JAR file named wicket-dojo-1.5-RC5.1.jar, is that from wicketstuff or wicket ? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Tue, Jun 28, 2011 at 6:39 PM, Clint Checketts checke...@gmail.com wrote: Why not just just use wicket- as the prefix? The groupId shows that it is org.wicketstuff. -Clint On Tue, Jun 28, 2011 at 4:27 PM, Bruno Borges bruno.bor...@gmail.com wrote: I started to modify all JAR poms to have the wicketstuff- preffix. Is anybody against this? Why? :-) *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Sat, Mar 26, 2011 at 9:22 PM, Bruno Borges bruno.bor...@gmail.com wrote: We could simply rename the artifactId property of projects, prepending with wicketstuff-, like wicket does with their modules. Still, I agree that this is will take some time and effort. Bruno Borges www.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld On Sat, Mar 26, 2011 at 12:36 PM, Michael O'Cleirigh michael.ocleir...@rivulet.ca wrote: This is more complicated than I first thought. See this issue: http://jira.codehaus.org/browse/MDEPLOY-93 Essentially it seems that the deploy plugin does not honour the finalName option and uploads in the original format when deploying. I will investigate this further but it won't be part of the next point releases unfortunately. Mike I'm planning on doing point releases this weekend for 1.4.16.1 and 1.5-rc2.1 and I'll make sure the artifacts generate using the longer name. Thanks, Mike In the most parent wicketstuff pom.xml: build finalName${project.groupId}-${project.artifactId}-${project.version}.jar/finalName On Fri, Mar 25, 2011 at 9:31 AM, Wilhelmsen Tor Iver toriv...@arrive.no wrote: - jasperreports-1.4.16.jar - jasperreports-3.7.2.jar The first one is from WicketStuff, but still, it is confusing to see this. This one of my biggest peeves with Maven: It has this concept of a groupId to namespace artifacts in the repository, but this is of no consequence when the jar files appear in the classpath, since the groupId namespace is not part of the actual file name. A workaround could be to prefix the jar file name with the groupId namespace somehow. - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wickettester testing a given WizardStep
A wizard is a component, so you should be able to use startComponent for it. On Wed, Jun 22, 2011 at 4:00 AM, datazuul ralf.eichin...@pixotec.de wrote: I have a RegistrationPage containing a Wizard with 5 steps. Now I want to write a WicketTester test for ONE specific WizardStep, let's say step 4. How? (I could write a test clicking through all steps before step 4 as I understood documentation right, but that is not my preferred approach. I want one Unit-Test for each step and setting needed step-prerequisites in setUp-method) Is it possible? (I just find startComponent and startPanel but not expected startWizard(WizardModel) ) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wickettester-testing-a-given-WizardStep-tp3616424p3616424.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AutoCompleteTextField which uses an Object, not a String
Yesterday while playing with AutoCompleTextField, I created a quickstart to show how it is 'broken'. I hadn't thought of using a converter. After using a converter the component behaves as I'd expect. So a simpler solution could be: 1) improve the AutoCompleteTextField's java doc to explain using the converter 2) update the wicketExample page to include an example using a converter, 3) add some logic, or an ease of use hook so that AutoComplete can detect when its being used against objects that aren't strings and is breaking. I'll open a Jira, attach the quickstart and attach a patch that takes care of those 3 pieces. Yesterday I glanced at the ObjectAutoComplete and it looks very powerful, but maybe even more complex. My initial desire was that an AutoCompleteTextField mirror how a DropDownChoice behaves by default. I'll try to demonstrate that in my patch. -Clint On Tue, Jun 14, 2011 at 10:51 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: we dont need to deprecate the existing one. it does something that object-autocomplete does not - lets you enter free-form-text with some assistance. -igor On Tue, Jun 14, 2011 at 6:55 PM, Jeremy Thomerson jer...@wickettraining.com wrote: I'd be up for at least moving the ObjectAutoComplete into core and adding @Deprecated to the existing one before 1.5.0 if there is consensus on it. -- Jeremy Thomerson http://wickettraining.com *Need a CMS for Wicket? Use Brix! http://brixcms.org* On Tue, Jun 14, 2011 at 11:27 AM, James Carman ja...@carmanconsulting.comwrote: On Tue, Jun 14, 2011 at 11:25 AM, Clint Checketts checke...@gmail.com wrote: Is there a good reason (besides backwards compatiblity) that the objectautocomplete hasn't replaced the broken string based one in wicket-extensions? It seems like AutoComplete should behave as similarly to DropDownChoice as possible. As it currently is, IChoiceRenderer feels broken with it. I would think it should have at least made its way into the core or extension by now. There have been enough requests for it. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AutoCompleteTextField which uses an Object, not a String
Is there a good reason (besides backwards compatiblity) that the objectautocomplete hasn't replaced the broken string based one in wicket-extensions? It seems like AutoComplete should behave as similarly to DropDownChoice as possible. As it currently is, IChoiceRenderer feels broken with it. -Clint On Tue, Jun 14, 2011 at 9:49 AM, Martin Grigorov mgrigo...@apache.orgwrote: maybe you need https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/objectautocomplete-parent On Tue, Jun 14, 2011 at 5:42 PM, drf davidrfi...@gmail.com wrote: I have a model which backs a form. One of the fields in the model is a custom object type, City. In the form I have a field defined as AutoCompleteTextFieldCity. This is populated with a list of City objects, and because City.toString() is overriden, everything displays nicely in the list. However, when a city is chosen, the model does not appear to be getting updated. I cannot find another way to access the City object which was selected. Can anyone help? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-which-uses-an-Object-not-a-String-tp3596762p3596762.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 -- 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
Re: CompoundPropertyModel for label?
You need to set the CompoundPropertyModel on the parent object. In your example the page. Try the following code: customer = new Customer(); customer.setFirstName(Jimmy); customer.setLastName(Dean); customer.getAddress().setStreet(123 Easy Street); myModel = new CompoundPropertyModelCustomer(customer); setDefaultModel(myModel); //This sets the page's model, which is the parent to the label's in question add(new Label(firstName)); add(new Label(lastName)); add(new Label(street.address)) On Sun, Jun 12, 2011 at 6:14 PM, Brian Lavender br...@brie.com wrote: Is it possible to use a compound property model for a label? I tried adding labels using the following, but when I run it, the label comes out with what appears to be a reference to the model. customer = new Customer(); customer.setFirstName(Jimmy); customer.setLastName(Dean); customer.getAddress().setStreet(123 Easy Street); myModel = new CompoundPropertyModelCustomer(customer); firstNameLabel = new Label(firstName,myModel); add(firstNameLabel); lastNameLabel = new Label(lastName,myModel); add(lastNameLabel); add(new Label(street.address, myModel)) CodeResult firstName from Compound Property Model com.brie.dtoo.Customer@7cb44d lastName from Compound Property Model com.brie.dtoo.Customer@7cb44d street.address from Compound Property Model com.brie.dtoo.Customer@7cb44d brian -- Brian Lavender http://www.brie.com/brian/ There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies. Professor C. A. R. Hoare The 1980 Turing award lecture - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: FormComponent convertInput for children FormComponets
I created https://issues.apache.org/jira/browse/WICKET-3765 and attached a quickstart. I commented out the Form in the quickstart. Just uncomment those lines to see the bug. Regarding the strangeness of the Form in the FormComponent: I may be able to remove the Form. This is an older component that I created over a year ago and finally figured out how to do it correctly when reading the Wicket Cookbook, which exposed this behavior. I may be able to refactor the inner Form out of the FormComponent, but the nature of my component is that the repeating element (as in a TextField) is configurable so it could be a TextField, or some other custom field (which could in turn have a possible inner form) so I want to make it as resilient as possible. Thanks! -Clint On Thu, Jun 2, 2011 at 9:42 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: create a quickstart and we can see if there is an easy fix. at first glance it seems rather strange to have a form inside a formcomponentpanel -igor On Wed, Jun 1, 2011 at 6:56 PM, Clint Checketts checke...@gmail.com wrote: I finally had a chance to create a quickstart and play with it. The issue happens when my FormComponentPanel has its own form. So it appears that the inner form delays the processing of those inner elements. Once I removed the inner form so the child FormComponents were added directly to my FormComponentPanel the getConvertedInput worked as expected. wicket:panel form wicket:id=form This inner form in the panel was the culprit! div wicket:id=namesList label wicket:id=label/label input wicket:id=name / /div /form /wicket:panel So this leads into another question: Is the a better solution to making it work if I can't remove the inner form? -Clint On Thu, May 19, 2011 at 11:16 AM, Clint Checketts checke...@gmail.com wrote: I'll validate my code again. It is running on Wicket 1.4.1 so maybe it was linked to the older version. Thanks everyone for the help, its good to know that it is working correctly for others. -Clint On Thu, May 19, 2011 at 7:51 AM, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Hi, I am doing the same kind of processing and it works fine. I have a FormComponentPanel with children FormComponentPanels. Here is what the convertInput() method looks like for the root FormComponentPanel: protected void convertInput() { // Retrieve all children final ListFoo fooList = new ArrayListFoo(); foosRepeater.visitChildren(FooFormFields.class, new IVisitorFooFormFields, Void() { @Override public void component(FooFormFields a_object, IVisitVoid a_visit) { Foo foo = a_object.getConvertedInput(); if (foo != null) { fooList.add(foo); } } }); setConvertedInput(fooList); } All the children validators are called and their convertedInput is properly set. Bertrand On 16/05/2011 5:35 PM, Clint Checketts wrote: I have a FormComponentPanel that contains multiple child formcomponent. The purpose of this panel is to be able to add in several cihldren dynamically. The end model is supposed to be the list from all the children component. I get the value in my convertInput() method by iterating over all the children components, calling each one's getConvertedInput() Here's the problem, the child component's values haven't convertedTheir input at that point, so i call 'validate()' on each one to trigger that coversion. Is that the right way to approach this? Am i causing unneeded/duplicate processing? . protected void convertInput() { final ArrayListT convertedInputList = new ArrayListT(); inForm.visitFormComponents(new IVisitor() { public Object formComponent(IFormVisitorParticipant formComponent) { if (formComponent instanceof FormComponent?) { FormComponentT fc = (FormComponentT) formComponent; *fc.validate(); * T convertedInput = *fc.getConvertedInput(); * if(null != convertedInput){ convertedInputList.add(convertedInput); } } return Component.IVisitor.CONTINUE_TRAVERSAL; } }); setConvertedInput(convertedInputList); } Thanks, -Clint - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: FormComponent convertInput for children FormComponets
I finally had a chance to create a quickstart and play with it. The issue happens when my FormComponentPanel has its own form. So it appears that the inner form delays the processing of those inner elements. Once I removed the inner form so the child FormComponents were added directly to my FormComponentPanel the getConvertedInput worked as expected. wicket:panel form wicket:id=form This inner form in the panel was the culprit! div wicket:id=namesList label wicket:id=label/label input wicket:id=name / /div /form /wicket:panel So this leads into another question: Is the a better solution to making it work if I can't remove the inner form? -Clint On Thu, May 19, 2011 at 11:16 AM, Clint Checketts checke...@gmail.comwrote: I'll validate my code again. It is running on Wicket 1.4.1 so maybe it was linked to the older version. Thanks everyone for the help, its good to know that it is working correctly for others. -Clint On Thu, May 19, 2011 at 7:51 AM, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Hi, I am doing the same kind of processing and it works fine. I have a FormComponentPanel with children FormComponentPanels. Here is what the convertInput() method looks like for the root FormComponentPanel: protected void convertInput() { // Retrieve all children final ListFoo fooList = new ArrayListFoo(); foosRepeater.visitChildren(FooFormFields.class, new IVisitorFooFormFields, Void() { @Override public void component(FooFormFields a_object, IVisitVoid a_visit) { Foo foo = a_object.getConvertedInput(); if (foo != null) { fooList.add(foo); } } }); setConvertedInput(fooList); } All the children validators are called and their convertedInput is properly set. Bertrand On 16/05/2011 5:35 PM, Clint Checketts wrote: I have a FormComponentPanel that contains multiple child formcomponent. The purpose of this panel is to be able to add in several cihldren dynamically. The end model is supposed to be the list from all the children component. I get the value in my convertInput() method by iterating over all the children components, calling each one's getConvertedInput() Here's the problem, the child component's values haven't convertedTheir input at that point, so i call 'validate()' on each one to trigger that coversion. Is that the right way to approach this? Am i causing unneeded/duplicate processing? . protected void convertInput() { final ArrayListT convertedInputList = new ArrayListT(); inForm.visitFormComponents(new IVisitor() { public Object formComponent(IFormVisitorParticipant formComponent) { if (formComponent instanceof FormComponent?) { FormComponentT fc = (FormComponentT) formComponent; *fc.validate(); * T convertedInput = *fc.getConvertedInput(); * if(null != convertedInput){ convertedInputList.add(convertedInput); } } return Component.IVisitor.CONTINUE_TRAVERSAL; } }); setConvertedInput(convertedInputList); } Thanks, -Clint - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: the html pages showing traces that we used wicket, is it a problem
You can override the RequestCycleProcessor to swap that out. Not the simplest change, but the hook is there. I'd say that you don't really have anything to worry about though. -Clint On Sun, May 22, 2011 at 5:53 AM, meduolis meduol...@gmail.com wrote: hariharansrc do not worry about those traces of wicket usage :). No one going to hack your app :D Put wicket logo on your web page instead ;) Powered by Apache Wicket :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/the-html-pages-showing-traces-that-we-used-wicket-is-it-a-problem-tp3540810p3541869.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Customize Validator Message based on Dynamic Variable
You could override the variablesMap() method to add in your values that the message in the properties file contains: Similar to the message: '${input}' isn't a valid widget. -Clint On Fri, May 20, 2011 at 2:34 PM, eugenebalt eugeneb...@yahoo.com wrote: In the Validators we override the method getResourceKey() to get a message from .properties. My problem is, my error message includes the value of a component on the form. So I only know the full message AFTER I get to onValidate(). How can I construct the message string here? Is there a way to provide the message right before issuing error() ? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Customize-Validator-Message-based-on-Dynamic-Variable-tp3539384p3539384.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: FormComponent convertInput for children FormComponets
I'll validate my code again. It is running on Wicket 1.4.1 so maybe it was linked to the older version. Thanks everyone for the help, its good to know that it is working correctly for others. -Clint On Thu, May 19, 2011 at 7:51 AM, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Hi, I am doing the same kind of processing and it works fine. I have a FormComponentPanel with children FormComponentPanels. Here is what the convertInput() method looks like for the root FormComponentPanel: protected void convertInput() { // Retrieve all children final ListFoo fooList = new ArrayListFoo(); foosRepeater.visitChildren(FooFormFields.class, new IVisitorFooFormFields, Void() { @Override public void component(FooFormFields a_object, IVisitVoid a_visit) { Foo foo = a_object.getConvertedInput(); if (foo != null) { fooList.add(foo); } } }); setConvertedInput(fooList); } All the children validators are called and their convertedInput is properly set. Bertrand On 16/05/2011 5:35 PM, Clint Checketts wrote: I have a FormComponentPanel that contains multiple child formcomponent. The purpose of this panel is to be able to add in several cihldren dynamically. The end model is supposed to be the list from all the children component. I get the value in my convertInput() method by iterating over all the children components, calling each one's getConvertedInput() Here's the problem, the child component's values haven't convertedTheir input at that point, so i call 'validate()' on each one to trigger that coversion. Is that the right way to approach this? Am i causing unneeded/duplicate processing? . protected void convertInput() { final ArrayListT convertedInputList = new ArrayListT(); inForm.visitFormComponents(new IVisitor() { public Object formComponent(IFormVisitorParticipant formComponent) { if (formComponent instanceof FormComponent?) { FormComponentT fc = (FormComponentT) formComponent; *fc.validate(); * T convertedInput = *fc.getConvertedInput(); * if(null != convertedInput){ convertedInputList.add(convertedInput); } } return Component.IVisitor.CONTINUE_TRAVERSAL; } }); setConvertedInput(convertedInputList); } Thanks, -Clint - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: FormComponent convertInput for children FormComponets
Sven, Having that code in updateModel is too late. The input needs to be converted and set to make it available to validators. The form processing cycle is roughly: 1- User submitts the form 2- Required fields are checked for existence 3- Input is converted 4- Validators run 5- Models get updated 6- onSubmit logic fires I need the logic in the conversion step so it is available in the validation step. -Clint On Tue, May 17, 2011 at 3:06 AM, Sven Meier s...@meiers.net wrote: Hi Clint, move your code into #updateModel() and set the collected list right into your model. Best regards Sven On 05/16/2011 11:35 PM, Clint Checketts wrote: I have a FormComponentPanel that contains multiple child formcomponent. The purpose of this panel is to be able to add in several cihldren dynamically. The end model is supposed to be the list from all the children component. I get the value in my convertInput() method by iterating over all the children components, calling each one's getConvertedInput() Here's the problem, the child component's values haven't convertedTheir input at that point, so i call 'validate()' on each one to trigger that coversion. Is that the right way to approach this? Am i causing unneeded/duplicate processing? . protected void convertInput() { final ArrayListT convertedInputList = new ArrayListT(); inForm.visitFormComponents(new IVisitor() { public Object formComponent(IFormVisitorParticipant formComponent) { if (formComponent instanceof FormComponent?) { FormComponentT fc = (FormComponentT) formComponent; *fc.validate(); * T convertedInput = *fc.getConvertedInput(); * if(null != convertedInput){ convertedInputList.add(convertedInput); } } return Component.IVisitor.CONTINUE_TRAVERSAL; } }); setConvertedInput(convertedInputList); } Thanks, -Clint - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: URL
Mount it with HybridUrlCodingStrategy On Monday, May 16, 2011, Abid K. abz...@gmail.com wrote: I have a page that's mounted and when accessing the page the url is: http://www.something.com/admin/userAdd When posting a form the url changes to: http://www.something.com/admin/userAdd/wicket:interface/:3:dataForm::IFormSubmitListener:: Is it possible that the url can stay clean like the first url? There was a mention of changing the url strategy to one pass, but I was wondering if something else could be done. Ps. Still learning Wicket Thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: MarkupNotFoundException strange behavior
This happens because you don't have an HTML file for your page. (Assuming you are extending WebPage). You'll need to tell more about your setup and when you are extending to really pinpoint the issue. EmployeeDedicationLoad extends WebPage, right? -Clint On Mon, May 16, 2011 at 1:24 PM, Tito njyt...@gmail.com wrote: Hi, I'm having this error: org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html' for component 'com.keepcon.web.timetracking.EmployeeDedicationLoad' not found. Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried.: [Page class = com.keepcon.web.timetracking.EmployeeDedicationLoad, id = 0, version = 0] Usually It's because html doesn't exist. But my application is deployed and working. Only with one user, and only in his computer (at least for the moment) I get this error. Does anyone know what could be causing this selective error? Thanks in advance Tito
FormComponent convertInput for children FormComponets
I have a FormComponentPanel that contains multiple child formcomponent. The purpose of this panel is to be able to add in several cihldren dynamically. The end model is supposed to be the list from all the children component. I get the value in my convertInput() method by iterating over all the children components, calling each one's getConvertedInput() Here's the problem, the child component's values haven't convertedTheir input at that point, so i call 'validate()' on each one to trigger that coversion. Is that the right way to approach this? Am i causing unneeded/duplicate processing? . protected void convertInput() { final ArrayListT convertedInputList = new ArrayListT(); inForm.visitFormComponents(new IVisitor() { public Object formComponent(IFormVisitorParticipant formComponent) { if (formComponent instanceof FormComponent?) { FormComponentT fc = (FormComponentT) formComponent; *fc.validate(); * T convertedInput = *fc.getConvertedInput(); * if(null != convertedInput){ convertedInputList.add(convertedInput); } } return Component.IVisitor.CONTINUE_TRAVERSAL; } }); setConvertedInput(convertedInputList); } Thanks, -Clint
Re: PropertyModel not binding DropDownChoice
If the ChoiceRenderer ID isn't unique or it has trouble matching it with the selected value, you could get this problem. On Mon, May 16, 2011 at 2:21 PM, lucast lucastol...@hotmail.com wrote: Dear Forum, I have yet another question about PropertyModel not binding to an object field but this time using DropDownChoice. In my form I have DropDownChoiceHowOftenType eventOccurHowOftenDropDownChoice = new DropDownChoiceHowOftenType(eventOccurHowOften, new PropertyModelHowOftenType(event, occurrHowOften), HowOftenType.getOccurHowOftenValues(), new ChoiceRendererHowOftenType() ); occurrHowOften is a field of object event, HowOftenType.getOccurHowOftenValues() return a list of Enum and ChoiceRendererHowOftenType simply implements getDisplayValue and getIdValue for IChoiceRenderer. When processing the form, after having filled the eventOccurHowOftenDropDownChoice, event.getOccurrHowOften returns null. As explained on http://apache-wicket.1842946.n4.nabble.com/PropertyModel-not-binding-TextField-td3527074.html my previous post , when analysing the content of the above eventOccurHowOftenDropDownChoice while debugging on Eclipse, the eventOccurHowOftenDropDownChoice.data contains an instance of event object and the occurHowOften enum field is populated. However, the original event.occurHowOften field is still null. Why is PropertyModel not binding the DropDownChoice to the variable? what am I missing here? The interesting thing is that another field DropDownChoiceEventType eventTypeDropDown = new DropDownChoiceEventType(eventTypeChoice,new PropertyModelEventType(event, eventType), Arrays.asList(EventType.values())); which is binding an enum field to event object is working absolutely fine. The only difference between the two is that on this one I am not passing an IChoiceRenderer object. Even when I don't use the IChoiceRenderer instance on the former, the PropertyModel is still not binding the DropDownChoice value to event.occurHowOften variable. These are very simple form fields and I still don't get what I'm doing wrong. Can you spot where I am making some sort of mistake? Thanks in advance, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PropertyModel-not-binding-DropDownChoice-tp3527154p3527154.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Create Datatable with empty columns and rows
I'd recommend using a listview and use CSS to lay it out as you mentioned. A data table is really useful when dealing with columnar data that needs pagination and sorting. On Saturday, May 14, 2011, malebu milton.qura...@gmail.com wrote: http://apache-wicket.1842946.n4.nabble.com/file/n3523546/Screen_shot_2011-05-14_at_9.55.31_PM.png I need to create a table like the attached image. I am not seasoned in wicket. I am not able to analyze where to start. I was able to create a DataTable but could not figure out how to get it started. I get a list of category heads from a table as an object in list i.e. ListCategoryType types = db.getCategoryTypes(); I need to iterate through the list and populate the table with empty column with vertical line background and empty rows after each category display. Any help would be really appreciated. I am currently stuck at this. The code is as follows: html xmlns=http://www.w3.org/1999/xhtml; head /head body table width=100% border=0 cellspacing=3 cellpadding=0 id=category tr td width=296 align=center Category 1 /td td width=23 rowspan=8 align=center background=images/vertical_line_black.pngnbsp;/td td width=374 align=center Category 3 /td td width=27 rowspan=8 align=center background=images/vertical_line_black.pngnbsp;/td td width=515 align=center Category 5 /td /tr tr td align=centerSub category 1/td td align=centerSub category 1/td td align=centerSub category 1/td /tr tr td align=centerSub category 2/td td align=centerSub category 2/td td align=centerSub category 2/td /tr tr td align=centernbsp;/td td align=centernbsp;/td td align=centernbsp;/td /tr tr td align=center Category 2 /td td align=center Category 4 /td td align=center Category 6 /td /tr tr td align=centerSub category 1/td td align=centerSub category 1/td td align=centerSub category 1/td /tr tr td align=centerSub category 2/td td align=centerSub category 2/td td align=centerSub category 2/td /tr tr td align=centernbsp;/td td align=centernbsp;/td td align=centernbsp;/td /tr /table /body /html - -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Create-Datatable-with-empty-columns-and-rows-tp3523546p3523546.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to bind object in Hashset to CompoundPropertyModel expression
You could try a helper method that allows indexed access. As in: userAccount. *membershipsAsList*.0.acceptedTerms I haven't tried it and guaranteeing the ordering would need to be accounted for. But its a potential direction. -Clint On Fri, May 13, 2011 at 3:04 PM, Sven Meier s...@meiers.net wrote: A set doesn't allow indexed access. Sven On 05/13/2011 09:55 PM, datazuul wrote: I have this model: final CompoundPropertyModel userModel = new CompoundPropertyModelUser(user); and want bind a checkbox to a boolean field in User - getUserAccount - getMemberships - Membership - acceptedTerms (the boolean field) I used this expression: userModel.bind(userAccount.memberships.map.0.acceptedTerms) and ...memberships.0.acceptedTerms and ...memberships[0].acceptedTerms but none of them works... memberships is defined as HashSet (due to Hibernate): public class UserAccount implements DomainObjectLong { ... private SetMembership memberships = new HashSetMembership(); How to solve this? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-bind-object-in-Hashset-to-CompoundPropertyModel-expression-tp3521031p3521031.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: TextField not getting the value after a validation eror
I'm not sure I understand the steps that cause the problem. Case 1 1- A user opens the page 2- The user click the link, updating the value textfield 3- User submits the form, no validation error occurs, all is well. Case 2- 1- user opens page 2- user submits form 3- required error apears, field is still empty Case 3- 1- user opens page 2- user clicks link, populating the textfield 3- user deletes the text from the text field 4- form is submitted, causing validation error and the textfield is repopulated with the value the clicked link put in it Is case 3 the problem you are hitting? -Clint On Fri, May 13, 2011 at 4:16 PM, msalman mohammad_sal...@yahoo.com wrote: I have a text field that is required to have a value. I also have a link that on being clicked inserts a value into the text field. It all works fine except if the user submits the form without setting the value for the text field. Once the form has been submitted without the required value, and the form has generated the error, the text field does seem to get/show the value that the link is trying to enter. I just hope that I am not doing something right and that some one will kindly point out the error. I am attaching a quickstart. Thanks. http://apache-wicket.1842946.n4.nabble.com/file/n3521252/TextFieldTest.zip TextFieldTest.zip -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/TextField-not-getting-the-value-after-a-validation-eror-tp3521252p3521252.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Questions Regarding Wicket URL Generation
Try a HybridUrlEncodingStrategy for your mount On Wednesday, May 11, 2011, Carlo Camerino carlo.camer...@gmail.com wrote: Hi There, I'm mounting bookmarkable pages in the Wicket Application. For example, mount(index, IndexPage.class); mount(confirmPage, ConfirmPage.class); I'm quite successful when using the following code setResponsePage(IndexPage.class); http://localhost:8080/application/index However, when I try to use setResponsePage(new ConfirmPage()); http://localhost:8080/application/?wicket1:: It doesn't work already Is there anyway that I could workaround this? It appears as something like this. Thanks Carlo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Separate log files (tomcat, hibernate, wicket, etc)
A hint to direct you: setup different 'categories' based on package you want to split it out on, then setup a separate appender for each of those categories to go to your separate files. I don't have an example for you though. Maybe this: https://wiki.base22.com/display/btg/How+to+setup+Log4j+in+a+web+app+-+fast On Fri, May 6, 2011 at 3:14 PM, Henrique Boregio hbore...@gmail.com wrote: Fine..majority wins, it's a log4j question haha Thanks anyways for the tips. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Initializing new thread in WicketApplication.init()
Also be sure to kill your thread in the application's onDestroy() otherwise old threads will hang around if you do redeploys, but don't bounce the JVM. You probably already thought of that. My scars are still fresh... -Clint On Tue, May 3, 2011 at 3:37 PM, Henrique Boregio hbore...@gmail.com wrote: Thanks Martin...had to do some refactoring but your solution worked great. On Tue, May 3, 2011 at 5:07 PM, Henrique Boregio hbore...@gmail.com wrote: Hi, I have a very simple thread that sleeps most of the time. Every hour, it goes to the database to check what new stuff has been added, and generates a summary of that. This thread is started in my WicketApplication.init() method. The problem is that the run() method of this thread, needs access to the following method WebApplication.get().getServletContext().getContextPath() but when it tries to access this method, the following error occurs: org.apache.wicket.WicketRuntimeException: There is no application attached to current thread Thread Any suggestions? Many thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Submit non-wicket form through wicket form
You could direct the non-wicket form's action to direct to a page and use the PageParameter's object to parse the input. I did that for a while until I finally learned how to use Wicket forms the right way. It worked quite well. You can parse in the values, manually checking validity (even manually running validators if you like) and still log your own feedback messages. -Clint -- Clint Checketts Sent with Sparrow On Monday, May 2, 2011 at 1:47 PM, Alec Swan wrote: Igor, we would like have access to the Wicket page model while processing the custom form submission, so using separate servlets is not a good solution for us. I started implemented the 3.1 step in our solution and immediately ran into a problem because wicket form contains a DIV with a hidden input with name wicketForm9a_hf_0, which I suspect is required by Wicket. I am assuming that 3.2 is a preferred approach because it will work even if other hidden form elements are added in later versions of Wicket. Thoughts? Thanks, Alec On Mon, May 2, 2011 at 10:44 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote: or you can write a servlet to process form submissions from all these different forms and call it a day. -igor On Mon, May 2, 2011 at 9:21 AM, Alec Swan alecs...@gmail.com wrote: Hello, We have an interesting situation here. We have a Wicket page which we deliver to our web designer. The web designer uses this page as a template to build many pages and on each page may or may not choose to add a non-wicket form. Our webapp should collect the names and values submitted from this form and store them in a CSV file. So, the question is how to provide the web designer the flexibility of adding a random form and being able to collect this form submission data on the back-end? One idea that I am currently working on is this. 1. Add an empty Wicket form to the the wicket template page; 2. Provide submitCustomForm() JavaScript method that web designer will call from his custom form's action; 3. In submitCustomForm() we can: 3.1 either change the custom form's action to point to Wicket form's action and submit custom form. 3.2. or somehow copy form elements from custom form to wicket form and submit wicket form. Your feedback will be greatly appreciated. Thanks, Alec - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DataTable's view does not always update
The reason for the 404 is the Websphere is checking for a file, then intending to filter before and after serving up the file. Since it finds no file to serve, it returns the 404. -Clint On Mon, May 2, 2011 at 9:33 AM, D D dawi...@gmail.com wrote: FYI. I added the index.htm file to my project and everything now works. This is very strange and if anyone has an insight why this helped I would be very glad to read about it. Since I didn't try switching to servlet I'm not sure if that would have helped as well. Thank you for all of your suggestions! Dave On Mon, May 2, 2011 at 6:18 AM, James Carman ja...@carmanconsulting.com wrote: Try changing it to a servlet. There's another thread going on here just recently which gives an example. On Sun, May 1, 2011 at 10:22 PM, D D dawi...@gmail.com wrote: I have a filter in web.xml file - however I did not set it up. At the same time I've started to question the setup because I tried to deploy a clean test app (by clean I mean new ear file for the test app and no extra ear files and configuration - just a strip down example from wicket's website) and I'm getting 404 trying to bring the application up. So the original application with problem is having 404 on ajax calls but it will start up. Test app will not start up - shows 404 all the time. Is it a WAS setup issue? Thanks, Dave On Sun, May 1, 2011 at 8:57 PM, James Carman ja...@carmanconsulting.com wrote: You are using a servlet instead of a filter, right? I don't see the entire conversation in my gmail, here, so I hope I didn't miss something. On Sun, May 1, 2011 at 9:51 PM, D D dawi...@gmail.com wrote: I tried the setting with true and false settings. It still doesn't work. Here is Ajax Debug INFO: Initiating Ajax GET request on ?wicket:interface=:0:dataForm:dataPanel:rxEntryTabs:panel:link::IBehaviorListener:0:-1random=0.6781234819490185 INFO: Invoking pre-call handler(s)... ERROR: Received Ajax response with code: 404 INFO: Invoking post-call handler(s)... INFO: Invoking failure handler(s)... INFO: focus removed from link30 I also traced through debug the response sent to HttpResponse object and it's what I'm expecting: “?xml version=1.0 encoding=UTF-8?ajax-responsecomponent id=counter31 ![CDATA[span id=counter315/span]]/component /ajax-response” Not only it's written but the response object is properly closed too. Not a single exception is thrown in Wicket's code. The problem has to be somewhere inside WAS processing, right? Any ideas where? Dave - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Running Wicket under WebSphere
I heard that Webspere gets confused with a filter as the endpoint. Try WicketServlet. I think there also is a patch for more recent Websphere versions. On Sunday, May 1, 2011, drf davidrfi...@gmail.com wrote: I should add that we are using Spring 3, which uses ContextLoaderListener, not ContextLoaderServlet -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Running-Wicket-under-WebSphere-tp3487476p3487531.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to fail validation if ListMultipleChoice is empty
Lets see the code about 'adding elements by pressing on a button'. The 'getValue()' method is returning the value from the list box's HTTP submitted values, if the add button is submitting values via ajax or some other means then it may need a different approach. -Clint On Sun, May 1, 2011 at 8:15 PM, Coleman, Chris chris.cole...@thalesgroup.com.au wrote: We have an app that allows people to add elements to a ListMultipleChoice by pressing on a button. We want the form to fail validation if the ListMultipleChoice contains no elements. I've tried this: targettedSetsList.add(new IValidator() { public void validate(IValidatable validatable) { // Always contains no items - strange Collection list = (Collection)validatable.getValue(); if ( list.size() == 0 ) { ValidationError ve = new ValidationError(); ve.setMessage(No sets have been specified for deployment); validatable.error(ve); } } }); but at validation the list.size() is always 0 even if the user has added elements. Am I doing it the right way? Is there a better way? DISCLAIMER:--- This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege or protection. Thales Australia does not warrant or represent that this e-mail or any documents, files and previous e-mail messages attached are error or virus free. --
Re: How to fail validation if ListMultipleChoice is empty
You are correct that the Form's validation should only fire when submitting the form. When an individual element is updated via ajax (as in an AjaxFormComponentUpdatingBehavior) then just the processing and validations steps are fired for the individual form component. It makes me wonder if you are using an AjaxSubmitButton instead of just an AjaxButton. (Or similarly an AjaxSubmitLink instead of an AjaxLink) Mind including your button's code? Also, why are you calling getChoices() instead of getConvertedInput() in the validator? Choices represent the possible selection options, the converted input is the value of the selected choices. -Clint On Sun, May 1, 2011 at 9:25 PM, Coleman, Chris chris.cole...@thalesgroup.com.au wrote: Yes, it's all via AJAX. In the last few minutes I've tried a different approach and it works ok but it introduces another problem: form.add(new AbstractFormValidator() { public FormComponent[] getDependentFormComponents() { return null; } public void validate(Form? form) { List sets = targettedSetsList.getChoices(); if ( sets.size() == 0 ) { targettedSetsList.error((IValidationError)new ValidationError().addMessageKey(error.noSetSpecified)); } } }); This accurately detects when nothing is in the list and displays an error message but once emptied we can not add new elements to the list because the validation is also executed when the 'add' button is pressed. The validation fails because the list is empty so the 'add' fails, making it impossible to add new elements when the list is empty. I thought validation would only occur when the user submits the form but it appears to be fired off whenever the user presses the 'add' button. Is this to be expected? -Original Message- From: Clint Checketts [mailto:checke...@gmail.com] Sent: Monday, 2 May 2011 12:10 PM To: users@wicket.apache.org Subject: Re: How to fail validation if ListMultipleChoice is empty Lets see the code about 'adding elements by pressing on a button'. The 'getValue()' method is returning the value from the list box's HTTP submitted values, if the add button is submitting values via ajax or some other means then it may need a different approach. -Clint On Sun, May 1, 2011 at 8:15 PM, Coleman, Chris chris.cole...@thalesgroup.com.au wrote: We have an app that allows people to add elements to a ListMultipleChoice by pressing on a button. We want the form to fail validation if the ListMultipleChoice contains no elements. I've tried this: targettedSetsList.add(new IValidator() { public void validate(IValidatable validatable) { // Always contains no items - strange Collection list = (Collection)validatable.getValue(); if ( list.size() == 0 ) { ValidationError ve = new ValidationError(); ve.setMessage(No sets have been specified for deployment); validatable.error(ve); } } }); but at validation the list.size() is always 0 even if the user has added elements. Am I doing it the right way? Is there a better way? DISCLAIMER:--- This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege or protection. Thales Australia does not warrant or represent that this e-mail or any documents, files and previous e-mail messages attached are error or virus free. -- DISCLAIMER:--- This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced
Re: DataTable's view does not always update
Make sure that sendredirect.compatibility property is set to false or deleted. It causes problems. You didn't say if it had originally be set or not though, lets make sure it didn't get left on at some point. Watch the URL, if you typed in http://localhost/myApp and it renders as http://localhost/myApp/*myApp* (note the duplicate context root) you could get 404s. Also convert to using the WicketServlet, WAS had trouble pointing to a filter as an endpoint (unless you have an empty index.htm file). Lets see if that gets you back on track. I suspect that is why your clean app isn't working, you have no index.htm file to trick WAS into working. -Clint On Sun, May 1, 2011 at 9:22 PM, D D dawi...@gmail.com wrote: I have a filter in web.xml file - however I did not set it up. At the same time I've started to question the setup because I tried to deploy a clean test app (by clean I mean new ear file for the test app and no extra ear files and configuration - just a strip down example from wicket's website) and I'm getting 404 trying to bring the application up. So the original application with problem is having 404 on ajax calls but it will start up. Test app will not start up - shows 404 all the time. Is it a WAS setup issue? Thanks, Dave On Sun, May 1, 2011 at 8:57 PM, James Carman ja...@carmanconsulting.com wrote: You are using a servlet instead of a filter, right? I don't see the entire conversation in my gmail, here, so I hope I didn't miss something. On Sun, May 1, 2011 at 9:51 PM, D D dawi...@gmail.com wrote: I tried the setting with true and false settings. It still doesn't work. Here is Ajax Debug INFO: Initiating Ajax GET request on ?wicket:interface=:0:dataForm:dataPanel:rxEntryTabs:panel:link::IBehaviorListener:0:-1random=0.6781234819490185 INFO: Invoking pre-call handler(s)... ERROR: Received Ajax response with code: 404 INFO: Invoking post-call handler(s)... INFO: Invoking failure handler(s)... INFO: focus removed from link30 I also traced through debug the response sent to HttpResponse object and it's what I'm expecting: “?xml version=1.0 encoding=UTF-8?ajax-responsecomponent id=counter31 ![CDATA[span id=counter315/span]]/component /ajax-response” Not only it's written but the response object is properly closed too. Not a single exception is thrown in Wicket's code. The problem has to be somewhere inside WAS processing, right? Any ideas where? Dave - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to fail validation if ListMultipleChoice is empty
Good catch on AjaxSubmitButton being deprecated, I guess an IDe would have made that obvious ;) I do have to say using the getChoices over a proper model may give you more work than needed in updating the underlying model objects (maybe consider overriding the getConvertedInput to return getChoices) It sounds like you have different buttons for adding and submitting. Correct me if this is too hackish, but you could change the validator to check if the addBtn is the submitting button, and ignore the validation in that case: form.add(new AbstractFormValidator() { public FormComponent[] getDependentFormComponents() { return null; } public void validate(Form? form) { List sets = targettedSetsList.getChoices(); if ((*!addBtn.equals(form.findSubmittingButton()) * sets.size() == 0 ) { targettedSetsList.error((IValidationError)new ValidationError().addMessageKey(error.noSetSpecified)); } } }); -Clint On Mon, May 2, 2011 at 12:27 AM, Coleman, Chris chris.cole...@thalesgroup.com.au wrote: According to the doco the default form processing behavior is executed for AjaxButton and AjaxSubmitButton (in fact AjaxSubmitButton appears to be deprecated - behaves the same as AjaxButton anyway?). I am using AjaxButton. I actually don't care about the selections but rather, the entries that the user has added to the list (whether selected or not) which is why I call getChoices() rather than getConvertedInput() The button code is: AjaxButton addBtn = new AjaxButton(add) { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { update(target, selectedAvailableSets, availableSetsList, targettedSetsList); } @Override protected void onError(AjaxRequestTarget target, Form form) { } }; addBtn.setOutputMarkupId(true); add(addBtn); -Original Message- From: Clint Checketts [mailto:checke...@gmail.com] Sent: Monday, 2 May 2011 2:28 PM To: users@wicket.apache.org Subject: Re: How to fail validation if ListMultipleChoice is empty You are correct that the Form's validation should only fire when submitting the form. When an individual element is updated via ajax (as in an AjaxFormComponentUpdatingBehavior) then just the processing and validations steps are fired for the individual form component. It makes me wonder if you are using an AjaxSubmitButton instead of just an AjaxButton. (Or similarly an AjaxSubmitLink instead of an AjaxLink) Mind including your button's code? Also, why are you calling getChoices() instead of getConvertedInput() in the validator? Choices represent the possible selection options, the converted input is the value of the selected choices. -Clint On Sun, May 1, 2011 at 9:25 PM, Coleman, Chris chris.cole...@thalesgroup.com.au wrote: Yes, it's all via AJAX. In the last few minutes I've tried a different approach and it works ok but it introduces another problem: form.add(new AbstractFormValidator() { public FormComponent[] getDependentFormComponents() { return null; } public void validate(Form? form) { List sets = targettedSetsList.getChoices(); if ( sets.size() == 0 ) { targettedSetsList.error((IValidationError)new ValidationError().addMessageKey(error.noSetSpecified)); } } }); This accurately detects when nothing is in the list and displays an error message but once emptied we can not add new elements to the list because the validation is also executed when the 'add' button is pressed. The validation fails because the list is empty so the 'add' fails, making it impossible to add new elements when the list is empty. I thought validation would only occur when the user submits the form but it appears to be fired off whenever the user presses the 'add' button. Is this to be expected? -Original Message- From: Clint Checketts [mailto:checke...@gmail.com] Sent: Monday, 2 May 2011 12:10 PM To: users@wicket.apache.org Subject: Re: How to fail validation if ListMultipleChoice is empty Lets see the code about 'adding elements by pressing on a button'. The 'getValue()' method is returning the value from the list box's HTTP submitted values, if the add button is submitting values via ajax or some other means then it may need a different approach. -Clint On Sun, May 1, 2011 at 8:15 PM, Coleman, Chris chris.cole...@thalesgroup.com.au wrote: We have an app that allows people to add elements to a ListMultipleChoice by pressing on a button. We want the form to fail validation if the ListMultipleChoice contains no elements. I've tried this: targettedSetsList.add(new IValidator() { public void validate(IValidatable validatable) { // Always contains no items - strange Collection list = (Collection)validatable.getValue(); if ( list.size
Re: DataTable's view does not always update
Ah. This is curious. I've run Wicket on WAS 6.1. Out of curiosity do you have the com.ibm.websphere.sendredirect.compatibility property set? See here: http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/xrun_jvm_sendredirect.html -Clint On Fri, Apr 29, 2011 at 3:13 PM, D D dawi...@gmail.com wrote: I've enabled the debug - project was set up for me and it was in deployment mode from the start... Question: why am I getting *ERROR: *Received Ajax response with code: 404? Is anyone running Wicket on WAS 6.1? Thanks, Dave On Fri, Apr 29, 2011 at 1:59 PM, D D dawi...@gmail.com wrote: Clint - I'm seeing similar problem in the simplest possible page. I took the Counter Page example from the Wicket's website and put that into my panels. (the only 2 things in the panel are the AjaxFallbackLink and Label) Clicking on the link would not update the counter. How do I get to to that Wicket debug panel? - I'm pretty new to Wicket. Since I'm not using a form I assume that for me it's problem #1. Dave On Thu, Apr 28, 2011 at 9:20 PM, Clint Checketts checke...@gmail.com wrote: I've seen that sort of behavior in 2 common types of cases: 1- An exception occurred, disrupting the Ajax response from even returning (you'll notice it as a type ERROR in the Wicket debug panel) 2- A form validator, required field, or conversion failed, stopping the form from updating underlying models (you would have still seen the onBeforeRender called in this case). You'd notice this behavior if the console had a message about 'unrendered feedback message' -Clint -- Clint Checketts Sent with Sparrow On Thursday, April 28, 2011 at 1:25 PM, Tom Barbaro wrote: Hi, I have several checkboxes in a datatable toolbar that control filtering for the content rendered in a datatable. When a checkbox is clicked, we add the datatable to the ajax target, which results in a new query. The dataprovider doQuery methond is called and returns the correct results. The problem is the view does not always update. No exceptions occur, the view just does not update. I set a breakpoint in onBeforeRender for the page and it is called when the view is updated. When the view is not updated it is not called. The only clue I have is the number of items in the view for the checkbox I just unselected is much larger (more than 100x) than the items selected by the unmodified checkboxes. Any ideas what would prevent the updating of the table? Tom -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DataTable-s-view-does-not-always-update-tp3481807p3481807.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Can't get Javascript filtering to work
I've seen folks get a misconfigure like this when they make the call in the application's constructor instead of the init() method. On Friday, April 29, 2011, Martin Grigorov mgrigo...@apache.org wrote: Hi, On Thu, Apr 28, 2011 at 9:50 PM, Alec Swan alecs...@gmail.com wrote: Thanks, Andrea. I was running in DEVELOPMENT mode and switching to DEPLOYMENT mode fixed the problem. I hope this gets documented somewhere. You are doing something wrong. MyApp#init() is called after WebApplication#internalInit() so your settings should override the defaults. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: POST path via Ajax erratically invalid when used with #
I don't know which method, but I am curious which browser you are seeing it in. On Thu, Apr 28, 2011 at 4:59 PM, Jeremy Levy jel...@gmail.com wrote: I've noticed that in 1.4.17 in some circumstances when using Wicket to POST data over AJAX the path it's POSTing to tries to include the value after # in the URL. For example on a page with a URL like http://foo.bar/MyPage#oneWicket-Ajax attempts to POST to http://foo.bar/MyPageone. I'm having trouble using the debugger to nail down where in the JS this is happening, can someone help point me to the function? Jeremy -- Jeremy Levy
Re: DataTable's view does not always update
I've seen that sort of behavior in 2 common types of cases: 1- An exception occurred, disrupting the Ajax response from even returning (you'll notice it as a type ERROR in the Wicket debug panel) 2- A form validator, required field, or conversion failed, stopping the form from updating underlying models (you would have still seen the onBeforeRender called in this case). You'd notice this behavior if the console had a message about 'unrendered feedback message' -Clint -- Clint Checketts Sent with Sparrow On Thursday, April 28, 2011 at 1:25 PM, Tom Barbaro wrote: Hi, I have several checkboxes in a datatable toolbar that control filtering for the content rendered in a datatable. When a checkbox is clicked, we add the datatable to the ajax target, which results in a new query. The dataprovider doQuery methond is called and returns the correct results. The problem is the view does not always update. No exceptions occur, the view just does not update. I set a breakpoint in onBeforeRender for the page and it is called when the view is updated. When the view is not updated it is not called. The only clue I have is the number of items in the view for the checkbox I just unselected is much larger (more than 100x) than the items selected by the unmodified checkboxes. Any ideas what would prevent the updating of the table? Tom -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DataTable-s-view-does-not-always-update-tp3481807p3481807.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Customized AjaxPagingNavigator to highlight selected page number
If you navigator has a unique class (or id) you could just refer to it via the CSS: I'm guessing something like .goto em{font-weight: bold; font-color: blue} would work. Note that disabled links by default are wrapped in em tags. If that isn't good enough, you can subclass the AjaxPagingNavigator and override the newPagingNavigationLink() method. In there you could add a behavior to do your custom styling or set the setBeforeDisabledLink() and setAfterDisabledLink() methods to insert in the markup you require. -Clint -- Clint Checketts Sent with Sparrow On Wednesday, April 27, 2011 at 4:31 AM, sap2000 wrote: The current page selection is noticed by disabled link of the selected page number. In our project we need to highlight (bold font and colour) selected page by means of css. How this can be achived ? Thank you. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Customized-AjaxPagingNavigator-to-highlight-selected-page-number-tp3477625p3477625.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Specific redirect after session timeout
Have you tried a HybridUrlEncodingStrategy? That one is pretty resilient to session restarts. -Clint On Mon, Apr 25, 2011 at 2:51 AM, Peter Karich peat...@yahoo.de wrote: Hi there, is it possible to grab the parameters (and the path) of the url and redirect the user automatically back to that page if he hits a session timeout? At the moment I'm using in my app.init() method getApplicationSettings().setPageExpiredErrorPage(SessionTimeout.class); and public SessionTimeout(final PageParameters oldParams) { setResponsePage(HomePage.class, oldParams); } But the oldParams variable does not contain the parameters the user had when he hits the session timeout. Or do I need to store that in a separate cookie? Regards, Peter. -- http://jetwick.com open twitter search - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Forcing parent CSS to be contributed after all child CSS
I recall reading an article once noting that you could contribute the CSS file noted in the parent class again in the child component and Wicket is smart enough to not duplicate the contribution, but it still forces the CSS file to appear later. You also may consider changing the parent CSS rules to be more specific or generic (depending on your intentions), to allow them to cascade. -Clint On Sat, Apr 23, 2011 at 5:05 PM, Alec Swan alecs...@gmail.com wrote: Hello, I have a component tree where some components contribute CSS. I have inline CSS for the parent component that should be contributed last in order to override CSS of child components. Children components contribute their CSS in their constructors using add(new StyleSheetReference(cssId, getClass(), /css/styles.css)). I have to use this approach because other approaches don't work with panel swapping (I have yet to create a JIRA issue for this). The parent component is contributing CSS by calling response.renderString(body {background-color:red}) from IHeaderContributor#renderHead(IHeaderResponse). I tried contributing parent CSS in parents onInitialize() and onBeforeRender(), but children's CSS always get written last. Is there any way to force parent's CSS to be contributed last? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Refreshing loadable detachable model object inside an ajax call
Your issue with the generics is you need to tell it that 'T extends Indetifiable', or take it out entirely if you are going to explicitly tell it that you are using the Parent class. Also feel free to make the argument match what your load method requires. The article could be referencing code that is old or whatever. Also keep in mind that the class Long implements Serializable, but the primitive long (lower case 'l') isn't an object and doesn't have a type inheritance (even though it will serialize, but that's a disfferent topic). -Clint public class EntityModelT *extends Identifiable* extends AbstractEntityModelT { public EntityModel(Class? extends T clazz, Serializable id) { super(clazz, id); } @Override protected T load(Class clazz, Serializable id) { return WicketApplication.get().get_ service().load(clazz, id); } } On Mon, Apr 18, 2011 at 6:16 AM, lucast lucastol...@hotmail.com wrote: Hi jcgarciam, I have made sure that my original class Parent does implement class IdentifiableSerializable and I have now modified EntityModelT to public class EntityModelT extends AbstractEntityModelParent {. That got rid the error message. So that's great. Thanks! I will try to have it running later on during the day. Why does AbstractEntityModel class on http://wicketinaction.com/2008/09/building-a-smart-entitymodel/ http://wicketinaction.com/2008/09/building-a-smart-entitymodel/ uses Serializable id, when later on, under Using EntityModel to bind to Forms it is passing a value of type Long to initialise the EntityModel class? Based on the example of the EntityModel.load() function, should I change my WicketApplication.get().get_service().load(clazz, id) to accept Serialisable instead of Long? Maybe I'm missing something basic here. But your suggestion helped to get past the initial hurdle. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Refreshing-loadable-detachable-model-object-inside-an-ajax-call-tp3446979p3457227.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: org.apache.wicket.WicketRuntimeException: No get method defined for class: class java.lang.String expression: userName;
The error is in the model you gave your form. Since you aren't explicitly stating a model for the DDC, it is assuming a CompoundPropertyModel on the parent form. I suspect your form declaration is something like new Form(form,new CompoundPropertyModel(getUserName())) It should be something like new Form(form,new CompoundPropertyModel(new User())) I'm personally not a fan of CPMs and prefer explicitly setting the model for each of my components. -Clint On Mon, Apr 18, 2011 at 11:59 PM, cablepuff cablep...@gmail.com wrote: Hi I have the following domain object public class User { private String email; private String firstName; private String lastName; private Account account; public String getUserName() { return this.account.getName(); } public void setUserName(String username) { this.account.setName(username); } } I have a form with dropdownchoice. final DropDownChoiceUser userChoice = new DropDownChoicePerson(userChoice, new ListModelUser(users), new ChoiceRendererUser(userName, userName)); When the page loads i get this error! org.apache.wicket.WicketRuntimeException: No get method defined for class: class java.lang.String expression: userName at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:492) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:332) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:242) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:95) at org.apache.wicket.markup.html.form.ChoiceRenderer.getIdValue(ChoiceRenderer.java:145) at org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(AbstractSingleSelectChoice.java:166) at org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:879) at org.apache.wicket.markup.html.form.AbstractChoice.onComponentTagBody(AbstractChoice.java:353) 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) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1441) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1604) at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1528) at org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:2012) 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) at org.apache.wicket.markup.html.border.Border$BorderBodyContainer.resolve(Border.java:421) at org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:65) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1445) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1604) at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1528) at org.apache.wicket.markup.html.border.Border$BorderBodyContainer.onComponentTagBody(Border.java:403) 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) at org.apache.wicket.markup.html.border.Border.resolve(Border.java:287) at org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:65) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1445) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1604) at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1528) at org.apache.wicket.markup.html.border.Border$BorderBodyContainer.onComponentTagBody(Border.java:403) 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) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1441) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1604) at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:697) at org.apache.wicket.markup.html.border.Border.onComponentTagBody(Border.java:328) at org.apache.wicket.Component.renderComponent(Component.java:2690) at
Re: Refreshing loadable detachable model object inside an ajax call
The 'implicit super constructor' warning means that in your constructor you need to call 'super()' The 'complains on type T' part I'd need a little more info. Feel free to post the exact lines of code. -Clint On Sat, Apr 16, 2011 at 2:21 AM, lucast lucastol...@hotmail.com wrote: However, when I try to extend the AbstractEntityModel as shown on EntityModelT extends AbstractEntityModelT example, my IDE starts to complaint with things like Implicit super constructor AbstractEntityModelT() is undefined for default constructor. Must define an explicit constructor. as for the extends AbstractEntityModelT it also complaints on type T.
Re: Mixing static with dynamic items in the same list
First of all, avoid using a label to generate html. Put the repeater on the LI element and add a link. Looks like you want an ExternalLink. HTML -- --- ul li a href=#First static item/a /li li a href=#Second static item/a /li li wicket:id=dynamicItems a wicket:id=dynamicListItem/a /li /ul Code - ListView dynamicItems = new ListView(dynamicItems, someList) { protected void populateItem(ListItem item) { ExternalLink link = new ExternalLink(dynamicListItem, hrefDestination ,item.getModel()); item.add(link); } }; You end up with better markup and java that is clearer to understand. On Sun, Apr 17, 2011 at 8:14 AM, Alexandros Karypidis akary...@yahoo.grwrote: Hello, I have a page with a simple HTML unordered list (ul), where part of the list items are static, whereas the rest of them are dynamic. To that end, I've injected a span tag at the end of the static items, adding a ListView in order to fill in the dynamic part, as follows: HTML - ul li a href=#First static item/a /li li a href=#Second static item/a /li span wicket:id=dynamicItems li wicket:id=dynamicListItem/li /span /ul Code - ListView dynamicItems = new ListView(dynamicItems, someList) { protected void populateItem(ListItem item) { Label link = new Label(dynamicListItem, a href='...' + item.getModelObject() + /a); link.setEscapeModelStrings(false); item.add(link); } }; This achieves what I need, but keeps the span tags in place (causing some unrelated CSS to miss its target elements). So, the HTML that is produced is as follows...: ul li a href=#First static item/a /li li a href=#Second static item/a /li spanliFirst dynamic item/li/span spanliSecond dynamic item/li/span spanliThird dynamic item/li/span /ul But what I want to achieve is the following clean output (notice the absence of span tags): ul li a href=#First static item/a /li li a href=#Second static item/a /li liFirst dynamic item/li liSecond dynamic item/li liThird dynamic item/li /ul How can I achieve this? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Refreshing loadable detachable model object inside an ajax call
Have you tried explicitly calling .detach() on the LDM? The net getObject() call should force the load() method to get called again. -Clint On Wed, Apr 13, 2011 at 7:16 AM, lucast lucastol...@hotmail.com wrote: Hi there, I have a problem reloading/refreshing Parent object P from inside an Ajax call. The conditions are as follow: I have Parent object P and child object C. Child object has a unique time-stamp constraint. Child objects can be created or updated from two different pages, page A and/or page B. In order to avoid unique constraint exception, I want to check if child with time-stamp T exists for parent P. It is my intention, therefore to refresh parent P in order to check. On the main panel I am using loadable detachable model and I am passing that loadable detachable model object to the panel where I want to do the checking. When I call (Parent) model.getObject(); I get the following exception: ERROR - RequestCycle - a different object with the same identifier value was already associated with the session: [com.myProject.dbEntities.domain.Parent#1364] org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.myProject.dbEntities.domain.Parent#1364] The way I am implementing the load function for the Loadable Detachable Model is just the standard: parentService().load(Parent.class, id); How can I refresh the Loadable Detachable Model object without getting the above exception and without having to refresh the entire page? Any help will be greatly appreciated. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Refreshing-loadable-detachable-model-object-inside-an-ajax-call-tp3446979p3446979.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ModalWindow detach/serialize crashes wicket app
Do you have a propetymodel with the session as its object? On Friday, April 1, 2011, Pedro Santos pedros...@gmail.com wrote: looks like your page is referencing session or pagemap somehow On Fri, Apr 1, 2011 at 4:15 PM, Russell Morrisey russell.morri...@missionse.com wrote: Guys, I'm having an intermittent issue in development where use of a ModalWindow on a page completely crashes wicket. I don't know of the ModalWindow is the root cause. I am hoping that someone with intimate knowledge of wicket's page store can help me narrow it down. Hints appreciated. =) The X button and other ajax controls within the ModalWindow's content page stop responding to user input. When I try to hit the same bookmarkable URL again for the containing page, wicket seems to have stopped running entirely, and I get a Tomcat HTTP 404 error. The JVM outputs a StackOverflowError which looks like it happens during page serialization. Apr 1, 2011 2:53:14 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet default threw exception java.lang.StackOverflowError The two blocks below occur multiple times, each, within a single trace: ... at org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:121) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1130) at org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203) at org.apache.wicket.protocol.http.pagestore.DiskPageStore.prepareForSerialization(DiskPageStore.java:1190) at org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.writeObject(SecondLevelCacheSessionStore.java:386) ... at org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:121) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1130) at org.apache.wicket.protocol.http.pagestore.AbstractPageStore$PageSerializer.getPageReplacementObject(AbstractPageStore.java:288) at org.apache.wicket.Page.writeReplace(Page.java:1383) In our application's init() method, we have this setting: Objects.setObjectStreamFactory(null); // jdk serialization I have tried to reproduce the problem in a quickstart; but, I have not had much luck, so far. We don't really have any custom code in our app that deals with object serialization. Any help would be appreciated. We are currently using wicket 1.4.9; if you guys think this might be fixed in a later version, we'd be happy to upgrade. I searched briefly through the JIRA, and nothing popped out at me. RUSSELL E. MORRISEY Programmer Analyst Professional Mission Solutions Engineering, LLC | russell.morri...@missionse.com | www.missionse.com http://www.missionse.com/ 304 West Route 38, Moorestown, NJ 08057-3212 This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind MSE to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: StatelessForm redirect
The remaining stack trace seems strange. But ignoring that and focusing on setting the 'action' attribute, in the webmarkup container that you use (in stead of a form component) Do something like: @Override onComponentTag(...){ tag.put(action,RequestCycle.get().urlFor(SearchResultspage.class)) } Its hacky but would work. Probably want to make sure you've using method=get on the form too. -Clint On Tue, Mar 29, 2011 at 11:50 AM, lovewicket pey...@hotmail.com wrote: Actually I handled the exception (in the catch block) and that's how I knew that the current page wanted to redirect to the intended page. I was getting the above posted exception and then the following exception: 2011-03-28 22:55:49.0783 ERROR http-8080-1 org.apache.wicket.protocol.http.WebResponse - Unable to redirect to: searchresults?value=year=AllmoviesIncluded=falseimagesIncluded=falseimageType=AllmovieType=AllmovieSize=Any, HTTP Response has already been committed. 2011-03-28 22:55:49.0783 ERROR http-8080-1 org.apache.wicket.protocol.http.WicketFilter - closing the buffer error java.lang.IllegalStateException at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:435) at org.apache.wicket.protocol.http.WebResponse.sendRedirect(WebResponse.java:299) at org.apache.wicket.protocol.http.WebResponse.redirect(WebResponse.java:250) at org.apache.wicket.protocol.http.BufferedWebResponse.close(BufferedWebResponse.java:67) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:502) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) How would you pass in pageparameters through component tag? Thank you -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/StatelessForm-redirect-tp3406282p3415450.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: StatelessForm redirect
Do you get the same error when mounting the page using a QueryStringEncodingStrategy? On Monday, March 28, 2011, lovewicket pey...@hotmail.com wrote: It looks like onSubmit, request first comes to the current page and then it gets forwarded to the results page. I am not sure why this is the case. In stateless application, loading the current page again fails the validation because the parameters that are needed to build the current page are not there. I even tried to store these as a hidden field, but on form submit they come up blank. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/StatelessForm-redirect-tp3406282p3412643.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: StatelessForm redirect
Wicket uses a 2 step render : http://wicket.apache.org/apidocs/1.4/org/apache/wicket/settings/IRequestCycleSettings.html Have you tried using setRenderStrategy(ONE_PASS_RENDER ONE_PASS_RENDER) in your application? -Clint On Mon, Mar 28, 2011 at 7:37 PM, lovewicket pey...@hotmail.com wrote: Yes. I have the following in my application class: mount(new QueryStringUrlCodingStrategy(/searchresults, SearchResultsPage.class)); It didn't work. I am not sure why wicket doesn't directly go to the specified page instead of loading the current page again and then going to the specified page. I would assume, in a stateless environment, this would fail everytime. By the way, if I change StatelessForm to Form, it all works, but it creates a session which is not desired (since we were having memory issues with sessions). As a workaround, I stored the parameters as a hidden field on the page (can verify this via Page Source), but when I tried to retrieve them via getMarkupAttributes() it came out blank so I have to assume that the attributes are added at the last rendering stage and are not read back in on form submit. I would really appreciate any ideas. Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/StatelessForm-redirect-tp3406282p3413429.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: StatelessForm redirect
Ah, the trouble is in your NPE: java.lang.NullPointerException at index.AbcPage.validateParams( AbcPage.java:258) As long as that exception remains unhandled, the pages won't hand off. The Form has to resubmit back to the page the form lives on since that is where the form listener is waiting. If you feel confident and wish to totally bypass wicket's form processing, instead of a Form you could use a WebMarkupContainer and in the onComponentTag set the Action attribute to the page you want to redirect to. I did something similar long ago when I was first learning Wicket. I don't recommend it, but it is a possible solution. -Clint On Mon, Mar 28, 2011 at 10:01 PM, lovewicket pey...@hotmail.com wrote: I tried to put the following in my application class, but unfortunately got the same results (application tries to load the current page and then redirect the request): getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.ONE_PASS_RENDER); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/StatelessForm-redirect-tp3406282p3413610.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Page to select something and use the selection in another page
Could the second page be a modal window? Or do you require that it is a separate browser window? On Sunday, March 27, 2011, fernandospr fernando...@gmail.com wrote: Hi, I need to build a page (1) where the user will have a form and one of the inputs will have a button that will open another page (2) where he/she will select something from a list, probably from a DataView, then accept and use the selected item in the form of page (1). Any ideas? Thanks in advance. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Page-to-select-something-and-use-the-selection-in-another-page-tp3409591p3409591.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Set all form fields to output markup id automatically
If this is specific to a particular form you could use A formcompoment visitor to iterate over each child and call setOutputMarkupId On Sunday, March 27, 2011, Bruno Borges bruno.bor...@gmail.com wrote: I was looking for a better way (optimized too) to achieve this, considering that I'm using Scala. I admit I'm not an expert on Scala though. :-) Bruno Borges www.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld On Sun, Mar 27, 2011 at 9:56 PM, James Carman ja...@carmanconsulting.comwrote: A quick way to set it by default would be to use a IComponentInitializationListener. On Sun, Mar 27, 2011 at 8:52 PM, Bruno Borges bruno.bor...@gmail.com wrote: I'm developing a project with Scala + Wicket and I wanted to set that all form components have their markup id output automatically (setOutputMarkupId(true)). Any idea? Cheers, Bruno Borges www.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld - 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
Wicket Cookbook Questions - ConversionExceptions (pg 30)
I'm really enjoying Igor's Wicket Cookbookhttps://www.packtpub.com/apache-wicket-cookbook/book(hooray for ebooks and instant delivery!) Instead of asking Igor directly, I figure this mailing list is a better forum. There is an example (page 30) like the following: ConversionException e = new ConversionException( Error converting value: + value + to an instance of: + Time.class.getName()); *e.setSourceValue(value);* e.setVariable(inputPiece, value); e.setResourceKey(getClass().getSimpleName() + . + errorKey); My question is the purpose of 'setSourceValue()' call. I suspected it was to leverage the converted value in validation messages, but ${input} already has that value. Next I figured it could be used for the sub piece of a conversion, like in parsing a time of day (11:15am) then is the minute section was wrong (11:99am) the it would expose that specific value, but setVariable() meets that need: e.setVariable(inputPiece, value); The previous line makes ${inputPiece} available in Validation messages. So what does setSourceValue() do? -Clint
Wicket mentioned at Server Side Symposium
Take the following with a grain of salt since I was told by a friend, of a friend that attended the Server Side Symposium last week. I don't have any of the details either so bear with me. Apparently in a session related to 'corporations using open source' the speaker asked if any companies were using Wicket. He cautioned that Wicket was an example of mis-managing by being known to break it's APIs in minor point-releases. In my experience with the Wicket API, I've only seen major API changes in the major releases: 1.3 - 1.4 and the upcoming 1.5. (In my book API *additions *like adding onConfigure don't count) So of course I stood up for Wicket. Even when I've proposed changes myself the core developers have done a great job of not breaking APIs. So, does anyone else know what this speaker may have been referring to regarding API breakages? -Clint
Replacing markup generated by a Behavior
I have a Visitor that iterates through my forms and adds a Behavior that writes out to the Response a div and any feedback messages that belong to that component. This is really great because it gives me inline feedback panels. Here is the problem: if the component is ever updated via ajax, the component the behavior is tied to get replaced in the DOM, but the feedback messages get written out in another div again. My core need is to create some sort of auto-adding inline feedbackpanel. Any good recommendations on how to work around this? It's such a good design pratice to have error messages next to the offending input fields, I'm sure others have had to deal with this.
Re: Replacing markup generated by a Behavior
Elegant! I'd been trying to think of ways to add my own markup ID and piggyback off any render requests that redraw the component to trigger and render the feedback, just using the component markupId will work great! Instead of setOutputMarkupId(false), I'll detect that to decide to add the ID or not and just remove the ID attribute in the onComponentTag() method. I'll code it up tomorrow. I've got a good feeling about this. Thanks for the help. Also I'll check out the IAjaxRegionMarkupIdProvider. Always good to check out the new interfaces. -Clint On Thu, Oct 28, 2010 at 5:28 PM, Jeremy Thomerson jer...@wickettraining.com wrote: On Thu, Oct 28, 2010 at 5:19 PM, Clint Checketts checke...@gmail.com wrote: I have a Visitor that iterates through my forms and adds a Behavior that writes out to the Response a div and any feedback messages that belong to that component. This is really great because it gives me inline feedback panels. Here is the problem: if the component is ever updated via ajax, the component the behavior is tied to get replaced in the DOM, but the feedback messages get written out in another div again. My core need is to create some sort of auto-adding inline feedbackpanel. Any good recommendations on how to work around this? It's such a good design pratice to have error messages next to the offending input fields, I'm sure others have had to deal with this. A couple options: - Use a Border. Of course, then it's harder to add this automatically because a border will look for the html in the parent container. - in your behavior, in the div you render, render the div with the markup ID of the component you are wrapping, and then call setOutputMarkupId(false) on the component you are wrapping. thus, you are moving the markup id up to the wrapping div. - if you are using wicket 1.4.10 or greater, implement IAjaxRegionMarkupIdProvider, which allows you to override the id of the markup region that will updated via ajax -- Jeremy Thomerson http://wickettraining.com *Need a CMS for Wicket? Use Brix! http://brixcms.org*
Re: How can I reload HTML in app engine?
The instructions that I followed were here: http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html Snippet from that post below. Note how he creates his own RequestCycle that enables modification watching when in DevelopmentMode: class MyWebRequestCycle extends WebRequestCycle { MyWebRequestCycle(final WebApplication application, final WebRequest request, final Response response) { super(application, request, response); } @Override protected void onBeginRequest() { if (getApplication().getConfigurationType().equals(Application.DEVELOPMENT)) { final GaeModificationWatcher resourceWatcher = (GaeModificationWatcher) getApplication() .getResourceSettings().getResourceWatcher(true); resourceWatcher.checkResources(); } } } -Clint On Thu, Oct 21, 2010 at 9:54 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Is you have success and-or find some easier solution can you ports here? I will start using GAE on a regular basis soon... Ernesto On Thu, Oct 21, 2010 at 11:51 PM, EC chalanga.e...@gmail.com wrote: What a hack. Those things should be simple. I will give it a try. On Thu, Oct 21, 2010 at 4:37 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Maybe [1] contains some info? Ernesto 1-http://kimenye.blogspot.com/2009/06/google-app-engine-wicket.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Conditional Validation (Save versus Submit)
I have a form with 2 buttons: Save and Submit. If the user hits Save I want to bypass my validations, but still update the underlying model objects so i can persist them in a partially completed state, then have the full validation run when the Submit button is clicked. If I call setDefaultFormProcessing(false) then the underlying model isn't updated either, right? This seems like a pretty common issue, has anyone else implemented a genius way of dealing with save/submit logic? Thanks, -Clint
Re: AJAX error on IE8 Win 7
I'm currently wrestling with a similar sounding bug with AjaxChoiceComponentUpdatingBehaviors and Radio boxes and IE7. I'll try to get it simplified down to a quickstart. -Clint On Tue, Aug 31, 2010 at 10:42 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: most likely you have a problem with your markup, eg a div inside a span or something like that. thats all i can say without seeing the code. -igor On Tue, Aug 31, 2010 at 5:28 AM, Laurentiu Trica laurentiu.tr...@finalfolder.biz wrote: Hello, I have a problem with an AjaxCheckBox which should update a panel in IE8 Win 7 I get the following error in the Ajax Debug Window: ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Object required Can you please help me with this? -- Laurentiu Trica Software Developer Mobile: (+40) 722 329318 S.C MoreDevs S.R.L. Email: laurentiu.tr...@finalfolder.biz This message can contain privileged or confidential information and it is intended only for addressee. Any unauthorized disclosure is strictly prohibited. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Extending RequestLogger
I'm trying to implement my own RequestLogger but have hit a snag. As an initial implementation i just copied the existing RequestLogger completely (instead of extending it) and am editting it to do what I need. There are 2 snags that I have run into: 1) SessionData and RequestData are inner classes in RequestLogger and the IRequestLogger interface requires the getRequests() to return a ListRequestData (meaning the inner class to RequestLogger). I could work around it if the interface said ListT extends RequestData instead of that specific RequestData. Could the interface's generics be updated to allow for that? Is there a way that I can 'override' the interface? 2) In SessionData addTimeTaken(long time), setSessionInfo(Object sessionInfo), and setSessionSize(long size) are declared without public or protected. SO i am not able to override them (or call them from my custom RequestLogger). Is that an oversight? Shouldn't those methods be 'public'? Let me know if you require me to open tickets or anything to fix these. I'm still new enough to this that I'm not certain if these are bugs or features. -Clint
Re: How to write markup if type of component is not known yet...
I use the AjaxEditableLabel and related components and I've subclassed them overriding the onBeforeRender adding a call that checks if it should be in edit mode, then its just a matter of setEnabled(false) to keep the AjaxEditableLabel as a label. -Clint On Wed, Dec 2, 2009 at 3:24 AM, Pieter Degraeuwe pieter.degrae...@systemworks.be wrote: Hmm, that seems to be an easier solution; this way I, don't need to wrap everyting in a panel... Thanks for that tip ! On Wed, Dec 2, 2009 at 10:21 AM, Daan van Etten d...@stuq.nl wrote: Ah, I misread your original question. Maybe you can use Wicket Fragments for each type of input. http://wicket.apache.org/examplefragments.html Regards, Daan van Etten On Wed, 2009-12-02 at 10:19 +0100, Pieter Degraeuwe wrote: I'll go for the 'each detail' has a panel, and create these detail Panels via a factory. Thanks all of you. On Wed, Dec 2, 2009 at 10:12 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Reuse the complex markup and use different detail panels for each detail? Maybe via some factory? Ernesto On Wed, Dec 2, 2009 at 10:06 AM, Pieter Degraeuwe pieter.degrae...@systemworks.be wrote: I want to avoid this, since I wanted to reuse the (complex) markup... Is there no way around this? On Wed, Dec 2, 2009 at 10:02 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Keep it simple and write 2 panels. -Ursprüngliche Nachricht- Von: Pieter Degraeuwe [mailto:pieter.degrae...@systemworks.be] Gesendet: Mittwoch, 2. Dezember 2009 09:55 An: users@wicket.apache.org Betreff: How to write markup if type of component is not known yet... Hi all, I want to write a panel which kan render in 2 modes: editable and read-only. In read-only mode all my components are just labels. In edit mode, are these labels replaced by input fields (e.g. Textfields, DropDowns, etc) The problem is now that I only want to write one markup (since all components are ordered in a quite complex hierarchy) Wicket complains now that tag type must be input instead of span... Is there any way around this. (Or am I doing bad practices...) regards, Pieter -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be
Re: wicket + jdbc template app
My Wicket app I maintain only uses the JdbcTemplate class from Spring. We don't use any hibernate or other ORM framework. I don't have any code I can give, but I can answer any questions. How far have you gotten? -Clint On Thu, Nov 19, 2009 at 7:23 AM, James Carman jcar...@carmanconsulting.comwrote: Are you saying you don't want to use Spring at all? But, you do want to use DBCP or C3P0? On Thu, Nov 19, 2009 at 7:46 AM, Ivan Dudko ivan.du...@gmail.com wrote: Hello, guys! I am still could not implement wicket application without any persistence framework and also spring-jdbc. I want to use only connection pooling with dbcp or c3p0. May you provide example for this kind of app. Thank you for answer! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WebRequestCycle is creating a HTTP 400/Bad request
I've been hitting a similar bug with MixedParamUrlCodingStrategy and Stateless forms. I haven't had a chance to create a sample yet so I just changed encoding strategies for the time being. I believe your bug is similar to the one I''m hitting. I'm using Wicket version 1.3.7. I'll try to post a simple case to see if it really is identical. -Clint On Wed, Oct 21, 2009 at 12:51 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: so is it jetty/tomcat doing the conversion of relative url to absolute? because looks like they are doing it incorrectly... -igor On Wed, Oct 21, 2009 at 9:11 AM, Wayne Pope waynemailingli...@googlemail.com wrote: Hi, firstly I'm sure this is something we are doing wrong here and is not an issue with wicket however we're lost as to what to do to solve it. We have a page mounted like this: mount(new MixedParamUrlCodingStrategy(/cube/todos, WhichTaskPage.class,. We then request this page: http://locolhost:8080/cube/todos/1/116 In the constructor of WhichTaskPage with throw a RestartResponseAtInterceptPageException (and I have tried just using setResponsePage) to another page. Now in WebRequestCycle.redirectTo(final Page page) the line: redirectUrl = page.urlFor(IRedirectListener.INTERFACE).toString(); creates the following url: ../../../?wicket:interface=:13 further up the call stack Jetty/Tomcat returns a HTTP 302 with the location: http://localhost:8080/../../../?wicket:interface=:13 Now the issue: Firefox seems to be smart enough to then request the following url (I'm using a the sniffer call fiddler for this): GET /?wicket:interface=:3 HTTP/1.1 this resolves and works fine. However Internet Explorer does what its asked and redirect to: GET /../../../?wicket:interface=:3 HTTP/1.1 This url does exists and Tomcat/Jetty returns HTTP 400 This is effecting all our IE users and we're in a bit of a panic as how to solve it. Any ideas? many thanks Wayne - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Preventing Copy Pasting URL's In Same Browser Session
I'm guessing they are trying to limit users from taking a test in one window and seeing the previous answers in another. -Clint On Tue, Sep 29, 2009 at 12:29 PM, nino martinez wael nino.martinez.w...@gmail.com wrote: could'nt he just have a page map with a size of 0? Of course reloads would'nt work and probably a bunch of other stuff too.. Seems like at strange thing to limit on though. 2009/9/29 Matej Knopp matej.kn...@gmail.com On Tue, Sep 29, 2009 at 6:48 PM, Pedro Santos pedros...@gmail.com wrote: We have this requirement in which we cannot allow the customer to copy paste the url that's appearing in the address bar into the same browser. Crazy thing. How about to include an request counter to your url encode/decode strategy? That wouldn't work. Or it would prevent refresh as well. This is not really doable. If you need this kind of control web applications simply aren't what you should be doing. -Matej On Tue, Sep 29, 2009 at 1:41 PM, Carlo Camerino carlo.camer...@gmail.comwrote: Hi everyone, We have this requirement in which we cannot allow the customer to copy paste the url that's appearing in the address bar into the same browser. For example in a different tab or in a new window. This can easily be done in Wicket Framework since the url has a corresponding page attached to it. For example if i get http://localhost/wicket:interface=1 appearing in the address bar, I can open anew tab paste the url and I could get into the same page. The users don't want this behavior. Could I make it work in such a way that I copy http://localhost/wicket:inteface=1, when i try to copy and paste it, it will redirect me to an error page? This happens even after the user has already logged in. Really need help on this one. Thanks Carlo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org