Re: Asynchronous construction of page

2009-11-03 Thread Kaspar Fischer

I will try to use pages in iframes then. Thanks a lot, Igor.
Kaspar

On 02.11.2009, at 22:59, Igor Vaynberg wrote:


if you want nonblocking you have to make each thing you are trying to
load asynchronously its own page inside an iframe.

the page itself can only be accessed synchronously, otherwise you
would have to do your own multithreaded access handling in
components...which would be horrific.

-igor

On Mon, Nov 2, 2009 at 1:32 PM, Kaspar Fischer
kaspar.fisc...@dreizak.com wrote:
I am trying to find out how to load several parts (Wicket panels)  
of a page
in parallel using Ajax. The content of these parts takes long to  
render but
I still want the user to see the other, readily available parts of  
the page,
with the delayed panels appearing when available. Several posts on  
this list
indicate that AjaxLazyLoadPanel's only work synchronously. Is this  
still the
case with the latest version/snapshot of Wicket? Is there maybe  
another

approach available (one that still uses Wicket for the parts)?

Thanks,
Kaspar

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Attribute modified question

2009-11-03 Thread pieter claassen
I am sure I am doing something very silly here but 

When I add the following AttributeModifier in my onBeforeRender()
method, the solution works as expected (so I load an image that
indicates that this page is selected)

icon.add(new AttributeModifier(this.src='
, null, true, new Model(urlFor(active)+';)));

However, when I abstract that same code into a private class, the
solution still works and the correct image loads that indicates which
page I am on, but the browser, never completes the request (so the
spinning wheel on the tab keeps on spinning).

icon.add(new ActivateImage(onload, active));
.
 private class ActivateImage extends AttributeModifier {

    private ActivateImage(String id, final ResourceReference ref) {
    super(id, null, true, new Model(this.src=' + urlFor(ref) + ';));
    }
    }

Any ideas?

Thanks,
Pieter

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Where to put HTML files?

2009-11-03 Thread Gonzalo Aguilar Delgado
Thank you a lot to all for your commentaries...

Everything exposed here seems to help me in one way or another. 

I will run a test for best approach and after decide the best way for
me.

Thank you again!


El jue, 29-10-2009 a las 14:27 +0100, Martijn Dashorst escribió:

 On Thu, Oct 29, 2009 at 2:20 PM, Olivier Bourgeois
 olivier.bourgeois@gmail.com wrote:
  The pros :
 
  - you have instant template/properties reloading in development mode without
  redeploying or complex IDE setup.
 
 This is something that the quickstart
 (http://wicket.apache.org/quickstart.html) already provides, no need
 for complex setups having to keep directory structures in sync, or
 having to debug a custom resource resolver, or finding out why the
 templates don't match your java code (Oh shouldn't I have updated
 production with the new templates?)
 
 Martijn
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 


Dynamic Rendering and Common Paramenters

2009-11-03 Thread Gonzalo Aguilar Delgado
Hello Again!

I have a form that I build dynamically based on a render parameter
value. I'm using
http://cwiki.apache.org/WICKET/forms-with-dynamic-elements.html


I use the constructor:

/**
 * Constructor
 */ 
public ViewModePage() 
{

...

// Get render parameter 
String value =
((PortletRequestContext)RequestContext.get()).getPortletRequest().getParameter(crmportal:userId);
...
// Check for a valid answer from this customer
if(value!=null  value.length()0)
{
log.debug(Value length:  + value.length());
User user = 
userDAOBean.find(UuidUserType.fromString(value));

if(user!=null)
{
answer = getLastAnswer(1,user);
if(answer!=null)
{
buildForm(answer);
surveySubmitButton.setEnabled(true);
}
}
}
...

}


buildForm(answer); gets the form build based on the user answer

The problem as you can figure out. It works as I do nothing with the
form... But when I submit the form the constructer gets not
called anymore. So no matter what's the value it will get not updated to
the new one.

The GREAT book wicket in action explained this issue well. You have to
use dynamic models:


 CODE --
In chapter 4, we’ll discuss the differences between static models
and dynamic mod-
els (the issue at hand) in greater depth. For now, we’ll solve the
problem by providing
the label with a model that calculates its value every time it’s
requested:

add(new Label(total, new Model() {
 @Override
public Object getObject() {
 NumberFormat nf = NumberFormat.getCurrencyInstance();
 return nf.format(getCart().getTotal());
 }
}));

---WICKET IN ACTION 


But as I have to build the form I do not have a dynamic model on page.
So how do I make the form gets updated each time
the page it's rendered without disturbing Wicket normal behaviour?

Do I explain myself?

Thank you all in advance.



















SimpleAttributeModifier on SubmitLink?

2009-11-03 Thread Peter Arnulf Lustig
Hi,

how can I achieve something like that:


abschliessen = (SubmitLink) new SubmitLink(abschliessen, antwortForm) {
@Override
public void onSubmit() {
preQuestionInit();
Worker.ClosingTestprocedure(tp);
preQuestionInit();
}
}
.add(new SimpleAttributeModifier(
onclick,
return confirm('Information...');));

I detected, that the add Statement overwrites the onclick handler for the 
form submit! How can I have both: After click on the Ok-Button it should fire 
up the form.





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Dynamic Rendering and Common Paramenters

2009-11-03 Thread Pedro Santos
 But when I submit the form the constructer gets not called anymore.
this is an expected behavior, an component instance is held on pagemap
between requests.

 But as I have to build the form I do not have a dynamic model on page.
Can't you manage an instance of an dynamic model on your component,
independent of your form build logic? You can. Figure out the best way to
your component. You can simple keep this model on an instance variable for
example.

On Tue, Nov 3, 2009 at 7:22 AM, Gonzalo Aguilar Delgado 
gagui...@aguilardelgado.com wrote:

 Hello Again!

 I have a form that I build dynamically based on a render parameter
 value. I'm using
 http://cwiki.apache.org/WICKET/forms-with-dynamic-elements.html


 I use the constructor:

 /**
 * Constructor
 */
public ViewModePage()
{

...

// Get render parameter
String value =

 ((PortletRequestContext)RequestContext.get()).getPortletRequest().getParameter(crmportal:userId);
...
// Check for a valid answer from this customer
if(value!=null  value.length()0)
{
log.debug(Value length:  + value.length());
User user =
 userDAOBean.find(UuidUserType.fromString(value));

if(user!=null)
{
answer = getLastAnswer(1,user);
if(answer!=null)
{
buildForm(answer);
surveySubmitButton.setEnabled(true);
}
}
}
...

}

 

 buildForm(answer); gets the form build based on the user answer

 The problem as you can figure out. It works as I do nothing with the
 form... But when I submit the form the constructer gets not
 called anymore. So no matter what's the value it will get not updated to
 the new one.

 The GREAT book wicket in action explained this issue well. You have to
 use dynamic models:


  CODE --
In chapter 4, we’ll discuss the differences between static models
 and dynamic mod-
 els (the issue at hand) in greater depth. For now, we’ll solve the
 problem by providing
 the label with a model that calculates its value every time it’s
 requested:

 add(new Label(total, new Model() {
 @Override
public Object getObject() {
 NumberFormat nf = NumberFormat.getCurrencyInstance();
 return nf.format(getCart().getTotal());
 }
 }));

 ---WICKET IN ACTION 


 But as I have to build the form I do not have a dynamic model on page.
 So how do I make the form gets updated each time
 the page it's rendered without disturbing Wicket normal behaviour?

 Do I explain myself?

 Thank you all in advance.




















-- 
Pedro Henrique Oliveira dos Santos


AW: OSGi Wicket

2009-11-03 Thread Giambalvo, Christian
Thanks for all answers.
I think OSGi is to much overhead for my needs.
Joint fits more my needs, but includes unneeded overhead (for my project).
I think I will implement my own mechanism with using a custom ClassResolver, 
cause I just need to search in new added jars (URLClassloader),
Authorizationstrategy for security and a class the recursivly mounts a whole 
package on a given basepath which is extended with the package structur of the 
plugin
(this structur includes a unique path so no collision will happen).

But thanks anyway for ideas!

Chris


-Ursprüngliche Nachricht-
Von: Ben Tilford [mailto:bentilf...@gmail.com] 
Gesendet: Montag, 2. November 2009 16:45
An: users@wicket.apache.org
Betreff: Re: OSGi Wicket

You might want to check out http://kenai.com/projects/joint the wicket
example builds a menu system based of pages / links that are on the
classpath which implement a Navigatable interface and have the @Navigation
annotation.

Still very early in development but it still might do what you need.

On Mon, Nov 2, 2009 at 2:29 AM, Giambalvo, Christian 
christian.giamba...@excelsisnet.com wrote:

 Maybe OSGi ist o much overhead for my needs.
 I just want to be able to load WicketPages from a jar during runtime.
 Lets say  i have a wicket app with just the wicketapplication and a
 homepage (extendable through plugins (jar)).
 Then during runtime i dropin a jar containing some Pages and i want wicket
 to be able to reach them.
 My idea is to to just add the jars to the classloader searchpath and let
 wicket do the rest.
 Is this a naive idea or whats the wicket way?

 Igor wrote (some time ago):
 what we have in wicket is a IClassResolver which we use to allow for
 pluggable class resolution.

 How can this pluggable resolution be accomplished?

 Greetz and thanks

 -Ursprüngliche Nachricht-
 Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
 Gesendet: Sonntag, 1. November 2009 06:40
 An: users@wicket.apache.org
 Betreff: Re: OSGi Wicket

 I do agree Eclipse buddy system in not proper OSGi, but it makes a lot
 easier to develop applications because

 1- Your application, components, etc, will be same as in any normal Wicket
 application (no changes to are needed)
 2- If you find out OSGi is not suitable at the end, you can always build
 the
 same application dropping OSGi and using the same (component) factory
 services. You will loose hot pluggability and that's it.

 I never hit serialization limitation myself. On the  other hand, I do know
 from experience that  integrating with certain application servers (using
 bridge approach) can be challenging. This is also something to take into
 account before deciding to use osgi.

 I think Igor is totally right about the things you should weight in
 deciding
 whether to use OSGi or not for a project. OSGi is a way to
 achieve pluggability but not the only one.

 Best,

 Ernesto


 On Sun, Nov 1, 2009 at 2:27 AM, David Leangen wic...@leangen.net wrote:

 
  If you do go with OSGi, you will have problems with classloaders and
  deserialization.
 
  To my knowledge, nobody has yet solved this (i.e. implemented a good
  solution) in a decent way. The Eclipse buddy system is not proper OSGi,
  IMO.
 
  pax-wicket does solve this problem (using proper OSGi), but I have
  never used their approach much even though I use the framework.
 
  Here is a post about this by me with some interesting comments from Igor:
 
   http://bioscene.blogspot.com/2009/03/serialization-in-osgi.html
 
 
  Good luck to you!
  =David
 
 
 
 
  On Nov 1, 2009, at 3:26 AM, Igor Vaynberg wrote:
 
   it is easy to create a pluggable application in wicket. all you need
  is a registry of component providers, whether it be something like
  spring [1], a custom registry like brix uses [2] or something more
  advanced like osgi. the choice should be based on the featureset you
  need. eg, if you need hot updating, classloader separation, etc, then
  osgi is good. if not, there are simpler ways to achieve modularity [1]
  [2]. the great news is that wicket lends itself easily to
  modularization.
 
  [1]
 
 http://wicketinaction.com/2008/10/creating-pluggable-applications-with-wicket-and-spring/
  [2] http://code.google.com/p/brix-cms/source/browse/#svn/trunk/brix-
  core/src/main/java/brix/registry
 
  -igor
 
  2009/10/29 Tomáš Mihok tomas.mi...@cnl.tuke.sk:
 
  Hello,
 
  I'm currently designing a new application. One of the requests is to
 make
  it
  modular. I found out that one of the possibilities to enable loading of
  modules while application is running is OSGi. Is there a
  tool/plugin/guide
  to accomplish this or are there any other possibilities of
 accomplishing
  same goal?
 
  Tom
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
  

Re: SimpleAttributeModifier on SubmitLink?

2009-11-03 Thread Ernesto Reinaldo Barreiro
I have used ModalWindow for similar use cases... and then do the actual work
on the ok button of a modal confirmation dialog. Is that approach fine for
your use case?

Regards,

Ernesto

On Tue, Nov 3, 2009 at 10:23 AM, Peter Arnulf Lustig u...@yahoo.dewrote:

 Hi,

 how can I achieve something like that:


 abschliessen = (SubmitLink) new SubmitLink(abschliessen, antwortForm) {
@Override
public void onSubmit() {
preQuestionInit();
Worker.ClosingTestprocedure(tp);
preQuestionInit();
}
}
.add(new SimpleAttributeModifier(
onclick,
return confirm('Information...');));

 I detected, that the add Statement overwrites the onclick handler for the
 form submit! How can I have both: After click on the Ok-Button it should
 fire up the form.





 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: SimpleAttributeModifier on SubmitLink?

2009-11-03 Thread Martijn Dashorst
Take a look at AttributeAppender, and transform it into AttributePrepender

Martijn

On Tue, Nov 3, 2009 at 10:23 AM, Peter Arnulf Lustig u...@yahoo.de wrote:
 Hi,

 how can I achieve something like that:


 abschliessen = (SubmitLink) new SubmitLink(abschliessen, antwortForm) {
           �...@override
            public void onSubmit() {
                preQuestionInit();
                Worker.ClosingTestprocedure(tp);
                preQuestionInit();
            }
        }
                .add(new SimpleAttributeModifier(
                        onclick,
                        return confirm('Information...');));

 I detected, that the add Statement overwrites the onclick handler for the 
 form submit! How can I have both: After click on the Ok-Button it should 
 fire up the form.





 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Portlet, liferay, strange error messages

2009-11-03 Thread Goran Novak
Hi

I'm using wicket 1.4.1 to develop portlets for liferay 5.2.3.

In jboss server.log I see errors coming from wicket. Does's somebody know
if these are real errors or just info messages that wicket sends to console
like error messages as it seems.

Porlets works fine.

Versions JBOSS-Tomcat-4.2.3
JDK 1.5.0_09
Liferay 5.2.3

This [1] is what I get when portlet is deployed, and bellow that [2] when I
click on
DropDownChoice and onSelectionChanged method is activated.

Thanks,
Goran

1.
09:50:33,088 INFO  [STDOUT] 09:50:33,088 INFO  [PortletHotDeployListener] 1
portlet for HelloWorldPortlet is available for use
09:50:33,604 INFO  [STDOUT] [03 stu 2009 09:50:33,588] [DEBUG] []
[HwApplication] [ HwApplication.init()]
09:50:33,619 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.Application callInitializers
INFO: [HwApplication] init: Wicket core library initializer
09:50:33,635 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface
name=IBehaviorListener, method=public abstract void
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
09:50:33,635 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface
name=IBehaviorListener, method=public abstract void
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
09:50:33,651 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface
name=IFormSubmitListener, method=public abstract void
org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
09:50:33,666 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface
name=IFormSubmitListener, method=public abstract void
org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
09:50:33,682 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface
name=ILinkListener, method=public abstract void
org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
09:50:33,697 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface
name=ILinkListener, method=public abstract void
org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
09:50:33,713 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface
name=IOnChangeListener, method=public abstract void
org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
09:50:33,729 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface
name=IOnChangeListener, method=public abstract void
org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
09:50:33,744 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface
name=IRedirectListener, method=public abstract void
org.apache.wicket.IRedirectListener.onRedirect()]
09:50:33,760 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface
name=IRedirectListener, method=public abstract void
org.apache.wicket.IRedirectListener.onRedirect()]
09:50:33,776 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface
name=IResourceListener, method=public abstract void
org.apache.wicket.IResourceListener.onResourceRequested()]
09:50:33,791 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface
name=IResourceListener, method=public abstract void
org.apache.wicket.IResourceListener.onResourceRequested()]
09:50:33,822 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface
name=IActivePageBehaviorListener, method=public abstract void
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
09:50:33,838 ERROR [STDERR] 2009.11.03 09:50:33
org.apache.wicket.RequestListenerInterface registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface

