Re: Accessing Page components

2009-12-17 Thread Paul Szulc
Just declare them final, should work just fine, but with consequences (you wont be able to re-reference them in a future). On Thu, Dec 17, 2009 at 8:45 AM, marioosh.net marioosh@gmail.comwrote: Is simple possibility to access page components in anonymous onClick method like in code below ?

Re: Accessing Page components

2009-12-17 Thread marioosh.net
2009/12/17, Pieter Degraeuwe pieter.degrae...@systemworks.be: However, I never do it like this. I always use PropertyModels() to 'map' my TextFields to properties of my object. This way your code in the onClick() method uses that just the object properties. (Note that the AjaxSubmitLink has no

Basic concept of Wicket

2009-12-17 Thread psytra...@gmx.de
Hi, I'm stuck with some very basic concepts, even if i read a book about wicket. Let's stress the counter-example, but first the questions: - Basic questions: Why does the counter not increment on reload? - Why is the WebPage created every time I reload the website, I though they are only

Re: Basic concept of Wicket

2009-12-17 Thread Marat Radchenko
- Why is the WebPage created every time I reload the website, I though they are only created once? Because it's stateless. Define 'once', btw. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional

Re: Basic concept of Wicket

2009-12-17 Thread Martin Makundi
- Basic questions: Why does the counter not increment on reload? Reload instantiates new object, with initial values. Cannot increment. - Why is the WebPage created every time I reload the website, I though they are only created once? Well.. that's the idea. Reload if there is no previous

Re: Accessing Page components

2009-12-17 Thread Pieter Degraeuwe
There are several ways how you can do this... To encourage losely coupled components folowing is in my opinion the best solution.. Work with a callback mechanism. let's say you define a callback interface SaveCallback with a method onSaved(AjaxRequestTarget target). The component that uses you

Re: Basic concept of Wicket

2009-12-17 Thread Martijn Dashorst
Your homepage is referenced using a bookmarkable URL. Bookmarkable URLs always invoke the constructor of the page. Martijn On Thu, Dec 17, 2009 at 11:42 AM, psytra...@gmx.de psytra...@gmx.de wrote: Hi, I'm stuck with some very basic concepts, even if i read a book about wicket. Let's stress

Re: Basic concept of Wicket

2009-12-17 Thread Johan Compagner
public class HomePage extends WebPage { private Long value = 0L; public HomePage(final PageParameters parameters) { Model m = new ModelSerializable() { private static final long serialVersionUID = 1L; // It doesn't

Re: Accessing Page components

2009-12-17 Thread marioosh.net
Pieter Degraeuwe wrote: There are several ways how you can do this... To encourage losely coupled components folowing is in my opinion the best solution.. Work with a callback mechanism. let's say you define a callback interface SaveCallback with a method onSaved(AjaxRequestTarget

How to use DateTimeField with java.sql.Timestamp

2009-12-17 Thread chinedu efoagui
Hello, I am very new to Wicket I am building an application that requires a Datetimefield The field in my database 'timein' is datetime. The pojo object accepts a java.sql.Timestamp /** * Returns the value of the codetimein/code property. * */ @Column(name = timein ) public

Re: Accessing Page components

2009-12-17 Thread Pieter Degraeuwe
Use the onSubmit(AjaxRequestTarget target) of your AjaxSubmitLink instead of your form. (Note that if you make use of FeedbackPanel, youd should also override the onError() method of that ajaxlink to 'refresh' your feedback panel) On Thu, Dec 17, 2009 at 2:14 PM, marioosh.net

Re: Accessing Page components

2009-12-17 Thread Pieter Degraeuwe
I don't have the habit to exend from Form, since I don't need to put logic there (I put it in my submitLinks/buttons) On Thu, Dec 17, 2009 at 2:45 PM, Pieter Degraeuwe pieter.degrae...@systemworks.be wrote: Use the onSubmit(AjaxRequestTarget target) of your AjaxSubmitLink instead of your

Re: How to use DateTimeField with java.sql.Timestamp

2009-12-17 Thread Matthias Keller
DateTimeField internally uses a DateTextField which is a normal TextField initialized as type java.util.Date You could create a class: public class TimestampField extends DateTimeField { protected DateTextField newDateTextField(String id, PropertyModel dateFieldModel) { return

Re: Accessing Page components

2009-12-17 Thread marioosh.net
Pieter Degraeuwe wrote: I don't have the habit to exend from Form, since I don't need to put logic there (I put it in my submitLinks/buttons) On Thu, Dec 17, 2009 at 2:45 PM, Pieter Degraeuwe pieter.degrae...@systemworks.be wrote: Use the onSubmit(AjaxRequestTarget target) of your

Re: How to use DateTimeField with java.sql.Timestamp

2009-12-17 Thread Marc Nuri (GMail)
You can create a custom converter. A simpler quick solution is to create two methods to encapsulate the sql date in a normal date: The pojo object accepts a java.sql.Timestamp Your original methods: [CODE] @Column(name = timein ) public java.sql.Timestamp getTimein() { return timein;

Re: Accessing Page components

2009-12-17 Thread Pieter Degraeuwe
class LinkForm extends Form { private AddLinkCallback callback; public LinkForm(String id, *final *AddLinkCallback callback) { super(id); this.callback = callback; *final *Link link = new Link(); this.setModel(new

Re: How to use DateTimeField with java.sql.Timestamp

2009-12-17 Thread chinedu efoagui
hello @matt I carried out your instruction i still got the same error WicketMessage: Error calling method: public void org.apache.wicket.extensions.yui.calendar.DateTimeField.setDate(java.util.Date) on object: [MarkupContainer [Component id = timein]] Root cause:

Re: Basic concept of Wicket

2009-12-17 Thread Igor Vaynberg
On Thu, Dec 17, 2009 at 2:42 AM, psytra...@gmx.de psytra...@gmx.de wrote: Hi, I'm stuck with some very basic concepts, even if i read a book about wicket. Let's stress the counter-example, but first the questions: - Basic questions: Why does the counter not increment on reload? by default

Re: How to use DateTimeField with java.sql.Timestamp

2009-12-17 Thread chinedu efoagui
thanks a lot I resolved it by add those getter and setters I would consider that a hack anyway but there still needs to be a simpler more streamlined way of achieving the same thing using the converters. Thanks again. On Thu, Dec 17, 2009 at 3:32 PM, chinedu efoagui chinedub...@gmail.com wrote:

Re: How to use DateTimeField with java.sql.Timestamp

2009-12-17 Thread Marc Nuri (GMail)
I use that continuously. Not only in Wicket but with swing too. It's a kind of hack but it does its job. The economic way is to use a converter because in the future you may use the converter with other model classes. In the other hand if you use the same model with different technologies (Swing,

Re: Accessing Page components

2009-12-17 Thread Juan Carlos Garcia M.
Pieter, passing the [*final *Link link = new Link();] object to the anonymous AjaxSubmitLink will Serialize the the link object itself. why not using the form.getModelObject() from the form parameter in ajaxsubmitl...@onsubmit()? *new LinkDAO().save(form.getModelObject())*; Pieter

Re: Pretty URLs and sessions

2009-12-17 Thread VGJ
Thanks Alex. I just had another meeting w/ the SEO guy today and the idea is to track orders moving through our storefront in order go gauge sales based on the SEO strategy. In other words, where did our customers come from (Google search?), what did they buy, and did they make it all the way

RE: Pretty URLs and sessions

2009-12-17 Thread Alex Rass
V, What you are looking for can be addressed in 2 ways. GA gives you a value to add to the page's html: some javascript which calls home and reports URL it was called from. This will tell you which items customers are looking at: item_id=2098 Using HybridUrlCodingStrategy (as per Alex O) will

Re: Pretty URLs and sessions

2009-12-17 Thread Alex Objelean
There are two possibilities: 1) In your application class add the following: mount(new HybridUrlCodingStrategy(/checkout, CheckoutPage.class)); 2) If you have wicket-stuff annotation dependency (http://wicketstuff.org/confluence/display/STUFFWIKI/wicketstuff-annotation) you can annotate your

Ajax not firing onSubmit after back-button press

2009-12-17 Thread Kurt Heston
I've read alot about ajax and the back button in the forums and on the web, but what I'm seeing looks to be a different problem in v1.4.3. I don't think it has anything to do with WICKET-271. I have some ajax in a panel that works perfectly after a page refresh but not after pressing the back

Re: How to replace Strings in JavaScript ?

2009-12-17 Thread nino martinez wael
look at input events on wicketstuff 2009/12/17 Martin Makundi martin.maku...@koodaripalvelut.com: Maybe it's TextTemplateHeaderContributor ? 2009/12/16 smallufo small...@gmail.com: Hi , Thanks But where is class TextTemplateContributor ? I cannot grep that class ... I could only find

How to have multiple HTML files per panel?

2009-12-17 Thread Don Ferguson
I've heard that it's possible to have multiple .html files for a given panel (or page, presumably), but how does one specify which file to apply? For example, if I have: LoginPanel.java LoginPanel.html LoginPanel_small.html How would I get wicket to use LoginPanel_small.html? Thanks in

Re: Accessing Page components

2009-12-17 Thread Pieter Degraeuwe
It is indeed a better (more proper) way to do it your way, but the Link object will be serialized as well, since it is not a DetachableLoadableModel if I'm not mistaking... On Thu, Dec 17, 2009 at 6:15 PM, Juan Carlos Garcia M. jcgarc...@gmail.comwrote: Pieter, passing the [*final *Link link

Re: How to have multiple HTML files per panel?

2009-12-17 Thread Scott Swank
You would either do so at the session level via session.setStyle(small) or at the component level by implementing LoginPanel.getVariation() and having it return small as appropriate. http://cwiki.apache.org/WICKET/localization-and-skinning-of-applications.html Scott On Thu, Dec 17, 2009 at

Re: How to have multiple HTML files per panel?

2009-12-17 Thread Ernesto Reinaldo Barreiro
http://cwiki.apache.org/WICKET/multiple-markups-per-page.html On Thu, Dec 17, 2009 at 9:26 PM, Don Ferguson don.fergu...@gmail.comwrote: I've heard that it's possible to have multiple .html files for a given panel (or page, presumably), but how does one specify which file to apply? For

retrieving multiple values for a key in a properties file

2009-12-17 Thread A. Maza
Hello, is it somehow possible to retrieve a String array (or a list or something else) for multiple values in a properties file. I want to achieve something like this: I have a properties file with the following entry myKey=firstValue,secondValue,thirdValue,... in a component I would need

Re: Pretty URLs and sessions

2009-12-17 Thread Alex Objelean
Also, it could be useful to check this out: http://day-to-day-stuff.blogspot.com/2008/10/wicket-extreme-consistent-urls.html Alex V. Jenks wrote: Excellent, excellent! This is exactly what I was after! That is...unless this SEO can find another monkey wrench to throw in it. But...it

DateTimeField enhancement

2009-12-17 Thread Steve Lowery
I'd like to use the DateTimeField component, but there is no API that I can see to override what DatePicker gets added to the component. I'd like to subclass the DatePicker and customize the icon, positioning, etc. I can do this if just dealing with the DateTextField, where I add the DatePicker

Re: DateTimeField enhancement

2009-12-17 Thread Martin Makundi
Patch would be nice.. ** Martin 2009/12/17 Steve Lowery slow...@gatessolutions.com: I'd like to use the DateTimeField component, but there is no API that I can see to override what DatePicker gets added to the component.  I'd like to subclass the DatePicker and customize the icon,

Re: Pretty URLs and sessions

2009-12-17 Thread VGJ
Hit a snag! At the cart page (going into the login page), I redirect to https like so: getRequestCycle().setRedirect(false); getRequestCycle().setRequestTarget(EmptyRequestTarget.getInstance()); getResponse().redirect(https://mysite/app/account;); user-account being mapped

Re: How to have multiple HTML files per panel?

2009-12-17 Thread Don Ferguson
Thanks Ernesto and Scott. Just what I needed. On Dec 17, 2009, at 12:37 PM, Ernesto Reinaldo Barreiro wrote: http://cwiki.apache.org/WICKET/multiple-markups-per-page.html On Thu, Dec 17, 2009 at 9:26 PM, Don Ferguson don.fergu...@gmail.comwrote: I've heard that it's possible to have

RE: Pretty URLs and sessions

2009-12-17 Thread Alex Rass
They're so wowed by GA, I doubt there's any turning back. Explain to your guys that GA is Google. If he is ok with Google knowing as much (or more) than you guys do about your own sales - then party on! Go GA! Also, you can track a lot more stuff than GA will let you since you know/own

Re: DateTimeField enhancement

2009-12-17 Thread slowery23
I am attempting to upload a patch. Should an issue be opened as well? MartinM wrote: Patch would be nice.. ** Martin 2009/12/17 Steve Lowery slow...@gatessolutions.com: I'd like to use the DateTimeField component, but there is no API that I can see to override what DatePicker gets

Re: Pretty URLs and sessions

2009-12-17 Thread Alex Objelean
You shouldn't have a code like this: getRequestCycle().setRedirect(false); getRequestCycle().setRequestTarget(EmptyRequestTarget.getInstance()); getResponse().redirect( https://mysite/app/?wicket:bookmarkablePage=:com.myapp.UserAccount;); A more 'wicket way' of doing thins

Re: DateTimeField enhancement

2009-12-17 Thread Martin Makundi
Yeah, rfe issue into jira and upload a patch proposal. ** Martin 2009/12/17 slowery23 slow...@gatessolutions.com: I am attempting to upload a patch.  Should an issue be opened as well? MartinM wrote: Patch would be nice.. ** Martin 2009/12/17 Steve Lowery slow...@gatessolutions.com:

Re: Accessing Page components

2009-12-17 Thread Juan Carlos Garcia M.
Totally right! :) Pieter Degraeuwe wrote: It is indeed a better (more proper) way to do it your way, but the Link object will be serialized as well, since it is not a DetachableLoadableModel if I'm not mistaking... On Thu, Dec 17, 2009 at 6:15 PM, Juan Carlos Garcia M.

Re: Pretty URLs and sessions

2009-12-17 Thread VGJ
Yes I know, I do this most of the time. However, I'm redirecting from http to https. When I wrote this app, this was what everyone was recommending. Is there another way? On Thu, Dec 17, 2009 at 2:45 PM, Alex Objelean alex_objel...@yahoo.comwrote: You shouldn't have a code like this:

Re: Pretty URLs and sessions

2009-12-17 Thread Alex Objelean
Though I didn't use it, there is HttpsRequestCycleProcessor (you should add it in your Application) and @RequireHttps annotation (for each WebPage which must be accessed through SSL) which should make this work. Alex V. Jenks wrote: Yes I know, I do this most of the time. However, I'm

How to disable cache for StringRequestTarget

2009-12-17 Thread Jazon
In my web app, I need to return some String. So I am using StringRequestTarget, instead of WebPage. The string is dynamic, so, I would like to disable browser cache. I know WebPage can override setHeaders to set no-cache. Is there a way to do the same thing when using StringRequestTarget? the

Re: How to disable cache for StringRequestTarget

2009-12-17 Thread Ernesto Reinaldo Barreiro
I haven't tried this... but it might work. public class MyStringRequestTarget extends StringRequestTarget { /** * @param string */ public MyStringRequestTarget(String string) { super(string); } /** * @param contentType * @param encoding * @param string */ public

Re: retrieving multiple values for a key in a properties file

2009-12-17 Thread Per Newgro
Am 17.12.2009 21:47, schrieb A. Maza: Hello, is it somehow possible to retrieve a String array (or a list or something else) for multiple values in a properties file. I want to achieve something like this: I have a properties file with the following entry