Re: Using Wicket Pages for an Internal Request

2008-12-10 Thread Ernesto Reinaldo Barreiro
Hope this helps...

http://www.nabble.com/Use-wicket-page-templates-not-for-webapplication-td19173648.html

http://cwiki.apache.org/confluence/display/WICKET/FAQs#FAQs-HowcanIrendermytemplatestoaString%3F
http://cwiki.apache.org/WICKET/use-wicket-as-template-engine.html

Ernesto

On Wed, Dec 10, 2008 at 7:31 AM, Mike Papper [EMAIL PROTECTED] wrote:

 Hi,

 thanks for that  - I did search the archives and found nothing...is there a
 name for this that you know of - such that I could use it in the search? I
 think I was calling it internal redirect.

 Mike


 On Dec 9, 2008, at 10:16 PM, Jeremy Thomerson wrote:

  Search around in the mail archives - the typical solution involves using
 WicketTester.

 On Tue, Dec 9, 2008 at 8:06 PM, Mike Papper [EMAIL PROTECTED] wrote:

  Hi, very new to Wicket and this list...

 so I'm wondering if anyone can tell me if the following is possible and
 approx. how-to?

 Overview: we have a wicket page that generates some html+javascript etc.
 We
 want to render this page from within the application (into a String) and
 send it to some other web service (such as Facebook). We currently use
 httpclient to make a http request back to our server and take the
 response
 and munge it. The overhead of the extra request is an unsatisfactory load
 on
 our servers.

 Is there a way to make to mimic an 'internal' servlet/web request and
 take
 that response (or at least the rendering of the Page) but do not affect
 the
 state of the current (external) http request? We tried using MockServlet
 with the WicketFilter but when the intenral request was finished it
 seemed
 to alter the state of the original request (such that the session went
 away
 and the response was invalid - I think the original response had been
 generated from the contents of the mock request/response). Even if this
 could be fixed...theres more:

 An additional constraint is to call this 'internal request' from anywhere
 in
 the code and not necessarily within a http request (i.e., from a Quartz
 thread). So, we may not have any WicketApplication ...If it is the case
 that
 we can only gert our hands on the WicketApplication from a thread that is
 part of a http request, then the quartz thread willnot have acces to
 WicketApplication (I am unsure about this).

 Looking around in the docs, I came across the RequestCycle and wondering
 if
 thats how I can do this?

 Any pointer for this would be appreciated - it would be a shame not to be
 able to use Wicket for this internal rendering.

 Mike




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



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




RE: Openid integration?

2008-12-10 Thread David Leangen

Hi, Nino,

Sorry, I haven't been following this list daily lately. I probably should,
since I just sifted through 500 messags. Wow, this list is really active!

Anyway, I did say I'd get back to you once I completed my OpenID
integration, and I just completed it recently.


However, I'm not sure I can really be of much use to you. The fact is that I
had to pretty much redo everything in a custom way. As you know, I am
running Wicket in OSGi using pax-wicket. This really changes a lot of
things, especially the way I'm using Wicket. My solution will certainly not
be generally applicable, so I won't even bother trying.

In any case, the login process using OpenID is a little different from the
traditional process. I used a few tricks in Wicket to get this to work.
(I'm writing from [my bad] memory, so please bear with me...) If you recall,
when a user logs in, there is some exception thrown like
UnauthorizedInstantiationException or something. There is a handler that can
be registered for this.

The default flow looks something like this:

  Is the user authenticated?
 No: -- throw new RestartAtSomethingException( LoginPage.class )
 Yes: -- throw new SecurityExceptionOrSomethingLikeThat

What I did was add an extra step for OpenID:

  Is the user authenticated?
 No: -- throw new RestartAtSomethingException( LoginPage.class )

  Is the user registered?
 No: -- throw new RestartAtSomethingException( RegistrationPage.class )
 Yes: -- throw new SecurityExceptionOrSomethingLikeThat

This seems to work well. Sorry I don't remember the actual names. ;-)

As for the authentication stuff (I think you were posing a question about
this, too), I used my own custom implementation based on the UserAdmin
service. It works very well and is very flexible, but it did take a while to
build correctly.

There was a lot more to it, but I would say those were the main aspects. Oh,
forgot to mention that I used openid4java. It seems to work ok, except for
the fact that is depends on openxri, which does some crappy dynamic
instantiation of xml parsers (I say crappy because it's a hassle in an
OSGi environment).


If you think there is something general we could make out of this, I'd be
happy to work with you, but I think it would only apply for pax-wicket
users. I just don't see how this solution could work for general Wicket
users.


Cheers,
Dave




 -Original Message-
 From: Nino Saturnino Martinez Vazquez Wael
 [mailto:[EMAIL PROTECTED]
 Sent: 2 December 2008 04:31
 To: users@wicket.apache.org
 Subject: Openid integration?


 Hi Guys

 Have any of you tried to do a openid integration ?

 --
 -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]




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



RE: Create custom UrlCodingStrategy

2008-12-10 Thread David Leangen

Assuming I understand what you're asking for...

There is a solution, but that's about all I can say.

I can say this because I managed somehow to pull it off. However, it took a
lot of hacks to the wicket code, which I don't recommend to anybody.

[Just to make sure I understand, let me explain what I did. I essentially
have one Wicket instance that is able to manage several different
applications (that would normally each have their own Wicket instance). Each
app gets mounted on its own contextual path, so like you say below
http://localhost/myapp1, http://localhost/myapp2, and so on.]


I was told that v1.5 will have more customizable support, so I would suggest
that you try to wait until then, unless you want to suffer mental trauma the
way I have trying to live through this experience. ;-)


Cheers,
Dave



 -Original Message-
 From: Mathias P.W Nilsson [mailto:[EMAIL PROTECTED]
 Sent: 3 December 2008 22:20
 To: users@wicket.apache.org
 Subject: Re: Create custom UrlCodingStrategy



 Is there no solution to this?

 this is my app ( http://localhost/myapp ). All I want is to be
 able to have
 a customer name after myapp that follows in the application.
 --
 View this message in context:
 http://www.nabble.com/Create-custom-UrlCodingStrategy-tp20660813p2
 0812776.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: spring proxy for my model causes notSerializable exception

2008-12-10 Thread David Leangen

I just briefly scanned your message, but this did remind me of something.
Not sure if it's related or not...

As far as I could tell from the Wicket code, for some reason proxy classes
do not get serialized. I've been meaning to ask about this myself, as it's
been causing me problems.


Cheers,
Dave



 -Original Message-
 From: miro [mailto:[EMAIL PROTECTED]
 Sent: 8 December 2008 02:55
 To: users@wicket.apache.org
 Subject: spring proxy for my model causes notSerializable exception



 I am  creating a spring  proxy for my model before attaching it
 to the form
 and i get notserializable exception

 here is the code
   protected Object getproxy(){
   ProxyFactory factory = new ProxyFactory(new
 ReassignGrantsOfficerDTO());
   factory.addAdvisor(new WorkflowMetaDataAdvisor());
   factory.setProxyTargetClass(true);
   Advised  advised=(Advised)factory.getProxy();
   advised.setExposeProxy(true);
   System.out.println(advised instanceof  WorkflowMetaData );
   System.out.println(advised instanceof
 ReassignGrantsOfficerDTO );
   return  advised;
   }
private class ReassignGrantsOfficerForm  extends Form{

public ReassignGrantsOfficerForm() {
   super(reassignGrantsOfficerForm, new
 CompoundPropertyModel(getproxy()));


 here the exception

 - Error serializing object class
 gov.hhs.acf.web.pages.auditprog.ReassignGrantsOfficerPage [object=[Page
 class = gov.hhs.acf.web.pages.auditprog.ReassignGrantsOfficerPage, id = 3,
 version = 0]]
 org.apache.wicket.util.io.SerializableChecker$WicketNotSerializabl
 eException:
 Unable to serialize class:
 gov.hhs.acf.dto.ReassignGrantsOfficerDTO$$EnhancerByCGLIB$$4657904b
 Field hierarchy is:
   3 [class=gov.hhs.acf.web.pages.auditprog.ReassignGrantsOfficerPage,
 path=3]
 private java.lang.Object org.apache.wicket.MarkupContainer.children
 [class=[Ljava.lang.Object;]
   java.lang.Object org.apache.wicket.Component.data[2]
 [class=org.apache.wicket.markup.html.WebMarkupContainer,
 path=3:reassignGrantsOfficerContainer]
 private java.lang.Object
 org.apache.wicket.MarkupContainer.children
 [class=[Ljava.lang.Object;]
   private java.lang.Object
 org.apache.wicket.MarkupContainer.children[0]
 [class=gov.hhs.acf.web.pages.auditprog.ReassignGrantsOfficerPage$R
 eassignGrantsOfficerForm,
 path=3:reassignGrantsOfficerContainer:reassignGrantsOfficerForm]
 java.lang.Object org.apache.wicket.Component.data
 [class=org.apache.wicket.model.CompoundPropertyModel]
   private java.lang.Object
 org.apache.wicket.model.CompoundPropertyModel.target
 [class=gov.hhs.acf.dto.ReassignGrantsOfficerDTO$$EnhancerByCGLIB$$
 4657904b]
 - field that is not serializable
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:342)
   at
 org.apache.wicket.util.io.SerializableChecker.checkFields(Serializ
 ableChecker.java:610)
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:533)
   at
 org.apache.wicket.util.io.SerializableChecker.checkFields(Serializ
 ableChecker.java:610)
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:533)
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:388)
   at
 org.apache.wicket.util.io.SerializableChecker.checkFields(Serializ
 ableChecker.java:610)
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:533)
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:388)
   at
 org.apache.wicket.util.io.SerializableChecker.checkFields(Serializ
 ableChecker.java:610)
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:533)
   at
 org.apache.wicket.util.io.SerializableChecker.writeObjectOverride(
 SerializableChecker.java:678)
   at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
   at
 org.apache.wicket.util.io.IObjectStreamFactory$2.writeObjectOverri
 de(IObjectStreamFactory.java:125)
   at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
   at
 org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1091)
   at
 org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serial
 izePage(AbstractPageStore.java:197)
   at
 org.apache.wicket.protocol.http.pagestore.DiskPageStore.storePage(
 DiskPageStore.java:811)
   at
 org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$Secon
 dLevelCachePageMap.put(SecondLevelCacheSessionStore.java:332)
   at org.apache.wicket.Session.requestDetached(Session.java:1370)
   at org.apache.wicket.RequestCycle.detach(RequestCycle.java:1085)
   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1372)
   at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)

Form field (value) does not update after validation error

2008-12-10 Thread Rutger Jansen
Hi,

I have a strange situation in the admin part of my application which I
have reproduced in this tiny code example.

In this example I can load a value in the textfield by clicking the
link (which also increases the number to show that the link works ok).
I can post the form without problems and load the value again.
But when a validation error occurs (in this case when the posted value
is too long), the field will not be updated after pressing the link
(even though the log shows that the link is clicked), unless I post
the form again without validation errors.

Am I forgetting something here?


Rutger


--- Example page class---
public class Example extends WebPage {

  private String value;
  private int valueVersion = 1;

  public Example() {
Form form = new Form(form);

TextField textfield = new TextField(textfield, new
PropertyModel(Example.this, value));
textfield.add(StringValidator.maximumLength(15));
form.add(textfield);

add(form);
add(new FeedbackPanel(feedback));

add(new Link(link){
  @Override
  public void onClick() {
value = This is a test + valueVersion++;
  }
});
  }
}

