Using continueToOriginalDestination() in a constructor - will it mess up the PageMap?

2008-11-05 Thread Wayne Pope
Hi,

as part of my SWARM 1.4 integration I'm looking trying to get a silent login
functionality working, and have used continueToOriginalDestination() in
constructor of a Login page.

However I saw this thread:
http://www.nabble.com/redirect-page-in-the-constructor-td18111387.html#a18204061


So I have implemented:
if (!getPage().continueToOriginalDestination()) {
   throw new
RestartResponseException(Application.get().getHomePage());
}

This works fine however am I messing up the PageMap?
Its not clear to me how the continueToOriginalDestination() works (looks
like just a boolean value). Is it Ok to do this? Or is there a way to get
the actual intercepted page class and throw a RestartResponseException?

Thanks
Wayne


pretty url resource, problem with colons

2008-11-05 Thread Artur W.

Hi!

I want to integrate FusionCharts with Wicket. I implement IResourceListener
the feed the chart
but this library reject urls which contain colons.

I know I can use some Filter that translate the address but maybe there is
some easier, wicket way to do it.

I need to translate wicket:interface/:28:t::IResourceListener::/ into
something like this wicket_interface/_28_t__IResourceListener__/

I do not want to change the coding strategy for the whole application, just
for this one resource.

Thanks,
Artur
-- 
View this message in context: 
http://www.nabble.com/pretty-url-resource%2C-problem-with-colons-tp20337880p20337880.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: adding favicon using behavior

2008-11-05 Thread Nino Saturnino Martinez Vazquez Wael

Yup like so, just change it to link instead of meta:

public class SiteAHeader extends AbstractBehavior implements
   IHeaderContributor {

   public void renderHead(IHeaderResponse response) {

   response
   .renderString(meta name=\description\ 
content=\description\ /);

   }

}


Igor Vaynberg wrote:

use iheadercontributor

-igor

On Tue, Nov 4, 2008 at 11:43 PM, Eyal Golan [EMAIL PROTECTED] wrote:
  

Hi,
We have a behavior that is added to our main page (we use markup
inheritance).
In the behavior we add CSS links (and JS).
We want to add a favicon as well.
Here's what we did:
response.getResponse().write(link rel=\SHORTCUT ICON\
href=\/resources/favicon.ico\/\n);

Is this the best way?

Thanks

--
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: pretty url resource, problem with colons

2008-11-05 Thread Artur W.

One more thing. The resource returns dynamic xml and it depends on the form
that was submitted by the user. So AFAIK I cannot use mountSharedResource
which works for the whole application. Am I right?

Artur
-- 
View this message in context: 
http://www.nabble.com/pretty-url-resource%2C-problem-with-colons-tp20337880p20338036.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



WIcket 1.4 IndicatingAjaxFallbackLink

2008-11-05 Thread Stefan Lindner
IndicatingAjaxFallbackLink is not generic. It extends AjaxFallbackLink

public abstract class IndicatingAjaxFallbackLink extends
AjaxFallbackLink

which is generic

public abstract class AjaxFallbackLinkT extends LinkT
implements IAjaxLink

I think IndicatingAjaxFallbackLink should be generic too. 

Stefan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: PageExpiredException on production

2008-11-05 Thread nico.ptrs

Have you had any progress with this problem? I'm experiencing exactly the
same...

Thanks



rivkash1 wrote:
 
 hello all,
 
 We are working with Wicket (1.3.4) on production for a couple of months.
 It runs within jetty 6.1.7.
 For some weeks, we are experiencing a strange PageExpiredException which
 happens only on production env.
 
 It mostly happens on 2 main Pages in which the users submit the same form
 in a rolling manner (i.e. fill the form fields, submit the form, the user
 is redirected to the same page with a clean form and fills the form with
 new data and so on repeatedly).
 
 It isn't a problem of session expiration because our session timeout is
 set to 10 hours, this is the setting in our web.xml file:
 
 session-config
 session-timeout600/session-timeout
 /session-config
 
 We changed the logging level of Wicket to DEBUG, I'm attaching only a
 little fraction from our log file,
 you can see the whole exception in the file attached to this post:
 
 This message is printed in level of warning, yet it is just for tracing:
 invoked resolve! RequestParameters:
 [RequestParameters  componentPath=4:registrationManagementForm
 pageMapName=null versionNumber=0 interfaceName=IActivePageBehav
 iorListener componentId=null behaviorId=1 urlDepth=-1
 parameters={random=0.14328683405517095,amp;wicket:ignoreIfNotActive=true
 } onlyProcessIfPathActive=false]
 -
 
 2008-09-01 15:18:47,372 [WARN ]
 security.authentication.NiteWebRequestCycleProcessor  -
 = ENTER ==
 ==
 This message is printed in level of warning, yet it is just for tracing:
 invoked resolveRenderedPage! RequestParameters:
 [RequestParameters  componentPath=4:registrationManagementForm
 pageMapName=null versionNumber=0 interfaceName=IActivePageBehav
 iorListener componentId=null behaviorId=1 urlDepth=-1
 parameters={random=0.14328683405517095,amp;wicket:ignoreIfNotActive=true
 } onlyProcessIfPathActive=false]
 -
 
 2008-09-01 15:18:47,372 [DEBUG] apache.wicket.Session  - Getting page
 [path = 4:registrationManagementForm, versionNumber = 0]
 2008-09-01 15:18:47,376 [WARN ]
 security.authentication.NiteWebRequestCycleProcessor  -
 -
 completed resolveRenderedPage! EXIT
 =
 2008-09-01 15:18:47,377 [WARN ]
 security.authentication.NiteWebRequestCycleProcessor  -
 = ENTER ==
 ==
 This message is printed in level of warning, yet it is just for tracing:
 invoked respond(RuntimeException e, RequestCycle requestCycle)!
 -
 
 2008-09-01 15:18:47,377 [WARN ]
 security.authentication.NiteWebRequestCycleProcessor  -
 = ENTER ==
 ==
 This message is printed in level of warning, yet it is just for tracing:
 invoked onRuntimeException!
 -
 
 2008-09-01 15:18:47,377 [ERROR]
 security.authentication.NiteWebRequestCycleProcessor  - onRuntimeException
 stack:
 org.apache.wicket.protocol.http.PageExpiredException: Cannot find the
 rendered page in session [pagemap=null,componentPath=4:r
 egistrationManagementForm,versionNumber=0]
 at
 org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:181)
 at
 il.org.nite.frm.security.authentication.NiteWebRequestCycleProcessor.resolve
 
  http://www.nabble.com/file/p19265678/prod_log.txt prod_log.txt 
 

-- 
View this message in context: 
http://www.nabble.com/PageExpiredException-on-production-tp19265678p20338193.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: adding favicon using behavior

2008-11-05 Thread Eyal Golan
10x :)
Igor, actually this is what I am using (an AbstractBehavior).
The 'renderString' is what I was looking for.

On Wed, Nov 5, 2008 at 10:44 AM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

 Yup like so, just change it to link instead of meta:

 public class SiteAHeader extends AbstractBehavior implements
   IHeaderContributor {

   public void renderHead(IHeaderResponse response) {

   response
   .renderString(meta name=\description\
 content=\description\ /);

   }

 }


 Igor Vaynberg wrote:

 use iheadercontributor

 -igor

 On Tue, Nov 4, 2008 at 11:43 PM, Eyal Golan [EMAIL PROTECTED] wrote:


 Hi,
 We have a behavior that is added to our main page (we use markup
 inheritance).
 In the behavior we add CSS links (and JS).
 We want to add a favicon as well.
 Here's what we did:
 response.getResponse().write(link rel=\SHORTCUT ICON\
 href=\/resources/favicon.ico\/\n);

 Is this the best way?

 Thanks

 --
 Eyal Golan
 [EMAIL PROTECTED]

 Visit: http://jvdrums.sourceforge.net/
 LinkedIn: http://www.linkedin.com/in/egolan74

 P  Save a tree. Please don't print this e-mail unless it's really
 necessary




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 -Wicket for love

 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


Re: Wicket integration with good charts api

2008-11-05 Thread Maarten Bosteels
I have a similar requirement and played a bit with Open Flash Charts. [1]
It took little effort to integrate wicket + ofc4j [2] + swfobject [3]

[1] http://teethgrinder.co.uk/open-flash-chart-2/glass-bar-chart.php
[2] http://code.google.com/p/ofcj/
[3] http://code.google.com/p/swfobject/

Another requirement was that the user could drag and drop charts around on
the page (à la iGoogle) so I tried something like
http://interface.eyecon.ro/demos/sort.html  but that failed miserably: half
the time the charts wouldn't show up correctly after dragging them around.
I still have to find out if I can solve this somehow. All pointers are
welcome.

Anyway, if you're interested, I can create a wiki page showing the wicket +
ofc4j + swfobject integration.

Maarten


On Tue, Nov 4, 2008 at 9:16 PM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

 You do know there are an abundance of jfreecharts right, they are highly
 customizable.. And theres even a javaweb start thing where they demo it...
 But you probably did show them this...

 http://www.jfree.org/jfreechart/jfreechart-1.0.11-demo.jnlp

 Tomasz Dziurko wrote:

 My client needs in his application very good looking charts (simple
 bars with some gradienst and 3D effects). Unfortunately he didn't like
 what JFreeChart library offers so I must find and implement another
 solution.
 Questions are:
 1. Is there any other chart library easy to integrate with Wicket?
 2.off-topicWhich chart api (could be me commercial, client is
 paying) could you suggest?/off-topic

 Thank you for your help

 Regards



 --
 -Wicket for love

 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Wicket integration with good charts api

2008-11-05 Thread Tomasz Dziurko
Sure I am interested! :) I think simple example on wiki showing basics
of using Open Flash Charts in Wicket would be nice alternative for
those unsatisfied with JFreeChars library.

Regards
-- 
Tomasz Dziurko

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question about property expressions

2008-11-05 Thread Jan Stette
2008/11/5 Igor Vaynberg [EMAIL PROTECTED]

 On Tue, Nov 4, 2008 at 5:54 PM, Jan Stette [EMAIL PROTECTED] wrote:
  Sure.  To explain a bit more why I'm asking: I have a table component
 that's
  configured using property expressions as to what's shown in each column.
  The types of objects to be shown in the table are not known in advance,
  hence having a hard coded model for a specific type of class isn't really
  desirable.  Given this, do you think it would make sense to provide an
  extended property model, so that it could cope with the type of example
 of
  objects I showed below?

 no i do not. we keep our property expression language simple on
 purpose - we prefer java over strings. what you should do is have
 these objects implement an itnerface that has String getValue(String
 key) defined - that is how java works. if you cant do that then you
 can always yourself write something that uses reflection.

 -igor


Sorry, I don't think I'm making myself clear.  I was asking if I could
provide an extended property model, not for it to be provided in Wicket!
:-)  As I asked in my original question, what is the right place to hook
this in, is it by overriding AbstractPropertyModel.getObject()?  I had a
look at http://cwiki.apache.org/WICKET/property-expression-language.html,
but that page seems out of date.

Regards,
Jan


Re: PageExpiredException on production

2008-11-05 Thread Nino Saturnino Martinez Vazquez Wael
It's on as default.. But checking the log for serializing errors will 
help you find out what the problem are..


rivkash1 wrote:

How do i check if the serializer is on/off? What's the defualt?


Nino.Martinez wrote:
  

Did you actively turn serializer check off?

rivkash1 wrote:


we set Wicket's logging level on production to DEBUG
I don't see any non-serializable errors.
How do i turn on the serializer check?

thanks
Rebecca


Martijn Dashorst wrote:
  
  

Check your logs for non-serializable errors (or test your application
locally with development mode on, and make sure the serializer check
is not turned off). This is the most common case for page expired
errors.

Martijn

On Wed, Sep 3, 2008 at 10:45 AM, rivkash1 [EMAIL PROTECTED] wrote:



Hi Martijn

NiteWebRequestCycleProcessor is a Class we added to the application 2
days
ago. It extends Wicket's WebRequestCycleProcessor and adds some
messages
to
the log to get more information about the problem.

The PageExpiredException is a problem that we have on production for a
couple of weeks - long before the NiteWebRequestCycleProcessor class
was
created in the application.

thanks
Rebecca


Martijn Dashorst wrote:
  
  

Sounds like a bug in your NiteWebRequestCycleProcessor

Martijn

On Wed, Sep 3, 2008 at 10:29 AM, rivkash1 [EMAIL PROTECTED] wrote:



Hello again,

does someone have any more ideas about our problem?
It is very problematic to work in production when the users are
thrown
out
with exception each hour...

thanks
Rebecca


rivkash1 wrote:
  
  

hello all,

We are working with Wicket (1.3.4) on production for a couple of
months.
It runs within jetty 6.1.7.
For some weeks, we are experiencing a strange PageExpiredException
which
happens only on production env.

It mostly happens on 2 main Pages in which the users submit the same
form
in a rolling manner (i.e. fill the form fields, submit the form, the
user
is redirected to the same page with a clean form and fills the form
with
new data and so on repeatedly).

It isn't a problem of session expiration because our session timeout
is
set to 10 hours, this is the setting in our web.xml file:

session-config
session-timeout600/session-timeout
/session-config

We changed the logging level of Wicket to DEBUG, I'm attaching only
a
little fraction from our log file,
you can see the whole exception in the file attached to this post:

This message is printed in level of warning, yet it is just for
tracing:
invoked resolve! RequestParameters:
[RequestParameters  componentPath=4:registrationManagementForm
pageMapName=null versionNumber=0 interfaceName=IActivePageBehav
iorListener componentId=null behaviorId=1 urlDepth=-1
parameters={random=0.14328683405517095,amp;wicket:ignoreIfNotActive=true
} onlyProcessIfPathActive=false]
-

2008-09-01 15:18:47,372 [WARN ]
security.authentication.NiteWebRequestCycleProcessor  -
= ENTER ==
==
This message is printed in level of warning, yet it is just for
tracing:
invoked resolveRenderedPage! RequestParameters:
[RequestParameters  componentPath=4:registrationManagementForm
pageMapName=null versionNumber=0 interfaceName=IActivePageBehav
iorListener componentId=null behaviorId=1 urlDepth=-1
parameters={random=0.14328683405517095,amp;wicket:ignoreIfNotActive=true
} onlyProcessIfPathActive=false]
-

