Re: PropertyModels *without* strings
On Thu, Nov 26, 2009 at 8:54 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: I would say that refactoring calls for improvement in the bindgen approach. Is it theoretically possible to facilitate refactoring with bindgen? Is it practically possible to facilitate refactoring with bindgen? i'm wondering whether it would be feasible to rewrite bindgen on top of lombok, since they can generate code via APT and eclipse AST modification. also, since version 0.9.0, support for Refactor - Rename is built in. gerolf
Re: Component.setLabel and label tags
s/getDefaultModelObjectAsString/getModelObjectAsString/... On Wed, Nov 25, 2009 at 5:29 PM, Xavier López xavil...@gmail.com wrote: Thanks anyway Pedro, it's a good insight, and pretty original ;-) Didn't think of it, nor knew about visitors... Sadly, I'm on Wicket 1.3.5 and it wouldn't be working anyway, as MarkupContainer does not seem to provide ' getDefaultModelObjectAsString', apart from what you said about MessageContainer... Just out of curiosity, wouldn't it be possible to do that traversal upwards (from formComponent to Form) ? And I suppose the wicket:message tags get converted somehow to these MessageContainers (which are tried to localize in the visitor by means of _message_ in its id) Thanks, Xavier 2009/11/25 Pedro Santos pedros...@gmail.com ops, I just see: if you have an form with more than one form componente, that behavior will not work. So, it was just an idea :) On Wed, Nov 25, 2009 at 2:13 PM, Pedro Santos pedros...@gmail.com wrote: Possible alternative that will work on current wicket version, since MessageContainer is an private inner class public class AdjustLabel extends AbstractBehavior { @Override public void beforeRender(Component component) { if (component instanceof FormComponent) { final FormComponent formComponent = (FormComponent)component; component.getParent().visitChildren(MarkupContainer.class, new IVisitorMarkupContainer() { public Object component(MarkupContainer component) { if (component.getId().startsWith(_message_)) { formComponent.setLabel(new ResourceModel(component .getDefaultModelObjectAsString())); return IVisitor.STOP_TRAVERSAL; } else { return null; } } }); } } } then you set: input.add(new AdjustLabel()); On Wed, Nov 25, 2009 at 1:51 PM, Xavier López xavil...@gmail.com wrote: I forgot, A possible solution would be using a shared StringResourceModel for both the setLabel() method and providing the label tag like this: label wicket:id=labelXspan wicket:id=labelXText/span/label StringResourceModel m = new StringResourceModel(form.x.label, this, null); x.setLabel(m); FormComponentLabel labelX = new FormComponentLabel(labelX, x); form.add(labelX); Label labelXText = new Label(labelXText, m); But I'm looking for a less intrusive solution on pages already developed... Thanks, Xavier -- Forwarded message -- From: Xavier López xavil...@gmail.com Date: 2009/11/25 Subject: Component.setLabel and label tags To: users@wicket.apache.org Hi, In a form, I have multiple fields each one with its corresponding FormComponentLabel, with proper wicket:message content in the markup file. Now, I'm facing the fact that I need to provide the same keys I provided in wicket:message in a StringResourceModel in component's setLabel() method. Although I'm aware it's not straightforward (setLabel requires a Model, and label's body is just body markup), it would be great if there was some way to avoid this duplication telling Wicket to use the same key provided in the FormComponentLabel's body... Does anyone have a hint ? Thanks, Xavier -- Klein bottle for rent--inquire within. -- Pedro Henrique Oliveira dos Santos -- Pedro Henrique Oliveira dos Santos -- Klein bottle for rent--inquire within. -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: PropertyModels *without* strings
Strings do break. Silently. They're the silent app killer. Wouldn't you rather know at compile-time that something is broken? That's the point of using Java over PHP. -- Jeremy Thomerson http://www.wickettraining.com On Thu, Nov 26, 2009 at 1:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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: PropertyModels *without* strings
Igor, Very interesting stuff. What are the pro's and con's when compared with the SafePropertyModel from https://issues.apache.org/jira/browse/WICKET-1327 ? Maarten On Thu, Nov 26, 2009 at 10:04 AM, Jeremy Thomerson jer...@wickettraining.com wrote: Strings do break. Silently. They're the silent app killer. Wouldn't you rather know at compile-time that something is broken? That's the point of using Java over PHP. -- Jeremy Thomerson http://www.wickettraining.com On Thu, Nov 26, 2009 at 1:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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: onclick auto-added to script tags?
Well, I don't use Spring integration in my projects, so I cannot tell you for sure if that could be the reason for this. I do however find it unlikely that Spring integration would alter html tags. What you could try is step through the rendering process with a debugger and see what's happening with the wicket:link/ tag. See AutoLinkResolver and WicketLinkTagHandler. Which version of Wicket are you running? Loritsch, Berin C. wrote: I'm integrated with Spring/Hibernate, could this be a side effect from the SpringInvocationHandler? I've not added anything of the sort directly (i.e. I have not created any ComponentInstantiationListeners myself). I've removed the wicket:link/ blocks for now in my header and things are working as expected. That rules out a browser plugin being at fault. -- View this message in context: http://old.nabble.com/onclick-auto-added-to-%3Cscript%3E-tags--tp26504274p26526076.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: WicketSessionFilter and several domains
Did you check if a session is actually created, e.g. do you see a cookie? I cannot imagine that if you use the exact same flow, and the only difference is the domain name, it would work in the one case but not the other. What happens exactly? Getting the session returns null? I suggest you try a debugger for finding out what's happening inside the WicketSessionFilter. Fernando Wermus-2 wrote: Bas, What I actually did was to login in .com and test the servlet I mentioned you. Then I logged out and logged in the site using .com.ar again. This second time failed. In this case, it seems that I am using different cookies and it shouldn't to affect if I get the session. To be more specific, I have some embeded flex clients which connects to Blazeds. I need to get wicket session to know who has logged in using wicket front end. Each flex client has been compiled using a specific url from the site. The servlet that is in charge is messageBroker that delegates to a class of my own the service called.There it is where I couldnt get the session when the user logged in to a specific domain. Thanks in advance. -- View this message in context: http://old.nabble.com/WicketSessionFilter-and-several-domains-tp26502429p26526474.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: Component.setLabel and label tags
Just found out a component that does what I proposed below more cleanly: SimpleFormComponentLabel. I'll finally be using this component, and seize the opportunity to insert automatically the 'required' textflag (*): public class MyLabel extends SimpleFormComponentLabel { String mandatory = ; public MyLabel(String id, final LabeledWebMarkupContainer labelProvider) { super(id, labelProvider); boolean required = false; if (labelProvider instanceof FormComponent){ required = ((FormComponent)labelProvider).isRequired(); } if (required){ mandatory = nbsp; + new StringResourceModel(MyHelper.KEY_MANDATORY_FIELD,labelProvider, null).getString(); } } protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) { replaceComponentTagBody(markupStream, openTag, getModelObjectAsString() + mandatory); } } 2009/11/26 Martijn Dashorst martijn.dasho...@gmail.com s/getDefaultModelObjectAsString/getModelObjectAsString/... On Wed, Nov 25, 2009 at 5:29 PM, Xavier López xavil...@gmail.com wrote: Thanks anyway Pedro, it's a good insight, and pretty original ;-) Didn't think of it, nor knew about visitors... Sadly, I'm on Wicket 1.3.5 and it wouldn't be working anyway, as MarkupContainer does not seem to provide ' getDefaultModelObjectAsString', apart from what you said about MessageContainer... Just out of curiosity, wouldn't it be possible to do that traversal upwards (from formComponent to Form) ? And I suppose the wicket:message tags get converted somehow to these MessageContainers (which are tried to localize in the visitor by means of _message_ in its id) Thanks, Xavier 2009/11/25 Pedro Santos pedros...@gmail.com ops, I just see: if you have an form with more than one form componente, that behavior will not work. So, it was just an idea :) On Wed, Nov 25, 2009 at 2:13 PM, Pedro Santos pedros...@gmail.com wrote: Possible alternative that will work on current wicket version, since MessageContainer is an private inner class public class AdjustLabel extends AbstractBehavior { @Override public void beforeRender(Component component) { if (component instanceof FormComponent) { final FormComponent formComponent = (FormComponent)component; component.getParent().visitChildren(MarkupContainer.class, new IVisitorMarkupContainer() { public Object component(MarkupContainer component) { if (component.getId().startsWith(_message_)) { formComponent.setLabel(new ResourceModel(component .getDefaultModelObjectAsString())); return IVisitor.STOP_TRAVERSAL; } else { return null; } } }); } } } then you set: input.add(new AdjustLabel()); On Wed, Nov 25, 2009 at 1:51 PM, Xavier López xavil...@gmail.com wrote: I forgot, A possible solution would be using a shared StringResourceModel for both the setLabel() method and providing the label tag like this: label wicket:id=labelXspan wicket:id=labelXText/span/label StringResourceModel m = new StringResourceModel(form.x.label, this, null); x.setLabel(m); FormComponentLabel labelX = new FormComponentLabel(labelX, x); form.add(labelX); Label labelXText = new Label(labelXText, m); But I'm looking for a less intrusive solution on pages already developed... Thanks, Xavier -- Forwarded message -- From: Xavier López xavil...@gmail.com Date: 2009/11/25 Subject: Component.setLabel and label tags To: users@wicket.apache.org Hi, In a form, I have multiple fields each one with its corresponding FormComponentLabel, with proper wicket:message content in the markup file. Now, I'm facing the fact that I need to provide the same keys I provided in wicket:message in a StringResourceModel in component's setLabel() method. Although I'm aware it's not straightforward (setLabel requires a Model, and label's body is just body markup), it would be great if there was some way to avoid this duplication telling Wicket to use the same key provided in the FormComponentLabel's body... Does anyone have a hint ? Thanks, Xavier -- Klein bottle for rent--inquire within. --
Re: PropertyModels *without* strings
the pro's of this compared to the SafeProperty is that the safe property needs to generate proxies at runtime so you need CGLIB and you could have issues with final classes this is more a develop environment solution which is because of that a bit nicer. On Thu, Nov 26, 2009 at 10:53, Maarten Bosteels mbosteels@gmail.comwrote: Igor, Very interesting stuff. What are the pro's and con's when compared with the SafePropertyModel from https://issues.apache.org/jira/browse/WICKET-1327 ? Maarten On Thu, Nov 26, 2009 at 10:04 AM, Jeremy Thomerson jer...@wickettraining.com wrote: Strings do break. Silently. They're the silent app killer. Wouldn't you rather know at compile-time that something is broken? That's the point of using Java over PHP. -- Jeremy Thomerson http://www.wickettraining.com On Thu, Nov 26, 2009 at 1:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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: PageParameters an URLEncode
I really want to know how to encode-decode params in new PageParamters() calls. Do I need to use WicketURLEncoder and WicketURLDecoder? If so, how? -- Tony On Tue, Nov 24, 2009 at 1:56 PM, Anton Veretennikov anton.veretenni...@gmail.com wrote: Hi! Sorry for simple question. Do we need URLEncode when we use new PageParameters(param=value1); -- Tony - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: PropertyModels *without* strings
Refactoring could definitely be supported in IDEA. With the Hibernate support, when you change a property name it will change your mapping hbm.xml (yes, we still use them) files for you automatically. Same thing happens with the Spring support. The configuration files are changed for you. I don't know how eclipse works with this kind of stuff, but IDEA definitely has hooks for this kind of stuff. On Thu, Nov 26, 2009 at 2:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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: PropertyModels *without* strings
On Thu, Nov 26, 2009 at 1:52 PM, James Carman jcar...@carmanconsulting.comwrote: The configuration files are changed for you. I don't know how eclipse works with this kind of stuff, but IDEA definitely has hooks for this kind of stuff. if you refactor-rename a class, you can have eclipse look for the FQCN in comments, strings, non-java files and change that accordingly. not sure if that also works for fields, methods,... On Thu, Nov 26, 2009 at 2:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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: PropertyModels *without* strings
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ltk/core/refactoring/participants/package-summary.html On Thu, Nov 26, 2009 at 13:52, James Carman jcar...@carmanconsulting.comwrote: Refactoring could definitely be supported in IDEA. With the Hibernate support, when you change a property name it will change your mapping hbm.xml (yes, we still use them) files for you automatically. Same thing happens with the Spring support. The configuration files are changed for you. I don't know how eclipse works with this kind of stuff, but IDEA definitely has hooks for this kind of stuff. On Thu, Nov 26, 2009 at 2:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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: PropertyModels *without* strings
Ah.. the next big thing, (in) refactoring (bindings?)!!! All glory to the person that does it. ** Martin 2009/11/26 Johan Compagner jcompag...@gmail.com: http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ltk/core/refactoring/participants/package-summary.html On Thu, Nov 26, 2009 at 13:52, James Carman jcar...@carmanconsulting.comwrote: Refactoring could definitely be supported in IDEA. With the Hibernate support, when you change a property name it will change your mapping hbm.xml (yes, we still use them) files for you automatically. Same thing happens with the Spring support. The configuration files are changed for you. I don't know how eclipse works with this kind of stuff, but IDEA definitely has hooks for this kind of stuff. On Thu, Nov 26, 2009 at 2:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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: PropertyModels *without* strings
I figured there had to be support for that. Very cool On Thu, Nov 26, 2009 at 8:14 AM, Johan Compagner jcompag...@gmail.com wrote: http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ltk/core/refactoring/participants/package-summary.html On Thu, Nov 26, 2009 at 13:52, James Carman jcar...@carmanconsulting.comwrote: Refactoring could definitely be supported in IDEA. With the Hibernate support, when you change a property name it will change your mapping hbm.xml (yes, we still use them) files for you automatically. Same thing happens with the Spring support. The configuration files are changed for you. I don't know how eclipse works with this kind of stuff, but IDEA definitely has hooks for this kind of stuff. On Thu, Nov 26, 2009 at 2:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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: PropertyModels *without* strings
very cool, i like propertyModels more than Compounds :) NM On Thu, Nov 26, 2009 at 11:09 AM, James Carman jcar...@carmanconsulting.com wrote: I figured there had to be support for that. Very cool On Thu, Nov 26, 2009 at 8:14 AM, Johan Compagner jcompag...@gmail.com wrote: http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ltk/core/refactoring/participants/package-summary.html On Thu, Nov 26, 2009 at 13:52, James Carman jcar...@carmanconsulting.comwrote: Refactoring could definitely be supported in IDEA. With the Hibernate support, when you change a property name it will change your mapping hbm.xml (yes, we still use them) files for you automatically. Same thing happens with the Spring support. The configuration files are changed for you. I don't know how eclipse works with this kind of stuff, but IDEA definitely has hooks for this kind of stuff. On Thu, Nov 26, 2009 at 2:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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: PropertyModels *without* strings
you guys are missing the point. Bindgen is a *standard apt processor*. it is not an eclipse plugin. all major IDEs have support for annotation processors baked in. refactoring support is definetely *possible*, but it would require an actual IDE pliugin. -igor On Thu, Nov 26, 2009 at 5:20 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Ah.. the next big thing, (in) refactoring (bindings?)!!! All glory to the person that does it. ** Martin 2009/11/26 Johan Compagner jcompag...@gmail.com: http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ltk/core/refactoring/participants/package-summary.html On Thu, Nov 26, 2009 at 13:52, James Carman jcar...@carmanconsulting.comwrote: Refactoring could definitely be supported in IDEA. With the Hibernate support, when you change a property name it will change your mapping hbm.xml (yes, we still use them) files for you automatically. Same thing happens with the Spring support. The configuration files are changed for you. I don't know how eclipse works with this kind of stuff, but IDEA definitely has hooks for this kind of stuff. On Thu, Nov 26, 2009 at 2:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
dynamic adding media player files
I am trying to dynamically add a media player to a page. How to I add the content to the html since the media files are going to be picked from the db. Is there a way to use WebMarkUpContainerWithAssociatedMarkup for this. Essentially want to provide the contents of a div. thanks! _ Hotmail: Trusted email with powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141665/direct/01/
RE: dynamic adding media player files
I need to add the following in a div script type=text/javascript AudioPlayer.embed(player, { soundFile: /mylocation/mymusic.mp3 }); /script wtithe the soundFile dynamically changing. thx From: ed_b...@hotmail.com To: users@wicket.apache.org Subject: dynamic adding media player files Date: Thu, 26 Nov 2009 10:11:06 -0800 I am trying to dynamically add a media player to a page. How to I add the content to the html since the media files are going to be picked from the db. Is there a way to use WebMarkUpContainerWithAssociatedMarkup for this. Essentially want to provide the contents of a div. thanks! _ Hotmail: Trusted email with powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141665/direct/01/ _ Bing brings you maps, menus, and reviews organized in one place. http://www.bing.com/search?q=restaurantsform=MFESRPpubl=WLHMTAGcrea=TEXT_MFESRP_Local_MapsMenu_Resturants_1x1
Re: PropertyModels *without* strings
that's why i was wondering about a lombok based bindgen implementation, since lombok is available as apt processor and eclipse plugin :) On Thu, Nov 26, 2009 at 5:13 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: you guys are missing the point. Bindgen is a *standard apt processor*. it is not an eclipse plugin. all major IDEs have support for annotation processors baked in. refactoring support is definetely *possible*, but it would require an actual IDE pliugin. -igor On Thu, Nov 26, 2009 at 5:20 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Ah.. the next big thing, (in) refactoring (bindings?)!!! All glory to the person that does it. ** Martin 2009/11/26 Johan Compagner jcompag...@gmail.com: http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ltk/core/refactoring/participants/package-summary.html On Thu, Nov 26, 2009 at 13:52, James Carman jcar...@carmanconsulting.comwrote: Refactoring could definitely be supported in IDEA. With the Hibernate support, when you change a property name it will change your mapping hbm.xml (yes, we still use them) files for you automatically. Same thing happens with the Spring support. The configuration files are changed for you. I don't know how eclipse works with this kind of stuff, but IDEA definitely has hooks for this kind of stuff. On Thu, Nov 26, 2009 at 2:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: dynamic adding media player files
http://cwiki.apache.org/WICKET/calling-wicket-from-javascript.html found the solution here. _ Windows 7: It works the way you want. Learn more. http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009v2
AW: PropertyModels *without* strings
Lombok looks preety cool. I think i will use it cause it saves a lot of typing and holds equals and hashcode in sync. -Ursprüngliche Nachricht- Von: Gerolf Seitz [mailto:gerolf.se...@gmail.com] Gesendet: Donnerstag, 26. November 2009 19:36 An: users@wicket.apache.org Betreff: Re: PropertyModels *without* strings that's why i was wondering about a lombok based bindgen implementation, since lombok is available as apt processor and eclipse plugin :) On Thu, Nov 26, 2009 at 5:13 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: you guys are missing the point. Bindgen is a *standard apt processor*. it is not an eclipse plugin. all major IDEs have support for annotation processors baked in. refactoring support is definetely *possible*, but it would require an actual IDE pliugin. -igor On Thu, Nov 26, 2009 at 5:20 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Ah.. the next big thing, (in) refactoring (bindings?)!!! All glory to the person that does it. ** Martin 2009/11/26 Johan Compagner jcompag...@gmail.com: http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ltk/core/refactoring/participants/package-summary.html On Thu, Nov 26, 2009 at 13:52, James Carman jcar...@carmanconsulting.comwrote: Refactoring could definitely be supported in IDEA. With the Hibernate support, when you change a property name it will change your mapping hbm.xml (yes, we still use them) files for you automatically. Same thing happens with the Spring support. The configuration files are changed for you. I don't know how eclipse works with this kind of stuff, but IDEA definitely has hooks for this kind of stuff. On Thu, Nov 26, 2009 at 2:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Jawr links rendering in Wicket
Hi all, I'm working on Jawr, a java library, which handle the bundling and compressing process for web resources. ( https://jawr.dev.java.net/ ) I would like to know the best way to integrate Jawr in Wicket. In fact, Jawr generates a custom URL for a specific resource bundle. For example, if you have a reference in your page like: script type=text/javascript src=/js/bundle/msg.js /script This will generates in production mode something like : script type=text/javascript src=/mywebapp/gzip_324521/js/myBundle.js /script and in debug mode : script type=text/javascript src=/mywebapp/js/myScript1.js / script type=text/javascript src=/mywebapp/js/myScript2.js / script type=text/javascript src=/mywebapp/js/myScript3.js / The first way of doing it was to create a dedicated component, which was provided by one of our contributor. So in the wicket page, we had something like: script wicket:id=bundle1 type=text/javascript src=/js/myBundle.js /script And in our page, we have : ... add(new JawrJavascriptReference(bundle1)); This works fine, but I would like to know if there is not an easier way to put it in place. I'm probably biased as I'm much more used to request based frameworks, but I would like to reference my bundle in my html page like : wicket:jawr script type=text/javascript src=/js/myBundle1.js /script script type=text/javascript src=/js/myBundle2.js /script /wicket:jawr and for image references : wicket:jawr img src=/img/appIcons/application.png/ /wicket:jawr To achieve this, I thought to implement a new IComponentResolver, but it seems to be not advised to do so as it's a core functionality of wicket... Another way to do it for Javascript and CSS resources would be to create an IHeaderContributor, which I find cleaner than a webMarkupContainer (no reference need to be define in the HTML page) but I need to have access to the request, and I didn't find a way to retrieve it. So I would like to know, what is the best way to implement it. Any thoughts or advises? Thanks in advance. Cheers, Ibrahim Chaehoi - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: PropertyModels *without* strings
Some time ago I was experimenting with lambdaJ. It uses the proxy way to obtain the propertyName. This way, your code could look like new TextFieldLong(orderNumber, new SafePropertyModel(target, property(on(Order.class).getOrderNumber(; If there is interest in this thing, I'm willing to contribute... Just my 2 cents... On Thu, Nov 26, 2009 at 8:30 PM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Lombok looks preety cool. I think i will use it cause it saves a lot of typing and holds equals and hashcode in sync. -Ursprüngliche Nachricht- Von: Gerolf Seitz [mailto:gerolf.se...@gmail.com] Gesendet: Donnerstag, 26. November 2009 19:36 An: users@wicket.apache.org Betreff: Re: PropertyModels *without* strings that's why i was wondering about a lombok based bindgen implementation, since lombok is available as apt processor and eclipse plugin :) On Thu, Nov 26, 2009 at 5:13 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: you guys are missing the point. Bindgen is a *standard apt processor*. it is not an eclipse plugin. all major IDEs have support for annotation processors baked in. refactoring support is definetely *possible*, but it would require an actual IDE pliugin. -igor On Thu, Nov 26, 2009 at 5:20 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Ah.. the next big thing, (in) refactoring (bindings?)!!! All glory to the person that does it. ** Martin 2009/11/26 Johan Compagner jcompag...@gmail.com: http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ltk/core/refactoring/participants/package-summary.html On Thu, Nov 26, 2009 at 13:52, James Carman jcar...@carmanconsulting.comwrote: Refactoring could definitely be supported in IDEA. With the Hibernate support, when you change a property name it will change your mapping hbm.xml (yes, we still use them) files for you automatically. Same thing happens with the Spring support. The configuration files are changed for you. I don't know how eclipse works with this kind of stuff, but IDEA definitely has hooks for this kind of stuff. On Thu, Nov 26, 2009 at 2:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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 - 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: Jawr links rendering in Wicket
nothing wrong with using icomponentresolver, we already have wicket:link which is analogous to wicket:jawr which does our own transformations, so you can take a look at how that is implemented. see WicketLinkResolver and WicketTagHandler -igor On Thu, Nov 26, 2009 at 12:51 PM, ibrahim CHAEHOI ichae...@gmail.com wrote: Hi all, I'm working on Jawr, a java library, which handle the bundling and compressing process for web resources. ( https://jawr.dev.java.net/ ) I would like to know the best way to integrate Jawr in Wicket. In fact, Jawr generates a custom URL for a specific resource bundle. For example, if you have a reference in your page like: script type=text/javascript src=/js/bundle/msg.js /script This will generates in production mode something like : script type=text/javascript src=/mywebapp/gzip_324521/js/myBundle.js /script and in debug mode : script type=text/javascript src=/mywebapp/js/myScript1.js / script type=text/javascript src=/mywebapp/js/myScript2.js / script type=text/javascript src=/mywebapp/js/myScript3.js / The first way of doing it was to create a dedicated component, which was provided by one of our contributor. So in the wicket page, we had something like: script wicket:id=bundle1 type=text/javascript src=/js/myBundle.js /script And in our page, we have : ... add(new JawrJavascriptReference(bundle1)); This works fine, but I would like to know if there is not an easier way to put it in place. I'm probably biased as I'm much more used to request based frameworks, but I would like to reference my bundle in my html page like : wicket:jawr script type=text/javascript src=/js/myBundle1.js /script script type=text/javascript src=/js/myBundle2.js /script /wicket:jawr and for image references : wicket:jawr img src=/img/appIcons/application.png/ /wicket:jawr To achieve this, I thought to implement a new IComponentResolver, but it seems to be not advised to do so as it's a core functionality of wicket... Another way to do it for Javascript and CSS resources would be to create an IHeaderContributor, which I find cleaner than a webMarkupContainer (no reference need to be define in the HTML page) but I need to have access to the request, and I didn't find a way to retrieve it. So I would like to know, what is the best way to implement it. Any thoughts or advises? Thanks in advance. Cheers, Ibrahim Chaehoi - 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: Jawr links rendering in Wicket
Hi, Thanks igor for your reply. I think that I will follow your suggestion and I will use the IComponentResolver. Cheers, Ibrahim On Thu, Nov 26, 2009 at 10:45 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: nothing wrong with using icomponentresolver, we already have wicket:link which is analogous to wicket:jawr which does our own transformations, so you can take a look at how that is implemented. see WicketLinkResolver and WicketTagHandler -igor On Thu, Nov 26, 2009 at 12:51 PM, ibrahim CHAEHOI ichae...@gmail.com wrote: Hi all, I'm working on Jawr, a java library, which handle the bundling and compressing process for web resources. ( https://jawr.dev.java.net/ ) I would like to know the best way to integrate Jawr in Wicket. In fact, Jawr generates a custom URL for a specific resource bundle. For example, if you have a reference in your page like: script type=text/javascript src=/js/bundle/msg.js /script This will generates in production mode something like : script type=text/javascript src=/mywebapp/gzip_324521/js/myBundle.js /script and in debug mode : script type=text/javascript src=/mywebapp/js/myScript1.js / script type=text/javascript src=/mywebapp/js/myScript2.js / script type=text/javascript src=/mywebapp/js/myScript3.js / The first way of doing it was to create a dedicated component, which was provided by one of our contributor. So in the wicket page, we had something like: script wicket:id=bundle1 type=text/javascript src=/js/myBundle.js /script And in our page, we have : ... add(new JawrJavascriptReference(bundle1)); This works fine, but I would like to know if there is not an easier way to put it in place. I'm probably biased as I'm much more used to request based frameworks, but I would like to reference my bundle in my html page like : wicket:jawr script type=text/javascript src=/js/myBundle1.js /script script type=text/javascript src=/js/myBundle2.js /script /wicket:jawr and for image references : wicket:jawr img src=/img/appIcons/application.png/ /wicket:jawr To achieve this, I thought to implement a new IComponentResolver, but it seems to be not advised to do so as it's a core functionality of wicket... Another way to do it for Javascript and CSS resources would be to create an IHeaderContributor, which I find cleaner than a webMarkupContainer (no reference need to be define in the HTML page) but I need to have access to the request, and I didn't find a way to retrieve it. So I would like to know, what is the best way to implement it. Any thoughts or advises? Thanks in advance. Cheers, Ibrahim Chaehoi - 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: PropertyModels *without* strings
The proxy-based approach runs into problems when the return types of the getters are final or non-proxyable in some way (at least for nested properties). We discussed this idea of recording the property expression (and I even wrote some code in Commons Proxy for it). I even proposed an entirely new project (called Commons Expression by me but others didn't like the name). On Thu, Nov 26, 2009 at 4:23 PM, Pieter Degraeuwe pieter.degrae...@systemworks.be wrote: Some time ago I was experimenting with lambdaJ. It uses the proxy way to obtain the propertyName. This way, your code could look like new TextFieldLong(orderNumber, new SafePropertyModel(target, property(on(Order.class).getOrderNumber(; If there is interest in this thing, I'm willing to contribute... Just my 2 cents... On Thu, Nov 26, 2009 at 8:30 PM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Lombok looks preety cool. I think i will use it cause it saves a lot of typing and holds equals and hashcode in sync. -Ursprüngliche Nachricht- Von: Gerolf Seitz [mailto:gerolf.se...@gmail.com] Gesendet: Donnerstag, 26. November 2009 19:36 An: users@wicket.apache.org Betreff: Re: PropertyModels *without* strings that's why i was wondering about a lombok based bindgen implementation, since lombok is available as apt processor and eclipse plugin :) On Thu, Nov 26, 2009 at 5:13 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: you guys are missing the point. Bindgen is a *standard apt processor*. it is not an eclipse plugin. all major IDEs have support for annotation processors baked in. refactoring support is definetely *possible*, but it would require an actual IDE pliugin. -igor On Thu, Nov 26, 2009 at 5:20 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Ah.. the next big thing, (in) refactoring (bindings?)!!! All glory to the person that does it. ** Martin 2009/11/26 Johan Compagner jcompag...@gmail.com: http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ltk/core/refactoring/participants/package-summary.html On Thu, Nov 26, 2009 at 13:52, James Carman jcar...@carmanconsulting.comwrote: Refactoring could definitely be supported in IDEA. With the Hibernate support, when you change a property name it will change your mapping hbm.xml (yes, we still use them) files for you automatically. Same thing happens with the Spring support. The configuration files are changed for you. I don't know how eclipse works with this kind of stuff, but IDEA definitely has hooks for this kind of stuff. On Thu, Nov 26, 2009 at 2:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands,
Adding a User Object to the Component Class
All - I'm coding a Wicket table and would like all the components in the table to have access to a specific reference. Another framework I worked with a very long time ago (Vermont Views, I believe) addressed this by providing a user pointer in the class that could be used for any purpose the programmer wanted. It was a void * in C; in Java it would be an Object reference. What do you think about adding this to Wicket's Component class, and maybe even others, like Page, Form, etc.? Thanks, Keith --- Keith R. Bennett Senior Software Consultant Linked In: http://www.linkedin.com/in/keithrbennett Blogs: http://krbtech.wordpress.com, http://keithrbennett.wordpress.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Navigating Wicket DataTable's
Hi, all. I'd like some feedback as to whether my need is already addressed in Wicket, or, if not, if I'm on the right track with some code I've written to address this need. I've been working with a DataTable and need to be able to query it for things like: For a given component: * What row am I in? * What column am I in? * What is the table that contains me? * What are my sibling components in this row? * What is my sibling component in this row for the column whose property is foo? * What is the component in my table at column x and row y? * What is the component in my table at the column whose key is foo and row y? I need this information because I want to be able to inspect the components' input before the values are saved to the underlying model (data provider). For example, in my form validation, I want to inspect those unsaved values. I can't do that in field validation because the error state depends on relationships between data items in several columns in the row. Or, I may have an error indicator icon in one column that is added to the Ajax target for other components in that row, and the error icon's visibility is dependent partly on components in that row whose data have not yet been saved. * * * I wrote some code that does this. Because it was difficult to guarantee that all components would have access to an object, I implemented this functionality as static methods. It relies heavily on the components' page relative paths (e.g. form:table:rows:1:cells:1:cell). One of the challenges was that the row number of the first row changes! When the table is repopulated, new row numbers are assigned. For example, a 5 row table will start out having its first row as #1, but later in its life it will be #6, and then later, #11... I don't think there's any hook into being notified of these changes, and even if there were, the static methods couldn't easily use them, so I wind up recalculating the row offset (1, 6, etc.) every time I need it. This involves inspecting all the columns rows and calculating the minimum, and is a bit unfortunate. Because all cell components have an id of cell, there is no way to tell which cell contains a foo field, which contains a bar field, etc., without getting its column number and looking it up somehow. (In some cases one could identify it by the class, but that wouldn't work all the time.) So I made an interface: /** * For columns that can be identified by a key name. */ public interface ColumnWithKey { String getColumnKey(); } Ideally, the need for a ColumnWithKey interface could be eliminated by adding getKey() to the IColumn interface. The code is at: http://gist.github.com/243802 and http://gist.github.com/243800 It uses Google Collections, a really cool generics-enabled collections library that brings some functional programming type goodies to Java. Any feedback on any of this? Would this code be helpful to anyone? Thanks, Keith --- Keith R. Bennett Senior Software Consultant Linked In: http://www.linkedin.com/in/keithrbennett Blogs: http://krbtech.wordpress.com, http://keithrbennett.wordpress.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketSessionFilter and several domains
Bas, I will try to explain what it is going on with this scenario (anyway I think you understood). 1. an user logs in the site using .com.ar 2. the user gets a flex component in the site's page. The flex component is compiled to point to .com services. 3. the flex component asks a specific service to the back-end which consults if this user has a wicket session, it fails. The user has never change the tab which is using. He has a cookie because he is accessing to the site using the same tab. Thus, it shouldnt have been any problem. On the another hand, I have set up the server with two dns manager, one for each domain. --- | a page (from .com.ar) | | | | -- | || a flex component | | || (connects .com) | | --- MessageBrokerServlet, flex component back end, which needs wicketSessionFilter to verify user authentication. WicketSessionServletFilter which injects the session into MessageBrokerServlet. WicketFilter. flex client --- MessageBrokerServlet through .com the page WicketFilter through .com.ar I know the cookie should be the same because they are in the same tab, but it is also truth that they connect using differents domains. The message log4j sends to me it is clear. It couldnt reach the session. Thanks anyway. On Thu, Nov 26, 2009 at 9:30 AM, bgooren b...@iswd.nl wrote: Did you check if a session is actually created, e.g. do you see a cookie? I cannot imagine that if you use the exact same flow, and the only difference is the domain name, it would work in the one case but not the other. What happens exactly? Getting the session returns null? I suggest you try a debugger for finding out what's happening inside the WicketSessionFilter. Fernando Wermus-2 wrote: Bas, What I actually did was to login in .com and test the servlet I mentioned you. Then I logged out and logged in the site using .com.ar again. This second time failed. In this case, it seems that I am using different cookies and it shouldn't to affect if I get the session. To be more specific, I have some embeded flex clients which connects to Blazeds. I need to get wicket session to know who has logged in using wicket front end. Each flex client has been compiled using a specific url from the site. The servlet that is in charge is messageBroker that delegates to a class of my own the service called.There it is where I couldnt get the session when the user logged in to a specific domain. Thanks in advance. -- View this message in context: http://old.nabble.com/WicketSessionFilter-and-several-domains-tp26502429p26526474.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 -- Fernando Wermus. www.linkedin.com/in/fernandowermus
Re: Adding a User Object to the Component Class
create your own subclass of websession that holds the user and then anywhere within a wicket request you can get to it via: ((MySession)Session.get()).getUser() -igor On Thu, Nov 26, 2009 at 6:20 PM, Keith Bennett keithrbenn...@gmail.com wrote: All - I'm coding a Wicket table and would like all the components in the table to have access to a specific reference. Another framework I worked with a very long time ago (Vermont Views, I believe) addressed this by providing a user pointer in the class that could be used for any purpose the programmer wanted. It was a void * in C; in Java it would be an Object reference. What do you think about adding this to Wicket's Component class, and maybe even others, like Page, Form, etc.? Thanks, Keith --- Keith R. Bennett Senior Software Consultant Linked In: http://www.linkedin.com/in/keithrbennett Blogs: http://krbtech.wordpress.com, http://keithrbennett.wordpress.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: Navigating Wicket DataTable's
datatable { populateitem(item i) { int col=i.getindex(); int row=i.getparent(Item.class).getindex(); } } -igor On Thu, Nov 26, 2009 at 7:27 PM, Keith Bennett keithrbenn...@gmail.com wrote: Hi, all. I'd like some feedback as to whether my need is already addressed in Wicket, or, if not, if I'm on the right track with some code I've written to address this need. I've been working with a DataTable and need to be able to query it for things like: For a given component: * What row am I in? * What column am I in? * What is the table that contains me? * What are my sibling components in this row? * What is my sibling component in this row for the column whose property is foo? * What is the component in my table at column x and row y? * What is the component in my table at the column whose key is foo and row y? I need this information because I want to be able to inspect the components' input before the values are saved to the underlying model (data provider). For example, in my form validation, I want to inspect those unsaved values. I can't do that in field validation because the error state depends on relationships between data items in several columns in the row. Or, I may have an error indicator icon in one column that is added to the Ajax target for other components in that row, and the error icon's visibility is dependent partly on components in that row whose data have not yet been saved. * * * I wrote some code that does this. Because it was difficult to guarantee that all components would have access to an object, I implemented this functionality as static methods. It relies heavily on the components' page relative paths (e.g. form:table:rows:1:cells:1:cell). One of the challenges was that the row number of the first row changes! When the table is repopulated, new row numbers are assigned. For example, a 5 row table will start out having its first row as #1, but later in its life it will be #6, and then later, #11... I don't think there's any hook into being notified of these changes, and even if there were, the static methods couldn't easily use them, so I wind up recalculating the row offset (1, 6, etc.) every time I need it. This involves inspecting all the columns rows and calculating the minimum, and is a bit unfortunate. Because all cell components have an id of cell, there is no way to tell which cell contains a foo field, which contains a bar field, etc., without getting its column number and looking it up somehow. (In some cases one could identify it by the class, but that wouldn't work all the time.) So I made an interface: /** * For columns that can be identified by a key name. */ public interface ColumnWithKey { String getColumnKey(); } Ideally, the need for a ColumnWithKey interface could be eliminated by adding getKey() to the IColumn interface. The code is at: http://gist.github.com/243802 and http://gist.github.com/243800 It uses Google Collections, a really cool generics-enabled collections library that brings some functional programming type goodies to Java. Any feedback on any of this? Would this code be helpful to anyone? Thanks, Keith --- Keith R. Bennett Senior Software Consultant Linked In: http://www.linkedin.com/in/keithrbennett Blogs: http://krbtech.wordpress.com, http://keithrbennett.wordpress.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: Can I Suppress Type Conversion Feedback Messages?
override convertinput() on that textfield and do not throw a conversion exception -igor On Thu, Nov 26, 2009 at 6:26 PM, Keith Bennett keithrbenn...@gmail.com wrote: Hi all... We have a form that has a table, and the table has a column that is populated with TextFieldInteger's. When there are nonnumeric characters in several of these fields, we get an error message in the feedback panel for each offending field. We'd rather combine them into a single message saying something like n Solicitation Number fields contained nonnumeric characters. I know how to create the combined message, but how can I suppress the individual ones? Thanks, Keith --- Keith R. Bennett Senior Software Consultant Linked In: http://www.linkedin.com/in/keithrbennett Blogs: http://krbtech.wordpress.com, http://keithrbennett.wordpress.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: Adding a User Object to the Component Class
Igor - Thanks for responding. The User solution would work where all components would share the same reference, but I need each table would have its own reference. Also, I was thinking it would be nice for each component to have its own Object. I realize I could have been clearer about that. Thanks, Keith On Nov 27, 2009, at 1:16 AM, Igor Vaynberg wrote: create your own subclass of websession that holds the user and then anywhere within a wicket request you can get to it via: ((MySession)Session.get()).getUser() -igor On Thu, Nov 26, 2009 at 6:20 PM, Keith Bennett keithrbenn...@gmail.com wrote: All - I'm coding a Wicket table and would like all the components in the table to have access to a specific reference. Another framework I worked with a very long time ago (Vermont Views, I believe) addressed this by providing a user pointer in the class that could be used for any purpose the programmer wanted. It was a void * in C; in Java it would be an Object reference. What do you think about adding this to Wicket's Component class, and maybe even others, like Page, Form, etc.? Thanks, Keith --- Keith R. Bennett Senior Software Consultant Linked In: http://www.linkedin.com/in/keithrbennett Blogs: http://krbtech.wordpress.com, http://keithrbennett.wordpress.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Adding a User Object to the Component Class
Adding another reference to component would increase the memory footprint for all users. You are the first one to ask so there's little to no demand for it. Wicket already has a default object slot: the model. If that doesn't solve your problem use the metadata. Martijn On Friday, November 27, 2009, Keith Bennett keithrbenn...@gmail.com wrote: Igor - Thanks for responding. The User solution would work where all components would share the same reference, but I need each table would have its own reference. Also, I was thinking it would be nice for each component to have its own Object. I realize I could have been clearer about that. Thanks, Keith On Nov 27, 2009, at 1:16 AM, Igor Vaynberg wrote: create your own subclass of websession that holds the user and then anywhere within a wicket request you can get to it via: ((MySession)Session.get()).getUser() -igor On Thu, Nov 26, 2009 at 6:20 PM, Keith Bennett keithrbenn...@gmail.com wrote: All - I'm coding a Wicket table and would like all the components in the table to have access to a specific reference. Another framework I worked with a very long time ago (Vermont Views, I believe) addressed this by providing a user pointer in the class that could be used for any purpose the programmer wanted. It was a void * in C; in Java it would be an Object reference. What do you think about adding this to Wicket's Component class, and maybe even others, like Page, Form, etc.? Thanks, Keith --- Keith R. Bennett Senior Software Consultant Linked In: http://www.linkedin.com/in/keithrbennett Blogs: http://krbtech.wordpress.com, http://keithrbennett.wordpress.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Adding a User Object to the Component Class
datatable.setmetadata(mykey, myobject); .. somewhere in a component under datatable public mytype findreference() { datatable table=findparent(datatable.class); return table.getmetadata(mykey); } -igor On Thu, Nov 26, 2009 at 11:02 PM, Keith Bennett keithrbenn...@gmail.com wrote: Igor - Thanks for responding. The User solution would work where all components would share the same reference, but I need each table would have its own reference. Also, I was thinking it would be nice for each component to have its own Object. I realize I could have been clearer about that. Thanks, Keith On Nov 27, 2009, at 1:16 AM, Igor Vaynberg wrote: create your own subclass of websession that holds the user and then anywhere within a wicket request you can get to it via: ((MySession)Session.get()).getUser() -igor On Thu, Nov 26, 2009 at 6:20 PM, Keith Bennett keithrbenn...@gmail.com wrote: All - I'm coding a Wicket table and would like all the components in the table to have access to a specific reference. Another framework I worked with a very long time ago (Vermont Views, I believe) addressed this by providing a user pointer in the class that could be used for any purpose the programmer wanted. It was a void * in C; in Java it would be an Object reference. What do you think about adding this to Wicket's Component class, and maybe even others, like Page, Form, etc.? Thanks, Keith --- Keith R. Bennett Senior Software Consultant Linked In: http://www.linkedin.com/in/keithrbennett Blogs: http://krbtech.wordpress.com, http://keithrbennett.wordpress.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