Re: Announcement: Annotation-based Mounting of Resources
Hi again, First of all, thank you for your time and dedication with this project, I think is really useful and interesting. I just can't have it working and I don't know the reason, I would really appreciate if you can spend a few minutes trying to help me if you don't mind. I'm using Wicket 1.4.3 and the annotations approach. My javascript files are all in /js not in the java folder. So what I do is go the init() of my webapp and write this: ResourceMount mount = new ResourceMount(); ResourceMount.mountAnnotatedPackageResources(/js, MyApplication.Page, this, mount); Then I go to MyApplication.Page.HomePage and write this annotation: @JsContribution(jquery.min.js) When I try to run the application, I get this error: failed to mount resource ('/js/all.js') WicketRuntimeException: js/all.js is already mounted for SharedResourceEncoder I'm sure I'm understanding something wrong... hope you can help me... Thank you again, Oskar sfussenegger wrote: Today, I’m happy to announce the availability of annotation-based mounting and merging of resources in wicketstuff-merged-resources (version 3.0-SNAPSHOT for Wicket 1.4, version 2.1-SNAPSHOT for Wicket 1.3). In order to mount resources, all that’s needed is adding annotations to component classes: @JsContribution @CssContribution(media = print) @ResourceContribution(value = accept.png, path = /img/accept.png) public class PanelOne extends Panel { public PanelOne(String id) { super(id); // ... } } As an added benefit, you’ll get all the other features of wicketstuff-merged-resources: merging of multiple files into one for less HTTP requests adding of versions to resource paths for aggressive caching pre-processing of resources (e.g. replacing colors in CSS files) optionally uploading them to Amazon Cloudfront (well, at least you can expect this feature soon – we are using it already) So you will speed up rendering of your pages while simplifying and reducing your code (there’s no need to merge, mount or add HeaderContributors manually anymore)! More on our blog ... http://techblog.molindo.at/2009/10/wicket-annotation-based-mounting-of-resources.html ... and Wicket Stuff Wiki: http://wicketstuff.org/confluence/display/STUFFWIKI/wicketstuff-merged-resources Cheers - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - Stefan Fussenegger Wicket: wicketstuff-merged-resources Wicket on techblog.molindo.at -- View this message in context: http://old.nabble.com/Announcement%3A-Annotation-based-Mounting-of-Resources-tp25886703p26604363.html Sent from the Wicket - User 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: submit a form using ajax
Hi, Finally I found a solution that works for me, just in case it is good for someone else: I added an AjaxFormComponentUpdatingBehavior onkeyup to all the fields in the form (actually just two), and I added an AbstractAjaxTimerBehavior to the page which will look for changes in the values and autosave them. Thank you all, Oskar bferr wrote: Could you try using an OnChangeAjaxBehavior with a setThrottleDelay(). Juri Prokofiev-2 wrote: I'm trying to save form values every 30 seconds and for this purpose I use AbstractAjaxTimerBehavior class, but can't figure out how to get the form values if submit button wasn't pressed? Thank you -- http://www.autoladu.ee - kõik varuosad ühes kohas -- View this message in context: http://www.nabble.com/submit-a-form-using-ajax-tp23943077p24928725.html Sent from the Wicket - User 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: submit a form using ajax
Any luck with this one? I can't figure out how to do it... igor.vaynberg wrote: you have to wire a bit of javascript to do this from the timer, see how ajaxsubmitlink does it... -igor On Tue, Jun 9, 2009 at 6:39 AM, Juri Prokofievj...@unix.ee wrote: I'm trying to save form values every 30 seconds and for this purpose I use AbstractAjaxTimerBehavior class, but can't figure out how to get the form values if submit button wasn't pressed? Thank you -- http://www.autoladu.ee - kõik varuosad ühes kohas - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/submit-a-form-using-ajax-tp23943077p24911252.html Sent from the Wicket - User 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
AutocompleteTextField and tab key
Hello, I'm trying to develop the suggestions gmail uses when inputting one email address. So I used one AutocompleteTextField that populates the possible values from the database nicely, but I can not make the model changing correctly if the users doesn't press the Enter key or click in the option. For example, I start typing my name: Oskar, when I typed 'Os', the autocomplete field founds my name, then I select it with the cursor keys and press the tab button for going to the next field in the form, but the model is still 'Os', not the complete 'Oskar' name I selected before pressing tab key. If I do the same, but I press 'Enter' instead, then it works nicely. -- View this message in context: http://www.nabble.com/AutocompleteTextField-and-tab-key-tp21576195p21576195.html Sent from the Wicket - User 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
AutocompleteTextField and tab key
Hello, I'm trying to develop the suggestions gmail uses when inputting one email address. So I used one AutocompleteTextField that populates the possible values from the database nicely, but I can not make the model changing correctly if the users doesn't press the Enter key or click in the option. For example, I start typing my name: Oskar, when I typed 'Os', the autocomplete field founds my name, then I select it with the cursor keys and press the tab button for going to the next field in the form, but the model is still 'Os', not the complete 'Oskar' name I selected before pressing tab key. If I do the same, but I press 'Enter' instead, then it works nicely. Thank you always for all your help and time, Oskar -- View this message in context: http://www.nabble.com/AutocompleteTextField-and-tab-key-tp21576199p21576199.html Sent from the Wicket - User 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 - how to populate two input fields
Hello, I know this message is from long time ago... but actually I'm stuck in a similar situation... is too much to ask if I can get that code too? Actually I know is too much to ask, but... Thanks, Oskar Francisco Diaz Trepat - gmail wrote: I'm on in. I'll send you the samples latter in the day. cheers, f(t) On 10/11/07, German Morales germanmora...@delta-sys.com wrote: Hallo, With some luck you will get the usage examples later. (Francisco?) German It seems that Oliver Lieven wrote: Hi German, thanks for your offer, would be great if you could send me your code. BTW, in the meantime I got my 2nd approach working, too. I've got the two separate textfields, each of them showing the zipcode - city autocomplete lists when data is entered. After selecting from the autocomplete list, both fields are updated correctly! Regards, Oliver German Morales wrote: Hi again, Yes, we have something similar to what you describe in your point 2. The only difference is that we have other structure. What we have is the following: -Each locality has an internal ID, a Zip Code, a City and a (swiss) kanton. -in the html we have a Hidden, which stores the internal ID, and 1 (only) TextField, which shows Zip Code + City + Canton (For example: 8052 Seebach, ZH). -then we have an extension as you mention (AutoCompleteTextField, Renderer, Behavior, JavaScript), which is already working with this schema. It also contains many fixes over the original autocompletetextfield (perhaps originated from the extra behavior?). If this approach is good for you, i can send you our version, plus some example usages. Regards, German It seems that Oliver Lieven wrote: Hi, thanks for your answer. No, solution didn't work as supposed, mainly because the AutoComplete fills the input field in the browser with the data (in my case either zipcode or city), but doesn't update the model. To update the model I have to attach some Ajax...Behavior, but this is called with the data put into the textfield (i.e. either the selected zipcode put into the zipcode field by the autocomplete, *or* the selected city from the city field). In the Ajax...Behavior's onUpdate()-method neither the city nor the zipcode are enough to determine the value to use to update the related field. So I had two other ideas: 1. in my autocomplete-list I set the textvalue to the id of a zipcode-city combination. When the user selects from the autocomplete-list, this id is written into the corresponding input-field. The attached AjaxOnChangeBehavior now gets this id, determines the zipcode-city, and updates the city and the zipcode field. This works, but looks a little strange to the user (e.g. selection of 71254 Ditzingen from autocomplete-list writes the id (1223) into the zipcode-field, this issues the Ajax-call, which updates both fields with the correct data, i.e. zipcode=71254, city=Ditzingen). As I said, works but not pretty. 2. So I'm currently extended the AutoCompleteTextField, ...Renderer, ...Behavior, ..JavaScript to accept a second, related field in its constructor. I then attach two attributes to the autocomplete-list entries (say textvalue and textvalue2), and modified the JavaScript to update both fields. This seems to me the best approach to my specific problem, and seems to work as intended. Hope my answer was not to confusing... regards, Oliver German Morales wrote: Hi, Sorry, i'm a little late with my response. Did the suggestion by Nino work? If it works, i would like to know more details about it. If not, we already had a somehow similar problem (Swiss addresses), and we have a different solution already working. Perhaps it can help you too. Regards, German It seems that Nino Saturnino Martinez Vazquez Wael wrote: NP, waiting with excitement to hear if it works:) Oliver Lieven wrote: Thanks allot for your efforts and detailed answer! Sounds good, I'll give it a try. Nino.Martinez wrote: No what I meant was that when a user selects something in one of your auto complete fields they'll automatickly select something in both, might have been a little scares on information: IModel commonModel=new Model(); AbstractModel() Text=new AbstractModel(){ getObject{ return commonModel.getObject.Text; } setObject(obj){ commonModel.setObject(obj) } } AbstractModel() name=new AbstractModel(){ getObject{ return commonModel.getObject.name; } setObject(obj){ commonModel.setObject(obj) } } AutoCompleteTextField phoneName = new AutoCompleteTextField( phoneName, name, new BestEffortRendererAutoCompleteRenderer()) { @Override protected Iterator
Re: ?xml tag, japanese and ie6
Hello, Thank you all for your quick responses. It is always nice to find people like you who are willing to help. The server is Red Hat, but I'm developing in local Windows machine... that is the mistake, the JVM is not using UTF-8 like in the Linux one. We tried to upload the files to the server without the ?xml tag, and everything worked smoothly. Again, thank you so much for your time, Oskar richardwilko wrote: Ok, but what os are you using? on windows the default character encoding is not utf-8 and java uses the system default character encoding. Also check that the html files are saved in utf-8 tbh i think that meta tag only works for really old browsers, but doesn't hurt anything if it is there. Toscano wrote: Hello, Thank you for your answer. In every case, the encoding in the browser is utf-8. It doesn't work with the metatag you send to me, it is already added in all the pages. It only works if I add the ?xml tag. Even more, I have one page with three different panels. Two of them have the ?xml line in the markup and the Japanese shows correctly, the third one has not and the japanese is corrupted. So in the same page we have correct and incorrect japanese, because the ?xml is not there. Has to be something related with Wicket... Thank you again, Oskar richardwilko wrote: What is the encoding of your outputted pages (in firefox right click, view page info)? This will depend on what platform you are running on (os and webserver). if it is not utf-8 then you will need to change your setup so that it is. then it *should* work. its also possible that the page encoding is being forced to something else by the browser. you could also try adding this line to your html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 / btw, I dont think this isnt really a wicket problem, more a server setup problem. Toscano wrote: Hello, We are developing a multilanguage application, so our standard is utf-8. We are making intensive use of Wicket's localization features, but recently we found a problem and we can't find a good solution for it. Basically is this: for not getting corrupted Japanese, we have to include the following line in the html file: ?xml version=1.0 encoding=UTF-8? But if we include that file, then all the layout in http://lists.xml.org/archives/xml-dev/200109/msg00182.html IE6 is a mess . We tried to change the ?XML declaration with metatags inside the head of the file, but it doesn't work, the Japanese only shows correctly if the tag is there. So if we leave the tag, we get Japanese but the layout is a mess in IE6. If we removed it, we get good layout but corrupted Japanese. Is there any tag or something to configure in Wicket for making the Japanese show correctly without the ?XML tag? As always, thank you for your time, Oskar -- View this message in context: http://www.nabble.com/%3C-xml-tag%2C-japanese-and-ie6-tp18400121p18479034.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
?xml tag, japanese and ie6
Hello, We are developing a multilanguage application, so our standard is utf-8. We are making intensive use of Wicket's localization features, but recently we found a problem and we can't find a good solution for it. Basically is this: for not getting corrupted Japanese, we have to include the following line in the html file: ?xml version=1.0 encoding=UTF-8? But if we include that file, then all the layout in http://lists.xml.org/archives/xml-dev/200109/msg00182.html IE6 is a mess . We tried to change the ?XML declaration with metatags inside the head of the file, but it doesn't work, the Japanese only shows correctly if the tag is there. So if we leave the tag, we get Japanese but the layout is a mess in IE6. If we removed it, we get good layout but corrupted Japanese. Is there any tag or something to configure in Wicket for making the Japanese show correctly without the ?XML tag? As always, thank you for your time, Oskar -- View this message in context: http://www.nabble.com/%3C-xml-tag%2C-japanese-and-ie6-tp18400121p18400121.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ?xml tag, japanese and ie6
Hello, Thank you for your answer. In every case, the encoding in the browser is utf-8. It doesn't work with the metatag you send to me, it is already added in all the pages. It only works if I add the ?xml tag. Even more, I have one page with three different panels. Two of them have the ?xml line in the markup and the Japanese shows correctly, the third one has not and the japanese is corrupted. So in the same page we have correct and incorrect japanese, because the ?xml is not there. Has to be something related with Wicket... Thank you again, Oskar richardwilko wrote: What is the encoding of your outputted pages (in firefox right click, view page info)? This will depend on what platform you are running on (os and webserver). if it is not utf-8 then you will need to change your setup so that it is. then it *should* work. its also possible that the page encoding is being forced to something else by the browser. you could also try adding this line to your html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 / btw, I dont think this isnt really a wicket problem, more a server setup problem. Toscano wrote: Hello, We are developing a multilanguage application, so our standard is utf-8. We are making intensive use of Wicket's localization features, but recently we found a problem and we can't find a good solution for it. Basically is this: for not getting corrupted Japanese, we have to include the following line in the html file: ?xml version=1.0 encoding=UTF-8? But if we include that file, then all the layout in http://lists.xml.org/archives/xml-dev/200109/msg00182.html IE6 is a mess . We tried to change the ?XML declaration with metatags inside the head of the file, but it doesn't work, the Japanese only shows correctly if the tag is there. So if we leave the tag, we get Japanese but the layout is a mess in IE6. If we removed it, we get good layout but corrupted Japanese. Is there any tag or something to configure in Wicket for making the Japanese show correctly without the ?XML tag? As always, thank you for your time, Oskar -- View this message in context: http://www.nabble.com/%3C-xml-tag%2C-japanese-and-ie6-tp18400121p18400964.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ?xml tag, japanese and ie6
Hi, Is Red Hat and the webserver is configured to serve in UTF-8. The point is that IE6 has problems to proccess HTML with the ?XML, so I need Wicket to not output that tag without affecting to the encoding of the content which has to be utf-8. Trust me, the layout results really hurt in IE6 with that tag. I have more experience working with Japanese websites, and I already checked all the encodings: file, webserver... richardwilko wrote: Ok, but what os are you using? on windows the default character encoding is not utf-8 and java uses the system default character encoding. Also check that the html files are saved in utf-8 tbh i think that meta tag only works for really old browsers, but doesn't hurt anything if it is there. Toscano wrote: Hello, Thank you for your answer. In every case, the encoding in the browser is utf-8. It doesn't work with the metatag you send to me, it is already added in all the pages. It only works if I add the ?xml tag. Even more, I have one page with three different panels. Two of them have the ?xml line in the markup and the Japanese shows correctly, the third one has not and the japanese is corrupted. So in the same page we have correct and incorrect japanese, because the ?xml is not there. Has to be something related with Wicket... Thank you again, Oskar richardwilko wrote: What is the encoding of your outputted pages (in firefox right click, view page info)? This will depend on what platform you are running on (os and webserver). if it is not utf-8 then you will need to change your setup so that it is. then it *should* work. its also possible that the page encoding is being forced to something else by the browser. you could also try adding this line to your html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 / btw, I dont think this isnt really a wicket problem, more a server setup problem. Toscano wrote: Hello, We are developing a multilanguage application, so our standard is utf-8. We are making intensive use of Wicket's localization features, but recently we found a problem and we can't find a good solution for it. Basically is this: for not getting corrupted Japanese, we have to include the following line in the html file: ?xml version=1.0 encoding=UTF-8? But if we include that file, then all the layout in http://lists.xml.org/archives/xml-dev/200109/msg00182.html IE6 is a mess . We tried to change the ?XML declaration with metatags inside the head of the file, but it doesn't work, the Japanese only shows correctly if the tag is there. So if we leave the tag, we get Japanese but the layout is a mess in IE6. If we removed it, we get good layout but corrupted Japanese. Is there any tag or something to configure in Wicket for making the Japanese show correctly without the ?XML tag? As always, thank you for your time, Oskar -- View this message in context: http://www.nabble.com/%3C-xml-tag%2C-japanese-and-ie6-tp18400121p18401237.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Migration to new version 1.3.3
Hello, Finally I decided to migrate the project I have been working for the last year from 1.2.6 to 1.3.3 Wicket version. Some of the errors I got before are solved, like the AutoComplete field (which is great, by the way), but I have two issues that I have to solve or I will go back to 1.2.6 for continuing with the development (we are really in a rush and must go live this summer). The issues are: - The application is in more than 20 languages, so UTF8 is mandatory. This was working fine, people types their name in Japanese and that goes to database smoothly. Now, every non-english character gets corrupted. The database and tomcat server configuration has not been touch, and not the code except for the migration issues... - Suddenly I got stackoverflow exceptions all the time (I have never seen that with 1.2.6) I'm using spring-wicket application with ibatis and postgresql running in Tomcat 6 with JDK 1.6 I have been researching about both in the mailing lists, but I still can't figure out why this is happening to me... As always, thank you very very much for your time and support, Oskar -- View this message in context: http://www.nabble.com/Migration-to-new-version-1.3.3-tp16820098p16820098.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Place HTML files inside one 'html' folder relative to java file
Hello, I have been looking at messages, examples and wiki, but I couldn't make this to work... I have one file: home.java, and around 26 language dependant html files (home.html, home_es.html, home_ja.html...). What I want to do is create a folder called 'html' and put the html files there. For example: Application/Registration/Register.java Application/Registration/html/Register.html Application/Registration/html/Register_es.html ... I tried this solution: http://cwiki.apache.org/confluence/display/WICKET/Control+where+HTML+files+are+loaded+from And added /html as resourceFinder, but still is not working. Any ideas? Thank you so much for your time and help, Oskar -- View this message in context: http://www.nabble.com/Place-HTML-files-inside-one-%27html%27-folder-relative-to-java-file-tp16323316p16323316.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Place HTML files inside one 'html' folder relative to java file
Hi Igor, Thank you for your answer although I'm afraid I have no idea on how to do it... so I will just leave as it is. I thought that it was easier! Thanks, Oskar igor.vaynberg wrote: you need to implement your own IResourceStreamLocator and register it in resource settings -igor On Thu, Mar 27, 2008 at 12:37 AM, Toscano [EMAIL PROTECTED] wrote: Hello, I have been looking at messages, examples and wiki, but I couldn't make this to work... I have one file: home.java, and around 26 language dependant html files (home.html, home_es.html, home_ja.html...). What I want to do is create a folder called 'html' and put the html files there. For example: Application/Registration/Register.java Application/Registration/html/Register.html Application/Registration/html/Register_es.html ... I tried this solution: http://cwiki.apache.org/confluence/display/WICKET/Control+where+HTML+files+are+loaded+from And added /html as resourceFinder, but still is not working. Any ideas? Thank you so much for your time and help, Oskar -- View this message in context: http://www.nabble.com/Place-HTML-files-inside-one-%27html%27-folder-relative-to-java-file-tp16323316p16323316.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Place-HTML-files-inside-one-%27html%27-folder-relative-to-java-file-tp16323316p16343707.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DropdownChoice, Ajax, and LoadableDetachableModel
Hello, I have two Dropdowns: Countries and Regions. When changing Countries, it goes to database and refresh the Regions with Ajax nicely. The first time the page loads, it will get the selected country from the database, and should show the regions but I don't really know how to do this. Normally, I can do with LoadableDetachableModel, and then assigning the ModelValue that corresponds, but with the Ajax behaviour I'm totally lost. Here is my code: countryWork.add(new AjaxFormComponentUpdatingBehavior(onchange) { protected void onUpdate(AjaxRequestTarget target) { target.addComponent(regionWork); regions = getRegionDaoInterface().getRegions(professionalInfo.getCountryWork().getCountryID()); if (regions.size()==0) regionWork.setEnabled(false); else regionWork.setEnabled(true); } }); Model regionModelChoices = new AbstractReadOnlyModel() { public Object getObject(Component component) { if (professionalInfo.getCountryWork()!=null) regions = getRegionDaoInterface().getRegions(professionalInfo.getCountryWork().getCountryID()); if (regions==null || regions.size()==0) regionWork.setEnabled(false); else regionWork.setEnabled(true); return regions; } }; How to load regions from a given country the first time the page loads without losing the ajax behaviour? As always, thank you very very much for your support, help, and time. Oskar -- View this message in context: http://www.nabble.com/DropdownChoice%2C-Ajax%2C-and-LoadableDetachableModel-tf4801900.html#a13739163 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DropdownChoice, Ajax, and LoadableDetachableModel
Hello Igor, Thank you for your message. My code was taken from that example, but the problem was a different one. Finally I found the solution, was as simply as change the AbstractReadOnlyModel for the LoadableDetachableModel. Thanks anyways! Oskar igor.vaynberg wrote: there is no difference between a regular page load and ajax see here http://wicketstuff.org/wicket13/ajax/choice.1 -igor On Nov 13, 2007 7:13 PM, Toscano [EMAIL PROTECTED] wrote: Hello, I have two Dropdowns: Countries and Regions. When changing Countries, it goes to database and refresh the Regions with Ajax nicely. The first time the page loads, it will get the selected country from the database, and should show the regions but I don't really know how to do this. Normally, I can do with LoadableDetachableModel, and then assigning the ModelValue that corresponds, but with the Ajax behaviour I'm totally lost. Here is my code: countryWork.add(new AjaxFormComponentUpdatingBehavior(onchange) { protected void onUpdate(AjaxRequestTarget target) { target.addComponent(regionWork); regions = getRegionDaoInterface().getRegions(professionalInfo.getCountryWork().getCountryID()); if (regions.size()==0) regionWork.setEnabled(false); else regionWork.setEnabled(true); } }); Model regionModelChoices = new AbstractReadOnlyModel() { public Object getObject(Component component) { if (professionalInfo.getCountryWork()!=null) regions = getRegionDaoInterface().getRegions(professionalInfo.getCountryWork().getCountryID()); if (regions==null || regions.size()==0) regionWork.setEnabled(false); else regionWork.setEnabled(true); return regions; } }; How to load regions from a given country the first time the page loads without losing the ajax behaviour? As always, thank you very very much for your support, help, and time. Oskar -- View this message in context: http://www.nabble.com/DropdownChoice%2C-Ajax%2C-and-LoadableDetachableModel-tf4801900.html#a13739163 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/DropdownChoice%2C-Ajax%2C-and-LoadableDetachableModel-tf4801900.html#a13739470 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Enable and Disable using Ajax
Hi again, That works fine for me! Now I understand how it should be. Thank you very very much, Oskar Dmitry Kandalov wrote: On Friday 09 November 2007 12:24:12 Dmitry Kandalov wrote: Probably that is because this component is already rendered. I mean the component has been already checked for being enabled :) Dima - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Enable-and-Disable-using-Ajax-tf4776221.html#a13719466 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Enable and Disable using Ajax
Hello, I found some questions related to this topic, but I couldn't make it to work. I have two dropdowns, countries and regions. The easy thing is that I load the regions when the country has been selected, and I use AjaxFormComponentUpdatingBehavior for this and works. The thing is that we don't have Regions for all the countries, so in that cases I want to disable the dropdown. This is the code I have: // countryWork is the first dropdown countryWork.add(new AjaxFormComponentUpdatingBehavior(onchange) { protected void onUpdate(AjaxRequestTarget target) {target.addComponent(regionWork);} }); // and regionWork is the region IModel regionModelChoices = new AbstractReadOnlyModel() { public Object getObject(Component component) { if (professionalInfo.getCountryWork()!=null) regions = getRegionDaoInterface().getRegions(professionalInfo.getCountryWork().getCountryID()); if (regions.size()==0) regionWork.setEnabled(false); else regionWork.setEnabled(true); return regions; } }; regionWork = new DropDownChoice(regionWork, new Model(), regionModelChoices, new ChoiceRenderer(regionName, regionID)); regionWork.setOutputMarkupId(true); The dropdown changes, but with one refresh delay. For example, I have regions for Canada but not for Spain. If I change to Canada, nothing happens, but the next change in the country will enable the dropdown. Any ideas? Thank you very much for your time, Oskar -- View this message in context: http://www.nabble.com/Enable-and-Disable-using-Ajax-tf4776221.html#a13662524 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reload Captcha Image
Thank you!! Finally I just made a submitlink and just make the image refresh in the onsubmit of the form. That worked fine. Thank you for your time and your help! Oskar -- View this message in context: http://www.nabble.com/Reload-Captcha-Image-tf4674760.html#a13419561 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Reload Captcha Image
Hello, I'm having problems with a Captcha image reloading method, and I'm sure it must be very easy to solve, but I can't!! I have a form with about 10 fields, and at the end one Captcha image using CaptchaImageResource and Image controls. Sometimes it is difficult to read, so I put one link with the following OnClick code: public void onClick() { imagePass=randomString(6,8); captchaImageResource = new CaptchaImageResource(imagePass); captchaImage.setImageResource(captchaImageResource); } I mean, I create a new captcha image correctly, but all the content of the fields are removed! This means that the user has to input them again. I think it is just a matter of the Link... if I just leave the OnClick code blank, it reloads the page without maintaining the values. I have a Form and a CompoundPropertyModel which works fine: // Form, pojo, and compound property model InitiationForm initiationForm; NewUser newUser; CompoundPropertyModel initiationFormModel; //Create CompoundPropertyModel initiationFormModel = new CompoundPropertyModel(newUser); // Form initiationForm = new InitiationForm (initiationForm, initiationFormModel); How can I refresh the image without losing the already input values? Thank you very very much for your time! Oskar -- View this message in context: http://www.nabble.com/Reload-Captcha-Image-tf4674760.html#a13356193 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]