2008-09-01 15:18:47,372 [DEBUG] apache.wicket.Session  - Getting
page
[path = 4:registrationManagementForm, versionNumber = 0]
2008-09-01 15:18:47,376 [WARN ]
security.authentication.NiteWebRequestCycleProcessor  -
-
completed resolveRenderedPage! EXIT
=
2008-09-01 15:18:47,377 [WARN ]
security.authentication.NiteWebRequestCycleProcessor  -
= ENTER ==
==
This message is printed in level of warning, yet it is just for
tracing:
invoked respond(RuntimeException e, RequestCycle requestCycle)!
-

2008-09-01 15:18:47,377 [WARN ]
security.authentication.NiteWebRequestCycleProcessor  -
= ENTER ==
==
This message is printed in level of warning, yet it is just for
tracing:
invoked onRuntimeException!
-

2008-09-01 15:18:47,377 [ERROR]
security.authentication.NiteWebRequestCycleProcessor  -
onRuntimeException
stack:
org.apache.wicket.protocol.http.PageExpiredException: Cannot find
the
rendered page in session [pagemap=null,componentPath=4:r
egistrationManagementForm,versionNumber=0]
at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:181)
at

How to terminate the session on not bookmarkable page?

2008-11-05 Thread Matthias Keller

Hi

I've got a wizard letting the user enter some information.
In the onFinish() method, I redirect him to my ConfirmationPage:
setResponsePage(new ConfirmationPage());
(I chose the instance method instead of the class method as I don't want 
to have a bookmarkable page there)


On the ConfirmationPage I need access to the session a last time to 
display a message like:

Thank you Mr XXX, you'll hear from us soon

After that I want to invalidate my session so that all the wizard pages 
are becoming inaccessible (I have to set them to versioned as the 
customer wants back button support inside the wizard...).
Unfortunately, when I call  getSession().invalidate();  anywhere in my 
ConfirmationPage (be it the constructor, onAfterRender() or even 
onDetach()), I'll never see the ConfirmationPage as I get the Page 
Expired message instead
How can I achieve the destruction of the session (and thus the pages) 
but still display this one last page? Reloading this confirmation page 
may give the  Page Expired  message, I dont care.


Thanks

Matt

--
[EMAIL PROTECTED]  +41 44 268 83 98
Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich
http://www.ergon.ch
__
e r g o nsmart people - smart software




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Render a Wicket page to a string for HTML email

2008-11-05 Thread Peter Ertl

Great work!

You should put this on the Wiki :-)


Am 05.11.2008 um 11:22 schrieb Jörn Zaefferer:


No voodoo neccessary, got it working:

protected String renderPage(Class? extends Page pageClass,
PageParameters pageParameters) {

//get the servlet context
WebApplication application = (WebApplication) 
WebApplication.get();

ServletContext context = application.getServletContext();

//fake a request/response cycle
MockHttpSession servletSession = new MockHttpSession(context);
servletSession.setTemporary(true);

MockHttpServletRequest servletRequest = new 
MockHttpServletRequest(
application, servletSession, context);
		MockHttpServletResponse servletResponse = new  
MockHttpServletResponse(

servletRequest);

//initialize request and response
servletRequest.initialize();
servletResponse.initialize();

WebRequest webRequest = new ServletWebRequest(servletRequest);

		BufferedWebResponse webResponse = new  
BufferedWebResponse(servletResponse);

webResponse.setAjax(true);

WebRequestCycle requestCycle = new WebRequestCycle(
application, webRequest, webResponse);

requestCycle.setRequestTarget(new
BookmarkablePageRequestTarget(pageClass, pageParameters));

try {
requestCycle.getProcessor().respond(requestCycle);

log.warn(Response after request: 
+webResponse.toString());

if (requestCycle.wasHandled() == false) {
requestCycle.setRequestTarget(new 
WebErrorCodeResponseTarget(

HttpServletResponse.SC_NOT_FOUND));
}
requestCycle.detach();

} finally {
requestCycle.getResponse().close();
}

return webResponse.toString();
}

Does it make sense to put this in a ticket to request it for Wicket  
1.5?


Jörn

On Tue, Nov 4, 2008 at 5:55 PM, Martijn Dashorst
[EMAIL PROTECTED] wrote:
Are you  in New Orleans in some voodoo bar? Why not join us at  
ApacheCon? :)


Martijn

On Tue, Nov 4, 2008 at 10:43 AM, Igor Vaynberg [EMAIL PROTECTED] 
 wrote:
without seeing your code we have to resort to waving a dead  
chicken in

front of our screens or making swags.

-igor

On Tue, Nov 4, 2008 at 9:19 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:

Hi,

I've found this article on how to render a page to a String:
http://www.danwalmsley.com/2008/10/21/render-a-wicket-page-to-a-string-for-html-email/

It seemed to be exactly what I was looking for. Copying the code  
into

my app, I got a compiler error on the line where the WebRequest is
created. Using the constructor to ServletWebRequest helped.

Nonetheless, I get only an empty string back, no clue whats going  
wrong.


I'm using Wicket 1.3.5.

Any ideas?

Jörn



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--
Become a Wicket expert, learn from the best: http:// 
wicketinaction.com

Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Render a Wicket page to a string for HTML email

2008-11-05 Thread Jörn Zaefferer
No voodoo neccessary, got it working:

protected String renderPage(Class? extends Page pageClass,
PageParameters pageParameters) {

//get the servlet context
WebApplication application = (WebApplication) 
WebApplication.get();

ServletContext context = application.getServletContext();

//fake a request/response cycle
MockHttpSession servletSession = new MockHttpSession(context);
servletSession.setTemporary(true);

MockHttpServletRequest servletRequest = new 
MockHttpServletRequest(
application, servletSession, context);
MockHttpServletResponse servletResponse = new 
MockHttpServletResponse(
servletRequest);

//initialize request and response
servletRequest.initialize();
servletResponse.initialize();

WebRequest webRequest = new ServletWebRequest(servletRequest);

BufferedWebResponse webResponse = new 
BufferedWebResponse(servletResponse);
webResponse.setAjax(true);

WebRequestCycle requestCycle = new WebRequestCycle(
application, webRequest, webResponse);

requestCycle.setRequestTarget(new
BookmarkablePageRequestTarget(pageClass, pageParameters));

try {
requestCycle.getProcessor().respond(requestCycle);

log.warn(Response after request: 
+webResponse.toString());

if (requestCycle.wasHandled() == false) {
requestCycle.setRequestTarget(new 
WebErrorCodeResponseTarget(

HttpServletResponse.SC_NOT_FOUND));
}
requestCycle.detach();

} finally {
requestCycle.getResponse().close();
}

return webResponse.toString();
}

Does it make sense to put this in a ticket to request it for Wicket 1.5?

Jörn

On Tue, Nov 4, 2008 at 5:55 PM, Martijn Dashorst
[EMAIL PROTECTED] wrote:
 Are you  in New Orleans in some voodoo bar? Why not join us at ApacheCon? :)

 Martijn

 On Tue, Nov 4, 2008 at 10:43 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 without seeing your code we have to resort to waving a dead chicken in
 front of our screens or making swags.

 -igor

 On Tue, Nov 4, 2008 at 9:19 AM, Jörn Zaefferer
 [EMAIL PROTECTED] wrote:
 Hi,

 I've found this article on how to render a page to a String:
 http://www.danwalmsley.com/2008/10/21/render-a-wicket-page-to-a-string-for-html-email/

 It seemed to be exactly what I was looking for. Copying the code into
 my app, I got a compiler error on the line where the WebRequest is
 created. Using the constructor to ServletWebRequest helped.

 Nonetheless, I get only an empty string back, no clue whats going wrong.

 I'm using Wicket 1.3.5.

 Any ideas?

 Jörn


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.4 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: adding extra javascript call in CheckBox

2008-11-05 Thread nickponico


Hi all, i have to do same thing.

I have to call an external javascript function on onClick method of the
checkbox.

i'm using a 1.2.6 version of apache wicket, and in this version the class
CheckBox has method onComponentTag with final modifier.

So i can't override this method.

Is there any other way to do this? (naturally without change my apache
wicket version )

Thanks in advance

