Re: shorter input names

2009-05-17 Thread Jan Kriesten
Hi Ian, > Thanks for that. For your solution to work it looks like wicket would > need to only call getInputName at most once for each input (since > subsequent calls would return different names). Is that how it works? no, within the trait I override the 'def getInputName' from Wicket with a

Re: How do you get a custom FormComponent to "remember" erroneous values?

2009-05-17 Thread Igor Vaynberg
In onbeforerender you should init the modelobkect not the model. But in your simple case you dont even need onbrforwrender, instead: new textfield(..., new propertymodel(this,"model")). Done. -Igor On Sunday, May 17, 2009, Ian MacLarty wrote: > Hi, > > If I have a TextField whose model object i

Re: How To Call A Method When Browser Is Closed

2009-05-17 Thread Igor Vaynberg
You can have each page register pinh into an application scoped map. Then have a thread checking for timeouts. -Igor On Sunday, May 17, 2009, Carlo M. Camerino wrote: > ya we've done something sort of similar to this one before but > it kinda behaves differently on different browsers. Plus issue

Re: Component creation and initialization

2009-05-17 Thread Martin Grigorov
El dom, 17-05-2009 a las 15:17 -0700, Igor Vaynberg escribió: > IOC works fine if you use constructor injection :) which is what you > should use. +1 Tor Iver, take a look at http://misko.hevery.com/code-reviewers-guide/ It is a very good reading! > the only reason people may prefer setter inje

Re: Bookmarkable fallback ajax link

2009-05-17 Thread Igor Vaynberg
What would you do with an Ajax fallback bookmarkable link? Do what the ret of them do and go to another page? That's the only thing bpls are goo for. -Igor On Sunday, May 17, 2009, John Patterson wrote: > > Actually I guess I could selectively re-enable url encoding (to put the > session id) for

Re: shorter input names

2009-05-17 Thread Ian MacLarty
Hi Jan, Thanks for that. For your solution to work it looks like wicket would need to only call getInputName at most once for each input (since subsequent calls would return different names). Is that how it works? I'm still learning Scala, but so far I find it a compelling alternative to Java.

Re: shorter input names

2009-05-17 Thread Jan Kriesten
Hi Ian, > Is there a way to get wicket to generate shorter name attributes for > input elements? I have a largish form and most of the data being sent > to the server is the names of the input elements. it is by overriding the method 'getInputName' on every FormComponent and returning a stable

Re: Bug in RequestUtils.toAbsolutePath?