--- Example html ---
html xmlns=http://www.w3.org/1999/xhtml;
xmlns:wicket=http://wicket.sourceforge.net/;
head/head
body
  div wicket:id=feedback /

  form wicket:id=form
input type=text wicket:id=textfield/
input type=submit /
  /form

  pa href=# wicket:id=linkLoad form value/a/p
/body
/html

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



How to stop the request processing and write to reponse

2008-12-10 Thread [EMAIL PROTECTED]

I badly need a way to stop the default request processing and responding back
to the client by writing response to the HttpResponse direclty.

I have a page say ProfilePage, in the page constructor on a certain
condition I want to write something to HttpResponse and stop further
processing and respond to the client.

How can i achieve this? 
-- 
View this message in context: 
http://www.nabble.com/How-to-stop-the-request-processing-and-write-to-reponse-tp20932098p20932098.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: Form field (value) does not update after validation error

2008-12-10 Thread Bruno Borges
Solution: remove the FormValidation =)
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, Dec 10, 2008 at 9:34 AM, Martijn Dashorst 
[EMAIL PROTECTED] wrote:

 Why on earth would you want to update a model value when there's a
 validation error in the input? That is the whole point of validation!

 Martijn

 On Wed, Dec 10, 2008 at 10:44 AM, Rutger Jansen [EMAIL PROTECTED] wrote:
  Hi,
 
  I have a strange situation in the admin part of my application which I
  have reproduced in this tiny code example.
 
  In this example I can load a value in the textfield by clicking the
  link (which also increases the number to show that the link works ok).
  I can post the form without problems and load the value again.
  But when a validation error occurs (in this case when the posted value
  is too long), the field will not be updated after pressing the link
  (even though the log shows that the link is clicked), unless I post
  the form again without validation errors.
 
  Am I forgetting something here?
 
 
  Rutger
 
 
  --- Example page class---
  public class Example extends WebPage {
 
   private String value;
   private int valueVersion = 1;
 
   public Example() {
 Form form = new Form(form);
 
 TextField textfield = new TextField(textfield, new
  PropertyModel(Example.this, value));
 textfield.add(StringValidator.maximumLength(15));
 form.add(textfield);
 
 add(form);
 add(new FeedbackPanel(feedback));
 
 add(new Link(link){
   @Override
   public void onClick() {
 value = This is a test + valueVersion++;
   }
 });
   }
  }
 
  --- Example html ---
  html xmlns=http://www.w3.org/1999/xhtml;
  xmlns:wicket=http://wicket.sourceforge.net/;
  head/head
  body
   div wicket:id=feedback /
 
   form wicket:id=form
 input type=text wicket:id=textfield/
 input type=submit /
   /form
 
   pa href=# wicket:id=linkLoad form value/a/p
  /body
  /html
 
  -
  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: Form field (value) does not update after validation error

2008-12-10 Thread Martijn Dashorst
Why on earth would you want to update a model value when there's a
validation error in the input? That is the whole point of validation!

Martijn

On Wed, Dec 10, 2008 at 10:44 AM, Rutger Jansen [EMAIL PROTECTED] wrote:
 Hi,

 I have a strange situation in the admin part of my application which I
 have reproduced in this tiny code example.

 In this example I can load a value in the textfield by clicking the
 link (which also increases the number to show that the link works ok).
 I can post the form without problems and load the value again.
 But when a validation error occurs (in this case when the posted value
 is too long), the field will not be updated after pressing the link
 (even though the log shows that the link is clicked), unless I post
 the form again without validation errors.

 Am I forgetting something here?


 Rutger


 --- Example page class---
 public class Example extends WebPage {

  private String value;
  private int valueVersion = 1;

  public Example() {
Form form = new Form(form);

TextField textfield = new TextField(textfield, new
 PropertyModel(Example.this, value));
textfield.add(StringValidator.maximumLength(15));
form.add(textfield);

add(form);
add(new FeedbackPanel(feedback));

add(new Link(link){
  @Override
  public void onClick() {
value = This is a test + valueVersion++;
  }
});
  }
 }

 --- Example html ---
 html xmlns=http://www.w3.org/1999/xhtml;
 xmlns:wicket=http://wicket.sourceforge.net/;
 head/head
 body
  div wicket:id=feedback /

  form wicket:id=form
input type=text wicket:id=textfield/
input type=submit /
  /form

  pa href=# wicket:id=linkLoad form value/a/p
 /body
 /html

 -
 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: Asynchron push/update/redirect

2008-12-10 Thread Michael Sparer

take a look at wicketstuff-push or wicketstuff-dojo-1.1. (which also includes
cometd that provides your desired push behaviour)

regards,
Michael


alexander.elsholz wrote:
 
 Hi,
 
 i need a possibility to refresh parts of view, when data on the server
 changed. there is no synchron ajax-event, where i can use the
 requesttarget, because i use a thread to ask an other service for the
 result.
 
 actually i use the ajaxSelfUpdateBehavior, but i think its too much
 traffic.
 
 also i want to switch the side in a asynchron event. when the event is
 occured i want to redirect the user to previews page. here i can also use
 a modal window, which displays two buttons (yes i want and no, i won't)
 
 thanks alex
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/Asynchron-push-update-redirect-tp20934629p20935238.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]



junit testing wicket with spring and hibernate

2008-12-10 Thread Per-Olof Wallin
Hi

I am using Wicket with Spring and Hibernate. I am using Eclipse as IDE and
Maven 2 as build tool.
This is working fine.

Now, I want to use JUnit for unit testing. This is where I have some
problems.

1. I have set up a test specific spring context file in src/test/resources.
This should be copied to target/test-classes/.
If I do a build in Eclipse, this is done. However, when I do a Maven install
the resource files are not copied to the test-classes directory.
As I understand this should be done by default by maven.
Any suggestions?

2. Even if I get 1 above working (such as by just having Eclipse build
first) I still get an error with spring:
java.lang.IllegalStateException: No WebApplicationContext found: no
ContextLoaderListener registered?
I might have set things up wrong, I've used a Struts 2 project as template
and this might have something to do with it.
What I basically want is a setup where I can test (using junit) an
application with wicket, spring, hibernate (and a hibernate's in-memory
database, hsqldb).
The spring context for the tests should be different from the real spring
context.
Some help on this would be greatly appreciated.

Best regards,

Per-Olof Vallin


Re: Openid integration?

2008-12-10 Thread Nino Saturnino Martinez Vazquez Wael



David Leangen wrote:

Hi, Nino,

Sorry, I haven't been following this list daily lately. I probably should,
since I just sifted through 500 messags. Wow, this list is really active!
  
Yeah, it's really knocking away :) So much that it really feels silent 
on other forums..

Anyway, I did say I'd get back to you once I completed my OpenID
integration, and I just completed it recently.
  

Ahh great.


However, I'm not sure I can really be of much use to you. The fact is that I
had to pretty much redo everything in a custom way. As you know, I am
running Wicket in OSGi using pax-wicket. This really changes a lot of
things, especially the way I'm using Wicket. My solution will certainly not
be generally applicable, so I won't even bother trying.
  

no problem.