E.



 
 new CheckBox(checkBox, new Model()) {
 protected void onComponentTag(ComponentTag tag) {
 tag.put(onclick,executeSomething(););
 }
 
 

-- 
View this message in context: 
http://www.nabble.com/adding-extra-javascript-call-in-CheckBox-tp15318650p20339961.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: adding extra javascript call in CheckBox

2008-11-05 Thread James Carman
Is AttributeModifier not available in 1.2.x?

On Wed, Nov 5, 2008 at 6:25 AM, nickponico [EMAIL PROTECTED] wrote:


 Hi all, i have to do same thing.

 I have to call an external javascript function on onClick method of the
 checkbox.

 i'm using a 1.2.6 version of apache wicket, and in this version the class
 CheckBox has method onComponentTag with final modifier.

 So i can't override this method.

 Is there any other way to do this? (naturally without change my apache
 wicket version )

 Thanks in advance

 E.




 new CheckBox(checkBox, new Model()) {
 protected void onComponentTag(ComponentTag tag) {
 tag.put(onclick,executeSomething(););
 }



 --
 View this message in context: 
 http://www.nabble.com/adding-extra-javascript-call-in-CheckBox-tp15318650p20339961.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to terminate the session on not bookmarkable page?

2008-11-05 Thread Nino Saturnino Martinez Vazquez Wael
Okay so onfinish redirect to a page which tells the message and 
invalidates and are bookmarkable.  Or just clear the pagemap...


Matthias Keller wrote:

Hi

Would be another possibility, but it doesn't change nothing at all - I 
still get the page expired thingy, which I also really would expect in 
this case...
It works if I use a bookmarkable page, but I dont want a fixed URL on 
the confirmation page which displays dynamic data from the wizard


Thanks

Matt

Nino Saturnino Martinez Vazquez Wael wrote:
Hmm why not to it 
org.apache.wicket.extensions.wizard.Wizard#onFinish()  .. ?


Matthias Keller wrote:

Hi

I've got a wizard letting the user enter some information.
In the onFinish() method, I redirect him to my ConfirmationPage:
setResponsePage(new ConfirmationPage());
(I chose the instance method instead of the class method as I don't 
want to have a bookmarkable page there)


On the ConfirmationPage I need access to the session a last time to 
display a message like:

Thank you Mr XXX, you'll hear from us soon

After that I want to invalidate my session so that all the wizard 
pages are becoming inaccessible (I have to set them to versioned as 
the customer wants back button support inside the wizard...).
Unfortunately, when I call  getSession().invalidate();  anywhere in 
my ConfirmationPage (be it the constructor, onAfterRender() or even 
onDetach()), I'll never see the ConfirmationPage as I get the Page 
Expired message instead
How can I achieve the destruction of the session (and thus the 
pages) but still display this one last page? Reloading this 
confirmation page may give the  Page Expired  message, I dont care.


Thanks

Matt








--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to terminate the session on not bookmarkable page?

2008-11-05 Thread Nino Saturnino Martinez Vazquez Wael
Hmm why not to it org.apache.wicket.extensions.wizard.Wizard#onFinish()  
.. ?


Matthias Keller wrote:

Hi

I've got a wizard letting the user enter some information.
In the onFinish() method, I redirect him to my ConfirmationPage:
setResponsePage(new ConfirmationPage());
(I chose the instance method instead of the class method as I don't 
want to have a bookmarkable page there)


On the ConfirmationPage I need access to the session a last time to 
display a message like:

Thank you Mr XXX, you'll hear from us soon

After that I want to invalidate my session so that all the wizard 
pages are becoming inaccessible (I have to set them to versioned as 
the customer wants back button support inside the wizard...).
Unfortunately, when I call  getSession().invalidate();  anywhere in my 
ConfirmationPage (be it the constructor, onAfterRender() or even 
onDetach()), I'll never see the ConfirmationPage as I get the Page 
Expired message instead
How can I achieve the destruction of the session (and thus the pages) 
but still display this one last page? Reloading this confirmation page 
may give the  Page Expired  message, I dont care.


Thanks

Matt



--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: adding extra javascript call in CheckBox

2008-11-05 Thread James Carman
What javascript do you want to put into your onclick handler?

On Wed, Nov 5, 2008 at 6:39 AM, nickponico [EMAIL PROTECTED] wrote:

 Thank you for your reply.

 Yes there is the Attribute Modifier, but i don't think it can help me.

 I try to explain shortly the problem:

 I have to modify a css class of a specific div: the DIV can't be managed by
 wicket (with wicket id), but only on html.

 So i created a little javascript function that change the css class, and i
 would like to execute it when a user clicks on a CheckBox.

 Since i can't manage function (and div) by wicket... i have some
 difficulties to associate it an attributeModifier.

 right?

 or do i forget something?

 thanks


 jwcarman wrote:

 Is AttributeModifier not available in 1.2.x?


 --
 View this message in context: 
 http://www.nabble.com/adding-extra-javascript-call-in-CheckBox-tp15318650p20340173.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



pages from session

2008-11-05 Thread miro

I want to make a page session based ie any time user selects the page the
page instance should be returned from session, is there a simple way to say
wicket save this page in session any requests for this page should be pulled
out of session ? 
-- 
View this message in context: 
http://www.nabble.com/pages--from-session-tp20340755p20340755.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: pages from session

2008-11-05 Thread James Carman
Why not save the data the page is based on in the session?

On Wed, Nov 5, 2008 at 7:25 AM, miro [EMAIL PROTECTED] wrote:

 I want to make a page session based ie any time user selects the page the
 page instance should be returned from session, is there a simple way to say
 wicket save this page in session any requests for this page should be pulled
 out of session ?
 --
 View this message in context: 
 http://www.nabble.com/pages--from-session-tp20340755p20340755.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: adding extra javascript call in CheckBox

2008-11-05 Thread nickponico

I've inserted this simple function in head of html:

script type=text/javascript
function show()
{
document.getElementById(myDiv).setAttribute(class, visible); 
}
/script
/head

and i'd like to execute this function on onlick...

so somthing like: onlclick=show()

This is a particular situation, but very important for my GUI.

Thanks

E.



jwcarman wrote:
 
 What javascript do you want to put into your onclick handler?
 
 

-- 
View this message in context: 
http://www.nabble.com/adding-extra-javascript-call-in-CheckBox-tp15318650p20340933.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: adding extra javascript call in CheckBox

2008-11-05 Thread Ernesto Reinaldo Barreiro


nickponico wrote:

Thank you for your reply.

Yes there is the Attribute Modifier, but i don't think it can help me. 


I try to explain shortly the problem:

I have to modify a css class of a specific div: the DIV can't be managed by
wicket (with wicket id), but only on html.
  
What do you mean by that? Why you cannot add a WebMarkupConatiner to the 
div? And additionally if you do setOutputMarkupId(true) you could use 
the generated id to do what you wnat in a (generated) javaScript 
function. I do such tricks all the time...


Ernesto


*
Este correo ha sido procesado por el antivirus del Grupo FCC.
*

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: adding extra javascript call in CheckBox

2008-11-05 Thread James Carman
So, why can't you use AttributeModifier to set the onclick text?

On Wed, Nov 5, 2008 at 7:37 AM, nickponico [EMAIL PROTECTED] wrote:

 I've inserted this simple function in head of html:

 script type=text/javascript
 function show()
 {
 document.getElementById(myDiv).setAttribute(class, visible);
 }
 /script
 /head

 and i'd like to execute this function on onlick...

 so somthing like: onlclick=show()

 This is a particular situation, but very important for my GUI.

 Thanks

 E.



 jwcarman wrote:

 What javascript do you want to put into your onclick handler?



 --
 View this message in context: 
 http://www.nabble.com/adding-extra-javascript-call-in-CheckBox-tp15318650p20340933.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: adding extra javascript call in CheckBox

2008-11-05 Thread nickponico

Ok... only now i've understood my mistake...

I've had to use a WebmarkupContainer for my div and later use an Attribute
Modifier.  

I didn't know WebMarkupContainer component usage.

Thanks to all for replies.

bye

E.


Ernesto Reinaldo Barreiro-3 wrote:
 
 Why you cannot add a WebMarkupConatiner to the div?
 

-- 
View this message in context: 
http://www.nabble.com/adding-extra-javascript-call-in-CheckBox-tp15318650p20342436.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to terminate the session on not bookmarkable page?

2008-11-05 Thread Johan Compagner
that does work no
you cant invalidate the session and then redirect to an instance/session
page.
What you could try is the invalidateNow() method and then the new instance
page will be created in the new session.

Also clearing pagemap or maybe just replacing the http session should work
(a new method on Session in the latest releases)

On Wed, Nov 5, 2008 at 12:00 PM, Matthias Keller
[EMAIL PROTECTED]wrote:

 Hi

 I've got a wizard letting the user enter some information.
 In the onFinish() method, I redirect him to my ConfirmationPage:
 setResponsePage(new ConfirmationPage());
 (I chose the instance method instead of the class method as I don't want to
 have a bookmarkable page there)

 On the ConfirmationPage I need access to the session a last time to display
 a message like:
 Thank you Mr XXX, you'll hear from us soon

 After that I want to invalidate my session so that all the wizard pages are
 becoming inaccessible (I have to set them to versioned as the customer wants
 back button support inside the wizard...).
 Unfortunately, when I call  getSession().invalidate();  anywhere in my
 ConfirmationPage (be it the constructor, onAfterRender() or even
 onDetach()), I'll never see the ConfirmationPage as I get the Page Expired
 message instead
 How can I achieve the destruction of the session (and thus the pages) but
 still display this one last page? Reloading this confirmation page may give
 the  Page Expired  message, I dont care.

 Thanks

 Matt

 --
 [EMAIL PROTECTED]  +41 44 268 83 98
 Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich
 http://www.ergon.ch
 __
 e r g o nsmart people - smart software





Re: Browser file download complete callback

2008-11-05 Thread bjolletz


Probably you're right, I've just begun using Wicket and am not very into the
inner workings of everything.

Thanks for the suggestion about decorating inputstream, should have thought
of it myself.

/Daniel


igor.vaynberg wrote:
 
 another problem with close is that you would have to internally keep a
 reference to the inputstream(), and what if getinputstream() was
 called more then once because for example you are generating a xls, a
 csv, and a png all at once...then your close() has to keep track of
 multiple references?
 
 -igor
 
 On Tue, Nov 4, 2008 at 9:22 AM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:
 the problem is that we would have to pass around the inputstream and
 iresourcestream unless we put the burden on you to make
 getreinputstream() return the same inputstream for the same request...

 you can pretty easily create a decorator for inputstream and intercept
 close(), its not perfect but it will work for right now while we
 figure out what to do with iresourcestream#close

 -igor

 On Tue, Nov 4, 2008 at 1:35 AM, bjolletz [EMAIL PROTECTED]
 wrote:

 Thanks for the reply!

 So you're suggesting that the close() method of the IResourceStream
 should
 be removed?

 Isn't there a point in having the close() method? In my case, by
 overriding
 the close() method, it would be possible to be notified when a download
 is
 complete. Don't know how else I would accomplish that (any
 suggestions?).

 Wouldn't it be a better idea to implement a close() method with default
 close behaviour in the abstract classes implementing the IResourceStream
 interface? That way, by extending one of these abstract resource stream
 classes, you dont have to mind about the close() method if you dont want
 to.

 /Daniel



 igor.vaynberg wrote:

 hmm, seems like a bug. it looks like we now close the input stream
 directly instead of using close() which allows users not to have to
 keep a reference to the stream. #close() can probably be removed.
 please open a jira issue.

 -igor

 On Mon, Nov 3, 2008 at 3:28 AM, bjolletz [EMAIL PROTECTED]
 wrote:

 Hi!

 I would like to have a download link through which a user can download
 some
 bytearray from my database. So far no problem, I accomplish this by
 creating
 a new WebResource and implementing the getResourceStream method.

 My problem is that I would like to be notified when the user is
 finished
 downloading so that I can mark the downloaded item as downloaded in my
 database. I'm using an AbstractResourceStream and I thought I would be
 able
 to do this by overriding the close() method. However, the close method
 of
 the AbstractResourceStream never seems to be called.

 The implementation of the getResourceStream() method of my WebResource
 object:

public IResourceStream getResourceStream() {
return new AbstractResourceStream() {
ByteArrayInputStream bais;
public InputStream getInputStream() throws
 ResourceStreamNotFoundException {
bais = getByteArrayInputStreamFromDB();
return bais;
}

public void close() throws IOException {
bais.close();
markByteArrayAsDownloadedInDB();
}
};
}


 Why is it that the close() method is never called? Is there a
 better/other
 way to do it? Is it at all possible to get a callback when a user is
 finished downloading the bytearray?

 Thanks in advance!

 /Daniel
 --
 View this message in context:
 http://www.nabble.com/Browser-file-download-complete-callback-tp20300290p20300290.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 View this message in context:
 http://www.nabble.com/Browser-file-download-complete-callback-tp20300290p20318122.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Browser-file-download-complete-callback-tp20300290p20342791.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: adding extra javascript call in CheckBox

2008-11-05 Thread Ernesto Reinaldo Barreiro


Do you get a JavaScript error? Maybe

document.getElementById(myDiv).className=visible;

will do the trick...

Ernesto


nickponico wrote:

I've inserted this simple function in head of html:

script type=text/javascript
function show()
{
document.getElementById(myDiv).setAttribute(class, visible); 
}

/script
/head

and i'd like to execute this function on onlick...

so somthing like: onlclick=show()

This is a particular situation, but very important for my GUI.

Thanks

E.



jwcarman wrote:
  

What javascript do you want to put into your onclick handler?





  




*
Este correo ha sido procesado por el antivirus del Grupo FCC.
*

Re: How to terminate the session on not bookmarkable page?

2008-11-05 Thread Matthias Keller

Hi

Would be another possibility, but it doesn't change nothing at all - I 
still get the page expired thingy, which I also really would expect in 
this case...
It works if I use a bookmarkable page, but I dont want a fixed URL on 
the confirmation page which displays dynamic data from the wizard


Thanks

Matt

Nino Saturnino Martinez Vazquez Wael wrote:
Hmm why not to it 
org.apache.wicket.extensions.wizard.Wizard#onFinish()  .. ?


Matthias Keller wrote:

Hi

I've got a wizard letting the user enter some information.
In the onFinish() method, I redirect him to my ConfirmationPage:
setResponsePage(new ConfirmationPage());
(I chose the instance method instead of the class method as I don't 
want to have a bookmarkable page there)


On the ConfirmationPage I need access to the session a last time to 
display a message like:

Thank you Mr XXX, you'll hear from us soon

After that I want to invalidate my session so that all the wizard 
pages are becoming inaccessible (I have to set them to versioned as 
the customer wants back button support inside the wizard...).
Unfortunately, when I call  getSession().invalidate();  anywhere in 
my ConfirmationPage (be it the constructor, onAfterRender() or even 
onDetach()), I'll never see the ConfirmationPage as I get the Page 
Expired message instead
How can I achieve the destruction of the session (and thus the pages) 
but still display this one last page? Reloading this confirmation 
page may give the  Page Expired  message, I dont care.


Thanks

Matt






--
[EMAIL PROTECTED]  +41 44 268 83 98
Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich
http://www.ergon.ch
__
e r g o nsmart people - smart software




smime.p7s
Description: S/MIME Cryptographic Signature


Re: pages from session

2008-11-05 Thread Johan Compagner
wicket already works that way.

but what do you mean by selects the page how does one select a page in
the browser?

if you just use page links (back links) to the page then that will always
happen

On Wed, Nov 5, 2008 at 1:25 PM, miro [EMAIL PROTECTED] wrote:


 I want to make a page session based ie any time user selects the page the
 page instance should be returned from session, is there a simple way to say
 wicket save this page in session any requests for this page should be
 pulled
 out of session ?
 --
 View this message in context:
 http://www.nabble.com/pages--from-session-tp20340755p20340755.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: adding extra javascript call in CheckBox

2008-11-05 Thread nickponico

Thank you for your reply.

Yes there is the Attribute Modifier, but i don't think it can help me. 

I try to explain shortly the problem:

I have to modify a css class of a specific div: the DIV can't be managed by
wicket (with wicket id), but only on html.

So i created a little javascript function that change the css class, and i
would like to execute it when a user clicks on a CheckBox.

Since i can't manage function (and div) by wicket... i have some
difficulties to associate it an attributeModifier.

right?

or do i forget something?

thanks


jwcarman wrote:
 
 Is AttributeModifier not available in 1.2.x?
 

-- 
View this message in context: 
http://www.nabble.com/adding-extra-javascript-call-in-CheckBox-tp15318650p20340173.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Render a Wicket page to a string for HTML email

2008-11-05 Thread James Carman
Is the setAjax(true) absolutely necessary in all cases?

On Wed, Nov 5, 2008 at 5:22 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:
 No voodoo neccessary, got it working:

 protected String renderPage(Class? extends Page pageClass,
 PageParameters pageParameters) {

//get the servlet context
WebApplication application = (WebApplication) 
 WebApplication.get();

ServletContext context = application.getServletContext();

//fake a request/response cycle
MockHttpSession servletSession = new MockHttpSession(context);
servletSession.setTemporary(true);

MockHttpServletRequest servletRequest = new 
 MockHttpServletRequest(
application, servletSession, context);
MockHttpServletResponse servletResponse = new 
 MockHttpServletResponse(
servletRequest);

//initialize request and response
servletRequest.initialize();
servletResponse.initialize();

WebRequest webRequest = new ServletWebRequest(servletRequest);

BufferedWebResponse webResponse = new 
 BufferedWebResponse(servletResponse);
webResponse.setAjax(true);

WebRequestCycle requestCycle = new WebRequestCycle(
application, webRequest, webResponse);

requestCycle.setRequestTarget(new
 BookmarkablePageRequestTarget(pageClass, pageParameters));

try {
requestCycle.getProcessor().respond(requestCycle);

log.warn(Response after request: 
 +webResponse.toString());

if (requestCycle.wasHandled() == false) {
requestCycle.setRequestTarget(new 
 WebErrorCodeResponseTarget(

 HttpServletResponse.SC_NOT_FOUND));
}
requestCycle.detach();

} finally {
requestCycle.getResponse().close();
}

return webResponse.toString();
}

 Does it make sense to put this in a ticket to request it for Wicket 1.5?

 Jörn

 On Tue, Nov 4, 2008 at 5:55 PM, Martijn Dashorst
 [EMAIL PROTECTED] wrote:
 Are you  in New Orleans in some voodoo bar? Why not join us at ApacheCon? :)

 Martijn

 On Tue, Nov 4, 2008 at 10:43 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 without seeing your code we have to resort to waving a dead chicken in
 front of our screens or making swags.

 -igor

 On Tue, Nov 4, 2008 at 9:19 AM, Jörn Zaefferer
 [EMAIL PROTECTED] wrote:
 Hi,

 I've found this article on how to render a page to a String:
 http://www.danwalmsley.com/2008/10/21/render-a-wicket-page-to-a-string-for-html-email/

 It seemed to be exactly what I was looking for. Copying the code into
 my app, I got a compiler error on the line where the WebRequest is
 created. Using the constructor to ServletWebRequest helped.

 Nonetheless, I get only an empty string back, no clue whats going wrong.

 I'm using Wicket 1.3.5.

 Any ideas?

 Jörn


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.4 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: adding extra javascript call in CheckBox

2008-11-05 Thread Ernesto Reinaldo Barreiro


Following example does almost what you want (if I didn;t get you wrong).

ChangeColorPanel.html

wicket:panel   
   div
   span wicket:id=colorPanel style= width: 10px; height: 10px; 
background-color: red;

 nbsp;nbsp;
   /span
   span wicket:id=red onclick=
 Red
   /span
   span wicket:id=blue onclick=
 Blue
   /span
   span wicket:id=green onclick=
 Green
   /span
   /div
/wicket:panel

ChangeColorPanel.java

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.AbstractReadOnlyModel;

/**
* @author EReinaldoB
*
*/
public class ChangeColorPanel extends Panel {

   private static final long serialVersionUID = 1L;

  
   private WebMarkupContainer colorPanel;