Re: Dynamic Rendering and Common Paramenters

2009-11-03 Thread Gonzalo Aguilar Delgado
Let me see if I understand what you say. 

I should build the form inside a component instead the page. And I
should keep a reference
to the dynamic model inside this component. 

This makes sense for me but I find one problem. Where do I read the
renderer parameter?

Because this code gets executed in the main page.

 CODE 
 // Get render parameter 
String value =
((PortletRequestContext)RequestContext.get()).getPortletRequest().getParameter(crmportal:userId);

--


I can do it in submit but then I should be able to communicate it to the
new component and
make it render again.

Is there a common way to do this in wicket?


Thank you



El mar, 03-11-2009 a las 08:00 -0200, Pedro Santos escribió:

  But when I submit the form the constructer gets not called anymore.
 this is an expected behavior, an component instance is held on pagemap
 between requests.
 
  But as I have to build the form I do not have a dynamic model on page.
 Can't you manage an instance of an dynamic model on your component,
 independent of your form build logic? You can. Figure out the best way to
 your component. You can simple keep this model on an instance variable for
 example.
 
 On Tue, Nov 3, 2009 at 7:22 AM, Gonzalo Aguilar Delgado 
 gagui...@aguilardelgado.com wrote:
 
  Hello Again!
 
  I have a form that I build dynamically based on a render parameter
  value. I'm using
  http://cwiki.apache.org/WICKET/forms-with-dynamic-elements.html
 
 
  I use the constructor:
 
  /**
  * Constructor
  */
 public ViewModePage()
 {
 
 ...
 
 // Get render parameter
 String value =
 
  ((PortletRequestContext)RequestContext.get()).getPortletRequest().getParameter(crmportal:userId);
 ...
 // Check for a valid answer from this customer
 if(value!=null  value.length()0)
 {
 log.debug(Value length:  + value.length());
 User user =
  userDAOBean.find(UuidUserType.fromString(value));
 
 if(user!=null)
 {
 answer = getLastAnswer(1,user);
 if(answer!=null)
 {
 buildForm(answer);
 surveySubmitButton.setEnabled(true);
 }
 }
 }
 ...
 
 }
 
  
 
  buildForm(answer); gets the form build based on the user answer
 
  The problem as you can figure out. It works as I do nothing with the
  form... But when I submit the form the constructer gets not
  called anymore. So no matter what's the value it will get not updated to
  the new one.
 
  The GREAT book wicket in action explained this issue well. You have to
  use dynamic models:
 
 
   CODE --
 In chapter 4, we’ll discuss the differences between static models
  and dynamic mod-
  els (the issue at hand) in greater depth. For now, we’ll solve the
  problem by providing
  the label with a model that calculates its value every time it’s
  requested:
 
  add(new Label(total, new Model() {
  @Override
 public Object getObject() {
  NumberFormat nf = NumberFormat.getCurrencyInstance();
  return nf.format(getCart().getTotal());
  }
  }));
 
  ---WICKET IN ACTION 
 
 
  But as I have to build the form I do not have a dynamic model on page.
  So how do I make the form gets updated each time
  the page it's rendered without disturbing Wicket normal behaviour?
 
  Do I explain myself?
 
  Thank you all in advance.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


Re: Dynamic Rendering and Common Paramenters

2009-11-03 Thread Pedro Santos
 I should build the form inside a component instead the page. And I
should keep a reference
to the dynamic model inside this component.
Not what I try to mean.

your report:
But as I have to build the form I do not have a dynamic model on page.
You can have your model, and you can have your component build logic.

you report:

So no matter what's the value it will get not updated to
the new one.
so i think you are working on diferent answer instances
can you send some buildForm(answer) lines?

On Tue, Nov 3, 2009 at 9:22 AM, Gonzalo Aguilar Delgado 
gagui...@aguilardelgado.com wrote:

 Let me see if I understand what you say.

 I should build the form inside a component instead the page. And I
 should keep a reference
 to the dynamic model inside this component.

 This makes sense for me but I find one problem. Where do I read the
 renderer parameter?

 Because this code gets executed in the main page.

  CODE 
  // Get render parameter
String value =

 ((PortletRequestContext)RequestContext.get()).getPortletRequest().getParameter(crmportal:userId);

 --


 I can do it in submit but then I should be able to communicate it to the
 new component and
 make it render again.

 Is there a common way to do this in wicket?


 Thank you



 El mar, 03-11-2009 a las 08:00 -0200, Pedro Santos escribió:

   But when I submit the form the constructer gets not called anymore.
  this is an expected behavior, an component instance is held on pagemap
  between requests.
 
   But as I have to build the form I do not have a dynamic model on page.
  Can't you manage an instance of an dynamic model on your component,
  independent of your form build logic? You can. Figure out the best way to
  your component. You can simple keep this model on an instance variable
 for
  example.
 
  On Tue, Nov 3, 2009 at 7:22 AM, Gonzalo Aguilar Delgado 
  gagui...@aguilardelgado.com wrote:
 
   Hello Again!
  
   I have a form that I build dynamically based on a render parameter
   value. I'm using
   http://cwiki.apache.org/WICKET/forms-with-dynamic-elements.html
  
  
   I use the constructor:
  
   /**
   * Constructor
   */
  public ViewModePage()
  {
  
  ...
  
  // Get render parameter
  String value =
  
  
 ((PortletRequestContext)RequestContext.get()).getPortletRequest().getParameter(crmportal:userId);
  ...
  // Check for a valid answer from this customer
  if(value!=null  value.length()0)
  {
  log.debug(Value length:  + value.length());
  User user =
   userDAOBean.find(UuidUserType.fromString(value));
  
  if(user!=null)
  {
  answer = getLastAnswer(1,user);
  if(answer!=null)
  {
  buildForm(answer);
  
  surveySubmitButton.setEnabled(true);
  }
  }
  }
  ...
  
  }
  
  
 
  
   buildForm(answer); gets the form build based on the user answer
  
   The problem as you can figure out. It works as I do nothing with the
   form... But when I submit the form the constructer gets not
   called anymore. So no matter what's the value it will get not updated
 to
   the new one.
  
   The GREAT book wicket in action explained this issue well. You have
 to
   use dynamic models:
  
  
    CODE --
  In chapter 4, we’ll discuss the differences between static models
   and dynamic mod-
   els (the issue at hand) in greater depth. For now, we’ll solve the
   problem by providing
   the label with a model that calculates its value every time it’s
   requested:
  
   add(new Label(total, new Model() {
   @Override
  public Object getObject() {
   NumberFormat nf = NumberFormat.getCurrencyInstance();
   return nf.format(getCart().getTotal());
   }
   }));
  
   ---WICKET IN ACTION 
  
  
   But as I have to build the form I do not have a dynamic model on page.
   So how do I make the form gets updated each time
   the page it's rendered without disturbing Wicket normal behaviour?
  
   Do I explain myself?
  
   Thank you all in advance.
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
 




-- 
Pedro Henrique Oliveira dos Santos


Re: DefaultObjectStreamFactory | Re: AccessControlException with Wicket on Google App Engine (GAE)

2009-11-03 Thread A. Maza

Thanks Igor,


I have seen that the Objects class provides a static setter in order to 
use a different Implementation of IObjectStreamFactory instead of the 
DefaultObjectStreamFactory.


Where would you recommend to place the code to set my own implementation 
of IObjectStreamFactory using the static setter provided by Objects. I 
am not sure if it is enough to place it in the init method of my class 
that derives from org.apache.wicket.Application. (i.e., may the Objects 
instance be cleared at some time by the GC?)


thanks,
andr






On 02.11.2009 17:28, Igor Vaynberg wrote:

that should most likely work without problems.

-igor

On Mon, Nov 2, 2009 at 1:47 AM, Andreas Mazaandr.m...@gmail.com  wrote:

just to circumvent the problem for a while, I am thinking of the following
workaround:

what would be the implications if I change the implementation of
IObjectStreamFactor.DefaultObjectStreamFactory so that
newObjectInputStream() and newObjectOutputStream return the regular  JDK
ObjectInputStream and ObjectOutputStream, respectively?

To my mind, this would eliminate the AccessControlException problem since I
am not subclassing ObjectInputStream and ObjectOutputStream.

thanks,
andr