In any case, the login process using OpenID is a little different from the
traditional process. I used a few tricks in Wicket to get this to work.
(I'm writing from [my bad] memory, so please bear with me...) If you recall,
when a user logs in, there is some exception thrown like
UnauthorizedInstantiationException or something. There is a handler that can
be registered for this.

The default flow looks something like this:

  Is the user authenticated?
 No: -- throw new RestartAtSomethingException( LoginPage.class )
 Yes: -- throw new SecurityExceptionOrSomethingLikeThat

What I did was add an extra step for OpenID:

  Is the user authenticated?
 No: -- throw new RestartAtSomethingException( LoginPage.class )

  Is the user registered?
 No: -- throw new RestartAtSomethingException( RegistrationPage.class )
 Yes: -- throw new SecurityExceptionOrSomethingLikeThat

This seems to work well. Sorry I don't remember the actual names. ;-)
  

No problem, I have this part working.

As for the authentication stuff (I think you were posing a question about
this, too), I used my own custom implementation based on the UserAdmin
service. It works very well and is very flexible, but it did take a while to
build correctly.

There was a lot more to it, but I would say those were the main aspects. Oh,
forgot to mention that I used openid4java. It seems to work ok, except for
the fact that is depends on openxri, which does some crappy dynamic
instantiation of xml parsers (I say crappy because it's a hassle in an
OSGi environment).
  

Yeah I saw your post on openid4java list.


If you think there is something general we could make out of this, I'd be
happy to work with you, but I think it would only apply for pax-wicket
users. I just don't see how this solution could work for general Wicket
users.
  
Hmm, I do actually have something working, which seems to be really 
simple. Using openid4java, my only problem are that I cant seem to get 
any openid providers to give me the requested attributes, like email and 
name. How did you solve this?


Cheers,
Dave




  

-Original Message-
From: Nino Saturnino Martinez Vazquez Wael
[mailto:[EMAIL PROTECTED]
Sent: 2 December 2008 04:31
To: users@wicket.apache.org
Subject: Openid integration?


Hi Guys

Have any of you tried to do a openid integration ?

--
-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]






-
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: Form field (value) does not update after validation error

2008-12-10 Thread Gerolf Seitz
don't know if i totally understood the setting of your example, but
your edit button shouldn't submit/post the form, eg. just use  a Link
attached to an input type=button tag instead of a Button.

  Gerolf

On Wed, Dec 10, 2008 at 1:11 PM, Rutger Jansen [EMAIL PROTECTED] wrote:

 Well this is of course a simple example.
 In my case I have an administration page with a list of domain
 objects, lets say cheeses (how did I come up with that idea?).

 On the same page I have a form with all fields of the cheese object
 (name and kiloPrice for example). Behind each cheese in the list there
 is an  'edit' button which will set that specific cheese object as a
 the current model object in the form, which results in the name and
 kiloPrice field in the form being filled with the values of the
 cheese.

 If then, for some reason the validation of a form post fails (the
 price is too high for this Gouda), and I (as an end user) decide to
 skip editing this Gouda cheese and press the edit button of the
 Cheddar cheese, the form will not be updated with the name and price
 of the Cheddar. The values of the Gouda remain. Even though the
 current object in the model was updated to Cheddar.

 When I now press the submit button again (after putting a correct
 price in the field), the Cheddar object is updated with the values of
 the Gouda (which were still in the formfields).

 I can make a bigger example like this if needed.


 On 12/10/08, Martijn Dashorst [EMAIL PROTECTED] wrote:
  Why on earth would you want to update a model value when there's a
  validation error in the input? That is the whole point of validation!
 
  Martijn
 
  On Wed, Dec 10, 2008 at 10:44 AM, Rutger Jansen [EMAIL PROTECTED]
 wrote:
  Hi,
 
  I have a strange situation in the admin part of my application which I
  have reproduced in this tiny code example.
 
  In this example I can load a value in the textfield by clicking the
  link (which also increases the number to show that the link works ok).
  I can post the form without problems and load the value again.
  But when a validation error occurs (in this case when the posted value
  is too long), the field will not be updated after pressing the link
  (even though the log shows that the link is clicked), unless I post
  the form again without validation errors.
 
  Am I forgetting something here?
 
 
  Rutger
 
 
  --- Example page class---
  public class Example extends WebPage {
 
   private String value;
   private int valueVersion = 1;
 
   public Example() {
 Form form = new Form(form);
 
 TextField textfield = new TextField(textfield, new
  PropertyModel(Example.this, value));
 textfield.add(StringValidator.maximumLength(15));
 form.add(textfield);
 
 add(form);
 add(new FeedbackPanel(feedback));
 
 add(new Link(link){
   @Override
   public void onClick() {
 value = This is a test + valueVersion++;
   }
 });
   }
  }
 
  --- Example html ---
  html xmlns=http://www.w3.org/1999/xhtml;
  xmlns:wicket=http://wicket.sourceforge.net/;
  head/head
  body
   div wicket:id=feedback /
 
   form wicket:id=form
 input type=text wicket:id=textfield/
 input type=submit /
   /form
 
   pa href=# wicket:id=linkLoad form value/a/p
  /body
  /html
 
  -
  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: junit testing wicket with spring and hibernate

2008-12-10 Thread Nino Saturnino Martinez Vazquez Wael

Hi Per-Olof

You should checkout Wicket 
Iolite(http://wicketstuff.org/confluence/display/STUFFWIKI/Wicket-Iolite), 
or WicketTopia(http://wicketopia.sourceforge.net/). Both uses this 
technique and has a snappy archetype for a swift start. The latter has 
builtin profiles for misc conf-files using maven. And if you grab the 
testing part from Wicket Iolite, you'll have what you want with 
WicketTopia.. The heres the idea, although below are very rough and it's 
much nicer in Wicket Iolite:



package zeuzgroup.application.test;

import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
import 
org.apache.wicket.spring.injection.annot.test.AnnotApplicationContextMock;

import org.apache.wicket.util.tester.WicketTester;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.jpa.AbstractJpaTests;

import zeuzgroup.application.ZeuzGroupApplication;
import zeuzgroup.core.localization.ITranslationService;
import zeuzgroup.core.provider.IDBDao;
import zeuzgroup.core.provider.TestFixtureProvider;

public abstract class BaseTest extends AbstractJpaTests {

   protected WicketTester wicketTester;

   protected IDBDao dbProvider;

   protected TestFixtureProvider testFixtureProvider = new 
TestFixtureProvider();


   protected ITranslationService translations;

   @Override
   protected String[] getConfigLocations() {
   return new String[] { classpath:applicationContext.xml };
   }

   protected BaseTest() {
   super();

   setDependencyCheck(false);

   // To make inherited properties (like
   // DataSource) not required.
   }

   @Override
   protected void onSetUpBeforeTransaction() throws Exception {

   super.onSetUpBeforeTransaction();
   readyStuff();

   }

   @Override
   protected boolean shouldUseShadowLoader() {
   return false;
   }

   private void readyStuff() {
   ApplicationContext appcxt = new ClassPathXmlApplicationContext(
   applicationContext.xml);
   dbProvider = (IDBDao) appcxt.getBean(dBDao);
   // 2. setup mock injection environment
   AnnotApplicationContextMock appctx = new 
AnnotApplicationContextMock();

   appctx.putBean(dBDao, dbProvider);
   appctx.putBean(translations, translations);

   ZeuzGroupApplication zeuzGroupApplication = new 
ZeuzGroupApplication();

   zeuzGroupApplication
   .setSpringComponentInjector(new SpringComponentInjector(
   zeuzGroupApplication, appctx));
   wicketTester = new WicketTester(zeuzGroupApplication);

   }

   protected IDBDao getAllInOneDao() {

   return dbProvider;

   }

   public IDBDao getDbDao() {
   return dbProvider;
   }

   @Required
   public void setDbProvider(IDBDao dbProvider) {
   this.dbProvider = dbProvider;
   testFixtureProvider.setDbProvider(dbProvider);
   }


}




Per-Olof Wallin wrote:

Hi

I am using Wicket with Spring and Hibernate. I am using Eclipse as IDE and
Maven 2 as build tool.
This is working fine.

Now, I want to use JUnit for unit testing. This is where I have some
problems.

1. I have set up a test specific spring context file in src/test/resources.
This should be copied to target/test-classes/.
If I do a build in Eclipse, this is done. However, when I do a Maven install
the resource files are not copied to the test-classes directory.
As I understand this should be done by default by maven.
Any suggestions?

2. Even if I get 1 above working (such as by just having Eclipse build
first) I still get an error with spring:
java.lang.IllegalStateException: No WebApplicationContext found: no
ContextLoaderListener registered?
I might have set things up wrong, I've used a Struts 2 project as template
and this might have something to do with it.
What I basically want is a setup where I can test (using junit) an
application with wicket, spring, hibernate (and a hibernate's in-memory
database, hsqldb).
The spring context for the tests should be different from the real spring
context.
Some help on this would be greatly appreciated.

Best regards,

Per-Olof Vallin

  


--
-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: Form field (value) does not update after validation error

2008-12-10 Thread Rutger Jansen
Sorry for the misunderstanding. But it's not a submit button, just a
link for editing. The onSubmit is not called there.

The form also has a button that does submit the form.

I see in debug mode that the link is correctly called and that the
model object is correctly updated, also when problem occurs after the
validation error.

On 12/10/08, Gerolf Seitz [EMAIL PROTECTED] wrote:
 don't know if i totally understood the setting of your example, but
 your edit button shouldn't submit/post the form, eg. just use  a Link
 attached to an input type=button tag instead of a Button.

   Gerolf

 On Wed, Dec 10, 2008 at 1:11 PM, Rutger Jansen [EMAIL PROTECTED] wrote:

 Well this is of course a simple example.
 In my case I have an administration page with a list of domain
 objects, lets say cheeses (how did I come up with that idea?).

 On the same page I have a form with all fields of the cheese object
 (name and kiloPrice for example). Behind each cheese in the list there
 is an  'edit' button which will set that specific cheese object as a
 the current model object in the form, which results in the name and
 kiloPrice field in the form being filled with the values of the
 cheese.

 If then, for some reason the validation of a form post fails (the
 price is too high for this Gouda), and I (as an end user) decide to
 skip editing this Gouda cheese and press the edit button of the
 Cheddar cheese, the form will not be updated with the name and price
 of the Cheddar. The values of the Gouda remain. Even though the
 current object in the model was updated to Cheddar.

 When I now press the submit button again (after putting a correct
 price in the field), the Cheddar object is updated with the values of
 the Gouda (which were still in the formfields).

 I can make a bigger example like this if needed.


 On 12/10/08, Martijn Dashorst [EMAIL PROTECTED] wrote:
  Why on earth would you want to update a model value when there's a
  validation error in the input? That is the whole point of validation!
 
  Martijn
 
  On Wed, Dec 10, 2008 at 10:44 AM, Rutger Jansen [EMAIL PROTECTED]
 wrote:
  Hi,
 
  I have a strange situation in the admin part of my application which I
  have reproduced in this tiny code example.
 
  In this example I can load a value in the textfield by clicking the
  link (which also increases the number to show that the link works ok).
  I can post the form without problems and load the value again.
  But when a validation error occurs (in this case when the posted value
  is too long), the field will not be updated after pressing the link
  (even though the log shows that the link is clicked), unless I post
  the form again without validation errors.
 
  Am I forgetting something here?
 
 
  Rutger
 
 
  --- Example page class---
  public class Example extends WebPage {
 
   private String value;
   private int valueVersion = 1;
 
   public Example() {
 Form form = new Form(form);
 
 TextField textfield = new TextField(textfield, new
  PropertyModel(Example.this, value));
 textfield.add(StringValidator.maximumLength(15));
 form.add(textfield);
 
 add(form);
 add(new FeedbackPanel(feedback));
 
 add(new Link(link){
   @Override
   public void onClick() {
 value = This is a test + valueVersion++;
   }
 });
   }
  }
 
  --- Example html ---
  html xmlns=http://www.w3.org/1999/xhtml;
  xmlns:wicket=http://wicket.sourceforge.net/;
  head/head
  body
   div wicket:id=feedback /
 
   form wicket:id=form
 input type=text wicket:id=textfield/
 input type=submit /
   /form
 
   pa href=# wicket:id=linkLoad form value/a/p
  /body
  /html
 
  -
  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: TinyMCE init method rendering twice

2008-12-10 Thread jchappelle

That works perfectly! Thanks for all your help.


pointbreak+wicketstuff wrote:
 
 Yes, it looks like TinyMceSettings does not have methods to remove the
 toolbars. I'll add those as soon as TeamCity deploys jars again... But
 you could work around that by adding a method overload for
 toJavaScript() to your custom MyTinyMceSettings, something like:
 
 public String toJavaScript(Mode mode, CollectionComponent
 components) {
 StringBuffer buffer = new StringBuffer(super.toJavaScript(mode,
 components));
 buffer.append(,\n\ttheme_advanced_buttons2: \\);
 buffer.append(,\n\ttheme_advanced_buttons3: \\);
 return buffer.toString();
 }
 
 Then you can also remove most of your disableButton calls. Or use the
 simple theme instead.
 
 
 On Tue, 9 Dec 2008 14:06:54 -0800 (PST), jchappelle
 [EMAIL PROTECTED] wrote:
 
 I downloaded the latest snapshot from the wicket-stuff repository and did
 the
 setStatusbarLocation(null) and that fixed that problem. However, now I
 have
 three toolbars in the top instead of one. All of my buttons are on the
 top
 toolbar but underneath it is two others that only have separators in them
 so
 it looks pretty weird. Here is my custom settings class:
 
 public class MyTinyMceSettings extends TinyMCESettings
 {
  private static final long serialVersionUID = 1L;
 
  public MyTinyMceSettings ()
  {
  super(TinyMCESettings.Theme.advanced);
  
 add(TinyMCESettings.bullist, TinyMCESettings.Toolbar.first,
 TinyMCESettings.Position.after);
 add(TinyMCESettings.numlist, TinyMCESettings.Toolbar.first,
 TinyMCESettings.Position.after);
 
 disableButton(TinyMCESettings.styleselect);
 disableButton(TinyMCESettings.sub);
 disableButton(TinyMCESettings.sup);
 disableButton(TinyMCESettings.charmap);
 disableButton(TinyMCESettings.image);
 disableButton(TinyMCESettings.anchor);
 disableButton(TinyMCESettings.help);
 disableButton(TinyMCESettings.code);
 disableButton(TinyMCESettings.link);
 disableButton(TinyMCESettings.unlink);
 disableButton(TinyMCESettings.formatselect);
 disableButton(TinyMCESettings.indent);
 disableButton(TinyMCESettings.outdent);
 disableButton(TinyMCESettings.undo);
 disableButton(TinyMCESettings.redo);
 disableButton(TinyMCESettings.cleanup);
 disableButton(TinyMCESettings.hr);
 disableButton(TinyMCESettings.visualaid);
 disableButton(TinyMCESettings.separator);
 disableButton(TinyMCESettings.formatselect);
 disableButton(TinyMCESettings.removeformat);
 
 setToolbarAlign(TinyMCESettings.Align.left);
 setToolbarLocation(TinyMCESettings.Location.top);
 setStatusbarLocation(null);
 setVerticalResizing(true);
 setHorizontalResizing(true);
  }
 }
  Any idea of how to remove those toolbars?
 
 Thanks,
 
 Josh
 
 
 pointbreak+wicketstuff wrote:
  
  You seem to be using an old version of tinymce. AFAIK, the latest
  version does not use mode: specific_textareas, but mode: exact in
  the tinyMCE.init call. Update to the latest version, and you should be
  fine I guess.
  
  You can remove the statusbar via
  TinyMceSettings.setStatusbarLocation(null) (which by the way is the
  default). See
  http://wiki.moxiecode.com/index.php/TinyMCE:Configuration#Layout for a
  comprehensive list and documentation on all available options.
  
  
  On Mon, 8 Dec 2008 10:45:40 -0800 (PST), jchappelle
  [EMAIL PROTECTED] wrote:
  
  I have a TinyMCE component in one of my pages and I am trying to
 remove
  the
  Path: toolbar at the bottom. I have noticed that the init method
  renders
  on my page twice. I only have one textarea on my page and I am adding
 a
  custom TinyMceBehavior to it. I am trying to disable the visualaid
  button(i
  assume that is how you remove the Path: at the bottom). On one of the
  init
  methods rendered it has that button disabled and on the other one it
  doesn't. I wonder if that could be causing it. Here is part of the
 html
  rendered:
  
  tinyMCE.init({
mode : specific_textareas,
editor_selector : 70fa4bd0-497a-4eb3-8de5-a3fbc13bedf3,
theme : advanced,
language : en,
plugins : contextmenu, save, paste, searchreplace, insertdatetime,
  preview, zoom, table, emotions, iespell, flash, print, directionality,
  fullscreen,
theme_advanced_buttons1_add_before : save, newdocument, separator,
theme_advanced_buttons1_add : fontselect, fontsizeselect,
theme_advanced_buttons2_add_before: cut, copy, paste, pastetext,
  pasteword, separator, search, replace, separator,
theme_advanced_buttons2_add : separator, inserttime, insertdate,
  separator, preview, zoom, separator, forecolor, backcolor,
theme_advanced_buttons3_add_before : tablecontrols,
theme_advanced_buttons3_add : emotions, iespell, flash, 

Adding buttons to a DataTable

2008-12-10 Thread Steve Flasby

Chaps, I am trying to add a button to a DataTable.
Sadly, the button is rendered as text saying   [cell]

Is this expected behavior?   If it is then I guess I need to wrap my 
button in a Panel to make it work or is there another even simpler solution.



Code extract follows:

ListIColumnPerson columns = new ArrayListIColumnPerson();
columns.add(new PropertyColumnPerson(new ModelString(id), id)); 
columns.add(new AbstractColumnPerson(new ModelString(select)){
  @Override
public void populateItem(ItemICellPopulatorPerson item,
String componentId, IModelPerson rowModel) {
item.add(new Button(componentId,
new StringModel(Select) ){
@Override
public void onSubmit() {
System.out.println( **);
}
});
}
}); 
form.add( new DataTablePerson(
table, columns, new SortableDataProviderPerson() {
...


Thanks in advance - Steve

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



Re: Adding buttons to a DataTable

2008-12-10 Thread James Carman
You could use a Fragment.

On Wed, Dec 10, 2008 at 10:26 AM, Steve Flasby [EMAIL PROTECTED] wrote:
 Chaps, I am trying to add a button to a DataTable.
 Sadly, the button is rendered as text saying   [cell]

 Is this expected behavior?   If it is then I guess I need to wrap my button
 in a Panel to make it work or is there another even simpler solution.


 Code extract follows:

 ListIColumnPerson columns = new ArrayListIColumnPerson();
 columns.add(new PropertyColumnPerson(new ModelString(id), id));
 columns.add(new AbstractColumnPerson(new ModelString(select)){
  @Override
public void populateItem(ItemICellPopulatorPerson item,
String componentId, IModelPerson rowModel) {
item.add(new Button(componentId,
new StringModel(Select) ){
@Override
public void onSubmit() {
System.out.println( **);
}
});
}
 });
 form.add( new DataTablePerson(
table, columns, new SortableDataProviderPerson() {
 ...


 Thanks in advance - Steve

 -
 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]



JRPdfResource File not found error when using IE6

2008-12-10 Thread lizz

I am creating a (jasper) pdf file using JRPdfResource in a JasperLink. This
works fine in Firefox and Internet Explorer 7, but when I use Internet
Explorer 6 I get an error message saying There was an error opening the
document. The file cannot be found..

I also have an Excel link using JRXlsResource but this one works fine for
all 3 browsers. 

Doesn anyone know why this happens?

Thanks :-)
-- 
View this message in context: 
http://www.nabble.com/JRPdfResource-File-not-found-error-when-using-IE6-tp20937848p20937848.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: Using Wicket Pages for an Internal Request

2008-12-10 Thread Jeremy Thomerson
Sorry - I'm travelling and I couldn't remember at the time and didn't have
the time to search right then.  I think those threads Ernesto gave should be
helpful.

On Wed, Dec 10, 2008 at 2:49 AM, Ernesto Reinaldo Barreiro 
[EMAIL PROTECTED] wrote:

 Hope this helps...


 http://www.nabble.com/Use-wicket-page-templates-not-for-webapplication-td19173648.html


 http://cwiki.apache.org/confluence/display/WICKET/FAQs#FAQs-HowcanIrendermytemplatestoaString%3F
 http://cwiki.apache.org/WICKET/use-wicket-as-template-engine.html

 Ernesto

 On Wed, Dec 10, 2008 at 7:31 AM, Mike Papper [EMAIL PROTECTED] wrote:

  Hi,
 
  thanks for that  - I did search the archives and found nothing...is there
 a
  name for this that you know of - such that I could use it in the
 search? I
  think I was calling it internal redirect.
 
  Mike
 
 
  On Dec 9, 2008, at 10:16 PM, Jeremy Thomerson wrote:
 
   Search around in the mail archives - the typical solution involves using
  WicketTester.
 
  On Tue, Dec 9, 2008 at 8:06 PM, Mike Papper [EMAIL PROTECTED] wrote:
 
   Hi, very new to Wicket and this list...
 
  so I'm wondering if anyone can tell me if the following is possible and
  approx. how-to?
 
  Overview: we have a wicket page that generates some html+javascript
 etc.
  We
  want to render this page from within the application (into a String)
 and
  send it to some other web service (such as Facebook). We currently use
  httpclient to make a http request back to our server and take the
  response
  and munge it. The overhead of the extra request is an unsatisfactory
 load
  on
  our servers.
 
  Is there a way to make to mimic an 'internal' servlet/web request and
  take
  that response (or at least the rendering of the Page) but do not affect
  the
  state of the current (external) http request? We tried using
 MockServlet
  with the WicketFilter but when the intenral request was finished it
  seemed
  to alter the state of the original request (such that the session went
  away
  and the response was invalid - I think the original response had been
  generated from the contents of the mock request/response). Even if this
  could be fixed...theres more:
 
  An additional constraint is to call this 'internal request' from
 anywhere
  in
  the code and not necessarily within a http request (i.e., from a Quartz
  thread). So, we may not have any WicketApplication ...If it is the case
  that
  we can only gert our hands on the WicketApplication from a thread that
 is
  part of a http request, then the quartz thread willnot have acces to
  WicketApplication (I am unsure about this).
 
  Looking around in the docs, I came across the RequestCycle and
 wondering
  if
  thats how I can do this?
 
  Any pointer for this would be appreciated - it would be a shame not to
 be
  able to use Wicket for this internal rendering.
 
  Mike
 
 
 
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 




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


NPE when redeploying

2008-12-10 Thread Adriano dos Santos Fernandes

Hi!

With Eclipse+Tomcat, that problems happens often when redeploying an 
application.


Is it something that can be fixed? I'm using 1.4-rc1.

Adriano

WicketMessage: Exception in rendering component: [MarkupContainer 
[Component id = _header_0]]


Root cause:

java.lang.NullPointerException at 
java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768) 
at 
org.apache.wicket.markup.MarkupCache$DefaultCacheImplementation.get(MarkupCache.java:738) 
at 
org.apache.wicket.markup.MarkupCache.removeMarkup(MarkupCache.java:130) 
at org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:485) 
at 
org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:553) 
at org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:319) 
at 
org.apache.wicket.markup.MarkupCache.getMarkupStream(MarkupCache.java:215) 
at 
org.apache.wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:354) 
at 
org.apache.wicket.markup.html.ContainerWithAssociatedMarkupHelper.renderHeadFromAssociatedMarkupFile(ContainerWithAssociatedMarkupHelper.java:72) 
at 
org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.renderHeadFromAssociatedMarkupFile(WebMarkupContainerWithAssociatedMarkup.java:73) 
at org.apache.wicket.markup.html.panel.Panel.renderHead(Panel.java:137) 
at 
org.apache.wicket.markup.html.internal.HtmlHeaderContainer$1.component(HtmlHeaderContainer.java:223) 
at 
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:859) 
at 
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:874) 
at 
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:874) 
at 
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:874) 
at 
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:874) 
at 
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:874) 
at 
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:874) 
at 
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:899) 
at 
org.apache.wicket.markup.html.internal.HtmlHeaderContainer.renderHeaderSections(HtmlHeaderContainer.java:214) 
at 
org.apache.wicket.markup.html.internal.HtmlHeaderContainer.onComponentTagBody(HtmlHeaderContainer.java:138) 
at org.apache.wicket.Component.renderComponent(Component.java:2525) at 
org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1504) at 
org.apache.wicket.Component.render(Component.java:2361) at 
org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:232) at 
org.apache.wicket.markup.resolver.HtmlHeaderResolver.resolve(HtmlHeaderResolver.java:78) 
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414) 
at 
org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1520) 
at org.apache.wicket.Page.onRender(Page.java:1502) at 
org.apache.wicket.Component.render(Component.java:2361) at 
org.apache.wicket.Page.renderPage(Page.java:906) at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:249) 
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104) 
at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1194) 
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1265) at 
org.apache.wicket.RequestCycle.steps(RequestCycle.java:1366) at 
org.apache.wicket.RequestCycle.request(RequestCycle.java:498) at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:444) 
at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282) 
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)