   /**
* @param id
*/
   public ChangeColorPanel(String id) {
   super(id);
  
   colorPanel = new WebMarkupContainer(colorPanel);

   colorPanel.setOutputMarkupId(true);
   add(colorPanel);
  
   WebMarkupContainer red = new WebMarkupContainer(red);
   red.add(new AttributeModifier(onclick, new 
AbstractReadOnlyModelString() {
  
   private static final long serialVersionUID = 1L;


   @Override
   public String getObject() {
   String id = colorPanel.getMarkupId();
   return document.getElementById(' + id + 
').style.backgroundColor='red';

   }
   }));   
   add(red);
  
   WebMarkupContainer blue = new WebMarkupContainer(blue);
   blue.add(new AttributeModifier(onclick, new 
AbstractReadOnlyModelString() {
  
   private static final long serialVersionUID = 1L;


   @Override
   public String getObject() {
   String id = colorPanel.getMarkupId();
   return document.getElementById(' + id + 
').style.backgroundColor='blue';

   }
   }));   
   add(blue);
  
   WebMarkupContainer green = new WebMarkupContainer(green);
   green.add(new AttributeModifier(onclick, new 
AbstractReadOnlyModelString() {
  
   private static final long serialVersionUID = 1L;


   @Override
   public String getObject() {
   String id = colorPanel.getMarkupId();
   return document.getElementById(' + id + 
').style.backgroundColor='green';

   }
   }));   
   add(green);

   }

}

if you replace the first span by a div a the the later spans by check 
boxes and intead of modifying the style.backgroundColor you modify the 
'className' to the css name you want, I guess this is what you want? 
This example works (I tested before posting it ;-) )


Best

Ernesto

nickponico wrote:

Thank you for your reply.

Yes there is the Attribute Modifier, but i don't think it can help me. 


I try to explain shortly the problem:

I have to modify a css class of a specific div: the DIV can't be managed by
wicket (with wicket id), but only on html.

So i created a little javascript function that change the css class, and i
would like to execute it when a user clicks on a CheckBox.

Since i can't manage function (and div) by wicket... i have some
difficulties to associate it an attributeModifier.

right?

or do i forget something?

thanks


jwcarman wrote:
  

Is AttributeModifier not available in 1.2.x?




  




*
Este correo ha sido procesado por el antivirus del Grupo FCC.
*

Re: Design question : accessing components between panels

2008-11-05 Thread Arun Wagle

Hi,

I had tried getPage() but it returns null to me.
Is it because the panel in which I am trying to access the other panel
component is a modal dialog?

Any suggestions.



igor.vaynberg wrote:
 
 component#getPage()
 
 -igor
 
 On Tue, Nov 4, 2008 at 9:28 PM, Arun Wagle [EMAIL PROTECTED] wrote:
 Hello ,

 I have an application which renders a page.
 This page has two panels , panel A and panel B
 Each panel has some components in it.

 Now I want to access some component in panel B from panel A.

 Can someone tell me how do I get a handle to panel B in panel A ?

 If I have an instance of the page, then I can do a *get(id of panel B)*
 to
 get the instance of panel B
 But how do I get the instance of the home page in panel A ?

 How can I acheive this scenarion in the best possible way?

 Can someone please help me as I have lot of cases with these scenarious ?




 Regards,
 Arun Wagle

 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Design-question-%3A-accessing-components-between-panels-tp20336382p20343178.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Wicket Formtester] Problem with Statelessform

2008-11-05 Thread Enes Fazli
Hello everybody,

I changed my forms to statelessforms, which works perfectly fine in the
actual app, only the test don't work anymore. I'm confronted with folowing
exception:
*org.apache.wicket.WicketRuntimeException: Internal error parsing
wicket:interface = :0:registerForm::IFormSubmitListener::/; wrong format for
url depth argument. Expected a number but was '/'*

Any hint on how to solve this problem?


Re: pages from session

2008-11-05 Thread miro

I mounted a page in my Application

now any time user requests the mounted path I want wicket to pull the
instance of the page from session and not create new instance of  this page 
how can I tell this to wicket ? 

jwcarman wrote:
 
 Why not save the data the page is based on in the session?
 
 On Wed, Nov 5, 2008 at 7:25 AM, miro [EMAIL PROTECTED] wrote:

 I want to make a page session based ie any time user selects the page the
 page instance should be returned from session, is there a simple way to
 say
 wicket save this page in session any requests for this page should be
 pulled
 out of session ?
 --
 View this message in context:
 http://www.nabble.com/pages--from-session-tp20340755p20340755.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/pages--from-session-tp20340755p20343184.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: pages from session

2008-11-05 Thread Johan Compagner
you could do something like that through the pagefactory i guess
override the default one


On Wed, Nov 5, 2008 at 4:12 PM, miro [EMAIL PROTECTED] wrote:


 I mounted a page in my Application

 now any time user requests the mounted path I want wicket to pull the
 instance of the page from session and not create new instance of  this page
 how can I tell this to wicket ?

 jwcarman wrote:
 
  Why not save the data the page is based on in the session?
 
  On Wed, Nov 5, 2008 at 7:25 AM, miro [EMAIL PROTECTED] wrote:
 
  I want to make a page session based ie any time user selects the page
 the
  page instance should be returned from session, is there a simple way to
  say
  wicket save this page in session any requests for this page should be
  pulled
  out of session ?
  --
  View this message in context:
  http://www.nabble.com/pages--from-session-tp20340755p20340755.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/pages--from-session-tp20340755p20343184.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Incremental migration from JSP-based applications to Wicket?

2008-11-05 Thread Susan Liebeskind
A follow up to this question, which generated just a single response 
from another fellow traveler...


The lack of response to questions about migrating JSP app could also be 
indicative of the fact that  Wicket is being used mostly to develop 
*new* applications. In other words, maybe only a smallish percentage of 
folks are trying to migrate their existing work. Instead, maybe a more 
typical use case is that people begin new developments with Wicket, and 
don't try to port over existing one.


Would some of the Wicket committers on this list have any anecdotal 
sense about whether Wicket is being used primarily for new apps vs, 
being a migration target?


Thanks again.

Susan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Design question : accessing components between panels

2008-11-05 Thread Michael Sparer

Whenever getPage() returns null it's most likely that the component isn't
added to a page yet. Just a guess: you're calling getPage() in the
constructor of your panel right? Try calling it in the onBeforeRender method
and page won't return null

hope that helps
Michael

Arun Wagle wrote:
 
 Hi,
 
 I had tried getPage() but it returns null to me.
 Is it because the panel in which I am trying to access the other panel
 component is a modal dialog?
 
 Any suggestions.
 
 
 
 igor.vaynberg wrote:
 
 component#getPage()
 
 -igor
 
 On Tue, Nov 4, 2008 at 9:28 PM, Arun Wagle [EMAIL PROTECTED]
 wrote:
 Hello ,

 I have an application which renders a page.
 This page has two panels , panel A and panel B
 Each panel has some components in it.

 Now I want to access some component in panel B from panel A.

 Can someone tell me how do I get a handle to panel B in panel A ?

 If I have an instance of the page, then I can do a *get(id of panel
 B)* to
 get the instance of panel B
 But how do I get the instance of the home page in panel A ?

 How can I acheive this scenarion in the best possible way?

 Can someone please help me as I have lot of cases with these scenarious
 ?




 Regards,
 Arun Wagle

 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/Design-question-%3A-accessing-components-between-panels-tp20336382p20343221.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: WIcket 1.4 IndicatingAjaxFallbackLink

2008-11-05 Thread Igor Vaynberg
it is generic in trunk.

-igor

On Wed, Nov 5, 2008 at 12:55 AM, Stefan Lindner [EMAIL PROTECTED] wrote:
 IndicatingAjaxFallbackLink is not generic. It extends AjaxFallbackLink

public abstract class IndicatingAjaxFallbackLink extends
 AjaxFallbackLink

 which is generic

public abstract class AjaxFallbackLinkT extends LinkT
 implements IAjaxLink

 I think IndicatingAjaxFallbackLink should be generic too.

 Stefan

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: adding favicon using behavior

2008-11-05 Thread Igor Vaynberg
On Wed, Nov 5, 2008 at 1:06 AM, Eyal Golan [EMAIL PROTECTED] wrote:
 10x :)

omfg its spreading

 Igor, actually this is what I am using (an AbstractBehavior).
 The 'renderString' is what I was looking for.

do you not use an ide?

-igor


 On Wed, Nov 5, 2008 at 10:44 AM, Nino Saturnino Martinez Vazquez Wael 
 [EMAIL PROTECTED] wrote:

 Yup like so, just change it to link instead of meta:

 public class SiteAHeader extends AbstractBehavior implements
   IHeaderContributor {

   public void renderHead(IHeaderResponse response) {

   response
   .renderString(meta name=\description\
 content=\description\ /);

   }

 }


 Igor Vaynberg wrote:

 use iheadercontributor

 -igor

 On Tue, Nov 4, 2008 at 11:43 PM, Eyal Golan [EMAIL PROTECTED] wrote:


 Hi,
 We have a behavior that is added to our main page (we use markup
 inheritance).
 In the behavior we add CSS links (and JS).
 We want to add a favicon as well.
 Here's what we did:
 response.getResponse().write(link rel=\SHORTCUT ICON\
 href=\/resources/favicon.ico\/\n);

 Is this the best way?

 Thanks

 --
 Eyal Golan
 [EMAIL PROTECTED]

 Visit: http://jvdrums.sourceforge.net/
 LinkedIn: http://www.linkedin.com/in/egolan74

 P  Save a tree. Please don't print this e-mail unless it's really
 necessary




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 -Wicket for love

 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 Eyal Golan
 [EMAIL PROTECTED]

 Visit: http://jvdrums.sourceforge.net/
 LinkedIn: http://www.linkedin.com/in/egolan74

 P  Save a tree. Please don't print this e-mail unless it's really necessary


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: pretty url resource, problem with colons

2008-11-05 Thread Igor Vaynberg
at this point you will have to rewrite webrequestcodingstrategy to use
_ instead of : and do some special escaping of actual _ values.

-igor

On Wed, Nov 5, 2008 at 12:41 AM, Artur W. [EMAIL PROTECTED] wrote:

 Hi!

 I want to integrate FusionCharts with Wicket. I implement IResourceListener
 the feed the chart
 but this library reject urls which contain colons.

 I know I can use some Filter that translate the address but maybe there is
 some easier, wicket way to do it.

 I need to translate wicket:interface/:28:t::IResourceListener::/ into
 something like this wicket_interface/_28_t__IResourceListener__/

 I do not want to change the coding strategy for the whole application, just
 for this one resource.

 Thanks,
 Artur
 --
 View this message in context: 
 http://www.nabble.com/pretty-url-resource%2C-problem-with-colons-tp20337880p20337880.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: pretty url resource, problem with colons

2008-11-05 Thread Igor Vaynberg
if its a shared resource it doesnt know about your form. you will have
to append those values to the url yourself after you generate the base
url for the resource.

-igor

On Wed, Nov 5, 2008 at 12:55 AM, Artur W. [EMAIL PROTECTED] wrote:

 One more thing. The resource returns dynamic xml and it depends on the form
 that was submitted by the user. So AFAIK I cannot use mountSharedResource
 which works for the whole application. Am I right?

 Artur
 --
 View this message in context: 
 http://www.nabble.com/pretty-url-resource%2C-problem-with-colons-tp20337880p20338036.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question about property expressions

2008-11-05 Thread Igor Vaynberg
the mechanism for looking up expressions is not extensible, because it
isnt meant to be extended. so you have to write your own model from
scratch using something like mvel/ognl to access the property. both of
those support method calls afaik.

-igor

On Wed, Nov 5, 2008 at 1:56 AM, Jan Stette [EMAIL PROTECTED] wrote:
 2008/11/5 Igor Vaynberg [EMAIL PROTECTED]

 On Tue, Nov 4, 2008 at 5:54 PM, Jan Stette [EMAIL PROTECTED] wrote:
  Sure.  To explain a bit more why I'm asking: I have a table component
 that's
  configured using property expressions as to what's shown in each column.
  The types of objects to be shown in the table are not known in advance,
  hence having a hard coded model for a specific type of class isn't really
  desirable.  Given this, do you think it would make sense to provide an
  extended property model, so that it could cope with the type of example
 of
  objects I showed below?

 no i do not. we keep our property expression language simple on
 purpose - we prefer java over strings. what you should do is have
 these objects implement an itnerface that has String getValue(String
 key) defined - that is how java works. if you cant do that then you
 can always yourself write something that uses reflection.

 -igor


 Sorry, I don't think I'm making myself clear.  I was asking if I could
 provide an extended property model, not for it to be provided in Wicket!
 :-)  As I asked in my original question, what is the right place to hook
 this in, is it by overriding AbstractPropertyModel.getObject()?  I had a
 look at http://cwiki.apache.org/WICKET/property-expression-language.html,
 but that page seems out of date.

 Regards,
 Jan


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using continueToOriginalDestination() in a constructor - will it mess up the PageMap?

2008-11-05 Thread Igor Vaynberg
continuetooriginaldestination remembers the url not the page, so it
redirects back to that url. the pagemap should be fine.

-igor

On Wed, Nov 5, 2008 at 12:41 AM, Wayne Pope
[EMAIL PROTECTED] wrote:
 Hi,

 as part of my SWARM 1.4 integration I'm looking trying to get a silent login
 functionality working, and have used continueToOriginalDestination() in
 constructor of a Login page.

 However I saw this thread:
 http://www.nabble.com/redirect-page-in-the-constructor-td18111387.html#a18204061


 So I have implemented:
 if (!getPage().continueToOriginalDestination()) {
   throw new
 RestartResponseException(Application.get().getHomePage());
 }

 This works fine however am I messing up the PageMap?
 Its not clear to me how the continueToOriginalDestination() works (looks
 like just a boolean value). Is it Ok to do this? Or is there a way to get
 the actual intercepted page class and throw a RestartResponseException?

 Thanks
 Wayne


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Render a Wicket page to a string for HTML email

2008-11-05 Thread Igor Vaynberg
make sure you do this in a thread other then the request thread so you
dont mess up any threadlocals.

-igor

On Wed, Nov 5, 2008 at 2:22 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:
 No voodoo neccessary, got it working:

 protected String renderPage(Class? extends Page pageClass,
 PageParameters pageParameters) {

//get the servlet context
WebApplication application = (WebApplication) 
 WebApplication.get();

ServletContext context = application.getServletContext();

//fake a request/response cycle
MockHttpSession servletSession = new MockHttpSession(context);
servletSession.setTemporary(true);

MockHttpServletRequest servletRequest = new 
 MockHttpServletRequest(
application, servletSession, context);
MockHttpServletResponse servletResponse = new 
 MockHttpServletResponse(
servletRequest);

//initialize request and response
servletRequest.initialize();
servletResponse.initialize();

WebRequest webRequest = new ServletWebRequest(servletRequest);

BufferedWebResponse webResponse = new 
 BufferedWebResponse(servletResponse);
webResponse.setAjax(true);

WebRequestCycle requestCycle = new WebRequestCycle(
application, webRequest, webResponse);

requestCycle.setRequestTarget(new
 BookmarkablePageRequestTarget(pageClass, pageParameters));

try {
requestCycle.getProcessor().respond(requestCycle);

log.warn(Response after request: 
 +webResponse.toString());

if (requestCycle.wasHandled() == false) {
requestCycle.setRequestTarget(new 
 WebErrorCodeResponseTarget(

 HttpServletResponse.SC_NOT_FOUND));
}
requestCycle.detach();

} finally {
requestCycle.getResponse().close();
}

return webResponse.toString();
}

 Does it make sense to put this in a ticket to request it for Wicket 1.5?

 Jörn

 On Tue, Nov 4, 2008 at 5:55 PM, Martijn Dashorst
 [EMAIL PROTECTED] wrote:
 Are you  in New Orleans in some voodoo bar? Why not join us at ApacheCon? :)

 Martijn

 On Tue, Nov 4, 2008 at 10:43 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 without seeing your code we have to resort to waving a dead chicken in
 front of our screens or making swags.

 -igor

 On Tue, Nov 4, 2008 at 9:19 AM, Jörn Zaefferer
 [EMAIL PROTECTED] wrote:
 Hi,

 I've found this article on how to render a page to a String:
 http://www.danwalmsley.com/2008/10/21/render-a-wicket-page-to-a-string-for-html-email/

 It seemed to be exactly what I was looking for. Copying the code into
 my app, I got a compiler error on the line where the WebRequest is
 created. Using the constructor to ServletWebRequest helped.

 Nonetheless, I get only an empty string back, no clue whats going wrong.

 I'm using Wicket 1.3.5.

 Any ideas?

 Jörn


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.4 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