On 30.10.2009 10:27, A. Maza wrote:


yes, except the fact that I am trying to use a Memcache-based
implementation of the IPageStore instead of the HTTPSessionStore (based on
the TerracottaPageStore. However, in my case the exception occurs when I am
trying to serialize the page using the provided method of the
AbstractPageStore.

The exception of the second stacktrace I posted was reported by another
user in the GAE forum [1], but happening in a totally different scenario.

In my initial post I forgot the link to the issue I have opened on the GAE
project site. [2]

I am using Wicket 1.4.3 (I have also tried it with 1.4.2) and the latest
GAE SDK (1.2.6)

regards,
andr



[1]
http://groups.google.com/group/google-appengine-java/browse_thread/thread/b80648c126778ef5/0a259ba5bba8078f?lnk=gstq=wicket+accesscontrolexception#0a259ba5bba8078f

[2]http://code.google.com/p/googleappengine/issues/detail?id=2334







On 29.10.2009 21:56, Esteban Masoero wrote:


I'm sure the answer is yes but to be sure: have you done everything
that is said here

http://stronglytypedblog.blogspot.com/2009/04/wicket-on-google-app-engine.html
?
Also, what versions of gae sdk and wicket are you using?

A. Maza escribió:


Hi,

I've encountered now (and have seen reported by other users) several
different cases where Wicket on GAE throws an AccessControlException
when serializing an object to a byte array.

Although this is clearly an issue of GAE permissions, I would like to
ask if someone could give me a hint, why this exception occurs or if
someone may know a workaround. I've already filed an issue for this on
the GAE project site [1] and would forward any findings of the wicket
community.

Below I include snippets of two different stacktraces.

Thanks in advance,
andr


snip1

java.security.AccessControlException: access denied
(java.io.SerializablePermission enableSubclassImplementation)
at

java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)

at

java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at

com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:151)

at java.io.ObjectOutputStream.init(ObjectOutputStream.java:253)
at

org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.init(IObjectStreamFactory.java:150)

at

org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory.newObjectOutputStream(IObjectStreamFactory.java:114)

at
org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:)
at

org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203)


/snip1

snip2
(java.io.SerializablePermission enableSubstitution)
at java.security.AccessControlContext.checkPermission
(AccessControlContext.java:264)
at java.security.AccessController.checkPermission
(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:
532)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkPermission(DevAppServerFactory.java:122)
at java.io.ObjectOutputStream.enableReplaceObject
(ObjectOutputStream.java:556)
at org.apache.wicket.util.lang.Objects
$ReplaceObjectOutputStream.init(Objects.java:179)
at org.apache.wicket.util.lang.Objects
$ReplaceObjectOutputStream.init(Objects.java:170)
at org.apache.wicket.util.lang.Objects.cloneModel(Objects.java:442)
at org.apache.wicket.version.undo.ModelChange.init(ModelChange.java:
103)
at org.apache.wicket.version.undo.ChangeList.componentModelChanging
(ChangeList.java:64)
at

org.apache.wicket.version.undo.UndoPageVersionManager.componentModelChangin­g


Re: Tree table with check box

2009-11-03 Thread vela

Hello again,

Please find the code below


In Page class:


IColumn columns[] = new IColumn[] 
{
new  PropertyTreeColumn(new 
ColumnLocation(Alignment.LEFT, 100,
Unit.PERCENT),Check,userObject.name)
{
public IRenderable 
newCell(javax.swing.tree.TreeNode node, int level)
{
return null;
}

public Component newCell(MarkupContainer 
parent,java.lang.String id,
javax.swing.tree.TreeNode node, int level)
{   
CheckBoxPanel boxPanel = new 
CheckBoxPanel(parent.getId(),id);
return boxPanel;
}
},
};

TreeDataProvider treedataProvider = new TreeDataProvider();
trtTest = new
TreeTable(trtTest,treedataProvider.getTreeModel(),columns);
trtTest.getTreeState().expandAll();

add(trtTest); 



In Check box panel class:


public class CheckBoxPanel extends Panel
{
private CheckBox cbxName;
private Label lblName;
private Link lnkName;

public CheckBoxPanel(String id, String model) 
{
super(id);
setMarkupId(id);
setOutputMarkupId(true);
setOutputMarkupPlaceholderTag(true);


cbxName = new CheckBox(cbxName, new AbstractCheckBoxModel());
add(cbxName);
   }
}



Tree Data Provider class:


public class TreeDataProvider 
{
private DefaultMutableTreeNode dmtRoot;
public TreeDataProvider()
{
dmtRoot = new DefaultMutableTreeNode(new TreeListVO(Test));

DefaultMutableTreeNode dmtBase1 = new DefaultMutableTreeNode(new
TreeListVO(Sakthi));
DefaultMutableTreeNode dmtChild1 = new 
DefaultMutableTreeNode(new
TreeListVO(Computer));
dmtBase1.add(dmtChild1);
dmtRoot.add(dmtBase1);
}

public TreeModel getTreeModel()
{
DefaultTreeModel dtmTree = new DefaultTreeModel(dmtRoot);
return dtmTree;
}
}




In Model class:


public class TreeListVO 
{
private String name;

public TreeListVO(String name) 
{
this.name = name;
}

public String getName() 
{
return name;
}
}



CheckBoxPanel  Page class have correspoding html file








-- 
View this message in context: 
http://old.nabble.com/Tree-table-with-check-box-tp26080852p26160113.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Dynamic Rendering and Common Paramenters

2009-11-03 Thread Gonzalo Aguilar Delgado



 I should build the form inside a component instead the page. And I
 should keep a reference
 to the dynamic model inside this component.
 Not what I try to mean.


So what's the way?



 
 your report:
 But as I have to build the form I do not have a dynamic model on page.
 You can have your model, and you can have your component build logic.





 
 you report:
 
 So no matter what's the value it will get not updated to
 the new one.
 so i think you are working on diferent answer instances
 can you send some buildForm(answer) lines?


Yes but's somewhat large, anyway answer has got from the code I sent
earlier. But it got not
updated because this code goes in the constructor that never gets
called.

Here goes the code:


public void buildForm(SurveyAnswer answer)
{

ListSurveyQuestion listQuestions = getQuestionList(1); // 
FIXIT: How
do we get this questionaire?

if(listQuestions!=null  listQuestions.size()0)
{

int category = -1;
QuestionCategoryComponent categoryComponent = null;

/*
 * We add category containers to the component array and
 * questions to the category containers.
 * 
 */
for(IteratorSurveyQuestion iter = 
listQuestions.iterator();
iter.hasNext();)
{
SurveyQuestion question = iter.next();

// Check if we should start a new category
if(category !=
question.getSurveyQuestionCategory().getIdSurveyQuestionCategory())
{
log.debug(Category:  +
question.getSurveyQuestionCategory().getQuestionCategoryDescription());
categoryComponent = new
QuestionCategoryComponent(surveyComponent,
question.getSurveyQuestionCategory().getQuestionCategoryDescription());
components.add(categoryComponent);
category =
question.getSurveyQuestionCategory().getIdSurveyQuestionCategory();
}

if(categoryComponent!=null)
{
SurveyQuestionResponse response = null;
if(answer!=null)
{
response = 
surveyAnswerFactory.getResponse(question, answer);

if(response.getIdSurveyQuestionResponse()==null)
{
log.info(Creating a 
new answer for this question);


surveyQuestionResponseDAO.save(response);

}
}

// Each question component holds 
question and answer
try {

categoryComponent.add(QuestionComponentFactory.getComponent(question,
response));
} catch (ComponentTypeException e) {
try {
warn(Response for 
question:  +
question.getSurveyQuestionDescription() +  has incorrect response!);

categoryComponent.add(QuestionComponentFactory.getComponent(question));
} catch (ComponentTypeException 
e1) {
log.error(Cannot 
create component);
}
}
}


}

}
}


 


Re: DefaultObjectStreamFactory | Re: AccessControlException with Wicket on Google App Engine (GAE)

2009-11-03 Thread Igor Vaynberg
application init should be fine.

-igor

On Tue, Nov 3, 2009 at 5:02 AM, A. Maza andr.m...@gmail.com wrote:
 Thanks Igor,


 I have seen that the Objects class provides a static setter in order to use
 a different Implementation of IObjectStreamFactory instead of the
 DefaultObjectStreamFactory.

 Where would you recommend to place the code to set my own implementation of
 IObjectStreamFactory using the static setter provided by Objects. I am not
 sure if it is enough to place it in the init method of my class that
 derives from org.apache.wicket.Application. (i.e., may the Objects instance
 be cleared at some time by the GC?)

 thanks,
 andr






 On 02.11.2009 17:28, Igor Vaynberg wrote:

 that should most likely work without problems.

 -igor

 On Mon, Nov 2, 2009 at 1:47 AM, Andreas Mazaandr.m...@gmail.com  wrote:

 just to circumvent the problem for a while, I am thinking of the
 following
 workaround:

 what would be the implications if I change the implementation of
 IObjectStreamFactor.DefaultObjectStreamFactory so that
 newObjectInputStream() and newObjectOutputStream return the regular  JDK
 ObjectInputStream and ObjectOutputStream, respectively?

 To my mind, this would eliminate the AccessControlException problem since
 I
 am not subclassing ObjectInputStream and ObjectOutputStream.

 thanks,
 andr


 On 30.10.2009 10:27, A. Maza wrote:

 yes, except the fact that I am trying to use a Memcache-based
 implementation of the IPageStore instead of the HTTPSessionStore (based
 on
 the TerracottaPageStore. However, in my case the exception occurs when I
 am
 trying to serialize the page using the provided method of the
 AbstractPageStore.

 The exception of the second stacktrace I posted was reported by another
 user in the GAE forum [1], but happening in a totally different
 scenario.

 In my initial post I forgot the link to the issue I have opened on the
 GAE
 project site. [2]

 I am using Wicket 1.4.3 (I have also tried it with 1.4.2) and the latest
 GAE SDK (1.2.6)

 regards,
 andr



 [1]

 http://groups.google.com/group/google-appengine-java/browse_thread/thread/b80648c126778ef5/0a259ba5bba8078f?lnk=gstq=wicket+accesscontrolexception#0a259ba5bba8078f

 [2]http://code.google.com/p/googleappengine/issues/detail?id=2334







 On 29.10.2009 21:56, Esteban Masoero wrote:

 I'm sure the answer is yes but to be sure: have you done everything
 that is said here


 http://stronglytypedblog.blogspot.com/2009/04/wicket-on-google-app-engine.html
 ?
 Also, what versions of gae sdk and wicket are you using?

 A. Maza escribió:

 Hi,

 I've encountered now (and have seen reported by other users) several
 different cases where Wicket on GAE throws an AccessControlException
 when serializing an object to a byte array.

 Although this is clearly an issue of GAE permissions, I would like to
 ask if someone could give me a hint, why this exception occurs or if
 someone may know a workaround. I've already filed an issue for this on
 the GAE project site [1] and would forward any findings of the wicket
 community.

 Below I include snippets of two different stacktraces.

 Thanks in advance,
 andr


 snip1

 java.security.AccessControlException: access denied
 (java.io.SerializablePermission enableSubclassImplementation)
 at


 java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)

 at


 java.security.AccessController.checkPermission(AccessController.java:546)
 at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
 at


 com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:151)

 at java.io.ObjectOutputStream.init(ObjectOutputStream.java:253)
 at


 org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.init(IObjectStreamFactory.java:150)

 at


 org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory.newObjectOutputStream(IObjectStreamFactory.java:114)

 at

 org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:)
 at


 org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203)


 /snip1

 snip2
 (java.io.SerializablePermission enableSubstitution)
 at java.security.AccessControlContext.checkPermission
 (AccessControlContext.java:264)
 at java.security.AccessController.checkPermission
 (AccessController.java:427)
 at java.lang.SecurityManager.checkPermission(SecurityManager.java:
 532)
 at com.google.appengine.tools.development.DevAppServerFactory
 $CustomSecurityManager.checkPermission(DevAppServerFactory.java:122)
 at java.io.ObjectOutputStream.enableReplaceObject
 (ObjectOutputStream.java:556)
 at org.apache.wicket.util.lang.Objects
 $ReplaceObjectOutputStream.init(Objects.java:179)
 at org.apache.wicket.util.lang.Objects
 $ReplaceObjectOutputStream.init(Objects.java:170)
 at org.apache.wicket.util.lang.Objects.cloneModel(Objects.java:442)
 at 