Complete stack:

org.apache.wicket.WicketRuntimeException: Exception in rendering 
component: [MarkupContainer [Component id = _header_0]] at 
org.apache.wicket.Component.renderComponent(Component.java:2564) at 
org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1504) at 

Re: Switchable panel via select ajax

2008-12-10 Thread Sven Meier
Why don't you just replace the current panel depending on a selection in 
your select field, see:


MarkupContainer#addOrReplace(Component)

Much easier than tinkering with the internals of Wicket's rendering.

Sven

Александър Шопов schrieb:

Hi guys,
I was wondering of a good strategy of making a panel that is changed via
ajax by a select field.
I was aiming at easy maintainability of the code, and thought of the
following.

+-+-++---+
|typeOfPan|V||   |
+-+-+|   Panel   |
 |   |
 +---+

I add an Ajax Behaviour to typeOfPan. The target of updating will
contain the second panel.
I have several versions of the Panel - for example one with text input
fields, several with selects and probably more in the future.
In the page I add a normal Panel. However I overload its onComponentTag,
onComponentTagBody, renderHead and delegate them to those of the real
panel that has the real components. I switch the real panel based on the
selection of typeOfPan. All of the panels are constructed with the same
id, however, just one of them is added to the page.
Will such a strategy actually work? I will be experimenting today,
however two things can be tricky - the id's in html of the real panels -
since they have never been added properly to the page and the second is
the real html that will be used to render the panel. Will that be the
one from the delegating panel or that of the real implementations?
I'd really like to separate the panels - each with its own code and html
and be able to switch between them, so if there is a better (or in fact
other working way) comments would be welcome.