fresh bug in wicket 1.4-rc1?, was: RE: [Wicket Formtester] Problem with Statelessform

2008-11-05 Thread Matz, Oliver
Hello,

 -Original Message-

 I changed my forms to statelessforms, which works perfectly fine in the
 actual app, only the test don't work anymore. I'm confronted with
 folowing
 exception:
 *org.apache.wicket.WicketRuntimeException: Internal error parsing
 wicket:interface = :0:registerForm::IFormSubmitListener::/; wrong
 format for
 url depth argument. Expected a number but was '/'*

we have the same problem since we have upgraded from wicket 1.4-m3 to 1.4-rc1.
(The tests used to work well with wicket 1.4-m3.)

I would appreciate any hint, too.

Oliver Matz

--
  Oliver Matz
  Development
  ppi Media GmbH
  Deliusstrasse 10
  24114 Kiel, Germany
  Geschäftsführer: Norbert Ohl, Martin Ruhle
  Amtsgericht Hamburg, HRB 84308
  phone  +49 (0) 431-53 53 -422
  fax+49 (0) 431-53 53 -222
  www.ppimedia.de

  Publishing solutions by ppi



Re: Incremental migration from JSP-based applications to Wicket?

2008-11-05 Thread Igor Vaynberg
i think the best way to migrate an app is to migrate it a
page/pageflow at a time. running wicket inside a jsp or jsp inside
wicket is always going to have gotchas you will have to work around.

-igor

On Wed, Nov 5, 2008 at 7:47 AM, Susan Liebeskind
[EMAIL PROTECTED] wrote:
 A follow up to this question, which generated just a single response from
 another fellow traveler...

 The lack of response to questions about migrating JSP app could also be
 indicative of the fact that  Wicket is being used mostly to develop *new*
 applications. In other words, maybe only a smallish percentage of folks are
 trying to migrate their existing work. Instead, maybe a more typical use
 case is that people begin new developments with Wicket, and don't try to
 port over existing one.

 Would some of the Wicket committers on this list have any anecdotal sense
 about whether Wicket is being used primarily for new apps vs, being a
 migration target?

 Thanks again.

 Susan

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: fresh bug in wicket 1.4-rc1?, was: RE: [Wicket Formtester] Problem with Statelessform

2008-11-05 Thread Igor Vaynberg
create a testcase and attach it to a jira issue.

-igor

On Wed, Nov 5, 2008 at 8:30 AM, Matz, Oliver [EMAIL PROTECTED] wrote:
 Hello,

 -Original Message-

 I changed my forms to statelessforms, which works perfectly fine in the
 actual app, only the test don't work anymore. I'm confronted with
 folowing
 exception:
 *org.apache.wicket.WicketRuntimeException: Internal error parsing
 wicket:interface = :0:registerForm::IFormSubmitListener::/; wrong
 format for
 url depth argument. Expected a number but was '/'*

 we have the same problem since we have upgraded from wicket 1.4-m3 to 1.4-rc1.
 (The tests used to work well with wicket 1.4-m3.)

 I would appreciate any hint, too.

 Oliver Matz

 --
  Oliver Matz
  Development
  ppi Media GmbH
  Deliusstrasse 10
  24114 Kiel, Germany
  Geschäftsführer: Norbert Ohl, Martin Ruhle
  Amtsgericht Hamburg, HRB 84308
  phone  +49 (0) 431-53 53 -422
  fax+49 (0) 431-53 53 -222
  www.ppimedia.de

  Publishing solutions by ppi



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Incremental migration from JSP-based applications to Wicket?

2008-11-05 Thread Susan Liebeskind

Igor Vaynberg wrote:

i think the best way to migrate an app is to migrate it a
page/pageflow at a time. running wicket inside a jsp or jsp inside
wicket is always going to have gotchas you will have to work around.

  
Agreed, and you just have to live with some quirks/gotchas while you go 
through the migration. 

But I'm just looking for a sense of how people start actually using 
Wicket. Do you have any feel for the ratio of new development in Wicket 
vs. migration old apps to Wicket, just based on the traffic you've seen 
go by on the list over the years?


Again, I know this is a non-scientific survey and not something that can 
be really quantified.


Susan



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Incremental migration from JSP-based applications to Wicket?

2008-11-05 Thread Igor Vaynberg
it is difficult to even guess because even if some people are
migrating their apps they dont necessarily mention it. start a new
thread on the list, call it [survey] how many people are migrating
existing apps to wicket vs start new apps and see how people respond.

you also have to define migrate. some people might think that
rewriting a new version of an app from scratch is migrating also.

-igor

On Wed, Nov 5, 2008 at 8:49 AM, Susan Liebeskind
[EMAIL PROTECTED] wrote:
 Igor Vaynberg wrote:

 i think the best way to migrate an app is to migrate it a
 page/pageflow at a time. running wicket inside a jsp or jsp inside
 wicket is always going to have gotchas you will have to work around.



 Agreed, and you just have to live with some quirks/gotchas while you go
 through the migration.
 But I'm just looking for a sense of how people start actually using Wicket.
 Do you have any feel for the ratio of new development in Wicket vs.
 migration old apps to Wicket, just based on the traffic you've seen go by on
 the list over the years?

 Again, I know this is a non-scientific survey and not something that can be
 really quantified.

 Susan



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Incremental migration from JSP-based applications to Wicket?

2008-11-05 Thread John Krasnay
On Wed, Nov 05, 2008 at 11:49:02AM -0500, Susan Liebeskind wrote:
 Igor Vaynberg wrote:
 i think the best way to migrate an app is to migrate it a
 page/pageflow at a time. running wicket inside a jsp or jsp inside
 wicket is always going to have gotchas you will have to work around.
 
   
 Agreed, and you just have to live with some quirks/gotchas while you go 
 through the migration. 
 
 But I'm just looking for a sense of how people start actually using 
 Wicket. Do you have any feel for the ratio of new development in Wicket 
 vs. migration old apps to Wicket, just based on the traffic you've seen 
 go by on the list over the years?
 
 Again, I know this is a non-scientific survey and not something that can 
 be really quantified.
 
 Susan

I migrated an application from SpringMVC/Freemarker (no JSP) to Wicket
over a period of several weeks. I basically did it as Igor suggested, a
page[flow] at a time; some URLs went to the old pages, some to the new.

The biggest issue I can recall is with feedback panels. If we raised a
feedback message (e.g. Session.get().info(Record saved.)) then
redirected to a non-Wicket page, the user wouldn't see the message until
they later hit a Wicket page. I'm sure we could have worked something up
to display Wicket feedback messages from non-Wicket pages but we
completed the migration before it became much of an issue.

jk

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Render a Wicket page to a string for HTML email

2008-11-05 Thread Peter Ertl

Won't it be easier / will it work to use WicketTester for this?


Am 05.11.2008 um 17:26 schrieb Igor Vaynberg:


make sure you do this in a thread other then the request thread so you
dont mess up any threadlocals.

-igor

On Wed, Nov 5, 2008 at 2:22 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:

No voodoo neccessary, got it working:

protected String renderPage(Class? extends Page pageClass,
PageParameters pageParameters) {

  //get the servlet context
  WebApplication application = (WebApplication)  
WebApplication.get();


  ServletContext context =  
application.getServletContext();


  //fake a request/response cycle
  MockHttpSession servletSession = new  
MockHttpSession(context);

  servletSession.setTemporary(true);

  MockHttpServletRequest servletRequest = new  
MockHttpServletRequest(

  application, servletSession, context);
  MockHttpServletResponse servletResponse = new  
MockHttpServletResponse(

  servletRequest);

  //initialize request and response
  servletRequest.initialize();
  servletResponse.initialize();

  WebRequest webRequest = new  
ServletWebRequest(servletRequest);


  BufferedWebResponse webResponse = new  
BufferedWebResponse(servletResponse);

  webResponse.setAjax(true);

  WebRequestCycle requestCycle = new WebRequestCycle(
  application, webRequest, webResponse);

  requestCycle.setRequestTarget(new
BookmarkablePageRequestTarget(pageClass, pageParameters));

  try {
   
requestCycle.getProcessor().respond(requestCycle);


  log.warn(Response after request:  
+webResponse.toString());


  if (requestCycle.wasHandled() == false) {
  requestCycle.setRequestTarget(new  
WebErrorCodeResponseTarget(
   
HttpServletResponse.SC_NOT_FOUND));

  }
  requestCycle.detach();

  } finally {
  requestCycle.getResponse().close();
  }

  return webResponse.toString();
  }

Does it make sense to put this in a ticket to request it for Wicket  
1.5?


Jörn

On Tue, Nov 4, 2008 at 5:55 PM, Martijn Dashorst
[EMAIL PROTECTED] wrote:
Are you  in New Orleans in some voodoo bar? Why not join us at  
ApacheCon? :)


Martijn

On Tue, Nov 4, 2008 at 10:43 AM, Igor Vaynberg [EMAIL PROTECTED] 
 wrote:
without seeing your code we have to resort to waving a dead  
chicken in

front of our screens or making swags.

-igor

On Tue, Nov 4, 2008 at 9:19 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:

Hi,

I've found this article on how to render a page to a String:
http://www.danwalmsley.com/2008/10/21/render-a-wicket-page-to-a-string-for-html-email/

It seemed to be exactly what I was looking for. Copying the code  
into

my app, I got a compiler error on the line where the WebRequest is
created. Using the constructor to ServletWebRequest helped.

Nonetheless, I get only an empty string back, no clue whats  
going wrong.


I'm using Wicket 1.3.5.

Any ideas?

Jörn



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Render a Wicket page to a string for HTML email

2008-11-05 Thread Igor Vaynberg
you still have to do it in a separate thread :)

-igor

On Wed, Nov 5, 2008 at 9:14 AM, Peter Ertl [EMAIL PROTECTED] wrote:
 Won't it be easier / will it work to use WicketTester for this?


 Am 05.11.2008 um 17:26 schrieb Igor Vaynberg:

 make sure you do this in a thread other then the request thread so you
 dont mess up any threadlocals.

 -igor

 On Wed, Nov 5, 2008 at 2:22 AM, Jörn Zaefferer
 [EMAIL PROTECTED] wrote:

 No voodoo neccessary, got it working:

 protected String renderPage(Class? extends Page pageClass,
 PageParameters pageParameters) {

  //get the servlet context
  WebApplication application = (WebApplication)
 WebApplication.get();

  ServletContext context = application.getServletContext();

  //fake a request/response cycle
  MockHttpSession servletSession = new
 MockHttpSession(context);
  servletSession.setTemporary(true);

  MockHttpServletRequest servletRequest = new
 MockHttpServletRequest(
  application, servletSession, context);
  MockHttpServletResponse servletResponse = new
 MockHttpServletResponse(
  servletRequest);

  //initialize request and response
  servletRequest.initialize();
  servletResponse.initialize();

  WebRequest webRequest = new
 ServletWebRequest(servletRequest);

  BufferedWebResponse webResponse = new
 BufferedWebResponse(servletResponse);
  webResponse.setAjax(true);

  WebRequestCycle requestCycle = new WebRequestCycle(
  application, webRequest, webResponse);

  requestCycle.setRequestTarget(new
 BookmarkablePageRequestTarget(pageClass, pageParameters));

  try {
  requestCycle.getProcessor().respond(requestCycle);

  log.warn(Response after request:
 +webResponse.toString());

  if (requestCycle.wasHandled() == false) {
  requestCycle.setRequestTarget(new
 WebErrorCodeResponseTarget(

  HttpServletResponse.SC_NOT_FOUND));
  }
  requestCycle.detach();

  } finally {
  requestCycle.getResponse().close();
  }

  return webResponse.toString();
  }

 Does it make sense to put this in a ticket to request it for Wicket 1.5?

 Jörn

 On Tue, Nov 4, 2008 at 5:55 PM, Martijn Dashorst
 [EMAIL PROTECTED] wrote:

 Are you  in New Orleans in some voodoo bar? Why not join us at
 ApacheCon? :)

 Martijn

 On Tue, Nov 4, 2008 at 10:43 AM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:

 without seeing your code we have to resort to waving a dead chicken in
 front of our screens or making swags.

 -igor

 On Tue, Nov 4, 2008 at 9:19 AM, Jörn Zaefferer
 [EMAIL PROTECTED] wrote:

 Hi,

 I've found this article on how to render a page to a String:

 http://www.danwalmsley.com/2008/10/21/render-a-wicket-page-to-a-string-for-html-email/

 It seemed to be exactly what I was looking for. Copying the code into
 my app, I got a compiler error on the line where the WebRequest is
 created. Using the constructor to ServletWebRequest helped.

 Nonetheless, I get only an empty string back, no clue whats going
 wrong.

 I'm using Wicket 1.3.5.

 Any ideas?

 Jörn


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.4 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Render a Wicket page to a string for HTML email

2008-11-05 Thread Peter Ertl

So would this be ok ?!

(caution! untested!)


try
{
  final String html =  
Executors.newSingleThreadExecutor().submit(new CallableString()

  {
public String call() throws Exception
{
  final WicketTester tester = new WicketTester();
  tester.startPage(MyPage.class);
  return new  
String(tester.getServletResponse().getBinaryContent(),  
tester.getServletResponse().getCharacterEncoding());

}
  }).get();
}
catch (InterruptedException e)
{
  e.printStackTrace();
}
catch (ExecutionException e)
{
  e.printStackTrace();
}






