Re: How to get the URL of a dynamically generated image?

2009-06-29 Thread Jeremy Thomerson
Probably best to mount the resource in your app init method so that it has a static path and then use that in your CSS. That, or you can use the text templating to inject the dynamic URL into templated CSS. Then you could just use urlFor to get the URL. -- Jeremy Thomerson

Re: How to get the URL of a dynamically generated image?

2009-06-29 Thread Martin Grigorov
See (Buffered)DynamicImageResource. Pass this resource to RequestCycle.urlFor(), this will return a context relative path to the resource. To pass that path to the .css you could use org.apache.wicket.util.template.CssTemplate Note: The path to the image in the .css must be relative to the .css

Re: wicketAjaxGet and PageExpiredException?

2009-06-29 Thread Ryan McKinley
yup! works great actually I had to use e.getCause() instanceof... thanks (as usual) for the excellent help! ryan On Jun 23, 2009, at 11:19 PM, Igor Vaynberg wrote: have you tried class myrequestcycle extends webrequestcycle { onruntimeexception(e) { if (e instanceof

RE: Using validators to validate page parameters

2009-06-29 Thread Fouche, Pierre
Thanks Igor. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Friday, June 26, 2009 5:09 PM To: users@wicket.apache.org Subject: Re: Using validators to validate page parameters Validatable v=new Validatable(value); new FooValidator().validate(v);

AjaxSelfUpdatingTimerBehavior: Leaving page not possible

2009-06-29 Thread Tokalak Ahmet
Hi Wicketians, i have a problem with AjaxSelfUpdatingTimerBehavior. I have added an AjaxSelfUpdatingTimerBehavior to a page, because of a background-thread running very long and the page checks (an AjaxSelfUpdatingTimerBehavior with 10 sec interval added at thread start to page) for the

Re: AjaxSelfUpdatingTimerBehavior: Leaving page not possible

2009-06-29 Thread Martin Funk
Am 29.06.2009 um 10:22 schrieb Tokalak Ahmet: Hi Wicketians, i have a problem with AjaxSelfUpdatingTimerBehavior. I have added an AjaxSelfUpdatingTimerBehavior to a page, because of a background-thread running very long and the page checks (an AjaxSelfUpdatingTimerBehavior with 10 sec

Re: Slideshow

2009-06-29 Thread Johannes Schneider
Thanks for that hint. Do you know how many images wicket-slides/SmoothGallery support? I will have galleries with thousands of pictures... Regards, Johannes francisco treacy wrote: Once you have your images sorted you may want to have a look at: http://code.google.com/p/wicket-slides/

AW: AjaxSelfUpdatingTimerBehavior: Leaving page not possible

2009-06-29 Thread Tokalak Ahmet
Thank you Martin for your quick answer. I think the problem is caused by the background-thread. I do start the thread with a low priority and as daemon but the application seems still waiting for the termination of the started thread. Very strange Von:

Re: guice-injection on page vs. components

2009-06-29 Thread Aaron Dixon
Figured this one out, thanks Igor. Our pages extended from a base page that was manually injecting services -- I'm not sure why -- so the components were getting the proxy and pages were getting the direct instance. I fixed this and things work perfectly now. Thanks for your help. On Fri, Jun

Re: Mysterious NullPointerException

2009-06-29 Thread Jeremy Levy
Igor, Can you give me some direction on how to go about getting the e. In my own RequestCycle I've done the following: @Override protected void logRuntimeException(RuntimeException e) { super.logRuntimeException(e); log.error(e); } Which doesn't help because I'm just

Re: Mysterious NullPointerException

2009-06-29 Thread Igor Vaynberg
you can set up another appender that writes to a file and get it out by name and write into it. alternatively you can print the stacktrace into a buffer and email the whole thing manually. usually smtp appenders should buffer X lines or Y seconds and send that out, maybe you can just tweak the

Detachable Models best practices

2009-06-29 Thread Neil Curzon
Hi all, Using 1.3.6, I've recently been simplifying some of my wicket code by using LoadableDetachableModels and PropertyModels instead of trying to manage static models in various ways. I had a strange and subtle bug caused by the fact that a form button update call into the next layer would

Re: Mysterious NullPointerException

2009-06-29 Thread mbrictson
If you simply call log.error(e), your log will only contain e.toString(), which does not include the stack trace. You need to use the 2-arg version of log.error() if you want the full trace. Try this: log.error(An uncaught runtime exception occurred, e); jelevy wrote: Igor, Can you give

Re: Mysterious NullPointerException

2009-06-29 Thread Igor Vaynberg
log.runtimeexception is already doing log.error(e.getMessage(), e); and he is still not seeing the stacktrace... -igor On Mon, Jun 29, 2009 at 9:41 AM, mbrictsonm...@55minutes.com wrote: If you simply call log.error(e), your log will only contain e.toString(), which does not include the stack

Re: localizer and variables

2009-06-29 Thread OjO
This id is used for event handling. When I moved the setMarkupId statement into onBeforeRender method, the handler no longer work. myCom.setMarkupId (getLocalizer().getString (handle, MyPanel.this, new Model (handleId))); igor.vaynberg wrote: set it in onbeforerender -igor On Fri, Jun

invoking an ajax refresh

2009-06-29 Thread Daniel Dominik Holúbek
hello everybody,i am wondering how to invoke refresh of a component with ajax. the situation: i have a listener listening for incoming messages. if a message is fetched, a method is executed, and I add the message text into a List object. I then want to refresh the ListView (or the parent

Re: localizer and variables

2009-06-29 Thread Igor Vaynberg
probably because you call getmarkupid() before you call setmarkupid() ? -igor On Mon, Jun 29, 2009 at 10:43 AM, OjOfang...@washington.edu wrote: This id is used for event handling. When I moved the setMarkupId statement into onBeforeRender method, the handler no longer work.

Re: Mysterious NullPointerException

2009-06-29 Thread Martijn Reuvers
Likely the message or stacktrace(s) (the actual cause) is throwing the nullpointer, in which case that is all you can see when logging. You might wanna try: log.error(whatever here,e.getCause()), generally the latter is what you're interested in anyway. You might also try: @Override protected

Re: localizer and variables

2009-06-29 Thread OjO
Here is another more complex case: LinkSelection.properties: edit_label=Edit done_label=Hide Edit... linkId=toggle_link_{id} onclick=toggleEdit('{id}'); return(false); divId=toggle_div_{id} LinkSelection.java has the following in the constructor: @Override protected void

Re: improved resource bundles in 1.4

2009-06-29 Thread OjO
I wonder if it is possible to simply make getString work for retrieving localized string in constructor in the next patch. The code would be much cleaner without the new ResourceModel or getLocalizer().getString igor.vaynberg wrote: i just committed a patch for WICKET-1103 which greatly

Re: Mysterious NullPointerException

2009-06-29 Thread Igor Vaynberg
even if the exception was not being chained it should have still had some sort of a stacktrace. -igor On Mon, Jun 29, 2009 at 11:39 AM, Martijn Reuversmartijn.reuv...@gmail.com wrote: Likely the message or stacktrace(s) (the actual cause) is throwing the nullpointer, in which case that is all

Re: localizer and variables

2009-06-29 Thread Igor Vaynberg
the property files are made for i18n, you are really abusing them. if you want these things externalized then load them from an external resource yourself. -igor On Mon, Jun 29, 2009 at 12:14 PM, OjOfang...@washington.edu wrote: Here is another more complex case: LinkSelection.properties:

Re: improved resource bundles in 1.4

2009-06-29 Thread Igor Vaynberg
no. i18n resources depend on the component hierarchy which is not known in a constructor of a component. -igor On Mon, Jun 29, 2009 at 12:40 PM, OjOfang...@washington.edu wrote: I wonder if it is possible to simply make getString work for retrieving localized string in constructor in the next

Re: Possible to retrieve previous page from PageMap

2009-06-29 Thread kar...@sf
Hello, I have implemented Carlo's approach in my base page and wrapped methods around it to create page parameters and redirect to the previous page. Thank you for this contribution. Everything works just fine, but there are some voices on my team that think that this approach is unnecessary

Re: localizer and variables

2009-06-29 Thread OjO
Sorry, I did not mean to abuse them. I am seeking the right way of getting String properties associated with a panel class. What do you mean by externalized? What is an external resource? igor.vaynberg wrote: the property files are made for i18n, you are really abusing them. if you want

Re: Possible to retrieve previous page from PageMap

2009-06-29 Thread Igor Vaynberg
i believe page reference has been backported to 1.3 trunk -igor On Mon, Jun 29, 2009 at 2:59 PM, kar...@sfkar...@users.sf.net wrote: Hello, I have implemented Carlo's approach in my base page and wrapped methods around it to create page parameters and redirect to the previous page. Thank

Re: Possible to retrieve previous page from PageMap

2009-06-29 Thread James Carman
Just copy PageReference. That's what we did. On Mon, Jun 29, 2009 at 5:59 PM, kar...@sfkar...@users.sf.net wrote: Hello, I have implemented Carlo's approach in my base page and wrapped methods around it to create page parameters and redirect to the previous page. Thank you for this

Re: localizer and variables

2009-06-29 Thread Igor Vaynberg
an external resource can be any file that is not javacode. eg inside your panel you can do Properties props=new Properties(); props.load(getClassLoader().getResourceAsStream(getClass().getName().replace(.,/)+.external.properties)); and have a MyPanel.external.properties file next to your

Localization message for validators

2009-06-29 Thread Major Péter
Hi all, I have recently upgraded my application to wicket 1.4-rc5, and now I have some troubles with the localization. With the previous 1.3.6 release I was capable to restrict a localization message for a validation to only one wicket id e.g. : in foobar.java RequiredTextField nameTF = new

Re: localizer and variables

2009-06-29 Thread Luther Baker
OjO, Ideally, strings or text that users actually see and interact with are candidates for i18n. javascript, markup ids, onclick attributes and the like need not be i18n. This kind of text can strictly be considered part of your codebase. Remember, strings exist in the i18n properties files to

Re: Exceptions after Tomcat restart

2009-06-29 Thread niaouli
Hi, I have quite the same problem using Eclipse WTP and Tomcat : a NoClassDefFoundError on my template page class, after Tomcat restart or reload. It works when I manually Clean the module work directory, but it's boring to do this each time I modify the source code. Did you finally find a

Re: Localization message for validators

2009-06-29 Thread Igor Vaynberg
open a jira issue with a quickstart attached. -igor 2009/6/29 Major Péter majorpe...@sch.bme.hu: Hi all, I have recently upgraded my application to wicket 1.4-rc5, and now I have some troubles with the localization. With the previous 1.3.6 release I was capable to restrict a localization

Re: add id to body with onComponentTag?

2009-06-29 Thread Marieke Vandamme
Can't anyone help me with my problem? Many thanks in advance ! Marieke Marieke Vandamme-2 wrote: Hello, I'm using the following setup with markup inheritance ParentPage.java extends WebPage ChildPage.java extends ParentPage.java In the constructor of my ParentPage I want the

Re: add id to body with onComponentTag?

2009-06-29 Thread Igor Vaynberg
add(new webmarkupcontainer(body) { istransparentresolver() { return true; } oncomponenttag(tag) { tag.put(id,foo); }}); htmlbody wicket:id=body.../body/html -igor On Mon, Jun 29, 2009 at 10:47 PM, Marieke Vandammema...@tvh.be wrote: Can't anyone help me with my problem? Many thanks in