Kind regards:
al_shopov


-
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: spring proxy for my model causes notSerializable exception

2008-12-10 Thread Igor Vaynberg
that used to happen only if you used wicket's special serializer. it
was the default one for a little while, but is not default any longer.

-igor

On Wed, Dec 10, 2008 at 1:19 AM, David Leangen [EMAIL PROTECTED] wrote:

 I just briefly scanned your message, but this did remind me of something.
 Not sure if it's related or not...

 As far as I could tell from the Wicket code, for some reason proxy classes
 do not get serialized. I've been meaning to ask about this myself, as it's
 been causing me problems.


 Cheers,
 Dave



 -Original Message-
 From: miro [mailto:[EMAIL PROTECTED]
 Sent: 8 December 2008 02:55
 To: users@wicket.apache.org
 Subject: spring proxy for my model causes notSerializable exception



 I am  creating a spring  proxy for my model before attaching it
 to the form
 and i get notserializable exception

 here is the code
   protected Object getproxy(){
   ProxyFactory factory = new ProxyFactory(new
 ReassignGrantsOfficerDTO());
   factory.addAdvisor(new WorkflowMetaDataAdvisor());
   factory.setProxyTargetClass(true);
   Advised  advised=(Advised)factory.getProxy();
   advised.setExposeProxy(true);
   System.out.println(advised instanceof  WorkflowMetaData );
   System.out.println(advised instanceof
 ReassignGrantsOfficerDTO );
   return  advised;
   }
private class ReassignGrantsOfficerForm  extends Form{

public ReassignGrantsOfficerForm() {
   super(reassignGrantsOfficerForm, new
 CompoundPropertyModel(getproxy()));


 here the exception

 - Error serializing object class
 gov.hhs.acf.web.pages.auditprog.ReassignGrantsOfficerPage [object=[Page
 class = gov.hhs.acf.web.pages.auditprog.ReassignGrantsOfficerPage, id = 3,
 version = 0]]
 org.apache.wicket.util.io.SerializableChecker$WicketNotSerializabl
 eException:
 Unable to serialize class:
 gov.hhs.acf.dto.ReassignGrantsOfficerDTO$$EnhancerByCGLIB$$4657904b
 Field hierarchy is:
   3 [class=gov.hhs.acf.web.pages.auditprog.ReassignGrantsOfficerPage,
 path=3]
 private java.lang.Object org.apache.wicket.MarkupContainer.children
 [class=[Ljava.lang.Object;]
   java.lang.Object org.apache.wicket.Component.data[2]
 [class=org.apache.wicket.markup.html.WebMarkupContainer,
 path=3:reassignGrantsOfficerContainer]
 private java.lang.Object
 org.apache.wicket.MarkupContainer.children
 [class=[Ljava.lang.Object;]
   private java.lang.Object
 org.apache.wicket.MarkupContainer.children[0]
 [class=gov.hhs.acf.web.pages.auditprog.ReassignGrantsOfficerPage$R
 eassignGrantsOfficerForm,
 path=3:reassignGrantsOfficerContainer:reassignGrantsOfficerForm]
 java.lang.Object org.apache.wicket.Component.data
 [class=org.apache.wicket.model.CompoundPropertyModel]
   private java.lang.Object
 org.apache.wicket.model.CompoundPropertyModel.target
 [class=gov.hhs.acf.dto.ReassignGrantsOfficerDTO$$EnhancerByCGLIB$$
 4657904b]
 - field that is not serializable
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:342)
   at
 org.apache.wicket.util.io.SerializableChecker.checkFields(Serializ
 ableChecker.java:610)
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:533)
   at
 org.apache.wicket.util.io.SerializableChecker.checkFields(Serializ
 ableChecker.java:610)
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:533)
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:388)
   at
 org.apache.wicket.util.io.SerializableChecker.checkFields(Serializ
 ableChecker.java:610)
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:533)
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:388)
   at
 org.apache.wicket.util.io.SerializableChecker.checkFields(Serializ
 ableChecker.java:610)
   at
 org.apache.wicket.util.io.SerializableChecker.check(SerializableCh
 ecker.java:533)
   at
 org.apache.wicket.util.io.SerializableChecker.writeObjectOverride(
 SerializableChecker.java:678)
   at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
   at
 org.apache.wicket.util.io.IObjectStreamFactory$2.writeObjectOverri
 de(IObjectStreamFactory.java:125)
   at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
   at
 org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1091)
   at
 org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serial
 izePage(AbstractPageStore.java:197)
   at
 org.apache.wicket.protocol.http.pagestore.DiskPageStore.storePage(
 DiskPageStore.java:811)
   at
 org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$Secon
 dLevelCachePageMap.put(SecondLevelCacheSessionStore.java:332)
   at 

Re: Form field (value) does not update after validation error

2008-12-10 Thread Igor Vaynberg
call clearinput() on the textfield from your link. formcomponents hold
on to the values entered by user if there is an error so the erroneous
values can be redisplayed when the form is redrawn.

-igor

On Wed, Dec 10, 2008 at 7:11 AM, Rutger Jansen [EMAIL PROTECTED] wrote:
 Sorry for the misunderstanding. But it's not a submit button, just a
 link for editing. The onSubmit is not called there.

 The form also has a button that does submit the form.

 I see in debug mode that the link is correctly called and that the
 model object is correctly updated, also when problem occurs after the
 validation error.

 On 12/10/08, Gerolf Seitz [EMAIL PROTECTED] wrote:
 don't know if i totally understood the setting of your example, but
 your edit button shouldn't submit/post the form, eg. just use  a Link
 attached to an input type=button tag instead of a Button.

   Gerolf

 On Wed, Dec 10, 2008 at 1:11 PM, Rutger Jansen [EMAIL PROTECTED] wrote:

 Well this is of course a simple example.
 In my case I have an administration page with a list of domain
 objects, lets say cheeses (how did I come up with that idea?).

 On the same page I have a form with all fields of the cheese object
 (name and kiloPrice for example). Behind each cheese in the list there
 is an  'edit' button which will set that specific cheese object as a
 the current model object in the form, which results in the name and
 kiloPrice field in the form being filled with the values of the
 cheese.

 If then, for some reason the validation of a form post fails (the
 price is too high for this Gouda), and I (as an end user) decide to
 skip editing this Gouda cheese and press the edit button of the
 Cheddar cheese, the form will not be updated with the name and price
 of the Cheddar. The values of the Gouda remain. Even though the
 current object in the model was updated to Cheddar.

 When I now press the submit button again (after putting a correct
 price in the field), the Cheddar object is updated with the values of
 the Gouda (which were still in the formfields).

 I can make a bigger example like this if needed.


 On 12/10/08, Martijn Dashorst [EMAIL PROTECTED] wrote:
  Why on earth would you want to update a model value when there's a
  validation error in the input? That is the whole point of validation!
 
  Martijn
 
  On Wed, Dec 10, 2008 at 10:44 AM, Rutger Jansen [EMAIL PROTECTED]
 wrote:
  Hi,
 
  I have a strange situation in the admin part of my application which I
  have reproduced in this tiny code example.
 
  In this example I can load a value in the textfield by clicking the
  link (which also increases the number to show that the link works ok).
  I can post the form without problems and load the value again.
  But when a validation error occurs (in this case when the posted value
  is too long), the field will not be updated after pressing the link
  (even though the log shows that the link is clicked), unless I post
  the form again without validation errors.
 
  Am I forgetting something here?
 
 
  Rutger
 
 
  --- Example page class---
  public class Example extends WebPage {
 
   private String value;
   private int valueVersion = 1;
 
   public Example() {
 Form form = new Form(form);
 
 TextField textfield = new TextField(textfield, new
  PropertyModel(Example.this, value));
 textfield.add(StringValidator.maximumLength(15));
 form.add(textfield);
 
 add(form);
 add(new FeedbackPanel(feedback));
 
 add(new Link(link){
   @Override
   public void onClick() {
 value = This is a test + valueVersion++;
   }
 });
   }
  }
 
  --- Example html ---
  html xmlns=http://www.w3.org/1999/xhtml;
  xmlns:wicket=http://wicket.sourceforge.net/;
  head/head
  body
   div wicket:id=feedback /
 
   form wicket:id=form
 input type=text wicket:id=textfield/
 input type=submit /
   /form
 
   pa href=# wicket:id=linkLoad form value/a/p
  /body
  /html
 
  -
  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]



Disabling Form submit

2008-12-10 Thread Sujit Arungundram
I have a form with a bunch of text fields and a submit button.
I would like to keep the form submit button disabled until the form passes 
validation. The form is currently validated using the  ajaxformvalidation 
behavior.

Is there an out of the box technique to do this? I  copied the 
AjaxFormValidationBehavior class and modified the onSubmit() to add the button 
as enabled when the form has no errors  in it.  Although this works, I would 
like to know if there is an elegant way to achieve this.

I added a DisabledBehavior class that just tags the component that needs to be 
enabled or disabled conditionally. And then onSubmit() I do the following:

getForm().visitChildren(FormComponent.class, new IVisitor() {public 
Object component(Component component) {for (Object behavior : 
component.getBehaviors()) {if (behavior instanceof 
DisabledBehavior)target.addComponent(component);
}return IVisitor.CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER; 
   } });

Would appreciate if anyone can suggest a better way to do this.

Thanks.


Re: Asynchron push/update/redirect

2008-12-10 Thread alexander.elsholz

hi,

thanks, it works fine for model-changes, so that components could read
actual data.

the open one is to switch the page by the asynchron server-push. there is no
Requestcycle  in the my asynchron event (its null).

to deal with this problem i tried to display the user a link, but there is a
secound problem. when i try to set the link visible true i get this
exception:

java.lang.IllegalStateException: you can only locate or create sessions in
the context of a request cycle
at org.apache.wicket.Session.findOrCreate(Session.java:206)

could you help me again?


thanks alex



Michael Sparer wrote:
 
 take a look at wicketstuff-push or wicketstuff-dojo-1.1. (which also
 includes cometd that provides your desired push behaviour)
 
 regards,
 Michael
 
 
 alexander.elsholz wrote:
 
 Hi,
 
 i need a possibility to refresh parts of view, when data on the server
 changed. there is no synchron ajax-event, where i can use the
 requesttarget, because i use a thread to ask an other service for the
 result.
 
 actually i use the ajaxSelfUpdateBehavior, but i think its too much
 traffic.
 
 also i want to switch the side in a asynchron event. when the event is
 occured i want to redirect the user to previews page. here i can also use
 a modal window, which displays two buttons (yes i want and no, i won't)
 
 thanks alex
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Asynchron-push-update-redirect-tp20934629p20942140.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: JRPdfResource File not found error when using IE6

2008-12-10 Thread Ernesto Reinaldo Barreiro
I have found myself some weird behaviors with PDFs and IE... E.g. when
trying to show a PDF in an iframe it would work for some versions of
IE 6 and not with others (same IE6 but not exactly the same release).
I never discovered why. Did you tried tricking it to  think it is 
downloading a  real PDF file? For instance, if you mounted a resource 
try doing it like  yyy/myfile.pdf. That  trick fixed my problem 
with iframes. Also on [1] there are some recommendations for writing
servlets for servicing PDF, maybe you could find there some useful info.

Best,

Ernesto

[1] http://itextdocs.lowagie.com/tutorial/general/webapp/


lizz wrote:
 I am creating a (jasper) pdf file using JRPdfResource in a JasperLink. This
 works fine in Firefox and Internet Explorer 7, but when I use Internet
 Explorer 6 I get an error message saying There was an error opening the
 document. The file cannot be found..

 I also have an Excel link using JRXlsResource but this one works fine for
 all 3 browsers. 

 Doesn anyone know why this happens?

 Thanks :-)
   


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