Am 05.11.2008 um 18:18 schrieb Igor Vaynberg:


you still have to do it in a separate thread :)

-igor

On Wed, Nov 5, 2008 at 9:14 AM, Peter Ertl [EMAIL PROTECTED] wrote:

Won't it be easier / will it work to use WicketTester for this?


Am 05.11.2008 um 17:26 schrieb Igor Vaynberg:

make sure you do this in a thread other then the request thread so  
you

dont mess up any threadlocals.

-igor

On Wed, Nov 5, 2008 at 2:22 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:


No voodoo neccessary, got it working:

protected String renderPage(Class? extends Page pageClass,
PageParameters pageParameters) {

//get the servlet context
WebApplication application = (WebApplication)
WebApplication.get();

ServletContext context =  
application.getServletContext();


//fake a request/response cycle
MockHttpSession servletSession = new
MockHttpSession(context);
servletSession.setTemporary(true);

MockHttpServletRequest servletRequest = new
MockHttpServletRequest(
application, servletSession, context);
MockHttpServletResponse servletResponse = new
MockHttpServletResponse(
servletRequest);

//initialize request and response
servletRequest.initialize();
servletResponse.initialize();

WebRequest webRequest = new
ServletWebRequest(servletRequest);

BufferedWebResponse webResponse = new
BufferedWebResponse(servletResponse);
webResponse.setAjax(true);

WebRequestCycle requestCycle = new WebRequestCycle(
application, webRequest, webResponse);

requestCycle.setRequestTarget(new
BookmarkablePageRequestTarget(pageClass, pageParameters));

try {
 
requestCycle.getProcessor().respond(requestCycle);


log.warn(Response after request:
+webResponse.toString());

if (requestCycle.wasHandled() == false) {
requestCycle.setRequestTarget(new
WebErrorCodeResponseTarget(

HttpServletResponse.SC_NOT_FOUND));
}
requestCycle.detach();

} finally {
requestCycle.getResponse().close();
}

return webResponse.toString();
}

Does it make sense to put this in a ticket to request it for  
Wicket 1.5?


Jörn

On Tue, Nov 4, 2008 at 5:55 PM, Martijn Dashorst
[EMAIL PROTECTED] wrote:


Are you  in New Orleans in some voodoo bar? Why not join us at
ApacheCon? :)

Martijn

On Tue, Nov 4, 2008 at 10:43 AM, Igor Vaynberg [EMAIL PROTECTED] 


wrote:


without seeing your code we have to resort to waving a dead  
chicken in

front of our screens or making swags.

-igor

On Tue, Nov 4, 2008 at 9:19 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:


Hi,

I've found this article on how to render a page to a String:

http://www.danwalmsley.com/2008/10/21/render-a-wicket-page-to-a-string-for-html-email/

It seemed to be exactly what I was looking for. Copying the  
code into
my app, I got a compiler error on the line where the  
WebRequest is

created. Using the constructor to ServletWebRequest helped.

Nonetheless, I get only an empty string back, no clue whats  
going

wrong.

I'm using Wicket 1.3.5.

Any ideas?

Jörn



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, 

Re: Render a Wicket page to a string for HTML email

2008-11-05 Thread Igor Vaynberg
that should do it for most cases. you might want to give wickettester
the actual application object also.

-igor

On Wed, Nov 5, 2008 at 9:26 AM, Peter Ertl [EMAIL PROTECTED] wrote:
 So would this be ok ?!

 (caution! untested!)


try
{
  final String html = Executors.newSingleThreadExecutor().submit(new
 CallableString()
  {
public String call() throws Exception
{
  final WicketTester tester = new WicketTester();
  tester.startPage(MyPage.class);
  return new String(tester.getServletResponse().getBinaryContent(),
 tester.getServletResponse().getCharacterEncoding());
}
  }).get();
}
catch (InterruptedException e)
{
  e.printStackTrace();
}
catch (ExecutionException e)
{
  e.printStackTrace();
}






 Am 05.11.2008 um 18:18 schrieb Igor Vaynberg:

 you still have to do it in a separate thread :)

 -igor

 On Wed, Nov 5, 2008 at 9:14 AM, Peter Ertl [EMAIL PROTECTED] wrote:

 Won't it be easier / will it work to use WicketTester for this?


 Am 05.11.2008 um 17:26 schrieb Igor Vaynberg:

 make sure you do this in a thread other then the request thread so you
 dont mess up any threadlocals.

 -igor

 On Wed, Nov 5, 2008 at 2:22 AM, Jörn Zaefferer
 [EMAIL PROTECTED] wrote:

 No voodoo neccessary, got it working:

 protected String renderPage(Class? extends Page pageClass,
 PageParameters pageParameters) {

//get the servlet context
WebApplication application = (WebApplication)
 WebApplication.get();

ServletContext context = application.getServletContext();

//fake a request/response cycle
MockHttpSession servletSession = new
 MockHttpSession(context);
servletSession.setTemporary(true);

MockHttpServletRequest servletRequest = new
 MockHttpServletRequest(
application, servletSession, context);
MockHttpServletResponse servletResponse = new
 MockHttpServletResponse(
servletRequest);

//initialize request and response
servletRequest.initialize();
servletResponse.initialize();

WebRequest webRequest = new
 ServletWebRequest(servletRequest);

BufferedWebResponse webResponse = new
 BufferedWebResponse(servletResponse);
webResponse.setAjax(true);

WebRequestCycle requestCycle = new WebRequestCycle(
application, webRequest, webResponse);

requestCycle.setRequestTarget(new
 BookmarkablePageRequestTarget(pageClass, pageParameters));

try {
requestCycle.getProcessor().respond(requestCycle);

log.warn(Response after request:
 +webResponse.toString());

if (requestCycle.wasHandled() == false) {
requestCycle.setRequestTarget(new
 WebErrorCodeResponseTarget(

 HttpServletResponse.SC_NOT_FOUND));
}
requestCycle.detach();

} finally {
requestCycle.getResponse().close();
}

return webResponse.toString();
}

 Does it make sense to put this in a ticket to request it for Wicket
 1.5?

 Jörn

 On Tue, Nov 4, 2008 at 5:55 PM, Martijn Dashorst
 [EMAIL PROTECTED] wrote:

 Are you  in New Orleans in some voodoo bar? Why not join us at
 ApacheCon? :)

 Martijn

 On Tue, Nov 4, 2008 at 10:43 AM, Igor Vaynberg
 [EMAIL PROTECTED]
 wrote:

 without seeing your code we have to resort to waving a dead chicken
 in
 front of our screens or making swags.

 -igor

 On Tue, Nov 4, 2008 at 9:19 AM, Jörn Zaefferer
 [EMAIL PROTECTED] wrote:

 Hi,

 I've found this article on how to render a page to a String:


 http://www.danwalmsley.com/2008/10/21/render-a-wicket-page-to-a-string-for-html-email/

 It seemed to be exactly what I was looking for. Copying the code
 into
 my app, I got a compiler error on the line where the WebRequest is
 created. Using the constructor to ServletWebRequest helped.

 Nonetheless, I get only an empty string back, no clue whats going
 wrong.

 I'm using Wicket 1.3.5.

 Any ideas?

 Jörn


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.4 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: 

Re: Render a Wicket page to a string for HTML email

2008-11-05 Thread Peter Ertl



  public String renderPageToString(final WebApplication application,  
final Page page)

  {
try
{
  return Executors.newSingleThreadExecutor().submit(new  
CallableString()

  {
public String call() throws Exception
{
  final WicketTester tester = new WicketTester(application);
  tester.startPage(page);
  tester.assertNoErrorMessage();
  return new  
String(tester.getServletResponse().getBinaryContent(),  
tester.getServletResponse().getCharacterEncoding());

}
  }).get();
}
catch (InterruptedException e)
{
  throw new WicketRuntimeException(e.getMessage(), e);
}
catch (ExecutionException e)
{
  throw new WicketRuntimeException(e.getMessage(), e);
}
  }




Am 05.11.2008 um 18:31 schrieb Igor Vaynberg:


that should do it for most cases. you might want to give wickettester
the actual application object also.

-igor

On Wed, Nov 5, 2008 at 9:26 AM, Peter Ertl [EMAIL PROTECTED] wrote:

So would this be ok ?!

(caution! untested!)


  try
  {
final String html =  
Executors.newSingleThreadExecutor().submit(new

CallableString()
{
  public String call() throws Exception
  {
final WicketTester tester = new WicketTester();
tester.startPage(MyPage.class);
return new  
String(tester.getServletResponse().getBinaryContent(),

tester.getServletResponse().getCharacterEncoding());
  }
}).get();
  }
  catch (InterruptedException e)
  {
e.printStackTrace();
  }
  catch (ExecutionException e)
  {
e.printStackTrace();
  }






Am 05.11.2008 um 18:18 schrieb Igor Vaynberg:


you still have to do it in a separate thread :)

-igor

On Wed, Nov 5, 2008 at 9:14 AM, Peter Ertl [EMAIL PROTECTED]  
wrote:


Won't it be easier / will it work to use WicketTester for this?


Am 05.11.2008 um 17:26 schrieb Igor Vaynberg:

make sure you do this in a thread other then the request thread  
so you

dont mess up any threadlocals.

-igor

On Wed, Nov 5, 2008 at 2:22 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:


No voodoo neccessary, got it working:

protected String renderPage(Class? extends Page pageClass,
PageParameters pageParameters) {

  //get the servlet context
  WebApplication application = (WebApplication)
WebApplication.get();

  ServletContext context =  
application.getServletContext();


  //fake a request/response cycle
  MockHttpSession servletSession = new
MockHttpSession(context);
  servletSession.setTemporary(true);

  MockHttpServletRequest servletRequest = new
MockHttpServletRequest(
  application, servletSession, context);
  MockHttpServletResponse servletResponse = new
MockHttpServletResponse(
  servletRequest);

  //initialize request and response
  servletRequest.initialize();
  servletResponse.initialize();

  WebRequest webRequest = new
ServletWebRequest(servletRequest);

  BufferedWebResponse webResponse = new
BufferedWebResponse(servletResponse);
  webResponse.setAjax(true);

  WebRequestCycle requestCycle = new WebRequestCycle(
  application, webRequest, webResponse);

  requestCycle.setRequestTarget(new
BookmarkablePageRequestTarget(pageClass, pageParameters));

  try {
   
requestCycle.getProcessor().respond(requestCycle);


  log.warn(Response after request:
+webResponse.toString());

  if (requestCycle.wasHandled() == false) {
  requestCycle.setRequestTarget(new
WebErrorCodeResponseTarget(

HttpServletResponse.SC_NOT_FOUND));
  }
  requestCycle.detach();

  } finally {
  requestCycle.getResponse().close();
  }

  return webResponse.toString();
  }

Does it make sense to put this in a ticket to request it for  
Wicket

1.5?

Jörn

On Tue, Nov 4, 2008 at 5:55 PM, Martijn Dashorst
[EMAIL PROTECTED] wrote:


Are you  in New Orleans in some voodoo bar? Why not join us at
ApacheCon? :)

Martijn

On Tue, Nov 4, 2008 at 10:43 AM, Igor Vaynberg
[EMAIL PROTECTED]
wrote:


without seeing your code we have to resort to waving a dead  
chicken

in
front of our screens or making swags.

-igor

On Tue, Nov 4, 2008 at 9:19 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:


Hi,

I've found this article on how to render a page to a String:


http://www.danwalmsley.com/2008/10/21/render-a-wicket-page-to-a-string-for-html-email/

It seemed to be exactly what I was looking for. Copying the  
code

into
my app, I got a compiler error on the line where the  
WebRequest is

created. Using the constructor to ServletWebRequest helped.

Nonetheless, I get only an empty string back, no clue whats  
going

wrong.

I'm using Wicket 1.3.5.

Any ideas?

Jörn




FileUpload Problem (Submitting a file from an Ajax ModalWindow)

2008-11-05 Thread Francisco Diaz Trepat - gmail
Hi all I have an issue submitting a file in IE. It is kind of an evolving
problem and is getting out of hand, I'm sure there is an easier solution.
First of all. I have an ajax ModalWindow that pops up and shows a label and
and the file input. This didn't upload anything on any browser, I guess
because nested forms are replace with divs and for some reason did not
submit as multipart.


this is the evolving part. :-)

After that, I'll tried an alternative that is working on Firefox but not on
IE, which was to add a multipart form on my page and another one on the
ModalWindow, and with an ajaxlink I Add the following JS code, that clones
the file-input of the ModalWindow to the Pages Form and then submits the
Pages Form. This works but not on IE.

