Re: Big Problem with TinyMCE
On your AjaxButton add TinyMceAjaxSubmitModifier. Kimotho. On Fri, Apr 30, 2010 at 12:53 AM, Brad Grier brad.gr...@salusnovus.comwrote: I'm trying to use a TinyMCE editor on a form (itself belonging to a panel added to a page via Ajax). The form is submitted via an AjaxButton. From other posts here and elsewhere I found I had to call tinyMCE.triggerSave(true,true); before the submit to get the data into the textarea's model and then tinyMCE.idCounter=0; after the submit. I used an IAjaxCallDecorator to add these functions to the submit button. The problem is that the form only submits with every other press of the button. When it fails, it looks like no script appended after the triggerSave runs. Can anyone help me out? I'm stuck. Thanks, Brad
Re: Image Upload Using TinyMCE Within Wicket Framework
When I submit a form with an emoticon from the fullfeatured tinymce, the image doesn't get displayed in the destination only the text. any suggestions, I've been stuck here for a while now. 2010/5/1 新希望软件 -- 俞宏伟 nhsoft@gmail.com image upload example run failuer, the application throwsNoClassDefFoundError . WicketMessage: Can't instantiate page using constructor public wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage() Root cause: java.lang.NoClassDefFoundError: wicket/contrib/tinymce/image/ImageUploadPanel at wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage.init(ImageUploadTinyMCEPage.java:42) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) Complete stack: org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor public wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage() at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at
Re: The better way tp add component directly
AbstractRepeater (and its subclasses) does it this way with its onPopulate() method, so this strategy should fit your case too. Perhaps think about a reuse strategy, i.e. don't create a new component if the type hasn't changed. Sven -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/The-better-way-tp-add-component-directly-tp2122805p2123830.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
Knowing Ajax Within RequestCycle
Hi, I have 2 questions: 1. is there a way to know from RequestCycle if a call is Ajax? 2. is there a way to know which Link reference initiated a call from RequestCyclle? thanks --
Re: Knowing Ajax Within RequestCycle
Hi, 1. is there a way to know from RequestCycle if a call is Ajax? AjaxRequestTarget.get() != null or ((WebRequestCycle)WebRequestCycle.get()).getWebRequest().isAjax(); 2. is there a way to know which Link reference initiated a call from RequestCyclle? Do you mean which Link was clicked? Isn't this encoded as a component path on the URL? Ernesto - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Knowing Ajax Within RequestCycle
On 1. Thanks On 2. yeah which link was clicked or in another way, the component path which the ongoing request will refers to What am trying to do: I allocate resources to each call from each request however some resources are not needed to be allocated during some ajax calls. i need to filter such requests by knowing who called them? On Mon, May 3, 2010 at 12:43 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Hi, 1. is there a way to know from RequestCycle if a call is Ajax? AjaxRequestTarget.get() != null or ((WebRequestCycle)WebRequestCycle.get()).getWebRequest().isAjax(); 2. is there a way to know which Link reference initiated a call from RequestCyclle? Do you mean which Link was clicked? Isn't this encoded as a component path on the URL? Ernesto - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Aladejebi Ayodeji A., DabarObjects Solutions Phone: +234 9 875 1763 Mobile: +234 803 589 1780 Email: d...@dabarobjects.com Web: www.dabarobjects.com
Re: Knowing Ajax Within RequestCycle
On 2. Can you just retrieve the URL and use that to decide? Best, Ernesto On Mon, May 3, 2010 at 2:40 PM, Ayodeji Aladejebi aladej...@gmail.com wrote: On 1. Thanks On 2. yeah which link was clicked or in another way, the component path which the ongoing request will refers to What am trying to do: I allocate resources to each call from each request however some resources are not needed to be allocated during some ajax calls. i need to filter such requests by knowing who called them? On Mon, May 3, 2010 at 12:43 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Hi, 1. is there a way to know from RequestCycle if a call is Ajax? AjaxRequestTarget.get() != null or ((WebRequestCycle)WebRequestCycle.get()).getWebRequest().isAjax(); 2. is there a way to know which Link reference initiated a call from RequestCyclle? Do you mean which Link was clicked? Isn't this encoded as a component path on the URL? Ernesto - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Aladejebi Ayodeji A., DabarObjects Solutions Phone: +234 9 875 1763 Mobile: +234 803 589 1780 Email: d...@dabarobjects.com Web: www.dabarobjects.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxEditableLabel with icon in addition to label
Dear all, I would like to add an icon next to the label of an AjaxEditableLabel component. I tried to use a Panel or WebMarkupContainer, but both are not subtypes to WebComponent (which is the return type of newLabel() that I tried to overwrite). Can you please provide me with suggestions about how to implement this? TIA, Erich
Re: Knowing Ajax Within RequestCycle
Yeah thanks that worked ! On Mon, May 3, 2010 at 1:47 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: On 2. Can you just retrieve the URL and use that to decide? Best, Ernesto On Mon, May 3, 2010 at 2:40 PM, Ayodeji Aladejebi aladej...@gmail.com wrote: On 1. Thanks On 2. yeah which link was clicked or in another way, the component path which the ongoing request will refers to What am trying to do: I allocate resources to each call from each request however some resources are not needed to be allocated during some ajax calls. i need to filter such requests by knowing who called them? On Mon, May 3, 2010 at 12:43 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Hi, 1. is there a way to know from RequestCycle if a call is Ajax? AjaxRequestTarget.get() != null or ((WebRequestCycle)WebRequestCycle.get()).getWebRequest().isAjax(); 2. is there a way to know which Link reference initiated a call from RequestCyclle? Do you mean which Link was clicked? Isn't this encoded as a component path on the URL? Ernesto - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Aladejebi Ayodeji A., DabarObjects Solutions Phone: +234 9 875 1763 Mobile: +234 803 589 1780 Email: d...@dabarobjects.com Web: www.dabarobjects.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Aladejebi Ayodeji A., DabarObjects Solutions Phone: +234 9 875 1763 Mobile: +234 803 589 1780 Email: d...@dabarobjects.com Web: www.dabarobjects.com
Re: Knowing Ajax Within RequestCycle
Please is there a way to get an ajax Behavior call string such as * wicket:interface=:1:homeScreen:helpForm:helpContainer:clientName:label::IBehaviorListener:0: * before rendering occurs? That is the Query String from a Label with an AjaxEditableBehavior On Mon, May 3, 2010 at 2:03 PM, Ayodeji Aladejebi aladej...@gmail.comwrote: Yeah thanks that worked ! On Mon, May 3, 2010 at 1:47 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: On 2. Can you just retrieve the URL and use that to decide? Best, Ernesto On Mon, May 3, 2010 at 2:40 PM, Ayodeji Aladejebi aladej...@gmail.com wrote: On 1. Thanks On 2. yeah which link was clicked or in another way, the component path which the ongoing request will refers to What am trying to do: I allocate resources to each call from each request however some resources are not needed to be allocated during some ajax calls. i need to filter such requests by knowing who called them? On Mon, May 3, 2010 at 12:43 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Hi, 1. is there a way to know from RequestCycle if a call is Ajax? AjaxRequestTarget.get() != null or ((WebRequestCycle)WebRequestCycle.get()).getWebRequest().isAjax(); 2. is there a way to know which Link reference initiated a call from RequestCyclle? Do you mean which Link was clicked? Isn't this encoded as a component path on the URL? Ernesto - 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 -- Aladejebi Ayodeji A., DabarObjects Solutions Phone: +234 9 875 1763 Mobile: +234 803 589 1780 Email: d...@dabarobjects.com Web: www.dabarobjects.com -- Aladejebi Ayodeji A., DabarObjects Solutions Phone: +234 9 875 1763 Mobile: +234 803 589 1780 Email: d...@dabarobjects.com Web: www.dabarobjects.com
Re: AjaxEditableLabel with icon in addition to label
use css... -igor On Mon, May 3, 2010 at 5:51 AM, Erich W Schreiner eschrei...@yahoo.com wrote: Dear all, I would like to add an icon next to the label of an AjaxEditableLabel component. I tried to use a Panel or WebMarkupContainer, but both are not subtypes to WebComponent (which is the return type of newLabel() that I tried to overwrite). Can you please provide me with suggestions about how to implement this? TIA, Erich - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Knowing Ajax Within RequestCycle
use urlFor(AjaxEditableBehavior...) on onbeforerender()? Best, Ernesto On Mon, May 3, 2010 at 3:45 PM, Ayodeji Aladejebi aladej...@gmail.com wrote: Please is there a way to get an ajax Behavior call string such as * wicket:interface=:1:homeScreen:helpForm:helpContainer:clientName:label::IBehaviorListener:0: * before rendering occurs? That is the Query String from a Label with an AjaxEditableBehavior On Mon, May 3, 2010 at 2:03 PM, Ayodeji Aladejebi aladej...@gmail.comwrote: Yeah thanks that worked ! On Mon, May 3, 2010 at 1:47 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: On 2. Can you just retrieve the URL and use that to decide? Best, Ernesto On Mon, May 3, 2010 at 2:40 PM, Ayodeji Aladejebi aladej...@gmail.com wrote: On 1. Thanks On 2. yeah which link was clicked or in another way, the component path which the ongoing request will refers to What am trying to do: I allocate resources to each call from each request however some resources are not needed to be allocated during some ajax calls. i need to filter such requests by knowing who called them? On Mon, May 3, 2010 at 12:43 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Hi, 1. is there a way to know from RequestCycle if a call is Ajax? AjaxRequestTarget.get() != null or ((WebRequestCycle)WebRequestCycle.get()).getWebRequest().isAjax(); 2. is there a way to know which Link reference initiated a call from RequestCyclle? Do you mean which Link was clicked? Isn't this encoded as a component path on the URL? Ernesto - 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 -- Aladejebi Ayodeji A., DabarObjects Solutions Phone: +234 9 875 1763 Mobile: +234 803 589 1780 Email: d...@dabarobjects.com Web: www.dabarobjects.com -- Aladejebi Ayodeji A., DabarObjects Solutions Phone: +234 9 875 1763 Mobile: +234 803 589 1780 Email: d...@dabarobjects.com Web: www.dabarobjects.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Big Problem with TinyMCE
I run into the same problem. I cant see the text written in text area. Could show the code you have written? thanks in advance On Mon, May 3, 2010 at 4:04 AM, Robert Kimotho kimot...@gmail.com wrote: On your AjaxButton add TinyMceAjaxSubmitModifier. Kimotho. On Fri, Apr 30, 2010 at 12:53 AM, Brad Grier brad.gr...@salusnovus.com wrote: I'm trying to use a TinyMCE editor on a form (itself belonging to a panel added to a page via Ajax). The form is submitted via an AjaxButton. From other posts here and elsewhere I found I had to call tinyMCE.triggerSave(true,true); before the submit to get the data into the textarea's model and then tinyMCE.idCounter=0; after the submit. I used an IAjaxCallDecorator to add these functions to the submit button. The problem is that the form only submits with every other press of the button. When it fails, it looks like no script appended after the triggerSave runs. Can anyone help me out? I'm stuck. Thanks, Brad -- Fernando Wermus. www.linkedin.com/in/fernandowermus
Re: wicketstuff-minis status?
Hi Nino, is there any update planned for mootools 1.2.4? Thanks, Natalie -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicketstuff-minis-status-tp1867557p2124092.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: Big Problem with TinyMCE
hey! do this: add to the page a hidden ajaxSubmitLink and se it an id, for example: submitToServer. In the onclick java method of the hidden ajaxSubmitLink do your java magic server-side. Then in your submit button of the html page, add a small javascript that save HTML and then clicks the hidden link, for example: function() { tinyMCE.triggerSave(true,true); document.getElementById('submitToServer').onclick(); }; Your problem is that wicket recive the information that is in a hidden textfield, but you have to say to tinyMce, to save in the hidden textfield the html the user have been writing (thats what tinyMCE.triggerSave do) then, when the data is saved in the textfield, you submit your form to the server, and in the wicket code, you use it like a normal textfield. NM On Mon, May 3, 2010 at 11:49 AM, Fernando Wermus fernando.wer...@gmail.comwrote: I run into the same problem. I cant see the text written in text area. Could show the code you have written? thanks in advance On Mon, May 3, 2010 at 4:04 AM, Robert Kimotho kimot...@gmail.com wrote: On your AjaxButton add TinyMceAjaxSubmitModifier. Kimotho. On Fri, Apr 30, 2010 at 12:53 AM, Brad Grier brad.gr...@salusnovus.com wrote: I'm trying to use a TinyMCE editor on a form (itself belonging to a panel added to a page via Ajax). The form is submitted via an AjaxButton. From other posts here and elsewhere I found I had to call tinyMCE.triggerSave(true,true); before the submit to get the data into the textarea's model and then tinyMCE.idCounter=0; after the submit. I used an IAjaxCallDecorator to add these functions to the submit button. The problem is that the form only submits with every other press of the button. When it fails, it looks like no script appended after the triggerSave runs. Can anyone help me out? I'm stuck. Thanks, Brad -- Fernando Wermus. www.linkedin.com/in/fernandowermus
Survey -- Tool Success Theory Empirical Study - Apache Wicket
Hello All, I recieved an email entitled Tool Success Theory Empirical Study - Apache Wicket. I was seeing if anyone else got this. Just wanted to make sure that the request is valid before I go and fill out the survey. Thanks -- Eric Reagan
Re: Survey -- Tool Success Theory Empirical Study - Apache Wicket
I did. don't know if valid. sorry :) On Mon, May 3, 2010 at 12:21 PM, Eric Reagan reaga...@gmail.com wrote: Hello All, I recieved an email entitled Tool Success Theory Empirical Study - Apache Wicket. I was seeing if anyone else got this. Just wanted to make sure that the request is valid before I go and fill out the survey. Thanks -- Eric Reagan -- Fernando Wermus. www.linkedin.com/in/fernandowermus
Combo Box
I've got a combo box with the list in a List of string arrays (code and decode). The bean has the currently selected code. I created a DropDownChoice with a custom ChoceRenderer as below. The CR interface is invoked for both the acquisition of the bean value and for each row of the list, which is why the below code checks the type of object coming in. This works great when displaying, but when the value comes back to the server, it is loaded back into the bean as [Ljava.lang.String;@3c6f3c6f. It looks like the Object.toString(). What am I doing wrong here? DropDownChoice ddc = new DropDownChoice(id, new PropertyModel(bean, id), listOfStringArrays, new IChoiceRenderer(){ @Override public Object getDisplayValue(Object array) { if(array instanceof String) return (String) array; else if(array.getClass().isArray()){ String[] result = (String[]) array; return result[1]; } else throw new RuntimeException(Huh?); } @Override public String getIdValue(Object array, int arg1) { if(array instanceof String) return (String) array; else if(array.getClass().isArray()) { String[] result = (String[]) array; return result[0]; } else throw new RuntimeException(Huh?); } }); -- Brian Mulholland One of the greatest delusions in the world is the hope that the evils in this world are to be cured by legislation. --Thomas B. Reed (1886) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
autocomplete based on other field's value + storing the reference
Hi, I've the following stripped down hierarchy: form wicket:id=form |- input type=text wicket:id=main |- input type=text wicket:id=description |- input type=hidden wicket:id=reference I'd like the description field to work as an autocomplete field: when the users clicks into it, it might suggest descriptions from the server side list, based on the value of the 'main' field. If the user selects one description, the reference id should be stored in the hidden field. After that (or if there is no suggestion) the user is free to edit the description field as (s)he likes. In the same form, I have several of these fields, therefore I need some generic solution. Any ideas or similar solutions? Thanks and regards, Istvan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: autocomplete based on other field's value + storing the reference
you'll need to do some customization, but you have the pieces with ajaxformcomponentupdatingbehavior, ajaxsubmitbehavior, and the built-in autocomplete. Some combination of those will help you. -- Jeremy Thomerson http://www.wickettraining.com On Mon, May 3, 2010 at 12:27 PM, Istvan Soos istvan.s...@gmail.com wrote: Hi, I've the following stripped down hierarchy: form wicket:id=form |- input type=text wicket:id=main |- input type=text wicket:id=description |- input type=hidden wicket:id=reference I'd like the description field to work as an autocomplete field: when the users clicks into it, it might suggest descriptions from the server side list, based on the value of the 'main' field. If the user selects one description, the reference id should be stored in the hidden field. After that (or if there is no suggestion) the user is free to edit the description field as (s)he likes. In the same form, I have several of these fields, therefore I need some generic solution. Any ideas or similar solutions? Thanks and regards, Istvan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Survey -- Tool Success Theory Empirical Study - Apache Wicket
I also received the survey. This has been discussed a few weeks ago. Search in the archives and you'll find the survey's author mail. Regards. On Mon, May 3, 2010 at 1:06 PM, Fernando Wermus fernando.wer...@gmail.com wrote: I did. don't know if valid. sorry :) On Mon, May 3, 2010 at 12:21 PM, Eric Reagan reaga...@gmail.com wrote: Hello All, I recieved an email entitled Tool Success Theory Empirical Study - Apache Wicket. I was seeing if anyone else got this. Just wanted to make sure that the request is valid before I go and fill out the survey. Thanks -- Eric Reagan -- Fernando Wermus. www.linkedin.com/in/fernandowermus -- Mauro Ciancio maurociancio at gmail dot com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
statefulness, and multiple tabs
I have a question about how to approach a certain kind of problem. Let me first explain what I'm doing, and then what the problem is with that. For the web app I'm creating, a user can, using a web form, edit data which is backed by a model that fetches the persistent object being modified. When the OK button is clicked, the changes are committed, and then show up in the database. So far, so good. While editing a given record called Issue, the user may choose to edit other records that it references (AffectedParty, in this case). To do this, we switch to the new page without performing any commit. When the referenced record is updated, the user returns to the original Issue record. So far, nothing has been committed. All changes will committed when editing is complete for the Issue record. The problem occurs when users open multiple tabs to multiple Issues. In this case, my persistence framework (Hibernate) is using one session for all updates, so a commit to one will affect all the others. This can cause all kinds of complex problems when the user is editing multiple unrelated records at the same time. I would like this application to be able to support working on multiple records at once. One place this can be fixed is in the persistence layer, by associating unrelated records with separate Sessions. However, this can get complicated, fast. Another thing that I might try is to detach the record from Hibernate at the end of each page being rendered, and reattach it at the time of update. Right now, this seems like the most reasonable solution. Is there a standard Wicket solution for this problem? A friend of mine who uses Seam suggested that I check out whether or not Wicket supports conversations, a concept with which I'm only partly familiar (they're like transactions, but can comprise multiple individual transactions...right?). So far, it looks to me like Wicket doesn't directly support this concept, and I'm not even sure how it would help me, anyway. Any suggestions?
Wicket 1.4.8 released
Wicket 1.4.8 is released! This is the eighth maintenance release of 1.4.x series and brings over 20 bug fixes and improvements. tag: https://svn.apache.org/repos/asf/wicket/releases/wicket-1.4.8/ maven: dependency groupIdorg.apache.wicket/groupId artifactIdwicket/artifactId version1.4.8/version /dependency download: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8 changelog: https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=truepid=12310561fixfor=12314811 cheers, -igor - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Math captcha with Wicket?
Did anyone ever integrate some kind of math capture with Wicket (please solve the following simple equation ...)? How would I do this, someone got a code pointer for me? -Tom - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Big Problem with TinyMCE
Nicolas, Your proposal work. But I have my TinyMCE in a modal window and it has stopped to close. In the other case, I don't get any string in text area, but my modal window close. I need both. Any suggestion? thanks in advance On Mon, May 3, 2010 at 12:06 PM, nicolas melendez nfmelen...@gmail.comwrote: hey! do this: add to the page a hidden ajaxSubmitLink and se it an id, for example: submitToServer. In the onclick java method of the hidden ajaxSubmitLink do your java magic server-side. Then in your submit button of the html page, add a small javascript that save HTML and then clicks the hidden link, for example: function() { tinyMCE.triggerSave(true,true); document.getElementById('submitToServer').onclick(); }; Your problem is that wicket recive the information that is in a hidden textfield, but you have to say to tinyMce, to save in the hidden textfield the html the user have been writing (thats what tinyMCE.triggerSave do) then, when the data is saved in the textfield, you submit your form to the server, and in the wicket code, you use it like a normal textfield. NM On Mon, May 3, 2010 at 11:49 AM, Fernando Wermus fernando.wer...@gmail.comwrote: I run into the same problem. I cant see the text written in text area. Could show the code you have written? thanks in advance On Mon, May 3, 2010 at 4:04 AM, Robert Kimotho kimot...@gmail.com wrote: On your AjaxButton add TinyMceAjaxSubmitModifier. Kimotho. On Fri, Apr 30, 2010 at 12:53 AM, Brad Grier brad.gr...@salusnovus.com wrote: I'm trying to use a TinyMCE editor on a form (itself belonging to a panel added to a page via Ajax). The form is submitted via an AjaxButton. From other posts here and elsewhere I found I had to call tinyMCE.triggerSave(true,true); before the submit to get the data into the textarea's model and then tinyMCE.idCounter=0; after the submit. I used an IAjaxCallDecorator to add these functions to the submit button. The problem is that the form only submits with every other press of the button. When it fails, it looks like no script appended after the triggerSave runs. Can anyone help me out? I'm stuck. Thanks, Brad -- Fernando Wermus. www.linkedin.com/in/fernandowermus -- Fernando Wermus. www.linkedin.com/in/fernandowermus
Re: Big Problem with TinyMCE
I've solved it with the following @Override protected IAjaxCallDecorator getAjaxCallDecorator() { return new AjaxCallDecorator(){ private static final long serialVersionUID = 4430011596296790970L; @Override public CharSequence decorateScript(CharSequence script) { return tinyMCE.triggerSave(true,true); + script; } }; } I don't need any extra button. I think this could be a behavior, doesn't it? On Mon, May 3, 2010 at 5:59 PM, Fernando Wermus fernando.wer...@gmail.comwrote: Nicolas, Your proposal work. But I have my TinyMCE in a modal window and it has stopped to close. In the other case, I don't get any string in text area, but my modal window close. I need both. Any suggestion? thanks in advance On Mon, May 3, 2010 at 12:06 PM, nicolas melendez nfmelen...@gmail.comwrote: hey! do this: add to the page a hidden ajaxSubmitLink and se it an id, for example: submitToServer. In the onclick java method of the hidden ajaxSubmitLink do your java magic server-side. Then in your submit button of the html page, add a small javascript that save HTML and then clicks the hidden link, for example: function() { tinyMCE.triggerSave(true,true); document.getElementById('submitToServer').onclick(); }; Your problem is that wicket recive the information that is in a hidden textfield, but you have to say to tinyMce, to save in the hidden textfield the html the user have been writing (thats what tinyMCE.triggerSave do) then, when the data is saved in the textfield, you submit your form to the server, and in the wicket code, you use it like a normal textfield. NM On Mon, May 3, 2010 at 11:49 AM, Fernando Wermus fernando.wer...@gmail.comwrote: I run into the same problem. I cant see the text written in text area. Could show the code you have written? thanks in advance On Mon, May 3, 2010 at 4:04 AM, Robert Kimotho kimot...@gmail.com wrote: On your AjaxButton add TinyMceAjaxSubmitModifier. Kimotho. On Fri, Apr 30, 2010 at 12:53 AM, Brad Grier brad.gr...@salusnovus.com wrote: I'm trying to use a TinyMCE editor on a form (itself belonging to a panel added to a page via Ajax). The form is submitted via an AjaxButton. From other posts here and elsewhere I found I had to call tinyMCE.triggerSave(true,true); before the submit to get the data into the textarea's model and then tinyMCE.idCounter=0; after the submit. I used an IAjaxCallDecorator to add these functions to the submit button. The problem is that the form only submits with every other press of the button. When it fails, it looks like no script appended after the triggerSave runs. Can anyone help me out? I'm stuck. Thanks, Brad -- Fernando Wermus. www.linkedin.com/in/fernandowermus -- Fernando Wermus. www.linkedin.com/in/fernandowermus -- Fernando Wermus. www.linkedin.com/in/fernandowermus
Re: Math captcha with Wicket?
off the top of my head class question { int lhs, int rhs, boolean plus; void randomize() { lhs=math.random()*10, rhs=math.random()*10; plus=math.random()0.5;} string tostring() { return +lhs+ +((plus)?+:-)+ +rhs; } boolean check(int answer) { if (plus) return answer==lhs+rhs else return answer==lhs-rhs; } class answerfield extends textfieldinteger { private final imodelquestion question; public answerfield(string id, imodelquestion question) { super(id, new modelinteger()); this.question=question; add(new ivalidatorinteger { public void validate(validatableinteger validatable) { if (!question.check(validatable.getvalue()) { validatable.error(new validationerror(are you smarter then a first grader?)); }); } protected void ondetach() { question.detach(); super.ondetach(); } } class mathcaptchapanel extends panel { private final question question=new question(); public mathcaptchapanel(string id) { add(new label(question, new propertymodel(this, question)); add(new answerfield(answer, new propertymodel(this, question)); } protected void onbeforerender() { question.randomize(); super.onbeforerender(); } } -igor On Mon, May 3, 2010 at 1:13 PM, Thomas Götz t...@richmountain.de wrote: Did anyone ever integrate some kind of math capture with Wicket (please solve the following simple equation ...)? How would I do this, someone got a code pointer for me? -Tom - 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
Session Timeout - detect last visited page and redirect accordingly
I have an application where on session timeout, I want to redirect to different pages based on what their last visited page was. Currently my app only redirects to the same page all the time through getApplicationSettings().setPageExpiredErrorPage(LoginPage.class). Is there any way to capture the prior page and redirect them accordingly? Thanks, Tony
Re: Session Timeout - detect last visited page and redirect accordingly
you can append the class name of the last visited page to every url by creating your own url coding strategy -igor On Mon, May 3, 2010 at 4:59 PM, Tony Wu e90t...@gmail.com wrote: I have an application where on session timeout, I want to redirect to different pages based on what their last visited page was. Currently my app only redirects to the same page all the time through getApplicationSettings().setPageExpiredErrorPage(LoginPage.class). Is there any way to capture the prior page and redirect them accordingly? Thanks, Tony - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Session Timeout - detect last visited page and redirect accordingly
Seems messy to have to carry that to every single URL. I was thinking about redirecting to a Proxy page and having the logic there to redirect elsewhere. The thing is I don't know what page I'm from once I'm at the proxy. I suppose I can store the last visited page in a cookie, but I'd like to avoid that route if possible. On Mon, May 3, 2010 at 5:32 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: you can append the class name of the last visited page to every url by creating your own url coding strategy -igor On Mon, May 3, 2010 at 4:59 PM, Tony Wu e90t...@gmail.com wrote: I have an application where on session timeout, I want to redirect to different pages based on what their last visited page was. Currently my app only redirects to the same page all the time through getApplicationSettings().setPageExpiredErrorPage(LoginPage.class). Is there any way to capture the prior page and redirect them accordingly? Thanks, Tony - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Session Timeout - detect last visited page and redirect accordingly
if not in url or cookies your only other space is session, and since that has timed out... -igor On Mon, May 3, 2010 at 5:43 PM, Tony Wu e90t...@gmail.com wrote: Seems messy to have to carry that to every single URL. I was thinking about redirecting to a Proxy page and having the logic there to redirect elsewhere. The thing is I don't know what page I'm from once I'm at the proxy. I suppose I can store the last visited page in a cookie, but I'd like to avoid that route if possible. On Mon, May 3, 2010 at 5:32 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: you can append the class name of the last visited page to every url by creating your own url coding strategy -igor On Mon, May 3, 2010 at 4:59 PM, Tony Wu e90t...@gmail.com wrote: I have an application where on session timeout, I want to redirect to different pages based on what their last visited page was. Currently my app only redirects to the same page all the time through getApplicationSettings().setPageExpiredErrorPage(LoginPage.class). Is there any way to capture the prior page and redirect them accordingly? Thanks, Tony - 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
When to use InjectorHolder
Do I need to use InjectorHolder when using @Inject in a model?
Re: When to use InjectorHolder
Not sure wicket-guice works with injectorholder. If you are not extending component, then you should pass the service to the constructor. Sent from my Incredible. On Mon, May 3, 2010 at 10:58 PM, Douglas Ferguson doug...@douglasferguson.us wrote: Do I need to use InjectorHolder when using @Inject in a model?
Re: When to use InjectorHolder
I thought that it did working with 1.4.8 On May 3, 2010, at 10:07 PM, Ryan Gravener wrote: Not sure wicket-guice works with injectorholder. If you are not extending component, then you should pass the service to the constructor. Sent from my Incredible. On Mon, May 3, 2010 at 10:58 PM, Douglas Ferguson doug...@douglasferguson.us wrote: Do I need to use InjectorHolder when using @Inject in a model? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: When to use InjectorHolder
Yes - on anything that does not extend Component you will need to inject manually. Components are injected automagically by adding the component instantiation listener (which is called from Component's constructor). -- Jeremy Thomerson http://www.wickettraining.com On Mon, May 3, 2010 at 9:58 PM, Douglas Ferguson doug...@douglasferguson.us wrote: Do I need to use InjectorHolder when using @Inject in a model?
Re: When to use InjectorHolder
Yes - it should - I think :) -- Jeremy Thomerson http://www.wickettraining.com On Mon, May 3, 2010 at 10:27 PM, Douglas Ferguson doug...@douglasferguson.us wrote: I thought that it did working with 1.4.8 On May 3, 2010, at 10:07 PM, Ryan Gravener wrote: Not sure wicket-guice works with injectorholder. If you are not extending component, then you should pass the service to the constructor. Sent from my Incredible. On Mon, May 3, 2010 at 10:58 PM, Douglas Ferguson doug...@douglasferguson.us wrote: Do I need to use InjectorHolder when using @Inject in a model? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: When to use InjectorHolder
Since the ConfigurableInjector doesn't implement the guice injector, how would I inject my mocks using my test module and the guice injector? D/ On May 3, 2010, at 10:31 PM, Jeremy Thomerson wrote: Yes - it should - I think :) -- Jeremy Thomerson http://www.wickettraining.com On Mon, May 3, 2010 at 10:27 PM, Douglas Ferguson doug...@douglasferguson.us wrote: I thought that it did working with 1.4.8 On May 3, 2010, at 10:07 PM, Ryan Gravener wrote: Not sure wicket-guice works with injectorholder. If you are not extending component, then you should pass the service to the constructor. Sent from my Incredible. On Mon, May 3, 2010 at 10:58 PM, Douglas Ferguson doug...@douglasferguson.us wrote: Do I need to use InjectorHolder when using @Inject in a model? - 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: Wicket Bench
A nice NetBeans plugin: http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=3586 Provides refactoring support and more. So if you rename or move between packages any Wicket components including pages then the plugin renames and moves the HTML, too. I think that an IDE should provide refactoring support so I think that Wicket needs that, too. Regards, Bernard On Wed, 28 Apr 2010 15:17:11 -0400, you wrote: Hi, Wicket n00b here. How good is Wicket Bench? I read on the site that it lacks maintainers and it didn't seem like it had alot of powerful features, just some nice convenience things. Is it a must have? Also, is it compatible with the latest Wicket release? I didn't see anything on the wicket bench site saying what version of wicket it was compatible with. Brian Mulholland - 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