Re: Switchable panel via select ajax

2008-12-10 Thread Александър Шопов
В 19:07 +0100 на 10.12.2008 (ср), Sven Meier написа:
 Why don't you just replace the current panel depending on a selection in 
 your select field, see:
 
 MarkupContainer#addOrReplace(Component)
 
 Much easier than tinkering with the internals of Wicket's rendering.
Yeah, you are totally right - I found about the API today ;-)

My question should be placed in the weekly list of top 10 noobiest questions.

Thanx and kind regards:
al_shopov


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



Re: Wicket integration with good charts api

2008-12-10 Thread shetc

Hi Maarten,

This is slightly off-topic as it's not really a Wicket issue but more of a
Flash problem.
The Open Flash Chart swf works fine as long as it is not used with SSL. 
According to 
http://kb.adobe.com/selfservice/viewContent.do?externalId=fdc7b5csliceId=2
Adobe , I need to add the following to my WebPage:


@Override
protected void setHeaders(WebResponse response) {
response.setHeader(Pragma, public);
response.setHeader(Cache-Control, cache, must-revalidate); 
}

However, this still does not work for an SSL connection. Have you had deal
with this issue?

Thanks,
Steve
-- 
View this message in context: 
http://www.nabble.com/Wicket-integration-with-good-charts-api-tp20322515p20944703.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 session back button support

2008-12-10 Thread Paolo Di Tommaso
Dear community,

I'm facing with a really ugly problem. In my web app I need to store some
variables in the Wicket session.

But this cause some nasty side-effects when users click on the browser back
button.

The page displays the previous content correctly but some components, which
model is based on session values, do not.

Is there any best practice for Wicket session to support the browser back
button (so that coming back the session is restored to the previous state)?

Thank you,

Paolo


Re: JRPdfResource File not found error when using IE6

2008-12-10 Thread Nino Saturnino Martinez Vazquez Wael
I've had huge problems with this aswell, but it's long time since.. I 
think it where on wicket 1.2, where firefox would pop a dl and IE would 
open the doc/xls inline.. I guess it's not exactly the same...


Ernesto Reinaldo Barreiro wrote:

I have found myself some weird behaviors with PDFs and IE... E.g. when
trying to show a PDF in an iframe it would work for some versions of
IE 6 and not with others (same IE6 but not exactly the same release).
I never discovered why. Did you tried tricking it to  think it is 
downloading a  real PDF file? For instance, if you mounted a resource 
try doing it like  yyy/myfile.pdf. That  trick fixed my problem 
with iframes. Also on [1] there are some recommendations for writing

servlets for servicing PDF, maybe you could find there some useful info.

Best,

Ernesto

[1] http://itextdocs.lowagie.com/tutorial/general/webapp/


lizz wrote:
  

I am creating a (jasper) pdf file using JRPdfResource in a JasperLink. This
works fine in Firefox and Internet Explorer 7, but when I use Internet
Explorer 6 I get an error message saying There was an error opening the
document. The file cannot be found..

I also have an Excel link using JRXlsResource but this one works fine for
all 3 browsers. 


Doesn anyone know why this happens?

Thanks :-)
  




-
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: Child page with no html

2008-12-10 Thread Nino Saturnino Martinez Vazquez Wael

Scott,

Think inheritance :)

Just write a super which has abstract methods that returns components 
for c1..c4() and thats it.. no need for trickery with 
IMarkupResourceStreamProvider ...


Should I elaborate more?

You could also take a look at the wicketstuff accordion thing, it does 
something along these lines[1]...



1=http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-accordion

regards

smackie604 wrote:

Hi,

My team has adopted wicket as it's web framework and we have been busy
creating a lot of interesting Panels to build pages for our product.  It is
turning out that most of the time all the components on the page are Panels
and we end up with a situation like this:

MyPage.java
--
public class MyPage extends BasePage
{
  MyPage()
  {
add(SomePanel(c1));
add(SomePanel(c2));
add(SomePanel(c3));
add(SomePanel(c4));
  }
}

MyPage.html
---
wicket:extend
  wicket:container wicket:id=c1/
  wicket:container wicket:id=c2/
  wicket:container wicket:id=c3/
  wicket:container wicket:id=c4/
/wicket:extend

It would be nice if we didn't have to write html files for pages in these
situations and instead just do something like this:

MyPage.java
--
public class MyPage extends BasePage
{
  MyPage()
  {
addToRepeater(SomePanel(c1));
addToRepeater(SomePanel(c2));
addToRepeater(SomePanel(c3));
addToRepeater(SomePanel(c4));
  }
}

Where BasePage will have a method called addToRepeater which just adds the
component to the repeater. 


I see we could do some trickery by implementing
IMarkupResourceStreamProvider on the BasePage to force the template of it's
child classes to always use BasePage.html.  I'm not sure this is the best
way of doing this, does anyone have any comments on using this approach?

Thanks,

Scott
  


--
-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]



Terracotta integration and issue sharing pagemaps

2008-12-10 Thread Michael Oswell
I am running into an issue that I _think_ is related to our terracotta  
installation.


1.  User visits page with a PageableListView.
2.  User navigates to another page in the PageableListView
3.  User clicks on a link generated within the listview

The following exception is generated

org.apache.wicket.WicketRuntimeException: component  
mainContentPanel:photoListContainer:photoList:82:switchLink not  
found on page com.example.wicket.pages.ExamplePage[id = 2],  
listener interface = [RequestListenerInterface  
name=IBehaviorListener, method=public abstract void  
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
	at  
org 
.apache 
.wicket 
.request 
.AbstractRequestCycleProcessor 
.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java: 
416)
	at  
org 
.apache 
.wicket 
.request 
.AbstractRequestCycleProcessor 
.resolveRenderedPage(AbstractRequestCycleProcessor.java:461)
	at  
org 
.apache 
.wicket 
.protocol 
.http 
.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
	at com.example.wicket.WicketApplication 
$2.resolve(WicketApplication.java:119)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1229)
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 
.springframework 
.orm 
.hibernate3 
.support 
.OpenSessionInViewFilter 
.doFilterInternal(OpenSessionInViewFilter.java:198)
	at  
org 
.springframework 
.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java: 
76)
	at  
org 
.apache 
.catalina 
.core 
.ApplicationFilterChain 
.internalDoFilter(ApplicationFilterChain.java:235)
	at  
org 
.apache 
.catalina 
.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 
206)
	at  
com.randomcoder.security.DisableUrlSessionFilter.doFilter(Unknown  
Source)
	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.valves.AccessLogValve.invoke(AccessLogValve.java: 
568)
	at  
org 
.apache 
.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java: 
109)
	at  
com.tc.tomcat55.session.SessionValve55.tcInvoke(SessionValve55.java: 
63)
	at  
com.tc.tomcat55.session.SessionValve55.invoke(SessionValve55.java:50)
	at  
org 
.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 
286)
	at  
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java: 
283)

at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
	at  
org 
.apache 
.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
	at org.apache.jk.common.ChannelSocket 
$SocketConnection.runIt(ChannelSocket.java:889)
	at org.apache.tomcat.util.threads.ThreadPool 
$ControlRunnable.run(ThreadPool.java:690)

at java.lang.Thread.run(Thread.java:595)


If I run only one server, then everything works as expected.  As soon  
as I add extra servers I begin to see this error.
From what I can tell, it appears as though the page map is not being  
distributed via terracotta, though I could be wrong. :)
The reason I think this is it appears as though the PageableListView  
page that I navigate to doesn't exist in the pagemap on the server  
that handles the request when I click a link and as such, generates  
the above exception.


Installation:
Terracotta 2.7.1
Wicket 1.3.5
tim-wicket-1.3-1.1.3

Any suggestions welcome.

thanks,

-- Mike

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



Re: Wicket session back button support

2008-12-10 Thread Matej Knopp
No. You have to track the changes yourself. Or use Page as the scope.
What's the reason to put values in session anyway?

-Matej

On Wed, Dec 10, 2008 at 11:18 PM, Paolo Di Tommaso
[EMAIL PROTECTED] wrote:
 Dear community,

 I'm facing with a really ugly problem. In my web app I need to store some
 variables in the Wicket session.

 But this cause some nasty side-effects when users click on the browser back
 button.

 The page displays the previous content correctly but some components, which
 model is based on session values, do not.

 Is there any best practice for Wicket session to support the browser back
 button (so that coming back the session is restored to the previous state)?

 Thank you,

 Paolo


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



Response filters not being applied when using custom subclass of WebResponse

2008-12-10 Thread LLehtinen

Hello -

I would like to use a response filter to replace some very often occurring
placeholders in the markup with values that depend on which Application
instance is being used. I realize there are other ways of doing this with
Wicket, but I have my reasons to try to keep this particular part out of the
Page/Component code.

This worked fine for one of the applications, I added my filter using the
getRequestCycleSettings().addResponseFilter() method. However, in another
application where I am using a custom subclass of WebResponse (to accomodate
some special needs regarding redirect handling), the filter method isn't
being called.

I browsed through the Wicket source code, and to me it looks like the
filter() method is only being used if the Response is an instance of
BufferedWebResponse.

RequestCycle source:

... 

if (getResponse() instanceof BufferedWebResponse)
{
try
{
 ((BufferedWebResponse)getResponse()).filter();
}

...

And the only reference to the filter method in Response that I found was the
one in - BufferedWebResponse. I can't subclass BufferedWebResponse for my
custom redirect needs, because the redirect method is marked final.

Any suggestions how to work around this? Am I trying to do something that
wasn't intended to be done? I know I can always fall back to a normal
filter and a HttpServletResponseWrapper, but I'd like to avoid it if I can
accomplish the same in Wicket code.

Many thanks in advance

--
Lauri Lehtinen
-- 
View this message in context: 
http://www.nabble.com/Response-filters-not-being-applied-when-using-custom-subclass-of-WebResponse-tp20946421p20946421.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: Child page with no html

2008-12-10 Thread smackie604

Thank you Nino!

The solution could not have been any easier:)  Here is how I did this incase
anyone else starts thinking of complicated solutions like myself:

ParentPage.java

public abstract class ParentPage extends WebPage
{
public static String COMPONENT_ID = component;

public ParentPage()
{
add( new ListViewComponent( listview, getComponents() )
{
protected void populateItem( ListItemComponent item )
{
item.add( item.getModel().getObject() );
}
} );
}

protected abstract ListComponent getComponents();
}

ParentPage.html
---
html
head
title/title
/head
body

div wicket:id=componentThis is a component/div

/body
/html