Here is the intricate solution:


 @Override
 public void onClick(AjaxRequestTarget cAjaxRequestTarget) {
String sFormId;
String sFileInputId;

MainPage cMainPage = (MainPage) cAjaxRequestTarget.getPage();

sFormId = cMainPage.getImportForm().getMarkupId();
sFileInputId =
cMainPage.getImportForm().getFileUploadField().getMarkupId();

String sSubmitScript =  +
  var cImportForm = document.getElementById(' + sFormId +
');\n +
  var cImportFileInput = document.getElementById(' +
sFileInputId + ');\n +
  var cFileInput = document.getElementById(' +
cUploadField.getMarkupId() + ');\n + //cUploadField is the FileInput from
the current ModalWindow that holds the ajax-link (whos onClick I'm
overriding)
  var sValue = cFileInput.value;\n +
  if (typeof(sValue)!=\undefined\  sValue.length5) {
+
 var cClone = cFileInput.cloneNode(true);\n +
var sName = cImportFileInput.name;\n +
cClone.name = sName;\n +
  
 cImportFileInput.parentNode.removeChild(cImportFileInput);\n +
cImportForm.appendChild(cClone);\n +
cImportForm.submit();\n +
  };


cAjaxRequestTarget.appendJavascript(sSubmitScript);
 }

As the Subject, what I need is to submit a file from an Ajax ModalWindow. Is
this possible?

Thanks,
f(t)


FileUpload always null

2008-11-05 Thread Steve Swinsburg

Hi all,

I'm having an odd problem in uploading a file where the result of:

FileUpload upload = uploadField.getFileUpload();

is always null. I can't see what I've done wrong.


Here's part of my onSubmit method which works for textfields, but not  
fileuploads. It's a normal fileupload by the way (so its not an AJAX  
issue):



public void onSubmit(){

if (uploadField != null) {
System.out.println(1 - uploadField not null);
FileUpload upload = uploadField.getFileUpload();
if(upload != null) {
System.out.println(2 - upload not null);
byte[] photoBytes = upload.getBytes();
}
}

}

where uploadField is defined in the class like so:
private FileUploadField uploadField;

and then added to the form:
uploadField = new FileUploadField(picture);
form.add(uploadField);


So the form works as expected for textfields but not fileuploads. Can  
anyone spot any issues/give me pointers? The form is multipart encoded.



thanks.







smime.p7s
Description: S/MIME cryptographic signature


Re: FileUpload Problem (Submitting a file from an Ajax ModalWindow)

2008-11-05 Thread Igor Vaynberg
plenty threads in the archives on uploading and ajax, you just have to search.

-igor

On Wed, Nov 5, 2008 at 9:48 AM, Francisco Diaz Trepat - gmail
[EMAIL PROTECTED] wrote:
 Hi all I have an issue submitting a file in IE. It is kind of an evolving
 problem and is getting out of hand, I'm sure there is an easier solution.
 First of all. I have an ajax ModalWindow that pops up and shows a label and
 and the file input. This didn't upload anything on any browser, I guess
 because nested forms are replace with divs and for some reason did not
 submit as multipart.


 this is the evolving part. :-)

 After that, I'll tried an alternative that is working on Firefox but not on
 IE, which was to add a multipart form on my page and another one on the
 ModalWindow, and with an ajaxlink I Add the following JS code, that clones
 the file-input of the ModalWindow to the Pages Form and then submits the
 Pages Form. This works but not on IE.

 Here is the intricate solution:


 @Override
 public void onClick(AjaxRequestTarget cAjaxRequestTarget) {
String sFormId;
String sFileInputId;

MainPage cMainPage = (MainPage) cAjaxRequestTarget.getPage();

sFormId = cMainPage.getImportForm().getMarkupId();
sFileInputId =
 cMainPage.getImportForm().getFileUploadField().getMarkupId();

String sSubmitScript =  +
  var cImportForm = document.getElementById(' + sFormId +
 ');\n +
  var cImportFileInput = document.getElementById(' +
 sFileInputId + ');\n +
  var cFileInput = document.getElementById(' +
 cUploadField.getMarkupId() + ');\n + //cUploadField is the FileInput from
 the current ModalWindow that holds the ajax-link (whos onClick I'm
 overriding)
  var sValue = cFileInput.value;\n +
  if (typeof(sValue)!=\undefined\  sValue.length5) {
 +
 var cClone = cFileInput.cloneNode(true);\n +
var sName = cImportFileInput.name;\n +
cClone.name = sName;\n +
  
  cImportFileInput.parentNode.removeChild(cImportFileInput);\n +
cImportForm.appendChild(cClone);\n +
cImportForm.submit();\n +
  };


cAjaxRequestTarget.appendJavascript(sSubmitScript);
 }

 As the Subject, what I need is to submit a file from an Ajax ModalWindow. Is
 this possible?

 Thanks,
 f(t)


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FileUpload always null

2008-11-05 Thread Igor Vaynberg
are there validation errors?

-igor

On Wed, Nov 5, 2008 at 10:14 AM, Steve Swinsburg
[EMAIL PROTECTED] wrote:
 Hi all,
 I'm having an odd problem in uploading a file where the result of:
 FileUpload upload = uploadField.getFileUpload();
 is always null. I can't see what I've done wrong.

 Here's part of my onSubmit method which works for textfields, but not
 fileuploads. It's a normal fileupload by the way (so its not an AJAX issue):
 public void onSubmit(){

 if (uploadField != null) {
 System.out.println(1 - uploadField not null);
 FileUpload upload = uploadField.getFileUpload();
 if(upload != null) {
 System.out.println(2 - upload not null);
 byte[] photoBytes = upload.getBytes();
 }
 }

 }

 where uploadField is defined in the class like so:

 private FileUploadField uploadField;
 and then added to the form:
 uploadField = new FileUploadField(picture);
 form.add(uploadField);

 So the form works as expected for textfields but not fileuploads. Can anyone
 spot any issues/give me pointers? The form is multipart encoded.


 thanks.






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FileUpload Problem (Submitting a file from an Ajax ModalWindow)

2008-11-05 Thread Francisco Diaz Trepat - gmail
I remember looking but on my google account, not in the nable archives.
Usually those threads where NO AJAX FILE UPLOAD POSSIBLE.

But I think my problem is different.

I'll take a look right now though.

Thanks Igor, always present, short, to the point, and present.. :-)

f(t)

On Wed, Nov 5, 2008 at 3:32 PM, Igor Vaynberg [EMAIL PROTECTED]wrote:

 plenty threads in the archives on uploading and ajax, you just have to
 search.

 -igor

 On Wed, Nov 5, 2008 at 9:48 AM, Francisco Diaz Trepat - gmail
 [EMAIL PROTECTED] wrote:
  Hi all I have an issue submitting a file in IE. It is kind of an evolving
  problem and is getting out of hand, I'm sure there is an easier solution.
  First of all. I have an ajax ModalWindow that pops up and shows a label
 and
  and the file input. This didn't upload anything on any browser, I guess
  because nested forms are replace with divs and for some reason did not
  submit as multipart.
 
 
  this is the evolving part. :-)
 
  After that, I'll tried an alternative that is working on Firefox but not
 on
  IE, which was to add a multipart form on my page and another one on the
  ModalWindow, and with an ajaxlink I Add the following JS code, that
 clones
  the file-input of the ModalWindow to the Pages Form and then submits the
  Pages Form. This works but not on IE.
 
  Here is the intricate solution:
 
 
  @Override
  public void onClick(AjaxRequestTarget cAjaxRequestTarget) {
 String sFormId;
 String sFileInputId;
 
 MainPage cMainPage = (MainPage) cAjaxRequestTarget.getPage();
 
 sFormId = cMainPage.getImportForm().getMarkupId();
 sFileInputId =
  cMainPage.getImportForm().getFileUploadField().getMarkupId();
 
 String sSubmitScript =  +
   var cImportForm = document.getElementById(' + sFormId
 +
  ');\n +
   var cImportFileInput = document.getElementById(' +
  sFileInputId + ');\n +
   var cFileInput = document.getElementById(' +
  cUploadField.getMarkupId() + ');\n + //cUploadField is the FileInput
 from
  the current ModalWindow that holds the ajax-link (whos onClick I'm
  overriding)
   var sValue = cFileInput.value;\n +
   if (typeof(sValue)!=\undefined\  sValue.length5)
 {
  +
  var cClone = cFileInput.cloneNode(true);\n +
 var sName = cImportFileInput.name;\n +
 cClone.name = sName;\n +
   
   cImportFileInput.parentNode.removeChild(cImportFileInput);\n +
 cImportForm.appendChild(cClone);\n +
 cImportForm.submit();\n +
   };
 
 
 cAjaxRequestTarget.appendJavascript(sSubmitScript);
  }
 
  As the Subject, what I need is to submit a file from an Ajax ModalWindow.
 Is
  this possible?
 
  Thanks,
  f(t)
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: ApacheCon live video streaming available; keynotes and Apache 101 are free

2008-11-05 Thread Bruno Borges
Thanks Jeremy for improving my blog's PageRank. :-)

But one important note: my posts are being written in Portuguese, so if you
want to check them all, go to Google Translator. :-) I try my best to write
a correct Portuguese to make it easy to be translated in English.

By the way, when Apache says Free Software as in free beer, they really make
it happen. I love this free beer thing that we have around here at
ApacheCon! :-)

Cheers,
Bruno Borges
blog.brunoborges.com.br
+55 21 76727099

The glory of great men should always be
measured by the means they have used to
acquire it.
- Francois de La Rochefoucauld


On Tue, Nov 4, 2008 at 5:37 PM, Jeremy Thomerson
[EMAIL PROTECTED]wrote:

 I also have the privilege of attending, so I am planning on live blogging
 from the sessions that I attend.  You will definitely get at least a
 picture
 or two of Martijn presenting tomorrow's session: Wicket in Action.

 My blog is here: http://www.jeremythomerson.com/blog/
 Bruno Borges is also attending with us, and his blog is here:
 http://blog.brunoborges.com.br/



 --
 Jeremy Thomerson
 http://www.wickettraining.com

 On Tue, Nov 4, 2008 at 10:30 AM, Martijn Dashorst [EMAIL PROTECTED]
 wrote:

  Can't make ApacheCon this week in New Orleans?  You can still watch all
  the keynotes, Apache 101 sessions, and system administration track in
  live video streams:
 
   http://streaming.linux-magazin.de/en/program_apacheconus08.htm?ann
 
  Keynotes and the Apache 101 lunchtime sessions are free; the full
  sysadmin track, including httpd performance, security, and server stack
  administration talks are available for a fee.
 
  Keynotes include:
  - David Recordon, Six Apart  (Wednesday 09:30)
   Learning from Apache to create Open Specifications
 
  - Shahani Markus Weerawarana, Ph.D.  (Thursday 11:30)
   Standing on the Shoulders of Giants
 
  - Sam Ramji, Microsoft  (Friday 11:30)
   struct.new(future, :open, :microsoft)
 
 
   Reminder: New Orleans is CST or UTC/GMT -6 hours.
 
 
  Advance notice: ApacheCon EU 2009 returns to Amsterdam, 23-27 March.  We
  had a great response to our CFP and look forward to announcing the
  schedule in the next month.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Re: Upload exceeds maxsize error comes AFTER upload has finished

2008-11-05 Thread Stefan Simik

This is how things work in HTTP.
One possible solution, that provides more control from client is flash
upload - see http://swfupload.org/
-- 
View this message in context: 
http://www.nabble.com/Upload-exceeds-maxsize-error-comes-AFTER-upload-has-finished-tp20228506p20347340.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



session timeout and session id

2008-11-05 Thread Arthur Leigh Allen
Hello people!

I know there are lots of threads with the same issue but I couldn't find a 
proper and well solved solution.

I have a web application with users to login and logout.
If a user logs in the user object is hold in the session.
If the user logs out by using the logout button, the online status of this user 
is set to offline in the database.

Well. My problem is the session timeout.
If a session timeout occurs I only can access the session id of the expired 
session (am I right?).
So I'm not able to access the user object anymore (?).

Some of you showed a solution by holding a map or list in the application 
class, e.g. key (sessionid) and value (user).
But I think it's expensive (memory).

It would be more performant to save the session id of the user in the user 
database table when the user logs in.
When the timeout occurs I could retrieve the user object from the database by 
using the unique session id.
Then I could modify the user object and make it persistent again.

Does anyone know a better way because I'm not fully satisfied with this 
solution, too?

Best regards!
Allen


  

Re: session timeout and session id

2008-11-05 Thread Bruno Borges
How expensive do you think it will be to save and bring back the user object
from the database? I'm pretty sure that working with that information in
memory is faster and less expensive. Why not just staying with the Map
solution? I'm pretty sure it works.

cheers,
Bruno Borges
blog.brunoborges.com.br
+55 21 76727099

The glory of great men should always be
measured by the means they have used to
acquire it.
- Francois de La Rochefoucauld


On Wed, Nov 5, 2008 at 1:31 PM, Arthur Leigh Allen 
[EMAIL PROTECTED] wrote:

 Hello people!

 I know there are lots of threads with the same issue but I couldn't find a
 proper and well solved solution.

 I have a web application with users to login and logout.
 If a user logs in the user object is hold in the session.
 If the user logs out by using the logout button, the online status of this
 user is set to offline in the database.

 Well. My problem is the session timeout.
 If a session timeout occurs I only can access the session id of the expired
 session (am I right?).
 So I'm not able to access the user object anymore (?).

 Some of you showed a solution by holding a map or list in the application
 class, e.g. key (sessionid) and value (user).
 But I think it's expensive (memory).

 It would be more performant to save the session id of the user in the user
 database table when the user logs in.
 When the timeout occurs I could retrieve the user object from the database
 by using the unique session id.
 Then I could modify the user object and make it persistent again.

 Does anyone know a better way because I'm not fully satisfied with this
 solution, too?

 Best regards!
 Allen





Re: session timeout and session id

2008-11-05 Thread Igor Vaynberg
you keep the status in the database, so add a column with session id
and when that session expires that is all you need to mark the user as
offline.

-igor

On Wed, Nov 5, 2008 at 11:31 AM, Arthur Leigh Allen
[EMAIL PROTECTED] wrote:
 Hello people!

 I know there are lots of threads with the same issue but I couldn't find a 
 proper and well solved solution.

 I have a web application with users to login and logout.
 If a user logs in the user object is hold in the session.
 If the user logs out by using the logout button, the online status of this 
 user is set to offline in the database.

 Well. My problem is the session timeout.
 If a session timeout occurs I only can access the session id of the expired 
 session (am I right?).
 So I'm not able to access the user object anymore (?).

 Some of you showed a solution by holding a map or list in the application 
 class, e.g. key (sessionid) and value (user).
 But I think it's expensive (memory).

 It would be more performant to save the session id of the user in the user 
 database table when the user logs in.
 When the timeout occurs I could retrieve the user object from the database by 
 using the unique session id.
 Then I could modify the user object and make it persistent again.

 Does anyone know a better way because I'm not fully satisfied with this 
 solution, too?

 Best regards!
 Allen




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: session timeout and session id

2008-11-05 Thread Jeremy Thomerson
Or if you don't want to add anything to your DB, change the boolean in your
database to a string - any nulls are not signed in.

On Wed, Nov 5, 2008 at 2:06 PM, Igor Vaynberg [EMAIL PROTECTED]wrote:

 you keep the status in the database, so add a column with session id
 and when that session expires that is all you need to mark the user as
 offline.

 -igor

 On Wed, Nov 5, 2008 at 11:31 AM, Arthur Leigh Allen
 [EMAIL PROTECTED] wrote:
   Hello people!
 
  I know there are lots of threads with the same issue but I couldn't find
 a proper and well solved solution.
 
  I have a web application with users to login and logout.
  If a user logs in the user object is hold in the session.
  If the user logs out by using the logout button, the online status of
 this user is set to offline in the database.
 
  Well. My problem is the session timeout.
  If a session timeout occurs I only can access the session id of the
 expired session (am I right?).
  So I'm not able to access the user object anymore (?).
 
  Some of you showed a solution by holding a map or list in the application
 class, e.g. key (sessionid) and value (user).
  But I think it's expensive (memory).
 
  It would be more performant to save the session id of the user in the
 user database table when the user logs in.
  When the timeout occurs I could retrieve the user object from the
 database by using the unique session id.
  Then I could modify the user object and make it persistent again.
 
  Does anyone know a better way because I'm not fully satisfied with this
 solution, too?
 
  Best regards!
  Allen
 
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Jeremy Thomerson
http://www.wickettraining.com


wicket:message as attribute and nested components

2008-11-05 Thread Sébastien Piller

Hello,

I was wondering if the behavior described here 
http://cwiki.apache.org/WICKET/wickets-xhtml-tags.html (use 
wicket:message as attribute) was broken or if I'm doing something wrong 
(Wicket 1.3.5)


I've written that:

form wicket:id=form wicket:message=class:formClass
   table
   wicket:container wicket:id=repeatrows
   tr
   td *wicket:message=class:formLabelCol*label 
wicket:id=label[label goes here]/label/td
   tdwicket:container 
wicket:id=component/wicket:container/td

   /tr
   tr
   td colspan=2wicket:container 
wicket:id=feedback/wicket:container/td

   /tr
   /wicket:container
   /table
   input type=submit / input type=reset /
/form


With a Java part that works fine.

If I remove the bold part, everything goes fine. If I leave them, I get 
the usual WicketRuntimeException


org.apache.wicket.markup.MarkupException: Unable to find component with id 
'label' in [MarkupContainer [Component id = _message_attr_12]]. This means that 
you declared wicket:id=label in your markup, but that


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket integration with good charts api

2008-11-05 Thread Thies Edeling

Maarten Bosteels wrote:

I have a similar requirement and played a bit with Open Flash Charts. [1]
It took little effort to integrate wicket + ofc4j [2] + swfobject [3]

[1] http://teethgrinder.co.uk/open-flash-chart-2/glass-bar-chart.php
[2] http://code.google.com/p/ofcj/
[3] http://code.google.com/p/swfobject/

Another requirement was that the user could drag and drop charts around on
the page (à la iGoogle) so I tried something like
http://interface.eyecon.ro/demos/sort.html  but that failed miserably: half
the time the charts wouldn't show up correctly after dragging them around.
I still have to find out if I can solve this somehow. All pointers are
welcome.

Anyway, if you're interested, I can create a wiki page showing the wicket +
ofc4j + swfobject integration.
  
Wiki page would be nice, those open flash charts look a lot better than 
the jfreechart images.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



strange error: getter for member

2008-11-05 Thread Björn-Peter Tietjens

Hi,

I am new to wicket and now I got a strange problem with wicket...

WicketMessage: No get method defined for class: class mypackage.Artikel expression: 
artikel

BUT: my class mypackage.Artikel does not have an member artikel... 


thanks for some help...

complete error:

WicketMessage: No get method defined for class: class 
de.synerlogis.core.artikel.Artikel expression: artikel


Root cause:

org.apache.wicket.WicketRuntimeException: No get method defined for 
class: class mypackage.Artikel expression: artikel at 
org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:436) 
at 
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:278) 
at 
org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:87) 
at 
org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113) 
at org.apache.wicket.Component.getModelObject(Component.java:1559) at 
org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(AbstractSingleSelectChoice.java:140) 
at 
org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:797) 
at 
org.apache.wicket.markup.html.form.AbstractChoice.onComponentTagBody(AbstractChoice.java:344) 
at org.apache.wicket.Component.renderComponent(Component.java:2481) at 
org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411) at 
org.apache.wicket.Component.render(Component.java:2318) at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1297) 
at 
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1476) 
at 
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1401) 
at 
org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:1679) 
at org.apache.wicket.Component.renderComponent(Component.java:2481) at 
org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411) at 
org.apache.wicket.markup.html.form.Form.onRender(Form.java:1743) at 
org.apache.wicket.Component.render(Component.java:2318) at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1297) 
at 
org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1427) 
at org.apache.wicket.Page.onRender(Page.java:1459) at 
org.apache.wicket.Component.render(Component.java:2318) at 
org.apache.wicket.Page.renderPage(Page.java:905) at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231) 
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104) 
at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1177) 
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1248) at 
org.apache.wicket.RequestCycle.steps(RequestCycle.java:1349) at 
org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:387) 
at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:199) 
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) 
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) 
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) 
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) 
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) 
at java.lang.Thread.run(Thread.java:619)





