Re: [Wicket-user] Using AjaxEventBehavior On A Page Component
Frank, Sorry for the latency. I was actually using 'onkeypress' and not 'onkeyup'. I tried using 'onkeyup' and that works. Try using 'onkeypress' and see if you can reproduce it. If so, hopefully something can be done to handle 'onkeypress' consistently across all platforms. Does JS even have a very concrete definition of what 'onkeypress' means and when it gets fired? -MT On Oct 20, 2006, at 3:11 AM, Frank Bille wrote: > Do you have some example code for that? I can't reproduce it (FF1.5), > when I'm doing something like this: > > > > Frank > > On 10/20/06, Frank Bille <[EMAIL PROTECTED]> wrote: >> On 10/20/06, Matthew P. Tilchen <[EMAIL PROTECTED]> wrote: >>> >>> Unfortunately the mozilla-based browsers do not >>> include the keyCode attribute on the event, it always comes through >>> as 0 for any key. The other browsers do include the correct unicode >>> value. >> >> >> Hmm, do you mean in terms of onkey* on tag? I'll try to >> look at it to >> see if there is some work around. >> >> Frank >> >> > > -- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Using AjaxEventBehavior On A Page Component
Thanks again Frank. That was extremely helpful. For the record, all the browsers I tested do fire the event off the body object (Mozilla- based, Safari, IE). Unfortunately the mozilla-based browsers do not include the keyCode attribute on the event, it always comes through as 0 for any key. The other browsers do include the correct unicode value. -MT On Oct 19, 2006, at 2:33 PM, Frank Bille wrote: > Wicket doesn't have something like that but you can do it yourself. > Take a look at this to get an idea: > > http://www.nabble.com/CTRL%2Bclick-tf2047972.html#a5640400 > > Frank > > > On 10/19/06, Matthew P. Tilchen <[EMAIL PROTECTED]> wrote: Thanks > for the help Frank. The changes you mentioned solved my > problem. I was operating under the fallacious assumption that the > Page object was attached to the tag. > > Now, regarding the following: > > "getBodyContainer().getBodyContainer() returns the WebMarkupContainer > which corresponds with the tag. (Though I don't know how good > the support is for having javascript events on the tag in the > different browsers)" > > I noticed that the Wicket Developers have a "TODO" item for changing > the name of "BodyContainer" to something else as it is really just a > facade used for getting what the user of the API would want, a > reference to the WebMarkupContainer, which is exactly what I am doing > here. Maybe they could even go so far as to add a > "getWebMarkupContainer()" to the WebPage class. I think this would be > less verbose and communicate the intent of the code more clearly. > > Finally, I was wondering if there is any way to actually look at what > key was pressed that triggered the JS "onkeypressed" event from the > perspective of the API. I hunted through the AjaxRequestTarget class > and I could not find a way to get this particular information or > anything else regarding the event. Does Wicket expose this somehow? > > Thanks again for your advice. > > -MT > > > -- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > -- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642__ > _ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Using AjaxEventBehavior On A Page Component
Thanks for the help Frank. The changes you mentioned solved my problem. I was operating under the fallacious assumption that the Page object was attached to the tag. Now, regarding the following: "getBodyContainer().getBodyContainer() returns the WebMarkupContainer which corresponds with the tag. (Though I don't know how good the support is for having javascript events on the tag in the different browsers)" I noticed that the Wicket Developers have a "TODO" item for changing the name of "BodyContainer" to something else as it is really just a facade used for getting what the user of the API would want, a reference to the WebMarkupContainer, which is exactly what I am doing here. Maybe they could even go so far as to add a "getWebMarkupContainer()" to the WebPage class. I think this would be less verbose and communicate the intent of the code more clearly. Finally, I was wondering if there is any way to actually look at what key was pressed that triggered the JS "onkeypressed" event from the perspective of the API. I hunted through the AjaxRequestTarget class and I could not find a way to get this particular information or anything else regarding the event. Does Wicket expose this somehow? Thanks again for your advice. -MT - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Using AjaxEventBehavior On A Page Component
Greetings, I am not certain as to whether this post will end up being a bug report or a feature request but hopefully one of you may have some advice. Ultimately I am trying to invoke ajax calls as a result of capturing "onkeypress" events fired by the document object. I have successfully achieved this on components other than Page components but I can not get it to work on Page objects. Here is the code for the Page subclass that I am speaking of: public class Index extends WebPage { public Index() { super(); final Label testLabel = new Label(this, "message", "Hello World"); testLabel.setOutputMarkupId(true); add(new AjaxEventBehavior(ClientEvent.KEYPRESS) { protected void onEvent(final AjaxRequestTarget target) { target.addComponent(testLabel); target.appendJavascript("new Effect.Highlight($('" + testLabel.getMarkupId() + "'));"); } }); } } My assumption is that the "onEvent" method will be invoked when the Page (or document in JS) fires a "onkeypress" event. Attempting to trigger the behavior on the loaded page does not invoke "onEvent" and the in page AJAX debugger shows no activity either. Has anyone else attempted this type of thing? If this is currently not supported it seems like this is something that would be consistent with Wicket Ajax implementation's design and I would love to see it added. Thanks. -MT - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user