ChildPage.java
--
public class ChildPage extends ParentPage
{
protected ListComponent getComponents()
{
List Component l = new ArrayListComponent();
l.add( new Label(COMPONENT_ID, Component 1) );
l.add( new Label(COMPONENT_ID, Component 2) );
l.add( new Label(COMPONENT_ID, Component 3) );
return l;
}
}


Nino.Martinez wrote:
 
 Scott,
 
 Think inheritance :)
 
 Just write a super which has abstract methods that returns components 
 for c1..c4() and thats it.. no need for trickery with 
 IMarkupResourceStreamProvider ...
 
 Should I elaborate more?
 
 You could also take a look at the wicketstuff accordion thing, it does 
 something along these lines[1]...
 
 
 1=http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-accordion
 
 regards
 
 smackie604 wrote:
 Hi,

 My team has adopted wicket as it's web framework and we have been busy
 creating a lot of interesting Panels to build pages for our product.  It
 is
 turning out that most of the time all the components on the page are
 Panels
 and we end up with a situation like this:

 MyPage.java
 --
 public class MyPage extends BasePage
 {
   MyPage()
   {
 add(SomePanel(c1));
 add(SomePanel(c2));
 add(SomePanel(c3));
 add(SomePanel(c4));
   }
 }

 MyPage.html
 ---
 wicket:extend
   wicket:container wicket:id=c1/
   wicket:container wicket:id=c2/
   wicket:container wicket:id=c3/
   wicket:container wicket:id=c4/
 /wicket:extend

 It would be nice if we didn't have to write html files for pages in these
 situations and instead just do something like this:

 MyPage.java
 --
 public class MyPage extends BasePage
 {
   MyPage()
   {
 addToRepeater(SomePanel(c1));
 addToRepeater(SomePanel(c2));
 addToRepeater(SomePanel(c3));
 addToRepeater(SomePanel(c4));
   }
 }

 Where BasePage will have a method called addToRepeater which just adds
 the
 component to the repeater. 

 I see we could do some trickery by implementing
 IMarkupResourceStreamProvider on the BasePage to force the template of
 it's
 child classes to always use BasePage.html.  I'm not sure this is the best
 way of doing this, does anyone have any comments on using this approach?

 Thanks,

 Scott
   
 
 -- 
 -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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Child-page-with-no-html-tp20945577p20947047.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: Terracotta integration and issue sharing pagemaps

2008-12-10 Thread Ned Collyer

From a quick glance (and im not at all familiar with PageableListView - but
am alright with their parent - ListView)

Has it anything to do with not calling setReuseItems(true) on the list view
itself? - Ie, its destroying the links, then recreating them each request?

Rgds

Ned



Michael Oswell wrote:
 
 I am running into an issue that I _think_ is related to our terracotta  
 installation.
 
 1.  User visits page with a PageableListView.
 2.  User navigates to another page in the PageableListView
 3.  User clicks on a link generated within the listview
 
 The following exception is generated
 
 org.apache.wicket.WicketRuntimeException: component  
 mainContentPanel:photoListContainer:photoList:82:switchLink not  
 found on page com.example.wicket.pages.ExamplePage[id = 2],  
 listener interface = [RequestListenerInterface  
 name=IBehaviorListener, method=public abstract void  
 org.apache.wicket.behavior.IBehaviorListener.onRequest()]
 
 
 If I run only one server, then everything works as expected.  As soon  
 as I add extra servers I begin to see this error.
  From what I can tell, it appears as though the page map is not being  
 distributed via terracotta, though I could be wrong. :)
 The reason I think this is it appears as though the PageableListView  
 page that I navigate to doesn't exist in the pagemap on the server  
 that handles the request when I click a link and as such, generates  
 the above exception.
 
 Installation:
   Terracotta 2.7.1
   Wicket 1.3.5
   tim-wicket-1.3-1.1.3
 
 Any suggestions welcome.
 
 thanks,
 
 -- Mike
 

-- 
View this message in context: 
http://www.nabble.com/Terracotta-integration-and-issue-sharing-pagemaps-tp20946423p20947187.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: Terracotta integration and issue sharing pagemaps

2008-12-10 Thread Michael Oswell


Ned,

I have tried setting setReuseItems(true) on the PageableListView but  
it makes no difference.


thanks,

-- Mike

On 10-Dec-08, at 4:30 PM, Ned Collyer wrote:

From a quick glance (and im not at all familiar with  
PageableListView - but

am alright with their parent - ListView)

Has it anything to do with not calling setReuseItems(true) on the  
list view
itself? - Ie, its destroying the links, then recreating them each  
request?


Rgds

Ned



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



Re: Openid integration?

2008-12-10 Thread David Leangen


 Hmm, I do actually have something working, which seems to be really 
 simple.

Ok, good for you!


 Using openid4java, my only problem are that I cant seem to get 
 any openid providers to give me the requested attributes, like 
 email and name. How did you solve this?

Are you sure it's an openid4java problem?

If the OP does not support extensions, then there's just nothing you can
do!

Normally (again from my porous memory, sorry!) there should be some
parameter in which the OP declares which extensions it supports. For
example, Yahoo supports only pape, nothing else. That means that try as
you might, you'll never get any registration info from them.

But in any case, this should be on the openid4java list, not here...


Cheers,
Dave




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



Re: spring proxy for my model causes notSerializable exception

2008-12-10 Thread David Leangen

  As far as I could tell from the Wicket code, for some reason proxy classes
  do not get serialized. I've been meaning to ask about this myself, as it's
  been causing me problems.


 that used to happen only if you used wicket's special serializer. it
 was the default one for a little while, but is not default any longer.

I see.

Was there originally a reason for not serializing proxy classes? Is
there still a reason for this?

Or would it be reasonable to submit an issue and possibly a patch in
JIRA for this?


Thanks!
=dml




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



Re: spring proxy for my model causes notSerializable exception

2008-12-10 Thread Igor Vaynberg
there wasnt a reason. the serializer, whose aim was to reduce the size
of serialized page, wasnt sophisticated enough to handle proxies
properly.

-igor

On Wed, Dec 10, 2008 at 5:52 PM, David Leangen [EMAIL PROTECTED] wrote:

  As far as I could tell from the Wicket code, for some reason proxy classes
  do not get serialized. I've been meaning to ask about this myself, as it's
  been causing me problems.


 that used to happen only if you used wicket's special serializer. it
 was the default one for a little while, but is not default any longer.

 I see.

 Was there originally a reason for not serializing proxy classes? Is
 there still a reason for this?

 Or would it be reasonable to submit an issue and possibly a patch in
 JIRA for this?


 Thanks!
 =dml




 -
 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: Child page with no html

2008-12-10 Thread John Krasnay
Careful!  ChildPage.getComponents() is invoked before ChildPage's
constructor. This will trip you up sooner or later.

You can easily fix this with a model:

IModel componentsModel = new AbstractReadOnlyModel() {
public Object getObject() { return getComponents(); }
}

add(new ListView(listview, componentsModel) { ... });

Personally, I prefer to use a RepeatingView in this sort of situation.
Just create the RepeatingView in the base class, then provide an add
method for subclasses to call to add components directly to the
RepeatingView. (I also provide a method that wraps
RepeatingView.newChildId.) This approach avoids the intermediate list,
the anonymous inner ListView subclass, and the problem described above.

jk


On Wed, Dec 10, 2008 at 04:16:31PM -0800, smackie604 wrote:
 
 Thank you Nino!
 
 The solution could not have been any easier:)  Here is how I did this incase
 anyone else starts thinking of complicated solutions like myself:
 
 ParentPage.java
 
 public abstract class ParentPage extends WebPage
 {
   public static String COMPONENT_ID = component;
 
   public ParentPage()
   {
   add( new ListViewComponent( listview, getComponents() )
   {
   protected void populateItem( ListItemComponent item )
   {
   item.add( item.getModel().getObject() );
   }
   } );
   }
 
   protected abstract ListComponent getComponents();
 }
 
 ParentPage.html
 ---
 html
 head
   title/title
 /head
 body
   
   div wicket:id=componentThis is a component/div
   
 /body
 /html
 
 ChildPage.java
 --
 public class ChildPage extends ParentPage
 {
   protected ListComponent getComponents()
   {
   List Component l = new ArrayListComponent();
   l.add( new Label(COMPONENT_ID, Component 1) );
   l.add( new Label(COMPONENT_ID, Component 2) );
   l.add( new Label(COMPONENT_ID, Component 3) );
   return l;
   }
 }
 
 
 Nino.Martinez wrote:
  
  Scott,
  
  Think inheritance :)
  
  Just write a super which has abstract methods that returns components 
  for c1..c4() and thats it.. no need for trickery with 
  IMarkupResourceStreamProvider ...
  
  Should I elaborate more?
  
  You could also take a look at the wicketstuff accordion thing, it does 
  something along these lines[1]...
  
  
  1=http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-accordion
  
  regards
  
  smackie604 wrote:
  Hi,
 
  My team has adopted wicket as it's web framework and we have been busy
  creating a lot of interesting Panels to build pages for our product.  It
  is
  turning out that most of the time all the components on the page are
  Panels
  and we end up with a situation like this:
 
  MyPage.java
  --
  public class MyPage extends BasePage
  {
MyPage()
{
  add(SomePanel(c1));
  add(SomePanel(c2));
  add(SomePanel(c3));
  add(SomePanel(c4));
}
  }
 
  MyPage.html
  ---
  wicket:extend
wicket:container wicket:id=c1/
wicket:container wicket:id=c2/
wicket:container wicket:id=c3/
wicket:container wicket:id=c4/
  /wicket:extend
 
  It would be nice if we didn't have to write html files for pages in these
  situations and instead just do something like this:
 
  MyPage.java
  --
  public class MyPage extends BasePage
  {
MyPage()
{
  addToRepeater(SomePanel(c1));
  addToRepeater(SomePanel(c2));
  addToRepeater(SomePanel(c3));
  addToRepeater(SomePanel(c4));
}
  }
 
  Where BasePage will have a method called addToRepeater which just adds
  the
  component to the repeater. 
 
  I see we could do some trickery by implementing
  IMarkupResourceStreamProvider on the BasePage to force the template of
  it's
  child classes to always use BasePage.html.  I'm not sure this is the best
  way of doing this, does anyone have any comments on using this approach?
 
  Thanks,
 
  Scott

  
  -- 
  -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]
  
  
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/Child-page-with-no-html-tp20945577p20947047.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]



passing list from java class to javascript

2008-12-10 Thread Ashis

Hello all,
   I have a question i need to pass list from java class to javascript.

  How can i do this stuff?

Thanks
-- 
View this message in context: 
http://www.nabble.com/passing-list-from-java-class-to-javascript-tp20949804p20949804.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: Using Wicket Pages for an Internal Request...emptying Wicket Session?

2008-12-10 Thread Mike Papper

Hi and thanks for the links, very useful.

I tried the easiest solution:




http://cwiki.apache.org/confluence/display/WICKET/FAQs#FAQs- 
HowcanIrendermytemplatestoaString%3F


and I am having a further problem

In this case, I am in the middle of a Wicket/http request and using  
the BaseWicketTester as so:


startPage(newly instantiated WebPage)
followed by
getServletResponse().getDocument()

which works fine (however, it leaves the wicket:id=... tagsin the  
String)


BUT when I go to write out the current wicket/http request (not the  
mock one from BaseWicketTester) it seems to be empty.