Re: Dynamic Rendering and Common Paramenters

2009-11-03 Thread Pedro Santos
Hi Gonzalo, I thought that with buildForm implementation I will see how you
create your form component. But seams that it is created on the line:
QuestionComponentFactory.getComponent(question,response)

Instead of ask you for more code, I will try to explain myself:

So no matter what's the value it will get not updated to the new one.
Any build component logic will stop you from create an form with an dynamic
model on it. I thing you are updating an object instance that isn't the one
on your form model.
on lines:
response = surveyAnswerFactory.getResponse(question,
answer);
and then:


categoryComponent.add(QuestionComponentFactory.getComponent(question,
response));
be sure of to work on the same response instance that is on your form model.

On Tue, Nov 3, 2009 at 1:38 PM, Gonzalo Aguilar Delgado 
gagui...@aguilardelgado.com wrote:




  I should build the form inside a component instead the page. And I
  should keep a reference
  to the dynamic model inside this component.
  Not what I try to mean.


 So what's the way?



 
  your report:
  But as I have to build the form I do not have a dynamic model on page.
  You can have your model, and you can have your component build logic.


 


 
  you report:
 
  So no matter what's the value it will get not updated to
  the new one.
  so i think you are working on diferent answer instances
  can you send some buildForm(answer) lines?


 Yes but's somewhat large, anyway answer has got from the code I sent
 earlier. But it got not
 updated because this code goes in the constructor that never gets
 called.

 Here goes the code:


public void buildForm(SurveyAnswer answer)
{

ListSurveyQuestion listQuestions = getQuestionList(1); //
 FIXIT: How
 do we get this questionaire?

if(listQuestions!=null  listQuestions.size()0)
{

int category = -1;
QuestionCategoryComponent categoryComponent = null;

/*
 * We add category containers to the component array
 and
 * questions to the category containers.
 *
 */
for(IteratorSurveyQuestion iter =
 listQuestions.iterator();
 iter.hasNext();)
{
SurveyQuestion question = iter.next();

// Check if we should start a new category
if(category !=
 question.getSurveyQuestionCategory().getIdSurveyQuestionCategory())
{
log.debug(Category:  +
 question.getSurveyQuestionCategory().getQuestionCategoryDescription());
categoryComponent = new
 QuestionCategoryComponent(surveyComponent,
 question.getSurveyQuestionCategory().getQuestionCategoryDescription());
components.add(categoryComponent);
category =
 question.getSurveyQuestionCategory().getIdSurveyQuestionCategory();
}

if(categoryComponent!=null)
{
SurveyQuestionResponse response =
 null;
if(answer!=null)
{
response =
 surveyAnswerFactory.getResponse(question, answer);

  if(response.getIdSurveyQuestionResponse()==null)
{
log.info(Creating
 a new answer for this question);


  surveyQuestionResponseDAO.save(response);

}
}

// Each question component holds
 question and answer
try {

 categoryComponent.add(QuestionComponentFactory.getComponent(question,
 response));
} catch (ComponentTypeException e) {
try {
warn(Response for
 question:  +
 question.getSurveyQuestionDescription() +  has incorrect response!);

 categoryComponent.add(QuestionComponentFactory.getComponent(question));
} catch
 (ComponentTypeException e1) {
log.error(Cannot
 create component);
}
}
}


}

}
}


 




-- 
Pedro Henrique Oliveira dos Santos


Problem with IFormsubmitting

2009-11-03 Thread Martin Makundi
Hi!

I need to accomplish the following:
1. receive ajax onchange event from a formcomponent
2. receive defaultformprocesing=false style submit
3. repaint an area; I this is why I need the form to be really
submitted (=rawinput but not validated).

I have built a custom component FormSubmittingDropDownChoice.

The problem is that even if I press another submit component (button,
for example), the form allways assumes the formSubmitting component to
be FormSubmittingDropDownChoice. Why? Because the findSubmittingButton
is so simple that if FormSubmittingDropDownChoice has a value, it is
the submitting component.