Re: wicket:message as attribute and nested components

2008-11-05 Thread Igor Vaynberg
im not sure it works on non-components. we can probably make it so.
please create a quickstart and attach it to a jira issue.

-igor

On Wed, Nov 5, 2008 at 12:57 PM, Sébastien Piller [EMAIL PROTECTED] wrote:
 Hello,

 I was wondering if the behavior described here
 http://cwiki.apache.org/WICKET/wickets-xhtml-tags.html (use wicket:message
 as attribute) was broken or if I'm doing something wrong (Wicket 1.3.5)

 I've written that:

 form wicket:id=form wicket:message=class:formClass
   table
   wicket:container wicket:id=repeatrows
   tr
   td *wicket:message=class:formLabelCol*label
 wicket:id=label[label goes here]/label/td
   tdwicket:container
 wicket:id=component/wicket:container/td
   /tr
   tr
   td colspan=2wicket:container
 wicket:id=feedback/wicket:container/td
   /tr
   /wicket:container
   /table
   input type=submit / input type=reset /
 /form


 With a Java part that works fine.

 If I remove the bold part, everything goes fine. If I leave them, I get the
 usual WicketRuntimeException

 org.apache.wicket.markup.MarkupException: Unable to find component with id
 'label' in [MarkupContainer [Component id = _message_attr_12]]. This means
 that you declared wicket:id=label in your markup, but that


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: strange error: getter for member

2008-11-05 Thread Jeremy Thomerson
Please show the code where you use either a PropertyModel or a
CompoundPropertyModel - that's what is causing this.  Wicket is trying to
find the getArtikel() method on your Artikel class.

-- 
Jeremy Thomerson
http://www.wickettraining.com



On Wed, Nov 5, 2008 at 3:51 PM, Björn-Peter Tietjens [EMAIL PROTECTED] wrote:

 Hi,

 I am new to wicket and now I got a strange problem with wicket...

 WicketMessage: No get method defined for class: class mypackage.Artikel
 expression: artikel

 BUT: my class mypackage.Artikel does not have an member artikel...
 thanks for some help...

 complete error:

 WicketMessage: No get method defined for class: class
 de.synerlogis.core.artikel.Artikel expression: artikel

 Root cause:

 org.apache.wicket.WicketRuntimeException: No get method defined for class:
 class mypackage.Artikel expression: artikel at
 org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:436)
 at
 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:278)
 at
 org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:87)
 at
 org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113)
 at org.apache.wicket.Component.getModelObject(Component.java:1559) at
 org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(AbstractSingleSelectChoice.java:140)
 at
 org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:797)
 at
 org.apache.wicket.markup.html.form.AbstractChoice.onComponentTagBody(AbstractChoice.java:344)
 at org.apache.wicket.Component.renderComponent(Component.java:2481) at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411) at
 org.apache.wicket.Component.render(Component.java:2318) at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1297) at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1476)
 at
 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1401)
 at
 org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:1679)
 at org.apache.wicket.Component.renderComponent(Component.java:2481) at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411) at
 org.apache.wicket.markup.html.form.Form.onRender(Form.java:1743) at
 org.apache.wicket.Component.render(Component.java:2318) at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1297) at
 org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1427) at
 org.apache.wicket.Page.onRender(Page.java:1459) at
 org.apache.wicket.Component.render(Component.java:2318) at
 org.apache.wicket.Page.renderPage(Page.java:905) at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)
 at
 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
 at
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1177)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1248) at
 org.apache.wicket.RequestCycle.steps(RequestCycle.java:1349) at
 org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:387) at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:199)
 at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
 at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
 at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
 at
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 at java.lang.Thread.run(Thread.java:619)





RE: WIcket 1.4 IndicatingAjaxFallbackLink

2008-11-05 Thread Stefan Lindner
I checked out trunk from http://svn.apache.org/repos/asf/wicket/trunk and 
IndicatingAjaxFallbackLink is still not generic. Am I using the wrong trunk URL?

Stefan

-Ursprüngliche Nachricht-
Von: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 5. November 2008 17:18
An: users@wicket.apache.org
Betreff: Re: WIcket 1.4 IndicatingAjaxFallbackLink

it is generic in trunk.

-igor

On Wed, Nov 5, 2008 at 12:55 AM, Stefan Lindner [EMAIL PROTECTED] wrote:
 IndicatingAjaxFallbackLink is not generic. It extends AjaxFallbackLink

public abstract class IndicatingAjaxFallbackLink extends
 AjaxFallbackLink

 which is generic

public abstract class AjaxFallbackLinkT extends LinkT
 implements IAjaxLink

 I think IndicatingAjaxFallbackLink should be generic too.

 Stefan

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: WIcket 1.4 IndicatingAjaxFallbackLink

2008-11-05 Thread Igor Vaynberg
woops i think i looked at fallbackbutton instead of link. svn up and
it will be generified.

-igor

On Wed, Nov 5, 2008 at 2:52 PM, Stefan Lindner [EMAIL PROTECTED] wrote:
 I checked out trunk from http://svn.apache.org/repos/asf/wicket/trunk and 
 IndicatingAjaxFallbackLink is still not generic. Am I using the wrong trunk 
 URL?

 Stefan

 -Ursprüngliche Nachricht-
 Von: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Gesendet: Mittwoch, 5. November 2008 17:18
 An: users@wicket.apache.org
 Betreff: Re: WIcket 1.4 IndicatingAjaxFallbackLink

 it is generic in trunk.

 -igor

 On Wed, Nov 5, 2008 at 12:55 AM, Stefan Lindner [EMAIL PROTECTED] wrote:
 IndicatingAjaxFallbackLink is not generic. It extends AjaxFallbackLink

public abstract class IndicatingAjaxFallbackLink extends
 AjaxFallbackLink

 which is generic

public abstract class AjaxFallbackLinkT extends LinkT
 implements IAjaxLink

 I think IndicatingAjaxFallbackLink should be generic too.

 Stefan

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: strange error: getter for member

2008-11-05 Thread James Carman
On Wed, Nov 5, 2008 at 5:05 PM, Jeremy Thomerson
[EMAIL PROTECTED] wrote:
 Please show the code where you use either a PropertyModel or a
 CompoundPropertyModel - that's what is causing this.  Wicket is trying to
 find the getArtikel() method on your Artikel class.

An *accessible* method.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



continuetooriginaldestination in expired page

2008-11-05 Thread Cristi Manole
Hello,

Consider a user who is on a modal window and his session expires. When he
tries to do something he will be redirected to the page expired page.

Is it possible that after he logs in to be redirected to the page from where
he opened the modal window? Something like what
continuetooriginaldestination does?

I can see that in the implementation I have the information about the last
page he was on is lost when instantiating page expired

If the user is on a regular page, if I take the server down and put it up
again, when he tries to get to some other page, he will be redirected to
login, log again and correctly be redirected to where he wanted to go. No
page expired. How can I have this exact same functionality?

Thank you in advance,
Cristi Manole


Re: Design question : accessing components between panels

2008-11-05 Thread Timo Rantalaiho
On Wed, 05 Nov 2008, Arun Wagle wrote:
 I have an application which renders a page.
 This page has two panels , panel A and panel B
 Each panel has some components in it.
 
 Now I want to access some component in panel B from panel A.

What exactly do you want to do with the panel B component in
panel A?

 Can someone tell me how do I get a handle to panel B in panel A ?

getPage().visitChildren(PanelB.class, new IVisitor() {
...
});

 Can someone please help me as I have lot of cases with these scenarious ?

Then you could have a look at

  https://issues.apache.org/jira/browse/WICKET-1312

and the blog posts referenced in it.

There has also been a lot of discussion of these scenarios 
on this mailing list before, so you could search Nabble on
that.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: strange error: getter for member

2008-11-05 Thread Timo Rantalaiho
On Wed, 05 Nov 2008, Björn-Peter Tietjens wrote:
 WicketMessage: No get method defined for class: class mypackage.Artikel 
 expression: artikel
 
 BUT: my class mypackage.Artikel does not have an member artikel... 

It sounds like your Form has a CompoundPropertyModel bound
to ad Artikel instance and a DropDownChoice (or something 
like that) with id artikel and without its own model. Then
CompoundPropertyModel binds it to the property 
Artikel.artikel -- see the Models page on Wicket wiki for
details.

As others pointed out, with your code it's easier for us to
see what's going on.

Problems like this are fairly common when using
(Compound)PropertyModels, and I've found it good to write
unit tests from early on to catch them soon.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: WIcket 1.4 IndicatingAjaxFallbackLink

2008-11-05 Thread Stefan Lindner
Yep! Thank you again!

Stefan

-Ursprüngliche Nachricht-
Von: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 6. November 2008 00:02
An: users@wicket.apache.org
Betreff: Re: WIcket 1.4 IndicatingAjaxFallbackLink

woops i think i looked at fallbackbutton instead of link. svn up and
it will be generified.

-igor

On Wed, Nov 5, 2008 at 2:52 PM, Stefan Lindner [EMAIL PROTECTED] wrote:
 I checked out trunk from http://svn.apache.org/repos/asf/wicket/trunk and 
 IndicatingAjaxFallbackLink is still not generic. Am I using the wrong trunk 
 URL?

 Stefan

 -Ursprüngliche Nachricht-
 Von: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Gesendet: Mittwoch, 5. November 2008 17:18
 An: users@wicket.apache.org
 Betreff: Re: WIcket 1.4 IndicatingAjaxFallbackLink

 it is generic in trunk.

 -igor

 On Wed, Nov 5, 2008 at 12:55 AM, Stefan Lindner [EMAIL PROTECTED] wrote:
 IndicatingAjaxFallbackLink is not generic. It extends AjaxFallbackLink

public abstract class IndicatingAjaxFallbackLink extends
 AjaxFallbackLink

 which is generic

public abstract class AjaxFallbackLinkT extends LinkT
 implements IAjaxLink

 I think IndicatingAjaxFallbackLink should be generic too.

 Stefan

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Need AjaxButton's but not its enclosing form's onSubmit() to be called

2008-11-05 Thread Kaspar Fischer

I have a form with an onSubmit(). The form contains a AjaxButton
with another onSubmit(). When the later gets called, the former gets
invoked, too. What I want, however, is that the form's onSubmit()
gets called iff the input type=submit-button is clicked, and that
the AjaxButton's onSubmit() is called iff the input type=button-
button is pressed.

How can I achieve this?

I tried calling setDefaultFormProcessing(false) on my AjaxButton,
but that does not update the form values (not what I want). I also
tried form.setDefaultButton(null) or form.setDefaultButton(submit),
which didn't help either.

Thanks,
Kaspar

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]