Question:
1. Could it be the case that using the MockWebApplication objects  
still work on thread/request-specific session and response data? I  
would explicitly hope this was NOT the case.


2. Perhaps the same HJttpServletResponse object is used for both the  
MockApp and WicketApp?


If this is the case, using the more complicated example may work as  
it hides those objects by using its own (newly instatiated)  
subclass of WicketApplication.


Further Question:
3. In this case, (seeing as I very new to Wicket and dont really get  
it all yet) would I be missing some state in the WicketApplication  
that my Page object is not going to have access too?


Mike



On Wed, Dec 10, 2008 at 2:49 AM, Ernesto Reinaldo Barreiro 
[EMAIL PROTECTED] wrote:


Hope this helps...


http://www.nabble.com/Use-wicket-page-templates-not-for- 
webapplication-td19173648.html



http://cwiki.apache.org/confluence/display/WICKET/FAQs#FAQs- 
HowcanIrendermytemplatestoaString%3F

http://cwiki.apache.org/WICKET/use-wicket-as-template-engine.html

Ernesto

On Wed, Dec 10, 2008 at 7:31 AM, Mike Papper [EMAIL PROTECTED]  
wrote:



Hi,

thanks for that  - I did search the archives and found  
nothing...is there

a

name for this that you know of - such that I could use it in the

search? I

think I was calling it internal redirect.

Mike


On Dec 9, 2008, at 10:16 PM, Jeremy Thomerson wrote:

 Search around in the mail archives - the typical solution  
involves using

WicketTester.

On Tue, Dec 9, 2008 at 8:06 PM, Mike Papper [EMAIL PROTECTED]  
wrote:


 Hi, very new to Wicket and this list...


so I'm wondering if anyone can tell me if the following is  
possible and

approx. how-to?

Overview: we have a wicket page that generates some html 
+javascript

etc.

We
want to render this page from within the application (into a  
String)

and
send it to some other web service (such as Facebook). We  
currently use

httpclient to make a http request back to our server and take the
response
and munge it. The overhead of the extra request is an  
unsatisfactory

load

on
our servers.

Is there a way to make to mimic an 'internal' servlet/web  
request and

take
that response (or at least the rendering of the Page) but do  
not affect

the
state of the current (external) http request? We tried using

MockServlet
with the WicketFilter but when the intenral request was  
finished it

seemed
to alter the state of the original request (such that the  
session went

away
and the response was invalid - I think the original response  
had been
generated from the contents of the mock request/response). Even  
if this

could be fixed...theres more:

An additional constraint is to call this 'internal request' from

anywhere

in
the code and not necessarily within a http request (i.e., from  
a Quartz
thread). So, we may not have any WicketApplication ...If it is  
the case

that
we can only gert our hands on the WicketApplication from a  
thread that

is
part of a http request, then the quartz thread willnot have  
acces to

WicketApplication (I am unsure about this).

Looking around in the docs, I came across the RequestCycle and

wondering

if
thats how I can do this?

Any pointer for this would be appreciated - it would be a shame  
not to

be

able to use Wicket for this internal rendering.

Mike





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




 
-

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








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



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



Re: Using Wicket Pages for an Internal Request...emptying Wicket Session?

2008-12-10 Thread Ernesto Reinaldo Barreiro
Hi Mike,

I never tried myself to use what is explained on those links... so I
cannot be of much help unless I start to guess things.


 In this case, I am in the middle of a Wicket/http request and using
 the BaseWicketTester as so:

 startPage(newly instantiated WebPage)
 followed by
 getServletResponse().getDocument()

 which works fine (however, it leaves the wicket:id=... tagsin the String)
There is some flag you have to set at application level to strip Wikect
tags from out put. Maybe that will solve that problem.

 BUT when I go to write out the current wicket/http request (not the
 mock one from BaseWicketTester) it seems to be empty.

 Question: 
 1. Could it be the case that using the MockWebApplication objects
 still work on thread/request-specific session and response data? I
 would explicitly hope this was NOT the case.

 2. Perhaps the same HJttpServletResponse object is used for both the
 MockApp and WicketApp?

 If this is the case, using the more complicated example may work as it
 hides those objects by using its own (newly instatiated) subclass of
 WicketApplication.

 Further Question:
 3. In this case, (seeing as I very new to Wicket and dont really get
 it all yet) would I be missing some state in the WicketApplication
 that my Page object is not going to have access too?
Maybe you could find further info on using Wicket tester here

http://cwiki.apache.org/WICKET/testing-pages.html

Ernesto

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



Modal Dialog with Form Reloading the page will cause the modal window to disappear

2008-12-10 Thread alexander.elsholz

Hi,

i put a form on a modal dialog and expected to get the standard recycle
(when validators failed, the submit method of the button of the dialog will
not performed). that works, but:
1) the dialog closed, after committing this message: Reloading the page
will cause the modal window to disappear
2) the validator-message will displayed on the web-page

what means this message?

thanks a lot 
alex
-- 
View this message in context: 
http://www.nabble.com/Modal-Dialog-with-Form-%22Reloading-the-page-will-cause-the-modal-window-to-disappear%22-tp20950542p20950542.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: Child page with no html

2008-12-10 Thread Nino Saturnino Martinez Vazquez Wael
Yeah, but the other way are a bit cleaner java code wise... And  I Scott 
where heading into modifying a lot of stuff that would bring an over 
complicated solution to work..


So the trickery would be to edit  and a whole bunch of other 
stuff(probably)IMarkupResourceStreamProvider, instead of facilitating 
the simple features of wicket.. :)


Jeremy Thomerson wrote:

You can also do exactly as you mentioned

In your base page, have a repeating view (i.e. ListView) that simply loops
over a ListComponent childPanels. Then your method
addToRepeater(Component component) will add to that list.

Should work exactly as you described.  What trickery is needed?  I guess I
miss that part.

On Wed, Dec 10, 2008 at 5:20 PM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

  

Scott,

Think inheritance :)

Just write a super which has abstract methods that returns components for
c1..c4() and thats it.. no need for trickery with
IMarkupResourceStreamProvider ...

Should I elaborate more?

You could also take a look at the wicketstuff accordion thing, it does
something along these lines[1]...


1=
http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-accordion

regards


smackie604 wrote:



Hi,

My team has adopted wicket as it's web framework and we have been busy
creating a lot of interesting Panels to build pages for our product.  It
is
turning out that most of the time all the components on the page are
Panels
and we end up with a situation like this:

MyPage.java
--
public class MyPage extends BasePage
{
 MyPage()
 {
   add(SomePanel(c1));
   add(SomePanel(c2));
   add(SomePanel(c3));
   add(SomePanel(c4));
 }
}

MyPage.html
---
wicket:extend
 wicket:container wicket:id=c1/
 wicket:container wicket:id=c2/
 wicket:container wicket:id=c3/
 wicket:container wicket:id=c4/
/wicket:extend

It would be nice if we didn't have to write html files for pages in these
situations and instead just do something like this:

MyPage.java
--
public class MyPage extends BasePage
{
 MyPage()
 {
   addToRepeater(SomePanel(c1));
   addToRepeater(SomePanel(c2));
   addToRepeater(SomePanel(c3));
   addToRepeater(SomePanel(c4));
 }
}

Where BasePage will have a method called addToRepeater which just adds the
component to the repeater.
I see we could do some trickery by implementing
IMarkupResourceStreamProvider on the BasePage to force the template of
it's
child classes to always use BasePage.html.  I'm not sure this is the best
way of doing this, does anyone have any comments on using this approach?

Thanks,

Scott


  

--
-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]






  


--
-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: Child page with no html

2008-12-10 Thread Nino Saturnino Martinez Vazquez Wael

Ahh, yeah there is something there..

And yes it's a very good idea to expose the id to the method like

getComponents(String id)

I think this is also the way I did with the accordion in stuff.


John Krasnay wrote:

Careful!  ChildPage.getComponents() is invoked before ChildPage's
constructor. This will trip you up sooner or later.

You can easily fix this with a model:

IModel componentsModel = new AbstractReadOnlyModel() {
public Object getObject() { return getComponents(); }
}

add(new ListView(listview, componentsModel) { ... });

Personally, I prefer to use a RepeatingView in this sort of situation.
Just create the RepeatingView in the base class, then provide an add
method for subclasses to call to add components directly to the
RepeatingView. (I also provide a method that wraps
RepeatingView.newChildId.) This approach avoids the intermediate list,
the anonymous inner ListView subclass, and the problem described above.

jk


On Wed, Dec 10, 2008 at 04:16:31PM -0800, smackie604 wrote:
  

Thank you Nino!

The solution could not have been any easier:)  Here is how I did this incase
anyone else starts thinking of complicated solutions like myself:

ParentPage.java

public abstract class ParentPage extends WebPage
{
public static String COMPONENT_ID = component;

public ParentPage()
{
add( new ListViewComponent( listview, getComponents() )
{
protected void populateItem( ListItemComponent item )
{
item.add( item.getModel().getObject() );
}
} );
}

protected abstract ListComponent getComponents();
}

ParentPage.html
---
html
head
title/title
/head
body

div wicket:id=componentThis is a component/div

/body
/html

ChildPage.java
--
public class ChildPage extends ParentPage
{
protected ListComponent getComponents()
{
List Component l = new ArrayListComponent();
l.add( new Label(COMPONENT_ID, Component 1) );
l.add( new Label(COMPONENT_ID, Component 2) );
l.add( new Label(COMPONENT_ID, Component 3) );
return l;
}
}


Nino.Martinez wrote:


Scott,

Think inheritance :)

Just write a super which has abstract methods that returns components 
for c1..c4() and thats it.. no need for trickery with 
IMarkupResourceStreamProvider ...


Should I elaborate more?

You could also take a look at the wicketstuff accordion thing, it does 
something along these lines[1]...



1=http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-accordion

regards

smackie604 wrote:
  

Hi,

My team has adopted wicket as it's web framework and we have been busy
creating a lot of interesting Panels to build pages for our product.  It
is
turning out that most of the time all the components on the page are
Panels
and we end up with a situation like this:

MyPage.java
--
public class MyPage extends BasePage
{
  MyPage()
  {
add(SomePanel(c1));
add(SomePanel(c2));
add(SomePanel(c3));
add(SomePanel(c4));
  }
}

MyPage.html
---
wicket:extend
  wicket:container wicket:id=c1/
  wicket:container wicket:id=c2/
  wicket:container wicket:id=c3/
  wicket:container wicket:id=c4/
/wicket:extend

It would be nice if we didn't have to write html files for pages in these
situations and instead just do something like this:

MyPage.java
--
public class MyPage extends BasePage
{
  MyPage()
  {
addToRepeater(SomePanel(c1));
addToRepeater(SomePanel(c2));
addToRepeater(SomePanel(c3));
addToRepeater(SomePanel(c4));
  }
}

Where BasePage will have a method called addToRepeater which just adds
the
component to the repeater. 


I see we could do some trickery by implementing
IMarkupResourceStreamProvider on the BasePage to force the template of
it's
child classes to always use BasePage.html.  I'm not sure this is the best
way of doing this, does anyone have any comments on using this approach?

Thanks,

Scott
  


--
-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]



  

--
View this message in context: 
http://www.nabble.com/Child-page-with-no-html-tp20945577p20947047.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