Is there a workaround or fix? How could I achieve similar
functionality in a working manner? This works well if I click the
FormSubmittingDropDownChoice, otherwise it does not :(

package com.tustor.wicket.common.reusables.formcomponents;

public class FormSubmittingDropDownChoiceT extends DropDownChoiceT
implements IFormSubmittingComponent {

  public FormSubmittingDropDownChoice(String id, various constructor options) {
super(id, choices, renderer);
  }
  /**
   * @see 
org.apache.wicket.markup.html.form.IFormSubmittingComponent#getDefaultFormProcessing()
   */
  public boolean getDefaultFormProcessing() {
return false;
  }

  /**
   * @see org.apache.wicket.markup.html.form.IFormSubmittingComponent#onSubmit()
   */
  public void onSubmit() {
// override
  }

  /**
   * wicket-ajax:
   *
   * if (submitButton != null) {
   *   s += Wicket.Form.encode(submitButton) + =1;
   * }
   *
   * @see org.apache.wicket.markup.html.form.FormComponent#getInputAsArray()
   */
  @Override
  public String[] getInputAsArray() {
return MarkupUtils.filterSubmitIndicator(super.getInputAsArray());
  }

  /**
   * @see 
org.apache.wicket.markup.html.form.AbstractSingleSelectChoice#getModelValue()
   */
  @Override
  public String getModelValue() {
String value = super.getModelValue();
if (1.equals(value)) {
  throw new IllegalStateException(1 not supported because of
javaScript wicket-ajax:submitForm: function(form, submitButton));
}
return value;
  }
}

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Problem with IFormsubmitting

2009-11-03 Thread Martin Makundi
Hi!

Maybe this is the solution:

String url = 
getRequest().getParameter(getHiddenFieldId());
if (!Strings.isEmpty(url))
{
dispatchEvent(getPage(), url);
}


??

Attach a change listener with ajax form submit?

**
Martin

2009/11/3 Martin Makundi martin.maku...@koodaripalvelut.com:
 Hi!

 I need to accomplish the following:
 1. receive ajax onchange event from a formcomponent
 2. receive defaultformprocesing=false style submit
 3. repaint an area; I this is why I need the form to be really
 submitted (=rawinput but not validated).

 I have built a custom component FormSubmittingDropDownChoice.

 The problem is that even if I press another submit component (button,
 for example), the form allways assumes the formSubmitting component to
 be FormSubmittingDropDownChoice. Why? Because the findSubmittingButton
 is so simple that if FormSubmittingDropDownChoice has a value, it is
 the submitting component.

 Is there a workaround or fix? How could I achieve similar
 functionality in a working manner? This works well if I click the
 FormSubmittingDropDownChoice, otherwise it does not :(

 package com.tustor.wicket.common.reusables.formcomponents;

 public class FormSubmittingDropDownChoiceT extends DropDownChoiceT
 implements IFormSubmittingComponent {

  public FormSubmittingDropDownChoice(String id, various constructor options) {
    super(id, choices, renderer);
  }
  /**
   * @see 
 org.apache.wicket.markup.html.form.IFormSubmittingComponent#getDefaultFormProcessing()
   */
  public boolean getDefaultFormProcessing() {
    return false;
  }

  /**
   * @see 
 org.apache.wicket.markup.html.form.IFormSubmittingComponent#onSubmit()
   */
  public void onSubmit() {
    // override
  }

  /**
   * wicket-ajax:
   *
   * if (submitButton != null) {
   *   s += Wicket.Form.encode(submitButton) + =1;
   * }
   *
   * @see org.apache.wicket.markup.html.form.FormComponent#getInputAsArray()
   */
 �...@override
  public String[] getInputAsArray() {
    return MarkupUtils.filterSubmitIndicator(super.getInputAsArray());
  }

  /**
   * @see 
 org.apache.wicket.markup.html.form.AbstractSingleSelectChoice#getModelValue()
   */
 �...@override
  public String getModelValue() {
    String value = super.getModelValue();
    if (1.equals(value)) {
      throw new IllegalStateException(1 not supported because of
 javaScript wicket-ajax:submitForm: function(form, submitButton));
    }
    return value;
  }
 }


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: Glue for composing panels

2009-11-03 Thread Frank Silbermann
Michal, I adopted your idea, but with a variation.  It is something like:

// Use this instead of WebPage for any base page whose component-tree
// construction relies on abstract or overridable methods.
//
abstract class DelayedConstructionWebPage extends WebPage {

private Boolean componentsAssembled = false;

...(preserve the standard constructors of WebPage)...

// This method's implementation will build the component tree.
// It may freely call abstract or overridable methods.
//
abstract protected void assembleComponents();

// If you have any method which accesses a component,
// and which might be called before the first rendering,
// to ensure that the component exists you should insert
// a one-line call to assembleComponentsIfNecessary()
//
protected assembleComponentsIfNecessary() {
if ( !componentsAssembled ) {
assembleComponents();
componentsAssembled = true;
}
}

@Override
void onBeforeRender() {
assembleComponentsIfNecessary();
super.onBeforeRender(); 
}
}   

I believe this will minimize the boilerplate code in the classes that provide 
the actual business value.

-Original Message-
From: Michal Kurtak [mailto:michal.kur...@gmail.com] 
Sent: Monday, November 02, 2009 11:08 AM
To: users@wicket.apache.org
Subject: Re: Glue for composing panels

Yes Frank, model-setting method was just an example how to access a
component before onBeforeRender() executes.

I've only tried to point out that we set componentsAssembled = true in
assembleComponents() method. We call assembleComponents() from
get-method (for referenced component) to ensure that referenced
component has been created.

michal

...
 /Frank

 -Original Message-
 From: Michal Kurtak [mailto:michal.kur...@gmail.com]
 Sent: Monday, November 02, 2009 3:39 AM
 To: users@wicket.apache.org
 Subject: Re: Glue for composing panels

 Hi Frank,

 We use the same approach as you. We have found one disadvantage, which
 relates to references to components created by subclasses.
 I'll demostrate it (problem and solution) in the following example:

 class BasePage extends Page
 {
   /** Component created by subclass */
   private Component component;
   private boolean componentsAssembled = false;

    /** Let the assemple method to set componentsAssembled flag */
    private void assembleComponents()
    {
        component = createComponent();
        ...
        componentsAssembled = true;
    }

    protected abstract Component createComponent();

     @Override
       void onBeforeRender() {
               if ( !componentsAssembled ) {
                       assembleComponents();
               }
               super.onBeforeRender(); // Or whatever else is needed
       }

   /** Method uses assambelComponents() to ensure, that component is created */
   public Component getComponent()
   {
       if(component == null)
       {
              assembleComponents();
       }
       return component;
   }

   /** public method delegete to referenced component. Uses safe
 getComponent() method  */
   public void setComponentModel(IModel? model)
   {
     getComponent().setModel(model);
   }



 michal


 2009/10/29 Frank Silbermann frank.silberm...@fedex.com:

 I was discussing glue for composing reusable panels into web pages on
 the blog of Erik van Oosten
 (http://blog.jteam.nl/2009/09/16/wicket-dos-and-donts/).

 I told him that my approach had been to create an abstract base page
 that constructs the common elements while leaving place-holders for
 page-specific panels by defining methods such as:

        abstract Panel createUpperLeftPanel (String wicketID);
        abstract Panel createLowerRightPanel(String wicketID);

 and having the base page's constructor say things like:

        Panel p1 = createUpperLeftPanel(a_wicket_id);
        add(p1);
        ...
        Add( createUpperRightPanel(another_wicket_id) );

 The child page's contribution would be the implementation of the
 abstract methods.

 I explained that I preferred this to mark-up inheritance because I could
 add to the base page in any number places (not just one place), the
 compiler would tell the child-page writer exactly what panels were
 needed, and most importantly, no additional mark-up whatsoever would
 need to be associated with any of the child pages.  (Panel classes used
 by the child page would of course have their associated mark-up.)

 Eric and others explained what a bad idea it is for constructors to call
 overridable methods -- they execute before the child-page's properties
 have been set.  I usually got away with this, but I admit I was burnt a
 few times.  Recently, I wondered whether there might be a simple fix for
 the constructor-calls-overridable-method problem, such as:

 (a) Move the base page's component tree construction out of the
 constructor, and put it into the method:

        private void assembleComponents() 

Re: Dynamic Rendering and Common Paramenters

2009-11-03 Thread Gonzalo Aguilar Delgado
But Pedro, 

Everything works well. The form got created and everything gets sent and
updated when I click the submit button.

So in this aspect everything works well. 

The only problem is that I need to get a render parameter that actually
I only get in constructor so never gets updated 
and I want to know what's the correct way to do this.

I don't think I'm updating a object instance that isn't the one from my
model. I took this into account.

Tnx


El mar, 03-11-2009 a las 14:15 -0200, Pedro Santos escribió:

 Hi Gonzalo, I thought that with buildForm implementation I will see how you
 create your form component. But seams that it is created on the line:
 QuestionComponentFactory.getComponent(question,response)
 
 Instead of ask you for more code, I will try to explain myself:
 
 So no matter what's the value it will get not updated to the new one.
 Any build component logic will stop you from create an form with an dynamic
 model on it. I thing you are updating an object instance that isn't the one
 on your form model.
 on lines:
 response = surveyAnswerFactory.getResponse(question,
 answer);
 and then:
 
 
 categoryComponent.add(QuestionComponentFactory.getComponent(question,
 response));
 be sure of to work on the same response instance that is on your form model.
 
 On Tue, Nov 3, 2009 at 1:38 PM, Gonzalo Aguilar Delgado 
 gagui...@aguilardelgado.com wrote:
 
 
 
 
   I should build the form inside a component instead the page. And I
   should keep a reference
   to the dynamic model inside this component.
   Not what I try to mean.
 
 
  So what's the way?
 
 
 
  
   your report:
   But as I have to build the form I do not have a dynamic model on page.
   You can have your model, and you can have your component build logic.
 
 
  
 
 
  
   you report:
  
   So no matter what's the value it will get not updated to
   the new one.
   so i think you are working on diferent answer instances
   can you send some buildForm(answer) lines?
 
 
  Yes but's somewhat large, anyway answer has got from the code I sent
  earlier. But it got not
  updated because this code goes in the constructor that never gets
  called.
 
  Here goes the code:
 
 
 public void buildForm(SurveyAnswer answer)
 {
 
 ListSurveyQuestion listQuestions = getQuestionList(1); //
  FIXIT: How
  do we get this questionaire?
 
 if(listQuestions!=null  listQuestions.size()0)
 {
 
 int category = -1;
 QuestionCategoryComponent categoryComponent = null;
 
 /*
  * We add category containers to the component array
  and
  * questions to the category containers.
  *
  */
 for(IteratorSurveyQuestion iter =
  listQuestions.iterator();
  iter.hasNext();)
 {
 SurveyQuestion question = iter.next();
 
 // Check if we should start a new category
 if(category !=
  question.getSurveyQuestionCategory().getIdSurveyQuestionCategory())
 {
 log.debug(Category:  +
  question.getSurveyQuestionCategory().getQuestionCategoryDescription());
 categoryComponent = new
  QuestionCategoryComponent(surveyComponent,
  question.getSurveyQuestionCategory().getQuestionCategoryDescription());
 components.add(categoryComponent);
 category =
  question.getSurveyQuestionCategory().getIdSurveyQuestionCategory();
 }
 
 if(categoryComponent!=null)
 {
 SurveyQuestionResponse response =
  null;
 if(answer!=null)
 {
 response =
  surveyAnswerFactory.getResponse(question, answer);
 
   if(response.getIdSurveyQuestionResponse()==null)
 {
 log.info(Creating
  a new answer for this question);
 
 
   surveyQuestionResponseDAO.save(response);
 
 }
 }
 
 // Each question component holds
  question and answer
 try {
 
  categoryComponent.add(QuestionComponentFactory.getComponent(question,
  response));
 } catch (ComponentTypeException e) {
 try {
 

Re: uploaded files in page instance

2009-11-03 Thread fachhoch

Is there any open source utility to write and manage files to temp folder ,
handle deletion , signle thread   access etc   ?


Newgro wrote:
 
 Igor Vaynberg schrieb:
 you guys ever hear of transactional isolation? :) databases handle all
 this kind of neat stuff for you.

 -igor

   
 Oh, i didn't saw that he tried it in one transaction. I thought it are 
 multiple stateless steps.
 Sorry
 Per
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/uploaded-files-in-page-instance-tp25962716p26160637.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Problem with IFormsubmitting

2009-11-03 Thread Martin Makundi
Hi!

I hope I found a solution usin IOnChangeListener.

Please try this out and let me know if it works for you. Maybe it
should be incorporated into Wicket?

public abstract class FormSubmitAjaxChangeListenerCallDecorator
implements IAjaxCallDecorator {
  private final static Method hiddenFieldGetter;

  static {
try {
  hiddenFieldGetter = Form.class.getDeclaredMethod(getHiddenFieldId);
  hiddenFieldGetter.setAccessible(true);
} catch (Exception e) {
  throw new RuntimeException(e);
}
  }
  /**
   * @see 
org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnFailureScript(java.lang.CharSequence)
   */
  public CharSequence decorateOnFailureScript(
  CharSequence arg0) {
return arg0;
  }

  /**
   * @see 
org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnSuccessScript(java.lang.CharSequence)
   */
  public CharSequence decorateOnSuccessScript(
  CharSequence arg0) {
return arg0;
  }

  /**
   * @see 
org.apache.wicket.ajax.IAjaxCallDecorator#decorateScript(java.lang.CharSequence)
   */
  public CharSequence decorateScript(CharSequence arg0) {
Form? root = getForm().getRootForm();
String hiddenFieldId;
try {
  hiddenFieldId = (String) hiddenFieldGetter.invoke(root);
  return new AppendingStringBuffer(document.getElementById(').append(
  
hiddenFieldId).append(').value=').append(getChangeListenerUrl()).append(
  ';).append(arg0);
} catch (Exception e) {
  throw new RuntimeException(e);
}
  }

  /**
   * @return Form?
   */
  public abstract Form? getForm();

  /**
   * @return CharSequence
   */
  public abstract CharSequence getChangeListenerUrl();
}


public abstract class AjaxFormSubmittingChangeListenerCheckBox extends
CheckBox {
  /**
   * @param id
   * @param model
   */
  public AjaxFormSubmittingChangeListenerCheckBox(String id,
IModelBoolean model) {
super(id, model);
add(new AjaxFormSubmitBehavior(JavaScriptConstants.ONCHANGE) {
  @Override
  protected void onError(AjaxRequestTarget target) {
AjaxFormSubmittingChangeListenerCheckBox.this.onError(target);
  }

  @Override
  protected void onSubmit(AjaxRequestTarget target) {
AjaxFormSubmittingChangeListenerCheckBox.this.onSubmit(target);
  }

  /**
   * @see 
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#getAjaxCallDecorator()
   */
  @Override
  protected IAjaxCallDecorator getAjaxCallDecorator() {
return new FormSubmitAjaxChangeListenerCallDecorator() {
  @Override
  public CharSequence getChangeListenerUrl() {
return urlFor(IOnChangeListener.INTERFACE);
  }

  @Override
  public Form? getForm() {
return AjaxFormSubmittingChangeListenerCheckBox.this.getForm();
  }

};
  }
});
  }

  /**
   * @param target
   */
  protected abstract void onSubmit(AjaxRequestTarget target);

  /**
   * @param target
   */
  protected void onError(AjaxRequestTarget target) {
onSubmit(target);
  }

  /**
   * @param id
   */
  public AjaxFormSubmittingChangeListenerCheckBox(String id) {
this(id, null);
  }
}


2009/11/3 Martin Makundi martin.maku...@koodaripalvelut.com:
 Hi!

 Maybe this is the solution:

                        String url = 
 getRequest().getParameter(getHiddenFieldId());
                        if (!Strings.isEmpty(url))
                        {
                                dispatchEvent(getPage(), url);
                        }


 ??

 Attach a change listener with ajax form submit?

 **
 Martin

 2009/11/3 Martin Makundi martin.maku...@koodaripalvelut.com:
 Hi!

 I need to accomplish the following:
 1. receive ajax onchange event from a formcomponent
 2. receive defaultformprocesing=false style submit
 3. repaint an area; I this is why I need the form to be really
 submitted (=rawinput but not validated).

 I have built a custom component FormSubmittingDropDownChoice.

 The problem is that even if I press another submit component (button,
 for example), the form allways assumes the formSubmitting component to
 be FormSubmittingDropDownChoice. Why? Because the findSubmittingButton
 is so simple that if FormSubmittingDropDownChoice has a value, it is
 the submitting component.

 Is there a workaround or fix? How could I achieve similar
 functionality in a working manner? This works well if I click the
 FormSubmittingDropDownChoice, otherwise it does not :(

 package com.tustor.wicket.common.reusables.formcomponents;

 public class FormSubmittingDropDownChoiceT extends DropDownChoiceT
 implements IFormSubmittingComponent {

  public FormSubmittingDropDownChoice(String id, various constructor options) 
 {
    super(id, choices, renderer);
  }
  /**
   * @see 
 org.apache.wicket.markup.html.form.IFormSubmittingComponent#getDefaultFormProcessing()
   */
  public boolean getDefaultFormProcessing() {
    return false;
  }

  /**
   * @see 
 

Re: Page model returning null

2009-11-03 Thread Loren Cole
Oh.  That is embarrassing.  Sorry for taking your time.

On Mon, Nov 2, 2009 at 7:47 PM, Jeremy Thomerson
jer...@wickettraining.comwrote:

 On Mon, Nov 2, 2009 at 4:57 PM, Loren Cole loren.c...@gmail.com wrote:

 HomePage hp = (HomePage) this.findPage();
 ModelEntity account = (ModelEntity)
  parent.getInnermostModel();
 

 Is this just a typo?  You're getting the home page and then getting the
 innermost model from something else?

 Shouldn't it be hp.getModel()?

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



Re: Problem with IFormsubmitting

2009-11-03 Thread Martin Makundi
Hi!

One finishing touch is needed. The hidden field should be cleared
after ajax submit. It seems to work now.. feel free to critisize.

public abstract class FormSubmitAjaxChangeListenerCallDecorator
implements IAjaxCallDecorator {
  private final static Method hiddenFieldGetter;

  static {
try {
  hiddenFieldGetter = Form.class.getDeclaredMethod(getHiddenFieldId);
  hiddenFieldGetter.setAccessible(true);
} catch (Exception e) {
  throw new RuntimeException(e);
}
  }
  /**
   * @see 
org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnFailureScript(java.lang.CharSequence)
   */
  public CharSequence decorateOnFailureScript(
  CharSequence arg0) {
return getSetHiddenFieldValue().append(arg0);
  }

  /**
   * @see 
org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnSuccessScript(java.lang.CharSequence)
   */
  public CharSequence decorateOnSuccessScript(
  CharSequence arg0) {
return getSetHiddenFieldValue().append(arg0);
  }

  /**
   * @see 
org.apache.wicket.ajax.IAjaxCallDecorator#decorateScript(java.lang.CharSequence)
   */
  public CharSequence decorateScript(CharSequence arg0) {
return getSetHiddenFieldValue(getChangeListenerUrl()).append(arg0);
  }

  /**
   * @param hiddenFieldId
   * @param value
   * @return
   */
  private AppendingStringBuffer getSetHiddenFieldValue(CharSequence value) {
try {
  Form? root = getForm().getRootForm();
  String hiddenFieldId;
  hiddenFieldId = (String) hiddenFieldGetter.invoke(root);
  return new AppendingStringBuffer(document.getElementById(').append(
  hiddenFieldId).append(').value=').append(value).append(
  ';);
} catch (Exception e) {
  throw new RuntimeException(e);
}
  }

  /**
   * @return Form?
   */
  public abstract Form? getForm();

  /**
   * @return CharSequence
   */
  public abstract CharSequence getChangeListenerUrl();
}

**
Martin

2009/11/3 Martin Makundi martin.maku...@koodaripalvelut.com:
 Hi!

 I hope I found a solution usin IOnChangeListener.

 Please try this out and let me know if it works for you. Maybe it
 should be incorporated into Wicket?

 public abstract class FormSubmitAjaxChangeListenerCallDecorator
 implements IAjaxCallDecorator {
  private final static Method hiddenFieldGetter;

  static {
    try {
      hiddenFieldGetter = Form.class.getDeclaredMethod(getHiddenFieldId);
      hiddenFieldGetter.setAccessible(true);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
  /**
   * @see 
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnFailureScript(java.lang.CharSequence)
   */
  public CharSequence decorateOnFailureScript(
      CharSequence arg0) {
    return arg0;
  }

  /**
   * @see 
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnSuccessScript(java.lang.CharSequence)
   */
  public CharSequence decorateOnSuccessScript(
      CharSequence arg0) {
    return arg0;
  }

  /**
   * @see 
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateScript(java.lang.CharSequence)
   */
  public CharSequence decorateScript(CharSequence arg0) {
    Form? root = getForm().getRootForm();
    String hiddenFieldId;
    try {
      hiddenFieldId = (String) hiddenFieldGetter.invoke(root);
      return new AppendingStringBuffer(document.getElementById(').append(
          
 hiddenFieldId).append(').value=').append(getChangeListenerUrl()).append(
          ';).append(arg0);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }

  /**
   * @return Form?
   */
  public abstract Form? getForm();

  /**
   * @return CharSequence
   */
  public abstract CharSequence getChangeListenerUrl();
 }


 public abstract class AjaxFormSubmittingChangeListenerCheckBox extends
 CheckBox {
  /**
   * @param id
   * @param model
   */
  public AjaxFormSubmittingChangeListenerCheckBox(String id,
 IModelBoolean model) {
    super(id, model);
    add(new AjaxFormSubmitBehavior(JavaScriptConstants.ONCHANGE) {
     �...@override
      protected void onError(AjaxRequestTarget target) {
        AjaxFormSubmittingChangeListenerCheckBox.this.onError(target);
      }

     �...@override
      protected void onSubmit(AjaxRequestTarget target) {
        AjaxFormSubmittingChangeListenerCheckBox.this.onSubmit(target);
      }

      /**
       * @see 
 org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#getAjaxCallDecorator()
       */
     �...@override
      protected IAjaxCallDecorator getAjaxCallDecorator() {
        return new FormSubmitAjaxChangeListenerCallDecorator() {
         �...@override
          public CharSequence getChangeListenerUrl() {
            return urlFor(IOnChangeListener.INTERFACE);
          }

         �...@override
          public Form? getForm() {
            return AjaxFormSubmittingChangeListenerCheckBox.this.getForm();
          }

        };
      }
    });
  }

  /**
   * @param target
   */
  protected abstract void onSubmit(AjaxRequestTarget target);

  /**
   * @param target
   */
  protected void 

Re: Dynamic Rendering and Common Paramenters

2009-11-03 Thread Pedro Santos
ok, how this parameter get updated? You receive it on every request? If so,
the usual way of to build your render logic dynamically is to implement
component onBeforeRender method, rather than on your component constructor.
See the ListView code for example: based on the model object (an list) the
list items are dynamically add to component. And that render logic is tested
based on list every component render. Similarly, you can have your render
logic executed based on a parameter every component render...

On Tue, Nov 3, 2009 at 3:25 PM, Gonzalo Aguilar Delgado 
gagui...@aguilardelgado.com wrote:

 But Pedro,

 Everything works well. The form got created and everything gets sent and
 updated when I click the submit button.

 So in this aspect everything works well.

 The only problem is that I need to get a render parameter that actually
 I only get in constructor so never gets updated
 and I want to know what's the correct way to do this.

 I don't think I'm updating a object instance that isn't the one from my
 model. I took this into account.

 Tnx


 El mar, 03-11-2009 a las 14:15 -0200, Pedro Santos escribió:

  Hi Gonzalo, I thought that with buildForm implementation I will see how
 you
  create your form component. But seams that it is created on the line:
  QuestionComponentFactory.getComponent(question,response)
 
  Instead of ask you for more code, I will try to explain myself:
 
  So no matter what's the value it will get not updated to the new one.
  Any build component logic will stop you from create an form with an
 dynamic
  model on it. I thing you are updating an object instance that isn't the
 one
  on your form model.
  on lines:
  response =
 surveyAnswerFactory.getResponse(question,
  answer);
  and then:
 
 
  categoryComponent.add(QuestionComponentFactory.getComponent(question,
  response));
  be sure of to work on the same response instance that is on your form
 model.
 
  On Tue, Nov 3, 2009 at 1:38 PM, Gonzalo Aguilar Delgado 
  gagui...@aguilardelgado.com wrote:
 
  
  
  
I should build the form inside a component instead the page. And I
should keep a reference
to the dynamic model inside this component.
Not what I try to mean.
  
  
   So what's the way?
  
  
  
   
your report:
But as I have to build the form I do not have a dynamic model on
 page.
You can have your model, and you can have your component build logic.
  
  
   
  
  
   
you report:
   
So no matter what's the value it will get not updated to
the new one.
so i think you are working on diferent answer instances
can you send some buildForm(answer) lines?
  
  
   Yes but's somewhat large, anyway answer has got from the code I sent
   earlier. But it got not
   updated because this code goes in the constructor that never gets
   called.
  
   Here goes the code:
  
  
  public void buildForm(SurveyAnswer answer)
  {
  
  ListSurveyQuestion listQuestions = getQuestionList(1);
 //
   FIXIT: How
   do we get this questionaire?
  
  if(listQuestions!=null  listQuestions.size()0)
  {
  
  int category = -1;
  QuestionCategoryComponent categoryComponent =
 null;
  
  /*
   * We add category containers to the component
 array
   and
   * questions to the category containers.
   *
   */
  for(IteratorSurveyQuestion iter =
   listQuestions.iterator();
   iter.hasNext();)
  {
  SurveyQuestion question = iter.next();
  
  // Check if we should start a new
 category
  if(category !=
   question.getSurveyQuestionCategory().getIdSurveyQuestionCategory())
  {
  log.debug(Category:  +
   question.getSurveyQuestionCategory().getQuestionCategoryDescription());
  categoryComponent = new
   QuestionCategoryComponent(surveyComponent,
   question.getSurveyQuestionCategory().getQuestionCategoryDescription());
  
  components.add(categoryComponent);
  category =
   question.getSurveyQuestionCategory().getIdSurveyQuestionCategory();
  }
  
  if(categoryComponent!=null)
  {
  SurveyQuestionResponse response
 =
   null;
  if(answer!=null)
  {
  response =
   surveyAnswerFactory.getResponse(question, answer);
  

Dynamically insert/remove WizardSteps based on user input ?

2009-11-03 Thread smallufo
Hi all :

It seems the WizardSteps are added into WizardModel in the constructor time.
I wonder if it is possible to dynamically insert/remove WizardSteps based on
user input ? (wicket-1.3.6)

Thanks a lot.


Re: London Wicket Event at Foyles Bookshop, November 21st, 2009

2009-11-03 Thread Martijn Dashorst
Bring your copy of Wicket in Action 

Martijn

On Tue, Nov 3, 2009 at 12:11 AM, jWeekend jweekend_for...@cabouge.com wrote:
 We will hold our next London Wicket Event on Saturday, 21st November, from
 14:45. This time we have hired The Gallery at the iconic Foyles Bookshop
 in central London.
 We again welcome guests and speakers from several countries, including at
 least 3 core committers, Matej, Jeremy and of course, Alastair, as well as
 the founders of WiQuery (Wicket-jQuery integration), Lionel Armanet and his
 team.

 Join us for some very interesting, high quality presentations and to chat
 with fellow Wicket users and developers at all levels. We're expecting this
 to be another popular event and since places are limited book and confirm
 early if you can make it. Details and registration are at the usual place
 [1].
 There is a cool little Jazz cafe at Foyles too, where there'll be a live act
 (Femi Temowo) at 13:00 if you enjoy some Jazz guitar relaxation before your
 intellectual stimulation. They offer a decent range of food and drink there
 too.

 The event schedule looks like:
 Cemal Bayramoglu: Introduction
 Jeremy Thomerson (USA): Custom JavaScript Integrations with Wicket + Auto
 Resolvers
 Lionel Armanet (FR): Announcing WiQuery 1.0: Introduction  Demo
 Matej Knopp (SK): BRIX CMS + Wicket 1.5 Developments QA
 Alastair Maw (UK): The Al Talk
 Our Regular General Wicket QA with Al and Cemal
 We expect to formally finish by around 19:00. I would expect the usual
 suspects will be heading somewhere in the neighbourhood for refreshments
 straight after the event, and of course you are more than welcome to join
 us.
 Regards - Cemal jWeekend http://jWeekend.com
 Training, Consulting, Development
 [1] http://jweekend.com/dev/LWUGReg/
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Tree table with check box

2009-11-03 Thread Per Newgro
You add a single column to your tree. But you overlay the default cell 
component by the checkboxpanel.
So you don't get all the stuff from parent component (Like link and node 
icon etc).

Check TreeTable.TreeFragment for details.

You have two opportunities:
1. If you want to add your checkbox directly beside the tree structure 
components you have to copy the code from the treetable class
2. If you only want the treestructure in one column (with a link label) 
and the combobox in the second column then you have to add

another column on which you don't overwrite newCell (see below)

HTH
Per

public class HomePage extends WebPage {

   private final TreeTable trtTest;

   /**
* Constructor that is invoked when page is invoked without a session.
*
* @param parameters
*Page parameters
*/
   public HomePage(final PageParameters parameters) {
   IColumn columns[] = new IColumn[] { col1(), col2() };

   TreeDataProvider treedataProvider = new TreeDataProvider();
   trtTest = new TreeTable(trtTest, treedataProvider.getTreeModel(),
   columns);
   trtTest.getTreeState().expandAll();
   add(trtTest);
   }

   private PropertyTreeColumn col1() {
   return new PropertyTreeColumn(new 
ColumnLocation(Alignment.MIDDLE, 5,

   Unit.PROPORTIONAL), Check, userObject.name);
   }

   private PropertyTreeColumn col2() {
   return new PropertyTreeColumn(new ColumnLocation(Alignment.LEFT, 
7, Unit.EM), L2,

   userObject.name) {
   @Override
   public Component newCell(MarkupContainer parent, String id,
   TreeNode node, int level) {
   DefaultMutableTreeNode n = (DefaultMutableTreeNode) node;
   CheckBoxPanel boxPanel = new CheckBoxPanel(parent.getId(), n
   .getUserObject());
   return boxPanel;
   }
   };
   }
}

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: 508 accessibility support

2009-11-03 Thread fachhoch

 AjaxFallbackDefaultDataTable  we add columns, I use PropertyColumn   , can I
add any attributemodifier to it ?



ryantxu wrote:
 

 takes values for alt attribute .  Like the sortable columns   , If I  
 can set
 value for alt attribute that would be really nice.
 
 how about:
 div.add( new AttributeModifier( alt, true, new ModelString( what  
 it should say... ))
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/508-accessibility-support-tp26119812p26160605.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



javax.crypto.BadPaddingException on expired sessions using CryptedUrlWebRequestCodingStrategy

2009-11-03 Thread Anthony DePalma
I am getting a WicketRuntimeException whenever a user clicks a session based
url after the session has expired. I noticed there was a previous thread
about this here:
http://old.nabble.com/Problem-with-Crypted-URL-to20533640.html#a20542221.

I was hoping since I upgraded my application to use the latest 1.4.3 that
this problem was solved, but I see that it is still occurring (You can
recreate it by opening a browser and starting a new session, restarting your
server, and then clicking a link - or just wait half an hour and try to
click a session link). For my application this is a pretty common scenario
since users may read bookmarkable urls leisurely and then click a modal
window link later, and instead of redirecting to the homepage with a nice
expiration message they get a hard error which clogs the logs up pretty bad.

Is there any plans to fix this, or anything I can do to prevent it while
maintaining crypted urls?


Re: problem with generation text in javascript code

2009-11-03 Thread paul wolanski

Hello,
Thank you Igor. it is what I've looked for.
Another solution is using VelocityPanel, which I did not wanted to use..

- paul



igor.vaynberg wrote:
 
 you can use TextTemplateHeaderContributor to externalize the template
 and define replacement vars.
 
 -igor
 
 On Fri, Oct 30, 2009 at 10:09 AM, paul wolanski mikola...@gmail.com
 wrote:

 Hello Martin,
 Hmmm it looks like a little bit dirty trick, because I will have to print
 out whole initialization between script tags...
 I'll try to find another way to resolve that.
 Thank you for help Martin.
 I appreciate that.

 Cheers,
 Paul


 martin-g wrote:

 make script element a Wicket citizen :-)
 script wicket:id=myScript.../script

 El vie, 30-10-2009 a las 14:32 +0100, pawel wolanski escribió:
 Hello,
 Yesterday I've faced with problem with generating javascript code.
 On page I've inserted code:
 i.e.:

 wicket:extend
      formscript type=text/javascript
       appInitialize(here should be generated string); //
 generated string should be pasted as a param
 
 /wicket:extend

 I want to mention, that I would not mix my application with velocity,
 which IMHO could be here the easiest solution..

 Thank you in advance for all answers.
 Cheers,
 Paul

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




 --
 View this message in context:
 http://old.nabble.com/problem-with-generation-text-in-javascript-code-tp26130184p26133706.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/problem-with-generation-text-in-javascript-code-tp26130184p26163580.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Problem with IFormsubmitting

2009-11-03 Thread Jeremy Thomerson
The power of this list is amazing - it seems you just had an entire thread
with yourself and answered your own question.  SYNERGY!  :)

But seriously, did you have any remaining questions on this that we could
assist with?


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



On Tue, Nov 3, 2009 at 12:22 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Hi!

 One finishing touch is needed. The hidden field should be cleared
 after ajax submit. It seems to work now.. feel free to critisize.

 public abstract class FormSubmitAjaxChangeListenerCallDecorator
 implements IAjaxCallDecorator {
  private final static Method hiddenFieldGetter;

  static {
try {
  hiddenFieldGetter = Form.class.getDeclaredMethod(getHiddenFieldId);
  hiddenFieldGetter.setAccessible(true);
} catch (Exception e) {
  throw new RuntimeException(e);
}
  }
  /**
   * @see
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnFailureScript(java.lang.CharSequence)
   */
  public CharSequence decorateOnFailureScript(
  CharSequence arg0) {
 return getSetHiddenFieldValue().append(arg0);
   }

  /**
   * @see
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnSuccessScript(java.lang.CharSequence)
   */
  public CharSequence decorateOnSuccessScript(
  CharSequence arg0) {
 return getSetHiddenFieldValue().append(arg0);
   }

  /**
   * @see
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateScript(java.lang.CharSequence)
   */
  public CharSequence decorateScript(CharSequence arg0) {
 return getSetHiddenFieldValue(getChangeListenerUrl()).append(arg0);
  }

  /**
   * @param hiddenFieldId
   * @param value
   * @return
   */
  private AppendingStringBuffer getSetHiddenFieldValue(CharSequence value) {
try {
   Form? root = getForm().getRootForm();
  String hiddenFieldId;
   hiddenFieldId = (String) hiddenFieldGetter.invoke(root);
  return new AppendingStringBuffer(document.getElementById(').append(
   hiddenFieldId).append(').value=').append(value).append(
  ';);
 } catch (Exception e) {
  throw new RuntimeException(e);
}
  }

  /**
   * @return Form?
   */
  public abstract Form? getForm();

  /**
   * @return CharSequence
   */
  public abstract CharSequence getChangeListenerUrl();
 }

 **
 Martin

 2009/11/3 Martin Makundi martin.maku...@koodaripalvelut.com:
  Hi!
 
  I hope I found a solution usin IOnChangeListener.
 
  Please try this out and let me know if it works for you. Maybe it
  should be incorporated into Wicket?
 
  public abstract class FormSubmitAjaxChangeListenerCallDecorator
  implements IAjaxCallDecorator {
   private final static Method hiddenFieldGetter;
 
   static {
 try {
   hiddenFieldGetter =
 Form.class.getDeclaredMethod(getHiddenFieldId);
   hiddenFieldGetter.setAccessible(true);
 } catch (Exception e) {
   throw new RuntimeException(e);
 }
   }
   /**
* @see
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnFailureScript(java.lang.CharSequence)
*/
   public CharSequence decorateOnFailureScript(
   CharSequence arg0) {
 return arg0;
   }
 
   /**
* @see
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnSuccessScript(java.lang.CharSequence)
*/
   public CharSequence decorateOnSuccessScript(
   CharSequence arg0) {
 return arg0;
   }
 
   /**
* @see
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateScript(java.lang.CharSequence)
*/
   public CharSequence decorateScript(CharSequence arg0) {
 Form? root = getForm().getRootForm();
 String hiddenFieldId;
 try {
   hiddenFieldId = (String) hiddenFieldGetter.invoke(root);
   return new
 AppendingStringBuffer(document.getElementById(').append(
 
  hiddenFieldId).append(').value=').append(getChangeListenerUrl()).append(
   ';).append(arg0);
 } catch (Exception e) {
   throw new RuntimeException(e);
 }
   }
 
   /**
* @return Form?
*/
   public abstract Form? getForm();
 
   /**
* @return CharSequence
*/
   public abstract CharSequence getChangeListenerUrl();
  }
 
 
  public abstract class AjaxFormSubmittingChangeListenerCheckBox extends
  CheckBox {
   /**
* @param id
* @param model
*/
   public AjaxFormSubmittingChangeListenerCheckBox(String id,
  IModelBoolean model) {
 super(id, model);
 add(new AjaxFormSubmitBehavior(JavaScriptConstants.ONCHANGE) {
   @Override
   protected void onError(AjaxRequestTarget target) {
 AjaxFormSubmittingChangeListenerCheckBox.this.onError(target);
   }
 
   @Override
   protected void onSubmit(AjaxRequestTarget target) {
 AjaxFormSubmittingChangeListenerCheckBox.this.onSubmit(target);
   }
 
   /**
* @see
 org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#getAjaxCallDecorator()
*/
   @Override
   protected IAjaxCallDecorator getAjaxCallDecorator() {
 return new FormSubmitAjaxChangeListenerCallDecorator() {
   

Re: Problem with IFormsubmitting

2009-11-03 Thread Martin Makundi
Tnx. I would like to ask (myself?) whether it could be formulated
simply into a behavior that can be attached into any formcomponent.
Probably. I will work on this next.

Ofcourse if more people try the code in their applications we will
soon learn if it breaks something.

**
Martin

2009/11/4 Jeremy Thomerson jer...@wickettraining.com:
 The power of this list is amazing - it seems you just had an entire thread
 with yourself and answered your own question.  SYNERGY!  :)

 But seriously, did you have any remaining questions on this that we could
 assist with?


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



 On Tue, Nov 3, 2009 at 12:22 PM, Martin Makundi 
 martin.maku...@koodaripalvelut.com wrote:

 Hi!

 One finishing touch is needed. The hidden field should be cleared
 after ajax submit. It seems to work now.. feel free to critisize.

 public abstract class FormSubmitAjaxChangeListenerCallDecorator
 implements IAjaxCallDecorator {
  private final static Method hiddenFieldGetter;

  static {
    try {
      hiddenFieldGetter = Form.class.getDeclaredMethod(getHiddenFieldId);
      hiddenFieldGetter.setAccessible(true);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
  /**
   * @see
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnFailureScript(java.lang.CharSequence)
   */
  public CharSequence decorateOnFailureScript(
      CharSequence arg0) {
     return getSetHiddenFieldValue().append(arg0);
   }

  /**
   * @see
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnSuccessScript(java.lang.CharSequence)
   */
  public CharSequence decorateOnSuccessScript(
      CharSequence arg0) {
     return getSetHiddenFieldValue().append(arg0);
   }

  /**
   * @see
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateScript(java.lang.CharSequence)
   */
  public CharSequence decorateScript(CharSequence arg0) {
     return getSetHiddenFieldValue(getChangeListenerUrl()).append(arg0);
  }

  /**
   * @param hiddenFieldId
   * @param value
   * @return
   */
  private AppendingStringBuffer getSetHiddenFieldValue(CharSequence value) {
    try {
       Form? root = getForm().getRootForm();
      String hiddenFieldId;
       hiddenFieldId = (String) hiddenFieldGetter.invoke(root);
      return new AppendingStringBuffer(document.getElementById(').append(
           hiddenFieldId).append(').value=').append(value).append(
          ';);
     } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }

  /**
   * @return Form?
   */
  public abstract Form? getForm();

  /**
   * @return CharSequence
   */
  public abstract CharSequence getChangeListenerUrl();
 }

 **
 Martin

 2009/11/3 Martin Makundi martin.maku...@koodaripalvelut.com:
  Hi!
 
  I hope I found a solution usin IOnChangeListener.
 
  Please try this out and let me know if it works for you. Maybe it
  should be incorporated into Wicket?
 
  public abstract class FormSubmitAjaxChangeListenerCallDecorator
  implements IAjaxCallDecorator {
   private final static Method hiddenFieldGetter;
 
   static {
     try {
       hiddenFieldGetter =
 Form.class.getDeclaredMethod(getHiddenFieldId);
       hiddenFieldGetter.setAccessible(true);
     } catch (Exception e) {
       throw new RuntimeException(e);
     }
   }
   /**
    * @see
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnFailureScript(java.lang.CharSequence)
    */
   public CharSequence decorateOnFailureScript(
       CharSequence arg0) {
     return arg0;
   }
 
   /**
    * @see
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateOnSuccessScript(java.lang.CharSequence)
    */
   public CharSequence decorateOnSuccessScript(
       CharSequence arg0) {
     return arg0;
   }
 
   /**
    * @see
 org.apache.wicket.ajax.IAjaxCallDecorator#decorateScript(java.lang.CharSequence)
    */
   public CharSequence decorateScript(CharSequence arg0) {
     Form? root = getForm().getRootForm();
     String hiddenFieldId;
     try {
       hiddenFieldId = (String) hiddenFieldGetter.invoke(root);
       return new
 AppendingStringBuffer(document.getElementById(').append(
 
  hiddenFieldId).append(').value=').append(getChangeListenerUrl()).append(
           ';).append(arg0);
     } catch (Exception e) {
       throw new RuntimeException(e);
     }
   }
 
   /**
    * @return Form?
    */
   public abstract Form? getForm();
 
   /**
    * @return CharSequence
    */
   public abstract CharSequence getChangeListenerUrl();
  }
 
 
  public abstract class AjaxFormSubmittingChangeListenerCheckBox extends
  CheckBox {
   /**
    * @param id
    * @param model
    */
   public AjaxFormSubmittingChangeListenerCheckBox(String id,
  IModelBoolean model) {
     super(id, model);
     add(new AjaxFormSubmitBehavior(JavaScriptConstants.ONCHANGE) {
      �...@override
       protected void onError(AjaxRequestTarget target) {
         AjaxFormSubmittingChangeListenerCheckBox.this.onError(target);
       }
 
      �...@override
       protected void onSubmit(AjaxRequestTarget target) {

Re: Problems with displaying modal window

2009-11-03 Thread Martin Makundi
WHy not fix your doctype first?

**
Martin

2009/11/4 Anders Sørensen aisz...@gmail.com:
 Hello everybody.

 I have a webpage under development where I use modal windows.
 This has so fare not caused any problems - but now I get an error on one of
 my pages.

 I have just added the modal window capability to the page - so this has not
 worked before.

 When I click the button I get the following errors in Firefox (and the pages
 just reloads)

 Line 1:
 Error: undefined entity
 Source File:
 Line: 1, Column: 61
 Source Code:
 div xmlns=http://www.w3.org/1999/xhtml;bINFO:
 /bUsingnbsp;XMLHttpRequestnbsp;transport/
 (here there is a green error under nbsp;)

 Line 2:
 Error: uncaught exception: [Exception... Component returned failure code:
 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLElement.innerHTML]
 nsresult: 0x80004003 (NS_ERROR_INVALID_POINTER)  location: JS frame ::
 http://localhost:8080/resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js::
 anonymous :: line 64  data: no]

 My guess to why I get this error is, that my page is defined as:

 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1 plus MathML 2.0//EN 
 http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;

 The reason for this is, that I display MathML on the page.

 The modal window however does not contain MathML - it's just regular html.

 Environment:
 Wicket 1.4.3
 JDK 1.6.0_16
 Firefox 3.5.4

 Does anybody have any input on this?

 --
 Med venlig hilsen/Best regards

 Anders Sørensen


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Migrating wivket app from 1.2.4 to 1.4.3

2009-11-03 Thread Shankar Subedi
Hello all,
I had build an application on wicket 1.2.4, spring and hibernate some about
2 years before.
Now i think, i need to upgrade wicket.

Since there are number of releases in between those version, I think there
are many modifications to be done.
Please show me the way..


Thanks in advance

Regards
shankar


Re: Migrating wivket app from 1.2.4 to 1.4.3

2009-11-03 Thread Igor Vaynberg
our wiki contains migration pages for 1.2 to 1.3 and 1.3 to 1.4

-igor

On Tue, Nov 3, 2009 at 9:17 PM, Shankar Subedi shankar.sub...@gmail.com wrote:
 Hello all,
 I had build an application on wicket 1.2.4, spring and hibernate some about
 2 years before.
 Now i think, i need to upgrade wicket.

 Since there are number of releases in between those version, I think there
 are many modifications to be done.
 Please show me the way..


 Thanks in advance

 Regards
 shankar


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Tree table with check box

2009-11-03 Thread vela

Hello again,

My requirement is exactly related to the point 1. you specified

1. If you want to add your checkbox directly beside the tree structure
components you have to copy the code from the treetable class 


If you could elaborate a bit, it will be very much useful to try out.





-- 
View this message in context: 
http://old.nabble.com/Tree-table-with-check-box-tp26080852p26191699.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



java.lang.NoClassDefFoundError: org/apache/wicket/util/lang/PropertyResolver

2009-11-03 Thread Anders
My environment:
. Apache Tomcat/6.0.18
. JDK 1.6.0_12-b04

I got this weird message in tomcat log, too:

Nov 4, 2009 12:13:03 AM org.apache.catalina.startup.HostConfig
checkResources
INFO: Reloading context [/acm]
Nov 4, 2009 12:13:03 AM org.apache.catalina.core.ContainerBase stop
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/acm].[AppServlet]
has not been started
Nov 4, 2009 12:13:03 AM org.apache.catalina.core.ContainerBase stop
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/acm].[jsp]
has not been started
Nov 4, 2009 12:13:03 AM org.apache.catalina.core.ContainerBase stop
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/acm].[default]
has not been started
Nov 4, 2009 12:13:03 AM
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor
processChildren
SEVERE: Exception invoking periodic operation:
java.lang.NoClassDefFoundError: org/apache/wicket/util/lang/PropertyResolver

at
org.apache.wicket.Application.internalDestroy(Application.java:887)
at
org.apache.wicket.protocol.http.WebApplication.internalDestroy(WebApplication.java:448)

at
org.apache.wicket.protocol.http.WicketFilter.destroy(WicketFilter.java:143)
at
org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:332)

at
org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:3744)

at
org.apache.catalina.core.StandardContext.stop(StandardContext.java:4513)
at
org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1108)
at
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1214)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)

at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)

at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)

at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)

at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)

at java.lang.Thread.run(Thread.java:619)
Nov 4, 2009 12:13:03 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started
Nov 4, 2009 12:13:03 AM org.apache.catalina.core.ContainerBase stop
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/acm].[AppServlet]
has not been started
Nov 4, 2009 12:13:03 AM org.apache.catalina.core.ContainerBase stop
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/acm].[jsp]
has not been started
Nov 4, 2009 12:13:03 AM org.apache.catalina.core.ContainerBase stop
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/acm].[default]
has not been started
Nov 4, 2009 12:13:03 AM
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor
processChildren
SEVERE: Exception invoking periodic operation:
java.lang.NoClassDefFoundError: org/apache/wicket/util/lang/PropertyResolver

at
org.apache.wicket.Application.internalDestroy(Application.java:887)
at
org.apache.wicket.protocol.http.WebApplication.internalDestroy(WebApplication.java:448)

at
org.apache.wicket.protocol.http.WicketFilter.destroy(WicketFilter.java:143)
at
org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:332)

at
org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:3744)

at
org.apache.catalina.core.StandardContext.stop(StandardContext.java:4513)
at
org.apache.catalina.core.StandardContext.reload(StandardContext.java:3093)
at
org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:404)

at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1309)

at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)

at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)

at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)

at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)

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

I checked wicket jar file, and org/apache/wicket/util/lang/PropertyResolver
class does exist.
Is it tomcat bug?
Any one has any suggestion?


Serialization Error

2009-11-03 Thread Douglas Ferguson
I'm getting a serialization error in my logs:

Nov 03 23:00:01 ERROR [TP-Processor34] lang.Objects - Error serializing object 
class com.conducive.ui.userPages.monitor.manage.MonitorsManagePage 
[object=[Page class = 
com.conducive.ui.userPages.monitor.manage.MonitorsManagePage, id = 120, version 
= 0, ajax = 4]]
org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: 
Unable to serialize class: 
com.conducive.ui.userPages.monitor.support.SortedTopicsAndMonitors$TopicGroup$1
Field hierarchy is:
  120 [class=com.conducive.ui.userPages.monitor.manage.MonitorsManagePage, 
path=120]
java.lang.Object org.apache.wicket.Component.data 
[class=[Ljava.lang.Object;]
  private org.apache.wicket.markup.html.IHeaderContributor 
org.apache.wicket.behavior.HeaderContributor.headerContributor[7] 
[class=com.conducive.ui.userPages.monitor.manage.MonitorsManagePage$1]
final org.apache.wicket.Component 
com.conducive.ui.userPages.monitor.manage.MonitorsManagePage$1.val$leftList 
[class=org.apache.wicket.markup.html.WebMarkupContainer, 
path=120:contentPart:leftList]
  private java.lang.Object org.apache.wicket.MarkupContainer.children 
[class=com.conducive.ui.userPages.monitor.manage.MonitorsManageParts$ContentPart$1,
 path=120:contentPart:leftList:topicBlocks]
final java.util.List 
com.conducive.ui.userPages.monitor.manage.MonitorsManageParts$ContentPart$1.val$sorted
 [class=java.util.ArrayList]
  final java.util.List 
com.conducive.ui.userPages.monitor.manage.MonitorsManageParts$ContentPart$1.val$sorted[write:1]
 
[class=com.conducive.ui.userPages.monitor.support.SortedTopicsAndMonitors$TopicGroup]
private final java.util.Set 
com.conducive.ui.userPages.monitor.support.SortedTopicsAndMonitors$TopicGroup.monitors
 [class=java.util.TreeSet]
  private final java.util.Set 
com.conducive.ui.userPages.monitor.support.SortedTopicsAndMonitors$TopicGroup.monitors[write:1]
 
[class=com.conducive.ui.userPages.monitor.support.SortedTopicsAndMonitors$TopicGroup$1]
 - field that is not serializable
at 
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:346)
at 
org.apache.wicket.util.io.SerializableChecker.access$500(SerializableChecker.java:63)
at 
org.apache.wicket.util.io.SerializableChecker$1InterceptingObjectOutputStream.replaceObject(SerializableChecker.java:494)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)

It seems to be complaining about this:

private final SetMonitor monitors = new TreeSetMonitor(new 
ComparatorMonitor() {

@Override
public int compare(Monitor o1, Monitor o2) {
return o1.getDescription().compareTo(o2.getDescription());
}



});

Shouldn't a comparator for a serializable also be serializable?

If this is in face not serializable, how do I work around this?

D/


Re: Serialization Error

2009-11-03 Thread Igor Vaynberg
comparator does not extend serializable.

make an inner class that extends serializable.

-igor

On Tue, Nov 3, 2009 at 11:27 PM, Douglas Ferguson
doug...@douglasferguson.us wrote:
 I'm getting a serialization error in my logs:

 Nov 03 23:00:01 ERROR [TP-Processor34] lang.Objects - Error serializing 
 object class com.conducive.ui.userPages.monitor.manage.MonitorsManagePage 
 [object=[Page class = 
 com.conducive.ui.userPages.monitor.manage.MonitorsManagePage, id = 120, 
 version = 0, ajax = 4]]
 org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: 
 Unable to serialize class: 
 com.conducive.ui.userPages.monitor.support.SortedTopicsAndMonitors$TopicGroup$1
 Field hierarchy is:
  120 [class=com.conducive.ui.userPages.monitor.manage.MonitorsManagePage, 
 path=120]
    java.lang.Object org.apache.wicket.Component.data 
 [class=[Ljava.lang.Object;]
      private org.apache.wicket.markup.html.IHeaderContributor 
 org.apache.wicket.behavior.HeaderContributor.headerContributor[7] 
 [class=com.conducive.ui.userPages.monitor.manage.MonitorsManagePage$1]
        final org.apache.wicket.Component 
 com.conducive.ui.userPages.monitor.manage.MonitorsManagePage$1.val$leftList 
 [class=org.apache.wicket.markup.html.WebMarkupContainer, 
 path=120:contentPart:leftList]
          private java.lang.Object org.apache.wicket.MarkupContainer.children 
 [class=com.conducive.ui.userPages.monitor.manage.MonitorsManageParts$ContentPart$1,
  path=120:contentPart:leftList:topicBlocks]
            final java.util.List 
 com.conducive.ui.userPages.monitor.manage.MonitorsManageParts$ContentPart$1.val$sorted
  [class=java.util.ArrayList]
              final java.util.List 
 com.conducive.ui.userPages.monitor.manage.MonitorsManageParts$ContentPart$1.val$sorted[write:1]
  
 [class=com.conducive.ui.userPages.monitor.support.SortedTopicsAndMonitors$TopicGroup]
                private final java.util.Set 
 com.conducive.ui.userPages.monitor.support.SortedTopicsAndMonitors$TopicGroup.monitors
  [class=java.util.TreeSet]
                  private final java.util.Set 
 com.conducive.ui.userPages.monitor.support.SortedTopicsAndMonitors$TopicGroup.monitors[write:1]
  
 [class=com.conducive.ui.userPages.monitor.support.SortedTopicsAndMonitors$TopicGroup$1]
  - field that is not serializable
 at 
 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:346)
 at 
 org.apache.wicket.util.io.SerializableChecker.access$500(SerializableChecker.java:63)
 at 
 org.apache.wicket.util.io.SerializableChecker$1InterceptingObjectOutputStream.replaceObject(SerializableChecker.java:494)
 at java.io.ObjectOutputStream.writeObject0(Unknown Source)
 at java.io.ObjectOutputStream.writeObject(Unknown Source)

 It seems to be complaining about this:

        private final SetMonitor monitors = new TreeSetMonitor(new 
 ComparatorMonitor() {

 @Override
 public int compare(Monitor o1, Monitor o2) {
 return o1.getDescription().compareTo(o2.getDescription());
 }



        });

 Shouldn't a comparator for a serializable also be serializable?

 If this is in face not serializable, how do I work around this?

 D/


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Migrating wivket app from 1.2.4 to 1.4.3

2009-11-03 Thread Martijn Dashorst
http://maps.google.com/maps?f=dsource=s_dsaddr=wicket+1.2daddr=wicket+1.4hl=engeocode=mra=lsdirflg=wsll=35.50998,-81.271745sspn=0.010428,0.016093ie=UTF8z=19

On Wed, Nov 4, 2009 at 7:13 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 our wiki contains migration pages for 1.2 to 1.3 and 1.3 to 1.4

 -igor

 On Tue, Nov 3, 2009 at 9:17 PM, Shankar Subedi shankar.sub...@gmail.com 
 wrote:
 Hello all,
 I had build an application on wicket 1.2.4, spring and hibernate some about
 2 years before.
 Now i think, i need to upgrade wicket.

 Since there are number of releases in between those version, I think there
 are many modifications to be done.
 Please show me the way..


 Thanks in advance

 Regards
 shankar


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org