2009-05-17 Thread Marat Radchenko
Just use getServletContextPath on ServletRequest. 2009/5/17, Martin Makundi : > That is my question.. whether I am stupid or someone baptized > "toAbsoluteUrl" wrong ;) > > I had to devise this: > > public static String getRootURL() { > StringBuffer requestURL = ((Request) ((WebRequest) >

Re: How do you get a custom FormComponent to "remember" erroneous values?

2009-05-17 Thread Ian MacLarty
On Mon, May 18, 2009 at 2:07 PM, Martin Makundi wrote: > Does not look right... but who am I to say. Why do you call > field.setModel(getModel()) at all? > I have to set the model of the nested component somewhere. I can't set it in the constructor, because the model is not available then. The d

Re: How do you get a custom FormComponent to "remember" erroneous values?

2009-05-17 Thread Martin Makundi
Does not look right... but who am I to say. Why do you call field.setModel(getModel()) at all? I would leave it out alltogether (= not change model). If you have other reasons to change the model, then you can override the FormComponent.internalOnModelChanged: /**

how to use Tree Component with LoadableDetachableModel

2009-05-17 Thread 新希望软件 -- 俞宏伟
Now i am using LinkTree with DefaultMutableTreeNode, it run well when tree node is limited in number, but when there has big number tree node, the wicket session file is too big, so i want to using LDM mode. is there any example code explain how to use tree component with loadabledetachablemodel.

Re: How To Call A Method When Browser Is Closed

2009-05-17 Thread Carlo M. Camerino
ya we've done something sort of similar to this one before but it kinda behaves differently on different browsers. Plus issues when the user presses refresh also arises. I was wondering if there was anything server side that can do this ? Can comet implement this? - Original Message - Fr

Re: Where is the Wicket+hibernate example of Francisco Treacy

2009-05-17 Thread James Carman
I have one that uses spring, not guice 2009/5/17 Александър Шопов : > This message by Francisco Treacy to the mailing list > http://osdir.com/ml/users-wicket.apache.org/2009-03/msg00989.html > > points to an example, that is no longer online. > > Does anyone else have a similar example? > > Kind r

Where is the Wicket+hibernate example of Francisco Treacy

2009-05-17 Thread Александър Шопов
This message by Francisco Treacy to the mailing list http://osdir.com/ml/users-wicket.apache.org/2009-03/msg00989.html points to an example, that is no longer online. Does anyone else have a similar example? Kind regards: al_shopov --

Re: How To Call A Method When Browser Is Closed

2009-05-17 Thread Jeremy Thomerson
You could try binding to window onUnload event but I think there are limitations as to what you can do within that and it may not always be called. -- Jeremy Thomerson http://www.wickettraining.com On Sun, May 17, 2009 at 10:32 PM, Carlo M. Camerino wrote: > Hi, > > I was just wondering if an

How To Call A Method When Browser Is Closed

2009-05-17 Thread Carlo M. Camerino
Hi, I was just wondering if any of you have implemented this in your wicket applications already. Have you tried calling a logout method when the user closed the browser? One of the things that I could do is to provide a timeout listener but it would have to wait for the expiration time to happe

shorter input names

2009-05-17 Thread Ian MacLarty
Hi, Is there a way to get wicket to generate shorter name attributes for input elements? I have a largish form and most of the data being sent to the server is the names of the input elements. Cheers, Ian. - To unsubscribe, e-m

Re: FeedbackPanel custom title "Please fix the following:"

2009-05-17 Thread pkcinna
Thanks guys. Looks like extending a Panel will be a flexible solution. I have been tesing on Google's app engine but their app server is still having issues with things like date formats... the YUI DateTimeField in wicket rc4 won't run but rc1 will... it looks like its just an issue on the Goog

Re: Bookmarkable fallback ajax link

2009-05-17 Thread John Patterson
Actually I guess I could selectively re-enable url encoding (to put the session id) for wicket ajax links. That would work. But I guess the googlebot does not always follow links right away. i.e. it might try to access the session dependant link the next day. So really, bookmarkable fallback u

Re: Component creation and initialization

2009-05-17 Thread Igor Vaynberg
IOC works fine if you use constructor injection :) which is what you should use. the only reason people may prefer setter injection is that configuration looks nicer. looks a lot nicer then -igor On Sun, May 17, 2009 at 2:50 PM, Wilhelmsen Tor Iver wrote: >> 2 - A constructor is for constru

Re: How do you get a custom FormComponent to "remember" erroneous values?

2009-05-17 Thread Ian MacLarty
Hi Martin, On Sun, May 17, 2009 at 10:56 PM, Martin Makundi wrote: > ... raw input? In my understanding it works by default. > Thanks for the hint. I got it to work by modifying my onBeforeRender to be: @Override protected void onBeforeRender() { if (!field.hasRawInput()) {

SV: Component creation and initialization

2009-05-17 Thread Wilhelmsen Tor Iver
> 2 - A constructor is for constructing - your object should > not be in an incomplete state when the constructor is > finished (such a state that methods such as isVisible can not > be called) Tha language ensures that the object is "complete" when the constructor exits, but with the exception

Re: Modifying LinkTree

2009-05-17 Thread Major Péter
Any thoughts or ideas? Thanks Major Péter írta: Hi all, I'm using a LinkTree in my app, which is pretty much the SimpleTree implementation at Wicket Ajax Examples ( http://www.wicket-library.com/wicket-examples/ajax/tree/simple.1 ), but I have to make it custom somehow. At this time the tree

Re: Bookmarkable fallback ajax link

2009-05-17 Thread John Patterson
I have already tried setting the stateless hint to true, which is the same as using a Bookmarkable link. The problem is that if any behaviour has a stateless hint of false, it overrides your links hint. Jeremy Thomerson-5 wrote: > > Is your Ajax link redirecting you to another page? Or is it

Re: Bookmarkable fallback ajax link

2009-05-17 Thread John Patterson
I disabled session ids on links so that bots wouldn't index every page with a sessionid. I read somewhere that although googlebot can and does index pages with session ids, it doesn't really like them and will probably index less of them than it otherwise would. Perhaps this is no longer the cas

Workaround for a test?

2009-05-17 Thread Martin Makundi
Hi! Anybody know a workaround for these two executeAjaxEvent bugs? 1. https://issues.apache.org/jira/browse/WICKET-2261 2. https://issues.apache.org/jira/browse/WICKET-2274 ** Martin - To unsubscribe, e-mail: users-unsubscr...@

Re: beware of changes between rc2 and rc4

2009-05-17 Thread Martin Makundi
What's important is that it has changed ;) The logic is better now, though. However, timestamp is required if one wants to save TIME into db and must be able to store "12:00 pm" and "06:00am next morning". Time alone cannot express 'tomorrow morning'. But in a text field input field it's better to

Re: beware of changes between rc2 and rc4

2009-05-17 Thread Steve Flasby
That was a Jira I raised as a result of asking about it on this list. I did ask if there was a reason why a sql timestamp was shown as only a time, as java.sql.xxx provides Date, Time and Timestamp. My understanding of this is that timestamp represents a date plus time whereas java.sql.time is a

Re: How do you get a custom FormComponent to "remember" erroneous values?

2009-05-17 Thread Martin Makundi
... raw input? In my understanding it works by default. public final String getValue() { if (NO_RAW_INPUT.equals(rawInput)) { return getModelValue(); } else {

Re: Bug in RequestUtils.toAbsolutePath?

2009-05-17 Thread Martin Makundi
That is my question.. whether I am stupid or someone baptized "toAbsoluteUrl" wrong ;) I had to devise this: public static String getRootURL() { StringBuffer requestURL = ((Request) ((WebRequest) RequestCycle.get().getRequest()).getHttpServletRequest()).getRequestURL(); int cutIndex = r

Re: Bug in RequestUtils.toAbsolutePath?

2009-05-17 Thread Marat Radchenko
Hmm... are you sure you want to use that method at all? It uses given path as relative to _current reqest path_. 2009/5/17, Martin Makundi : > No, there is no code in RequestUtils that would care about a leading > slash ... it will just result in > > > "http://www.mydomain.com/BookmarkablePage/P

Misfunctionality in WIA source code

2009-05-17 Thread HHB
Hey, I think the code of chapter 11 of "Wicket In Action" book isn't functioning properly. After logging in, try to logout, you should notice that you are still in the same page and you have to click on Logout link again in order to be taken to the sign in page. Any ideas? I'm using the same log

How do you get a custom FormComponent to "remember" erroneous values?

2009-05-17 Thread Ian MacLarty
Hi, If I have a TextField whose model object is a Float, then if the user enters an invalid value, say "aaa", the TextField will remember that invalid value and display it when the page is re-rendered. How would you go about getting the same behaviour for a custom FormComponent? Here is my simp

Re: Component creation and initialization

2009-05-17 Thread Vladimir K
If the question is ressurecting again and again then it is an evidence that there is something to address and improve. At least Wicket does not have a method with self-documented name which deffers component creation. As the result people have to search (using different words) and they don't satis

Re: objectautocomplete on a form with CompoundPropertyModel

2009-05-17 Thread Vladimir K
Does it perform validation on form submit? nino martinez wael wrote: > > hmm true, I think it's because it's ajax and actually get set before > the form are submited. I agree it would be nice if it acted exactly > like normal form, but I guess the way it are now allows much more > flexibility,

Re: Nested form bug?

2009-05-17 Thread Martin Makundi
if (argument == null) throw illegalargumentexception The argument is not allowed to be null. And I assume it is not null, because the Field onto which PropertyModel(dummy, "notNullExpression") is attached, isRequired(true). So null values should not be passed from the wicket framework.. in princi

Re: Nested form bug?

2009-05-17 Thread Daniele Dellafiore
I see that the originating exception is: Caused by: java.lang.IllegalArgumentException: Argument "null" must not be empty or only whitespace. at com.myapp.dto.Dummy(Dummy.java:76) that is, an exception raised by your code. What is the code at Dummy.java:76? On Wed, May 13, 2009 at 7:09 PM,

beware of changes between rc2 and rc4

2009-05-17 Thread Martin Makundi
Hi! We were surprised to find SqlTimestampConverter changed: 1.4-rc2 DateFormat.getTimeInstance(dateFormat, locale); 1.4-rc4 DateFormat.getDateTimeInstance(dateFormat, timeFormat, locale); Maybe there could be a TimeToSqlTimestampConverter ... well, I'll just reuse the old class for a custom on

Re: Bug in RequestUtils.toAbsolutePath?

2009-05-17 Thread Martin Makundi
No, there is no code in RequestUtils that would care about a leading slash ... it will just result in "http://www.mydomain.com/BookmarkablePage/Parameter1/Value1/Parameter2//images/Image.png"; Note a typo in my previous email, normally it returns: "http://www.mydomain.com/BookmarkablePage/Parame

Re: Bug in RequestUtils.toAbsolutePath?

2009-05-17 Thread Marat Radchenko
Maybe RequestUtils.toAbsolutePath("/images/Image.png") (note leading slash)? 2009/5/17 Martin Makundi : > Hi! > > I have a dynamic image which resides in > "http://www.mydomain.com/images/Image.png"; (the filename itself might > vary). In order for the image to be visible in downloaded documents,

Bug in RequestUtils.toAbsolutePath?

2009-05-17 Thread Martin Makundi
Hi! I have a dynamic image which resides in "http://www.mydomain.com/images/Image.png"; (the filename itself might vary). In order for the image to be visible in downloaded documents, the path must be absolute. RequestUtils.toAbsolutePath("images/Imange.png"); works most of the time, except in si