NoSuchFieldException

2009-11-04 Thread Dusanb

hi i get this exception only in table with paging. Can somebody help me with
this


13:01:10.536 [SocketListener0-9] DEBUG o.a.w.util.lang.PropertyResolver -
Cannot find field class
org.apache.wicket.extensions.markup.html.repeater.data.table.NavigatorLabel$LabelModelObject.from
java.lang.NoSuchFieldException: from
at java.lang.Class.getField(Unknown Source)
at
org.apache.wicket.util.lang.PropertyResolver.findField(PropertyResolver.java:472)
at
org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:452)
at
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
at
org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
at
org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.getValue(PropertyVariableInterpolator.java:86)
at
org.apache.wicket.util.string.interpolator.VariableInterpolator.toString(VariableInterpolator.java:129)
at
org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.interpolate(PropertyVariableInterpolator.java:70)
at
org.apache.wicket.Localizer.substitutePropertyExpressions(Localizer.java:350)
at org.apache.wicket.Localizer.getString(Localizer.java:249)
at
org.apache.wicket.model.StringResourceModel.getString(StringResourceModel.java:343)
at
org.apache.wicket.model.StringResourceModel.load(StringResourceModel.java:469)
at
org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:114)
at org.apache.wicket.Component.getModelObject(Component.java:1510)
at 
org.apache.wicket.Component.getModelObjectAsString(Component.java:1532)
at
org.apache.wicket.markup.html.basic.Label.onComponentTagBody(Label.java:111)
at org.apache.wicket.Component.renderComponent(Component.java:2429)
at
org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:60)
at org.apache.wicket.Component.render(Component.java:2266)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
at org.apache.wicket.Component.renderComponent(Component.java:2429)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2266)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at
org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
at
org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
at org.apache.wicket.Component.renderComponent(Component.java:2429)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2266)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
at org.apache.wicket.Component.renderComponent(Component.java:2429)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2266)
at
org.apache.wicket.markup.repeater.AbstractRepeater.renderChild(AbstractRepeater.java:119)
at
org.apache.wicket.markup.repeater.AbstractRepeater.onRender(AbstractRepeater.java:100)
at org.apache.wicket.Component.render(Component.java:2266)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at
org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
at
org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
at org.apache.wicket.Component.renderComponent(Component.java:2429)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2266)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at
org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
at
org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
at org.apache.wicket.Component.renderComponent(Component.java:2429)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)

Re: NoSuchFieldException

2009-11-04 Thread Ernesto Reinaldo Barreiro
Did you check your jars versions? As Igor has suggested you in a previous
thread...

Regards,

Ernesto

On Wed, Nov 4, 2009 at 9:35 AM, Dusanb bani...@gmail.com wrote:


 hi i get this exception only in table with paging. Can somebody help me
 with
 this


 13:01:10.536 [SocketListener0-9] DEBUG o.a.w.util.lang.PropertyResolver -
 Cannot find field class

 org.apache.wicket.extensions.markup.html.repeater.data.table.NavigatorLabel$LabelModelObject.from
 java.lang.NoSuchFieldException: from
at java.lang.Class.getField(Unknown Source)
at

 org.apache.wicket.util.lang.PropertyResolver.findField(PropertyResolver.java:472)
at

 org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:452)
at

 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
at

 org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
at

 org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.getValue(PropertyVariableInterpolator.java:86)
at

 org.apache.wicket.util.string.interpolator.VariableInterpolator.toString(VariableInterpolator.java:129)
at

 org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.interpolate(PropertyVariableInterpolator.java:70)
at

 org.apache.wicket.Localizer.substitutePropertyExpressions(Localizer.java:350)
at org.apache.wicket.Localizer.getString(Localizer.java:249)
at

 org.apache.wicket.model.StringResourceModel.getString(StringResourceModel.java:343)
at

 org.apache.wicket.model.StringResourceModel.load(StringResourceModel.java:469)
at

 org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:114)
at org.apache.wicket.Component.getModelObject(Component.java:1510)
at
 org.apache.wicket.Component.getModelObjectAsString(Component.java:1532)
at

 org.apache.wicket.markup.html.basic.Label.onComponentTagBody(Label.java:111)
at org.apache.wicket.Component.renderComponent(Component.java:2429)
at
 org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:60)
at org.apache.wicket.Component.render(Component.java:2266)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at

 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
at org.apache.wicket.Component.renderComponent(Component.java:2429)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2266)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at

 org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
at

 org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
at org.apache.wicket.Component.renderComponent(Component.java:2429)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2266)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at

 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
at org.apache.wicket.Component.renderComponent(Component.java:2429)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2266)
at

 org.apache.wicket.markup.repeater.AbstractRepeater.renderChild(AbstractRepeater.java:119)
at

 org.apache.wicket.markup.repeater.AbstractRepeater.onRender(AbstractRepeater.java:100)
at org.apache.wicket.Component.render(Component.java:2266)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at

 org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
at

 org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
at org.apache.wicket.Component.renderComponent(Component.java:2429)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2266)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at

 org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
at

Re: NoSuchFieldException

2009-11-04 Thread Martin Grigorov
Hi Dusanb,

Try to debug it yourself.
Here are the steps:
- download the Wicket sources (the easiest way is: mvn
-DdownloadSources=true eclipse:eclipse, refresh the Eclipse project. The
same applies for IDEA and Netbeans)
- attach a breakpoint at
org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(String,
Class). There is an 'else' clause with this code 
method = findGetter(clz, exp);
- here Wicket should find
org.apache.wicket.extensions.markup.html.repeater.data.table.NavigatorLabel.LabelModelObject.getFrom()

For some reason it doesn't. The debugger will show you what is wrong.

El mié, 04-11-2009 a las 00:35 -0800, Dusanb escribió:
 hi i get this exception only in table with paging. Can somebody help me with
 this
 
 
 13:01:10.536 [SocketListener0-9] DEBUG o.a.w.util.lang.PropertyResolver -
 Cannot find field class
 org.apache.wicket.extensions.markup.html.repeater.data.table.NavigatorLabel$LabelModelObject.from
 java.lang.NoSuchFieldException: from
   at java.lang.Class.getField(Unknown Source)
   at
 org.apache.wicket.util.lang.PropertyResolver.findField(PropertyResolver.java:472)
   at
 org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:452)
   at
 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
   at
 org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
   at
 org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.getValue(PropertyVariableInterpolator.java:86)
   at
 org.apache.wicket.util.string.interpolator.VariableInterpolator.toString(VariableInterpolator.java:129)
   at
 org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.interpolate(PropertyVariableInterpolator.java:70)
   at
 org.apache.wicket.Localizer.substitutePropertyExpressions(Localizer.java:350)
   at org.apache.wicket.Localizer.getString(Localizer.java:249)
   at
 org.apache.wicket.model.StringResourceModel.getString(StringResourceModel.java:343)
   at
 org.apache.wicket.model.StringResourceModel.load(StringResourceModel.java:469)
   at
 org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:114)
   at org.apache.wicket.Component.getModelObject(Component.java:1510)
   at 
 org.apache.wicket.Component.getModelObjectAsString(Component.java:1532)
   at
 org.apache.wicket.markup.html.basic.Label.onComponentTagBody(Label.java:111)
   at org.apache.wicket.Component.renderComponent(Component.java:2429)
   at
 org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:60)
   at org.apache.wicket.Component.render(Component.java:2266)
   at 
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
   at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
   at
 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
   at org.apache.wicket.Component.renderComponent(Component.java:2429)
   at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
   at org.apache.wicket.Component.render(Component.java:2266)
   at 
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
   at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
   at
 org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
   at
 org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
   at org.apache.wicket.Component.renderComponent(Component.java:2429)
   at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
   at org.apache.wicket.Component.render(Component.java:2266)
   at 
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
   at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
   at
 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
   at org.apache.wicket.Component.renderComponent(Component.java:2429)
   at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
   at org.apache.wicket.Component.render(Component.java:2266)
   at
 org.apache.wicket.markup.repeater.AbstractRepeater.renderChild(AbstractRepeater.java:119)
   at
 org.apache.wicket.markup.repeater.AbstractRepeater.onRender(AbstractRepeater.java:100)
   at org.apache.wicket.Component.render(Component.java:2266)
   at 
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
   at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
   at
 org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
   at
 org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
   at org.apache.wicket.Component.renderComponent(Component.java:2429)
   at 

Re: NoSuchFieldException

2009-11-04 Thread Dusanb

you mean the jar for wicket. 
i use these:  http://old.nabble.com/file/p26192856/jar.jpg 



reiern70 wrote:
 
 Did you check your jars versions? As Igor has suggested you in a previous
 thread...
 
 Regards,
 
 Ernesto
 
 On Wed, Nov 4, 2009 at 9:35 AM, Dusanb bani...@gmail.com wrote:
 

 hi i get this exception only in table with paging. Can somebody help me
 with
 this


 13:01:10.536 [SocketListener0-9] DEBUG o.a.w.util.lang.PropertyResolver -
 Cannot find field class

 org.apache.wicket.extensions.markup.html.repeater.data.table.NavigatorLabel$LabelModelObject.from
 java.lang.NoSuchFieldException: from
at java.lang.Class.getField(Unknown Source)
at

 org.apache.wicket.util.lang.PropertyResolver.findField(PropertyResolver.java:472)
at

 org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:452)
at

 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
at

 org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
at

 org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.getValue(PropertyVariableInterpolator.java:86)
at

 org.apache.wicket.util.string.interpolator.VariableInterpolator.toString(VariableInterpolator.java:129)
at

 org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.interpolate(PropertyVariableInterpolator.java:70)
at

 org.apache.wicket.Localizer.substitutePropertyExpressions(Localizer.java:350)
at org.apache.wicket.Localizer.getString(Localizer.java:249)
at

 org.apache.wicket.model.StringResourceModel.getString(StringResourceModel.java:343)
at

 org.apache.wicket.model.StringResourceModel.load(StringResourceModel.java:469)
at

 org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:114)
at org.apache.wicket.Component.getModelObject(Component.java:1510)
at
 org.apache.wicket.Component.getModelObjectAsString(Component.java:1532)
at

 org.apache.wicket.markup.html.basic.Label.onComponentTagBody(Label.java:111)
at
 org.apache.wicket.Component.renderComponent(Component.java:2429)
at
 org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:60)
at org.apache.wicket.Component.render(Component.java:2266)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at

 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
at
 org.apache.wicket.Component.renderComponent(Component.java:2429)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2266)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at

 org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
at

 org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
at
 org.apache.wicket.Component.renderComponent(Component.java:2429)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2266)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at

 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
at
 org.apache.wicket.Component.renderComponent(Component.java:2429)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2266)
at

 org.apache.wicket.markup.repeater.AbstractRepeater.renderChild(AbstractRepeater.java:119)
at

 org.apache.wicket.markup.repeater.AbstractRepeater.onRender(AbstractRepeater.java:100)
at org.apache.wicket.Component.render(Component.java:2266)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
at

 org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
at

 org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
at
 org.apache.wicket.Component.renderComponent(Component.java:2429)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2266)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
at

 

RE: Migrating wivket app from 1.2.4 to 1.4.3

2009-11-04 Thread Alex Rass
They don't cover some breaks in AjaxFallbackDefaultDataTable interfaces.
If you don't use those - it's an easy conversion.
Make sure you do a clean recompile and it will show you what's broken.

Seems like 1.5 is around the corner... May want to wait a little. Though it
seems from the messages that 1.4.x - 1.5 should be easy. 

-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Sent: Wednesday, November 04, 2009 1:14 AM
To: users@wicket.apache.org
Subject: Re: Migrating wivket app from 1.2.4 to 1.4.3

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



-
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-04 Thread Martijn Dashorst
On Wed, Nov 4, 2009 at 10:03 AM, Alex Rass a...@itbsllc.com wrote:
 Seems like 1.5 is around the corner... May want to wait a little. Though it
 seems from the messages that 1.4.x - 1.5 should be easy.

Huh? 1.5 is nowhere near completion.

Martijn

-- 
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: NoSuchFieldException

2009-11-04 Thread Ernesto Reinaldo Barreiro
Sorry I can't see jar versions form the image you posted;-). I do not have
the sources of Wicket-1.3.0 at hand but the exception you get seems to be
raised because PropertyResolver can't find a field with a given name.  Why
don't you install the sources, as Martin suggested, and debug it yourself?

Best,

Ernesto

On Wed, Nov 4, 2009 at 9:53 AM, Dusanb bani...@gmail.com wrote:


 you mean the jar for wicket.
 i use these:  http://old.nabble.com/file/p26192856/jar.jpg



 reiern70 wrote:
 
  Did you check your jars versions? As Igor has suggested you in a previous
  thread...
 
  Regards,
 
  Ernesto
 
  On Wed, Nov 4, 2009 at 9:35 AM, Dusanb bani...@gmail.com wrote:
 
 
  hi i get this exception only in table with paging. Can somebody help me
  with
  this
 
 
  13:01:10.536 [SocketListener0-9] DEBUG o.a.w.util.lang.PropertyResolver
 -
  Cannot find field class
 
 
 org.apache.wicket.extensions.markup.html.repeater.data.table.NavigatorLabel$LabelModelObject.from
  java.lang.NoSuchFieldException: from
 at java.lang.Class.getField(Unknown Source)
 at
 
 
 org.apache.wicket.util.lang.PropertyResolver.findField(PropertyResolver.java:472)
 at
 
 
 org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:452)
 at
 
 
 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
 at
 
 
 org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
 at
 
 
 org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.getValue(PropertyVariableInterpolator.java:86)
 at
 
 
 org.apache.wicket.util.string.interpolator.VariableInterpolator.toString(VariableInterpolator.java:129)
 at
 
 
 org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.interpolate(PropertyVariableInterpolator.java:70)
 at
 
 
 org.apache.wicket.Localizer.substitutePropertyExpressions(Localizer.java:350)
 at org.apache.wicket.Localizer.getString(Localizer.java:249)
 at
 
 
 org.apache.wicket.model.StringResourceModel.getString(StringResourceModel.java:343)
 at
 
 
 org.apache.wicket.model.StringResourceModel.load(StringResourceModel.java:469)
 at
 
 
 org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:114)
 at
 org.apache.wicket.Component.getModelObject(Component.java:1510)
 at
  org.apache.wicket.Component.getModelObjectAsString(Component.java:1532)
 at
 
 
 org.apache.wicket.markup.html.basic.Label.onComponentTagBody(Label.java:111)
 at
  org.apache.wicket.Component.renderComponent(Component.java:2429)
 at
 
 org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:60)
 at org.apache.wicket.Component.render(Component.java:2266)
 at
  org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
 at
 
 
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
 at
 
 
 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
 at
  org.apache.wicket.Component.renderComponent(Component.java:2429)
 at
  org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
 at org.apache.wicket.Component.render(Component.java:2266)
 at
  org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
 at
 
 
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
 at
 
 
 org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
 at
 
 
 org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
 at
  org.apache.wicket.Component.renderComponent(Component.java:2429)
 at
  org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
 at org.apache.wicket.Component.render(Component.java:2266)
 at
  org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
 at
 
 
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
 at
 
 
 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
 at
  org.apache.wicket.Component.renderComponent(Component.java:2429)
 at
  org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
 at org.apache.wicket.Component.render(Component.java:2266)
 at
 
 
 org.apache.wicket.markup.repeater.AbstractRepeater.renderChild(AbstractRepeater.java:119)
 at
 
 
 org.apache.wicket.markup.repeater.AbstractRepeater.onRender(AbstractRepeater.java:100)
 at org.apache.wicket.Component.render(Component.java:2266)
 at
  org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
 at
 
 
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
 at
 
 
 

Re: NoSuchFieldException

2009-11-04 Thread Martin Grigorov
1.3.0 is too old
try to upgrade to latest 1.3.x at least (if not 1.4.3)

El mié, 04-11-2009 a las 00:53 -0800, Dusanb escribió:
 you mean the jar for wicket. 
 i use these:  http://old.nabble.com/file/p26192856/jar.jpg 
 
 
 
 reiern70 wrote:
  
  Did you check your jars versions? As Igor has suggested you in a previous
  thread...
  
  Regards,
  
  Ernesto
  
  On Wed, Nov 4, 2009 at 9:35 AM, Dusanb bani...@gmail.com wrote:
  
 
  hi i get this exception only in table with paging. Can somebody help me
  with
  this
 
 
  13:01:10.536 [SocketListener0-9] DEBUG o.a.w.util.lang.PropertyResolver -
  Cannot find field class
 
  org.apache.wicket.extensions.markup.html.repeater.data.table.NavigatorLabel$LabelModelObject.from
  java.lang.NoSuchFieldException: from
 at java.lang.Class.getField(Unknown Source)
 at
 
  org.apache.wicket.util.lang.PropertyResolver.findField(PropertyResolver.java:472)
 at
 
  org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:452)
 at
 
  org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
 at
 
  org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
 at
 
  org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.getValue(PropertyVariableInterpolator.java:86)
 at
 
  org.apache.wicket.util.string.interpolator.VariableInterpolator.toString(VariableInterpolator.java:129)
 at
 
  org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.interpolate(PropertyVariableInterpolator.java:70)
 at
 
  org.apache.wicket.Localizer.substitutePropertyExpressions(Localizer.java:350)
 at org.apache.wicket.Localizer.getString(Localizer.java:249)
 at
 
  org.apache.wicket.model.StringResourceModel.getString(StringResourceModel.java:343)
 at
 
  org.apache.wicket.model.StringResourceModel.load(StringResourceModel.java:469)
 at
 
  org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:114)
 at org.apache.wicket.Component.getModelObject(Component.java:1510)
 at
  org.apache.wicket.Component.getModelObjectAsString(Component.java:1532)
 at
 
  org.apache.wicket.markup.html.basic.Label.onComponentTagBody(Label.java:111)
 at
  org.apache.wicket.Component.renderComponent(Component.java:2429)
 at
  org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:60)
 at org.apache.wicket.Component.render(Component.java:2266)
 at
  org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
 at
 
  org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
 at
 
  org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
 at
  org.apache.wicket.Component.renderComponent(Component.java:2429)
 at
  org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
 at org.apache.wicket.Component.render(Component.java:2266)
 at
  org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
 at
 
  org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
 at
 
  org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
 at
 
  org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
 at
  org.apache.wicket.Component.renderComponent(Component.java:2429)
 at
  org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
 at org.apache.wicket.Component.render(Component.java:2266)
 at
  org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
 at
 
  org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
 at
 
  org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
 at
  org.apache.wicket.Component.renderComponent(Component.java:2429)
 at
  org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
 at org.apache.wicket.Component.render(Component.java:2266)
 at
 
  org.apache.wicket.markup.repeater.AbstractRepeater.renderChild(AbstractRepeater.java:119)
 at
 
  org.apache.wicket.markup.repeater.AbstractRepeater.onRender(AbstractRepeater.java:100)
 at org.apache.wicket.Component.render(Component.java:2266)
 at
  org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
 at
 
  org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
 at
 
  org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
 at
 
  org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
 at
  org.apache.wicket.Component.renderComponent(Component.java:2429)
 at
  

RE: Dynamically insert/remove WizardSteps based on user input ?

2009-11-04 Thread Frank Prins
Hey smallufo,

Yes, definitely, that's the way.
I am just working on quite a huge wizard right now, using the dynamic
approach.
The just assign the first step to the model, and in each of the steps
you implement next() in which you can create the next step, based on
choices made by the user.
Works like a charm!

have fun with it :-)
Frank

 -Original Message-
 From: Pedro Santos [mailto:pedros...@gmail.com]
 Sent: dinsdag 3 november 2009 23:12
 To: users@wicket.apache.org
 Subject: Re: Dynamically insert/remove WizardSteps based on user input
?
 
 I guess:
 http://wicket.apache.org/docs/wicket-1.3.2/wicket-

extensions/apidocs/org/apache/wicket/extensions/wizard/dynamic/IDynamicW
izardS
 tep.html
 
 On Tue, Nov 3, 2009 at 6:38 PM, smallufo small...@gmail.com wrote:
 
  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.
 
 
 
 
 --
 Pedro Henrique Oliveira dos Santos

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



Re: NoSuchFieldException

2009-11-04 Thread Dusanb

i downloaded new jar for wicket and the exception dissapear.

thank you for helping me 


martin-g wrote:
 
 Hi Dusanb,
 
 Try to debug it yourself.
 Here are the steps:
 - download the Wicket sources (the easiest way is: mvn
 -DdownloadSources=true eclipse:eclipse, refresh the Eclipse project. The
 same applies for IDEA and Netbeans)
 - attach a breakpoint at
 org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(String,
 Class). There is an 'else' clause with this code 
 method = findGetter(clz, exp);
 - here Wicket should find
 org.apache.wicket.extensions.markup.html.repeater.data.table.NavigatorLabel.LabelModelObject.getFrom()
 
 For some reason it doesn't. The debugger will show you what is wrong.
 
 El mié, 04-11-2009 a las 00:35 -0800, Dusanb escribió:
 hi i get this exception only in table with paging. Can somebody help me
 with
 this
 
 
 13:01:10.536 [SocketListener0-9] DEBUG o.a.w.util.lang.PropertyResolver -
 Cannot find field class
 org.apache.wicket.extensions.markup.html.repeater.data.table.NavigatorLabel$LabelModelObject.from
 java.lang.NoSuchFieldException: from
  at java.lang.Class.getField(Unknown Source)
  at
 org.apache.wicket.util.lang.PropertyResolver.findField(PropertyResolver.java:472)
  at
 org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:452)
  at
 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
  at
 org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
  at
 org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.getValue(PropertyVariableInterpolator.java:86)
  at
 org.apache.wicket.util.string.interpolator.VariableInterpolator.toString(VariableInterpolator.java:129)
  at
 org.apache.wicket.util.string.interpolator.PropertyVariableInterpolator.interpolate(PropertyVariableInterpolator.java:70)
  at
 org.apache.wicket.Localizer.substitutePropertyExpressions(Localizer.java:350)
  at org.apache.wicket.Localizer.getString(Localizer.java:249)
  at
 org.apache.wicket.model.StringResourceModel.getString(StringResourceModel.java:343)
  at
 org.apache.wicket.model.StringResourceModel.load(StringResourceModel.java:469)
  at
 org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:114)
  at org.apache.wicket.Component.getModelObject(Component.java:1510)
  at
 org.apache.wicket.Component.getModelObjectAsString(Component.java:1532)
  at
 org.apache.wicket.markup.html.basic.Label.onComponentTagBody(Label.java:111)
  at org.apache.wicket.Component.renderComponent(Component.java:2429)
  at
 org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:60)
  at org.apache.wicket.Component.render(Component.java:2266)
  at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
  at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
  at
 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
  at org.apache.wicket.Component.renderComponent(Component.java:2429)
  at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
  at org.apache.wicket.Component.render(Component.java:2266)
  at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
  at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
  at
 org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
  at
 org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
  at org.apache.wicket.Component.renderComponent(Component.java:2429)
  at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
  at org.apache.wicket.Component.render(Component.java:2266)
  at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
  at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
  at
 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)
  at org.apache.wicket.Component.renderComponent(Component.java:2429)
  at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
  at org.apache.wicket.Component.render(Component.java:2266)
  at
 org.apache.wicket.markup.repeater.AbstractRepeater.renderChild(AbstractRepeater.java:119)
  at
 org.apache.wicket.markup.repeater.AbstractRepeater.onRender(AbstractRepeater.java:100)
  at org.apache.wicket.Component.render(Component.java:2266)
  at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
  at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)
  at
 org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:631)
  at
 org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:112)
  at 

Re: NoSuchFieldException

2009-11-04 Thread Dusanb

can somebody tell me how can i start new topic?
-- 
View this message in context: 
http://old.nabble.com/java.lang.NoClassDefFoundError%3A-org-apache-wicket-util-lang-PropertyResolver-tp26191924p26194912.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



Apache Tomcat and CSS

2009-11-04 Thread Oliver-Sven Fritsch

Hi everybody!

This might not have to do with Wicket directly but I experience some 
very strange behavior with wicket pages on tomcat.
I do have a login page with a centered div container and two input 
fields for username and password. If I deploy my application on my local 
machine (win xp) into my tomcat everything look really nice on both 
firefox and ie8. BUT if I deploy the same .war archive into a linux 
server's tomcat my centered div is moved to the left of my browser 
window and my style definitions are somewhat messed up. This only 
aspects IE8, firefox displays everything very well. My third test 
machine (win server 2008) does everything well too (ff  ie8) so I guess 
it has something to do with tomcat running under linux. If I look at the 
page's sourcecode its exactly the same on all three environments.
What makes me think that wicket has something to do with that is the 
fact that a plain html file does render correctly on all systems and all 
browsers.


I validated my code using w3c's validator and it's says everything is 
fine except for the wicket:id tags which seems to be normal. Encoding is 
set to utf-8 so this shouldn't be a problem and doctype definitions are 
well too. This is a really strange problem which I can't seem to solve. 
Does anybody ever experienced somthing similar? Maybe any of you 
Wicket-Guru's ? :-)


Any help is really apreciated!

Thanks in advance
Oliver


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



Re: Apache Tomcat and CSS

2009-11-04 Thread Martijn Dashorst
My guess is capitalization... (windows is case insensitive, and linux isn't)

Capitalization is the difference between helping your uncle Jack off
a horse and helping your uncle jack off a horse

Martijn

On Wed, Nov 4, 2009 at 1:38 PM, Oliver-Sven Fritsch o...@3blogos.com wrote:
 Hi everybody!

 This might not have to do with Wicket directly but I experience some very
 strange behavior with wicket pages on tomcat.
 I do have a login page with a centered div container and two input fields
 for username and password. If I deploy my application on my local machine
 (win xp) into my tomcat everything look really nice on both firefox and ie8.
 BUT if I deploy the same .war archive into a linux server's tomcat my
 centered div is moved to the left of my browser window and my style
 definitions are somewhat messed up. This only aspects IE8, firefox displays
 everything very well. My third test machine (win server 2008) does
 everything well too (ff  ie8) so I guess it has something to do with tomcat
 running under linux. If I look at the page's sourcecode its exactly the same
 on all three environments.
 What makes me think that wicket has something to do with that is the fact
 that a plain html file does render correctly on all systems and all
 browsers.

 I validated my code using w3c's validator and it's says everything is fine
 except for the wicket:id tags which seems to be normal. Encoding is set to
 utf-8 so this shouldn't be a problem and doctype definitions are well too.
 This is a really strange problem which I can't seem to solve. Does anybody
 ever experienced somthing similar? Maybe any of you Wicket-Guru's ? :-)

 Any help is really apreciated!

 Thanks in advance
 Oliver


 -
 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: Apache Tomcat and CSS

2009-11-04 Thread Martijn Dashorst
Note: check your CSS filenames and the links to those.

Martijn

On Wed, Nov 4, 2009 at 1:42 PM, Martijn Dashorst
martijn.dasho...@gmail.com wrote:
 My guess is capitalization... (windows is case insensitive, and linux isn't)

 Capitalization is the difference between helping your uncle Jack off
 a horse and helping your uncle jack off a horse

 Martijn

 On Wed, Nov 4, 2009 at 1:38 PM, Oliver-Sven Fritsch o...@3blogos.com wrote:
 Hi everybody!

 This might not have to do with Wicket directly but I experience some very
 strange behavior with wicket pages on tomcat.
 I do have a login page with a centered div container and two input fields
 for username and password. If I deploy my application on my local machine
 (win xp) into my tomcat everything look really nice on both firefox and ie8.
 BUT if I deploy the same .war archive into a linux server's tomcat my
 centered div is moved to the left of my browser window and my style
 definitions are somewhat messed up. This only aspects IE8, firefox displays
 everything very well. My third test machine (win server 2008) does
 everything well too (ff  ie8) so I guess it has something to do with tomcat
 running under linux. If I look at the page's sourcecode its exactly the same
 on all three environments.
 What makes me think that wicket has something to do with that is the fact
 that a plain html file does render correctly on all systems and all
 browsers.

 I validated my code using w3c's validator and it's says everything is fine
 except for the wicket:id tags which seems to be normal. Encoding is set to
 utf-8 so this shouldn't be a problem and doctype definitions are well too.
 This is a really strange problem which I can't seem to solve. Does anybody
 ever experienced somthing similar? Maybe any of you Wicket-Guru's ? :-)

 Any help is really apreciated!

 Thanks in advance
 Oliver


 -
 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




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



LinkTree

2009-11-04 Thread jahid

Hi,

I have a LinkTree on a page, that page also contains a panel. First time 
the page will be loaded with an empty panel. But if user clicks on link, 
then i wanted to replace the empty panel with a new panel. but it seems 
like its not  working. Below is the part of my code-


  1. public ListContractsPage() {
  2. add(prepareTree());
  3. add(new
 EmptyPanel(detailsPanel,).setOutputMarkupId(true));
  4. }
  5. private BaseTree prepareTree() {
  6. DefaultMutableTreeNode rootNode = new
 DefaultMutableTreeNode(Contracts);
  7. TreeModel treeModel = new DefaultTreeModel(rootNode);
  8. assembleContracts(rootNode);
  9. final LinkTree linkTree=new LinkTree(tree, treeModel){
 10. @Override
 11. protected void onNodeLinkClicked(Object node, BaseTree
 tree, AjaxRequestTarget target) {
 12. Object userObject = ((DefaultMutableTreeNode)
 node).getUserObject();
 13. Panel targetPanel;
 14. if (userObject instanceof ServiceHandle) {
 15. targetPanel = new
 ServiceDetailsPanelServiceHandle(detailsPanel, (ServiceHandle)
 userObject);
 16. } else if (userObject instanceof ContractHandle) {
 17. targetPanel = new
 ContractDetailsPanelContractHandle(detailsPanel,
 (ContractHandle) userObject);
 18. } else {
 19. throw new AssertionError(Expected: master,
 sub or service handle, but found:  +
 userObject.getClass().getSimpleName());
 20. }
 21. targetPanel.setOutputMarkupId(true);
 22. target.addComponent(targetPanel);
 23. }
 24. };
 25. return linkTree;
 26. }


The panel which is added on line3, will be replaced by line15 or line17. 
But it seems like its not replacing. I actually debugged, and the 
control reaches over there and executes upto line22. But the new panel 
was never rendered on browser.


I am using wicket 1.4.2.

Anyone have any idea why new panels are not rendered?

Thanks in advance.

Jahid

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



LinkTree

2009-11-04 Thread jahid

Hi,

I have a LinkTree on a page, that page also contains a panel. First time 
the page will be loaded with an empty panel. But if user clicks on link, 
then i wanted to replace the empty panel with a new panel. but it seems 
like its not  working. Below is the part of my code-


  1. public ListContractsPage() {
  2. add(prepareTree());
  3. add(new
 EmptyPanel(detailsPanel,).setOutputMarkupId(true));
  4. }
  5. private BaseTree prepareTree() {
  6. DefaultMutableTreeNode rootNode = new
 DefaultMutableTreeNode(Contracts);
  7. TreeModel treeModel = new DefaultTreeModel(rootNode);
  8. assembleContracts(rootNode);
  9. final LinkTree linkTree=new LinkTree(tree, treeModel){
 10. @Override
 11. protected void onNodeLinkClicked(Object node, BaseTree
 tree, AjaxRequestTarget target) {
 12. Object userObject = ((DefaultMutableTreeNode)
 node).getUserObject();
 13. Panel targetPanel;
 14. if (userObject instanceof ServiceHandle) {
 15. targetPanel = new
 ServiceDetailsPanelServiceHandle(detailsPanel, (ServiceHandle)
 userObject);
 16. } else if (userObject instanceof ContractHandle) {
 17. targetPanel = new
 ContractDetailsPanelContractHandle(detailsPanel,
 (ContractHandle) userObject);
 18. } else {
 19. throw new AssertionError(Expected: master,
 sub or service handle, but found:  +
 userObject.getClass().getSimpleName());
 20. }
 21. targetPanel.setOutputMarkupId(true);
 22. target.addComponent(targetPanel);
 23. }
 24. };
 25. return linkTree;
 26. }
 27.

The panel which is added on line3, will be replaced by line15 or line17. 
But it seems like its not replacing. I actually debugged, and the 
control reaches over there and executes upto line22. But the new panel 
was never rendered on browser.


I am using wicket 1.4.2.

Anyone have any idea why new panels are not rendered?

Thanks in advance.

Jahid


Re: LinkTree

2009-11-04 Thread Vytautas Racelis

Hi,
 you should have a container and add that container into target.

 This is how i've done this:

http://xaloon.googlecode.com/svn/trunk/xaloon-wicket-jpa-components/src/main/java/org/xaloon/wicket/component/tree/TreePanel.java

jahid wrote:

Hi,

I have a LinkTree on a page, that page also contains a panel. First time 
the page will be loaded with an empty panel. But if user clicks on link, 
then i wanted to replace the empty panel with a new panel. but it seems 
like its not  working. Below is the part of my code-


  1. public ListContractsPage() {
  2. add(prepareTree());
  3. add(new
 EmptyPanel(detailsPanel,).setOutputMarkupId(true));
  4. }
  5. private BaseTree prepareTree() {
  6. DefaultMutableTreeNode rootNode = new
 DefaultMutableTreeNode(Contracts);
  7. TreeModel treeModel = new DefaultTreeModel(rootNode);
  8. assembleContracts(rootNode);
  9. final LinkTree linkTree=new LinkTree(tree, treeModel){
 10. @Override
 11. protected void onNodeLinkClicked(Object node, BaseTree
 tree, AjaxRequestTarget target) {
 12. Object userObject = ((DefaultMutableTreeNode)
 node).getUserObject();
 13. Panel targetPanel;
 14. if (userObject instanceof ServiceHandle) {
 15. targetPanel = new
 ServiceDetailsPanelServiceHandle(detailsPanel, (ServiceHandle)
 userObject);
 16. } else if (userObject instanceof ContractHandle) {
 17. targetPanel = new
 ContractDetailsPanelContractHandle(detailsPanel,
 (ContractHandle) userObject);
 18. } else {
 19. throw new AssertionError(Expected: master,
 sub or service handle, but found:  +
 userObject.getClass().getSimpleName());
 20. }
 21. targetPanel.setOutputMarkupId(true);
 22. target.addComponent(targetPanel);
 23. }
 24. };
 25. return linkTree;
 26. }


The panel which is added on line3, will be replaced by line15 or line17. 
But it seems like its not replacing. I actually debugged, and the 
control reaches over there and executes upto line22. But the new panel 
was never rendered on browser.


I am using wicket 1.4.2.

Anyone have any idea why new panels are not rendered?

Thanks in advance.

Jahid

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




--
Regards,
Vytautas Racelis
---
phone:+370-600-34389
e-mail: turi...@gmail.com
www.xaloon.org
www.leenle.com

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



Re: NoSuchFieldException

2009-11-04 Thread Martin Grigorov
El mié, 04-11-2009 a las 03:57 -0800, Dusanb escribió:
 can somebody tell me how can i start new topic?
write mail to users@wicket.apache.org


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



Re: LinkTree

2009-11-04 Thread Pedro Santos
Add you need to replace your old detailsPanel for the new one. Like:
HomePage.this.replace(targetPanel)

On Wed, Nov 4, 2009 at 11:20 AM, Vytautas Racelis turi...@gmail.com wrote:

 Hi,
  you should have a container and add that container into target.

  This is how i've done this:

 http://xaloon.googlecode.com/svn/trunk/xaloon-wicket-jpa-components/src/main/java/org/xaloon/wicket/component/tree/TreePanel.java


 jahid wrote:

 Hi,

 I have a LinkTree on a page, that page also contains a panel. First time
 the page will be loaded with an empty panel. But if user clicks on link,
 then i wanted to replace the empty panel with a new panel. but it seems like
 its not  working. Below is the part of my code-

  1. public ListContractsPage() {
  2. add(prepareTree());
  3. add(new
 EmptyPanel(detailsPanel,).setOutputMarkupId(true));
  4. }
  5. private BaseTree prepareTree() {
  6. DefaultMutableTreeNode rootNode = new
 DefaultMutableTreeNode(Contracts);
  7. TreeModel treeModel = new DefaultTreeModel(rootNode);
  8. assembleContracts(rootNode);
  9. final LinkTree linkTree=new LinkTree(tree, treeModel){
  10. @Override
  11. protected void onNodeLinkClicked(Object node, BaseTree
 tree, AjaxRequestTarget target) {
  12. Object userObject = ((DefaultMutableTreeNode)
 node).getUserObject();
  13. Panel targetPanel;
  14. if (userObject instanceof ServiceHandle) {
  15. targetPanel = new
 ServiceDetailsPanelServiceHandle(detailsPanel, (ServiceHandle)
 userObject);
  16. } else if (userObject instanceof ContractHandle) {
  17. targetPanel = new
 ContractDetailsPanelContractHandle(detailsPanel,
 (ContractHandle) userObject);
  18. } else {
  19. throw new AssertionError(Expected: master,
 sub or service handle, but found:  +
 userObject.getClass().getSimpleName());
  20. }
  21. targetPanel.setOutputMarkupId(true);
  22. target.addComponent(targetPanel);
  23. }
  24. };
  25. return linkTree;
  26. }


 The panel which is added on line3, will be replaced by line15 or line17.
 But it seems like its not replacing. I actually debugged, and the control
 reaches over there and executes upto line22. But the new panel was never
 rendered on browser.

 I am using wicket 1.4.2.

 Anyone have any idea why new panels are not rendered?

 Thanks in advance.

 Jahid

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



 --
 Regards,
 Vytautas Racelis
 ---
 phone:+370-600-34389
 e-mail: turi...@gmail.com
 www.xaloon.org
 www.leenle.com


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




-- 
Pedro Henrique Oliveira dos Santos


Re: LinkTree

2009-11-04 Thread jahid
Guys, thanks a lot for quick reply. I have changed my code according to 
your mentioned way, but seems like i am doing something wrong. Below are 
my code, markup and stacktrace -




  1. private WebMarkupContainer markupContainer;
  2. final String DETAILS_PANEL_ID =detailsPanel;
  3. public ListContractsPage() {
  4. markupContainer =new WebMarkupContainer(markupContainer);
  5. markupContainer.setOutputMarkupId(true);
  6. markupContainer.add(new
 Label(DETAILS_PANEL_ID,label).setOutputMarkupId(true));
  7. add(prepareTree());
  8. add(markupContainer);
  9. }
 10. private BaseTree prepareTree() {
 11. DefaultMutableTreeNode rootNode = new
 DefaultMutableTreeNode(Contracts);
 12. TreeModel treeModel = new DefaultTreeModel(rootNode);
 13. assembleContracts(rootNode);
 14. final LinkTree linkTree=new LinkTree(tree, treeModel){
 15. @Override
 16. protected void onNodeLinkClicked(Object node, BaseTree
 tree, AjaxRequestTarget target) {
 17. //markupContainer.remove(DETAILS_PANEL_ID);
 18. Object userObject = ((DefaultMutableTreeNode)
 node).getUserObject();
 19. Panel targetPanel;
 20. if (userObject instanceof ServiceHandle) {
 21. targetPanel = new
 ServiceDetailsPanelServiceHandle(DETAILS_PANEL_ID,
 (ServiceHandle) userObject);
 22. } else if (userObject instanceof ContractHandle) {
 23. targetPanel = new
 ContractDetailsPanelContractHandle(DETAILS_PANEL_ID,
 (ContractHandle) userObject);
 24. } else {
 25. throw new AssertionError(Expected: master,
 sub or service handle, but found:  +
 userObject.getClass().getSimpleName());
 26. }
 27. targetPanel.setOutputMarkupId(true);
 28. ListContractsPage.this.addOrReplace(targetPanel);
 29. target.addComponent(targetPanel);
 30. }
 31. };
 32. linkTree.setOutputMarkupId(true);
 33. linkTree.getTreeState().expandNode(rootNode);
 34. return linkTree;
 35. }




  1. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
  2. http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
  3. html xmlns=http://www.w3.org/1999/xhtml;
  4.   xmlns:wicket=http://wicket.apache.org/; xml:lang=en
 lang=en
  5. body
  6. wicket:extend
  7. h4Contracts:/h4
  8. table
  9. tr
 10. td
 11. span wicket:id=tree[tree will be here]/span
 12. /td
 13. /tr
 14. tr
 15. td
 16. span wicket:id=markupContainer
 17. span
 wicket:id=detailsPanel/span   
 18. /span

 19. /td
 20. /tr
 21. /table
 22. /wicket:extend
 23. /body
 24. /html




WicketMessage: Unable to find the markup for the component. That may be 
due to transparent containers or components implementing 
IComponentResolver: [MarkupContainer [Component id = detailsPanel]]


Root cause:

org.apache.wicket.WicketRuntimeException: Unable to find the markup for 
the component. That may be due to transparent containers or components 
implementing IComponentResolver: [MarkupContainer [Component id = 
detailsPanel]]
at 
org.apache.wicket.MarkupFragmentFinder.find(MarkupFragmentFinder.java:125)

at org.apache.wicket.Component.locateMarkupStream(Component.java:3820)
at org.apache.wicket.Component.renderComponent(Component.java:2557)
at 
org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:793)
at 
org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:667)
at 
org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:579)
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1249)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1320)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)

at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at 

AW: LinkTree

2009-11-04 Thread Giambalvo, Christian
Hi,

i did another way an that way worked.

Replace markupContainer.add(new 
Label(DETAILS_PANEL_ID,label).setOutputMarkupId(true));
with 
private final Label labelToReplace = new 
Label(DETAILS_PANEL_ID,label).setOutputMarkupId(true);

markupContainer.add(labelToReplace);
...
And in onNodeLinkClicked create your panel and then do: 
labelToReplace.replaceWith(targetPanel);

Hope this helps.

-Ursprüngliche Nachricht-
Von: jahid [mailto:ja...@outscore.se] 
Gesendet: Mittwoch, 4. November 2009 15:13
An: users@wicket.apache.org
Betreff: Re: LinkTree

Guys, thanks a lot for quick reply. I have changed my code according to 
your mentioned way, but seems like i am doing something wrong. Below are 
my code, markup and stacktrace -



   1. private WebMarkupContainer markupContainer;
   2. final String DETAILS_PANEL_ID =detailsPanel;
   3. public ListContractsPage() {
   4. markupContainer =new WebMarkupContainer(markupContainer);
   5. markupContainer.setOutputMarkupId(true);
   6. markupContainer.add(new
  Label(DETAILS_PANEL_ID,label).setOutputMarkupId(true));
   7. add(prepareTree());
   8. add(markupContainer);
   9. }
  10. private BaseTree prepareTree() {
  11. DefaultMutableTreeNode rootNode = new
  DefaultMutableTreeNode(Contracts);
  12. TreeModel treeModel = new DefaultTreeModel(rootNode);
  13. assembleContracts(rootNode);
  14. final LinkTree linkTree=new LinkTree(tree, treeModel){
  15. @Override
  16. protected void onNodeLinkClicked(Object node, BaseTree
  tree, AjaxRequestTarget target) {
  17. //markupContainer.remove(DETAILS_PANEL_ID);
  18. Object userObject = ((DefaultMutableTreeNode)
  node).getUserObject();
  19. Panel targetPanel;
  20. if (userObject instanceof ServiceHandle) {
  21. targetPanel = new
  ServiceDetailsPanelServiceHandle(DETAILS_PANEL_ID,
  (ServiceHandle) userObject);
  22. } else if (userObject instanceof ContractHandle) {
  23. targetPanel = new
  ContractDetailsPanelContractHandle(DETAILS_PANEL_ID,
  (ContractHandle) userObject);
  24. } else {
  25. throw new AssertionError(Expected: master,
  sub or service handle, but found:  +
  userObject.getClass().getSimpleName());
  26. }
  27. targetPanel.setOutputMarkupId(true);
  28. ListContractsPage.this.addOrReplace(targetPanel);
  29. target.addComponent(targetPanel);
  30. }
  31. };
  32. linkTree.setOutputMarkupId(true);
  33. linkTree.getTreeState().expandNode(rootNode);
  34. return linkTree;
  35. }




   1. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
   2. http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
   3. html xmlns=http://www.w3.org/1999/xhtml;
   4.   xmlns:wicket=http://wicket.apache.org/; xml:lang=en
  lang=en
   5. body
   6. wicket:extend
   7. h4Contracts:/h4
   8. table
   9. tr
  10. td
  11. span wicket:id=tree[tree will be here]/span
  12. /td
  13. /tr
  14. tr
  15. td
  16. span wicket:id=markupContainer
  17. span
  wicket:id=detailsPanel/span   
  18. /span
  19. /td
  20. /tr
  21. /table
  22. /wicket:extend
  23. /body
  24. /html




WicketMessage: Unable to find the markup for the component. That may be 
due to transparent containers or components implementing 
IComponentResolver: [MarkupContainer [Component id = detailsPanel]]

Root cause:

org.apache.wicket.WicketRuntimeException: Unable to find the markup for 
the component. That may be due to transparent containers or components 
implementing IComponentResolver: [MarkupContainer [Component id = 
detailsPanel]]
at 
org.apache.wicket.MarkupFragmentFinder.find(MarkupFragmentFinder.java:125)
at org.apache.wicket.Component.locateMarkupStream(Component.java:3820)
at org.apache.wicket.Component.renderComponent(Component.java:2557)
at 
org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:793)
at 
org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:667)
at 
org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:579)
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1249)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1320)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at 

Re: AW: LinkTree

2009-11-04 Thread jahid
Ohh my bad, i was trying to replace the targetPanel to the page, not 
to the markupContainer. Now its working! :)



Thanks guys!

//Jahid

Giambalvo, Christian wrote:

Hi,

i did another way an that way worked.

Replace markupContainer.add(new 
Label(DETAILS_PANEL_ID,label).setOutputMarkupId(true));
with 
private final Label labelToReplace = new Label(DETAILS_PANEL_ID,label).setOutputMarkupId(true);


markupContainer.add(labelToReplace);
...
And in onNodeLinkClicked create your panel and then do: 
labelToReplace.replaceWith(targetPanel);

Hope this helps.

-Ursprüngliche Nachricht-
Von: jahid [mailto:ja...@outscore.se] 
Gesendet: Mittwoch, 4. November 2009 15:13

An: users@wicket.apache.org
Betreff: Re: LinkTree

Guys, thanks a lot for quick reply. I have changed my code according to 
your mentioned way, but seems like i am doing something wrong. Below are 
my code, markup and stacktrace -




   1. private WebMarkupContainer markupContainer;
   2. final String DETAILS_PANEL_ID =detailsPanel;
   3. public ListContractsPage() {
   4. markupContainer =new WebMarkupContainer(markupContainer);
   5. markupContainer.setOutputMarkupId(true);
   6. markupContainer.add(new
  Label(DETAILS_PANEL_ID,label).setOutputMarkupId(true));
   7. add(prepareTree());
   8. add(markupContainer);
   9. }
  10. private BaseTree prepareTree() {
  11. DefaultMutableTreeNode rootNode = new
  DefaultMutableTreeNode(Contracts);
  12. TreeModel treeModel = new DefaultTreeModel(rootNode);
  13. assembleContracts(rootNode);
  14. final LinkTree linkTree=new LinkTree(tree, treeModel){
  15. @Override
  16. protected void onNodeLinkClicked(Object node, BaseTree
  tree, AjaxRequestTarget target) {
  17. //markupContainer.remove(DETAILS_PANEL_ID);
  18. Object userObject = ((DefaultMutableTreeNode)
  node).getUserObject();
  19. Panel targetPanel;
  20. if (userObject instanceof ServiceHandle) {
  21. targetPanel = new
  ServiceDetailsPanelServiceHandle(DETAILS_PANEL_ID,
  (ServiceHandle) userObject);
  22. } else if (userObject instanceof ContractHandle) {
  23. targetPanel = new
  ContractDetailsPanelContractHandle(DETAILS_PANEL_ID,
  (ContractHandle) userObject);
  24. } else {
  25. throw new AssertionError(Expected: master,
  sub or service handle, but found:  +
  userObject.getClass().getSimpleName());
  26. }
  27. targetPanel.setOutputMarkupId(true);
  28. ListContractsPage.this.addOrReplace(targetPanel);
  29. target.addComponent(targetPanel);
  30. }
  31. };
  32. linkTree.setOutputMarkupId(true);
  33. linkTree.getTreeState().expandNode(rootNode);
  34. return linkTree;
  35. }




   1. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
   2. http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
   3. html xmlns=http://www.w3.org/1999/xhtml;
   4.   xmlns:wicket=http://wicket.apache.org/; xml:lang=en
  lang=en
   5. body
   6. wicket:extend
   7. h4Contracts:/h4
   8. table
   9. tr
  10. td
  11. span wicket:id=tree[tree will be here]/span
  12. /td
  13. /tr
  14. tr
  15. td
  16. span wicket:id=markupContainer
  17. span
  wicket:id=detailsPanel/span   
  18. /span

  19. /td
  20. /tr
  21. /table
  22. /wicket:extend
  23. /body
  24. /html




WicketMessage: Unable to find the markup for the component. That may be 
due to transparent containers or components implementing 
IComponentResolver: [MarkupContainer [Component id = detailsPanel]]


Root cause:

org.apache.wicket.WicketRuntimeException: Unable to find the markup for 
the component. That may be due to transparent containers or components 
implementing IComponentResolver: [MarkupContainer [Component id = 
detailsPanel]]
at 
org.apache.wicket.MarkupFragmentFinder.find(MarkupFragmentFinder.java:125)

at org.apache.wicket.Component.locateMarkupStream(Component.java:3820)
at org.apache.wicket.Component.renderComponent(Component.java:2557)
at 
org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:793)
at 
org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:667)
at 
org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:579)
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1249)

at 

Re: Problem with IFormsubmitting

2009-11-04 Thread Martin Makundi
Hi!

The proposed solution does not work with Modal Windows!!
* http://osdir.com/ml/users-wicket.apache.org/2009-11/msg00076.html

Modal windws have a fake parent form:

form style=border-width: 0px; margin: 0px; padding: 0px;
background-color: transparent; position: static;

.. and ofcourse it does not have a hidden input field...

.. so the solution gets a bit nastier...

.. we must fake the hidden field value into the request ... ?

Is there another less pervasive way to do this? Maybe alter wicket a bit ;) ?

The solution here is implementation specific and probably works with jetty only:


public abstract class
AjaxFormSubmittingChangeListenerDropDownChoiceT extends
DropDownChoiceT {
  private final static Method hiddenFieldGetter;
  static {
try {
  hiddenFieldGetter = Form.class.getDeclaredMethod(getHiddenFieldId);
  hiddenFieldGetter.setAccessible(true);
} catch (Exception e) {
  throw new RuntimeException(e);
}
  }

  /** Initialize */ {
add(new AjaxFormSubmitBehavior(JavaScriptConstants.ONCHANGE) {

  @Override
  protected void onError(AjaxRequestTarget target) {
AjaxFormSubmittingChangeListenerDropDownChoice.this.onError(target);
  }

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

  /**
   * @see 
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior#onEvent(org.apache.wicket.ajax.AjaxRequestTarget)
   */
  @Override
  protected void onEvent(AjaxRequestTarget target) {
org.mortbay.util.MultiMap parameters =
((org.mortbay.jetty.Request) ((WebRequest)
getRequest()).getHttpServletRequest()).getParameters();

parameters.put(getHiddenFieldId(AjaxFormSubmittingChangeListenerDropDownChoice.this.getForm()),

AjaxFormSubmittingChangeListenerDropDownChoice.this.urlFor(IOnChangeListener.INTERFACE));
super.onEvent(target);
  }

  /**
   * @param form
   * @return String
   */
  private String getHiddenFieldId(Form? form) {
try {
  Form? root = form.getRootForm();
  return (String) hiddenFieldGetter.invoke(root);
} catch (Exception e) {
  throw new RuntimeException(e);
}
  }

});
  }
}


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


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



Custom model for lists

2009-11-04 Thread Steffen Dienst

Hi,

I need a model to represent a list of integers. I'd like to represent this list as a comma separated string in a text 
field. Is there any model I can use as a foundation? Where can I learn about implementing this (converting list to comma 
separated string and back)?


Thanks in advance,

Steffen

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



CompoundPropertyModel in conjunction with RadioChoiceChoiceRenderers

2009-11-04 Thread Xavier López
Hi,

I have a question regarding the use of RadioChoice and ChoiceRenderer's in
conjunction with CompoundPropertyModel. I'm new to Wicket (but already a
convinced user ;) ), so maybe my approach on this one is not at all as it
should be... Any comments are welcome !

I'll get into details. Let's say I have a class in my domain model named
Person. This entity has a property named 'deptId' of type String. The Person
entity is the backing for a CompundPropertyModel applied to the whole form.
The 'deptId' field is inputted by the user, let's say, by means of a
RadioChoice (I guess it makes no difference from a DropDownChoice taking
into account the point of the question). The choice list for the RadioChoice
component is a List made up of DTO objects with properties id and
description. To ensure proper rendering of labels, I use a suitable
ChoiceRenderer.

Now, problems come when the 'deptId' property has a value in the Person
entity used in the CompoundPropertyModel. I get an error saying that class
String does not have any property called 'id' (I suppose this error comes
from having a ModelObject of type String and also having a ChoiceRenderer
refering to 'id' property).

I'll provide some sample code:

markup
-
...
form wicket:id=form
...
span valign=top wicket:id=deptId/span
...
/form
...

Java
-

...
ListSimpleElementDTO choices = contextData.getChoices();
Person p = new Person(...);
Form f = new Form(form){...};
f.setModel(new CompoundPropertyModel(p));
ChoiceRenderer cr = new ChoiceRenderer(deptId, choices, new
ChoiceRenderer(id, description));
f.add(cr);
...


I suppose the 'normal' way of doing things would be providing a custom Model
to 'cr', but I'd like to know if there is a possibility to achieve this
point still using CompoundPropertyModel...

The stack trace I get is the following:

WicketMessage: No get method defined for class: class java.lang.String
expression: id
Root cause:
org.apache.wicket.WicketRuntimeException: No get method defined for class:
class java.lang.String expression: id
at
org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440)
at
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282)
at
org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91)
at
org.apache.wicket.markup.html.form.ChoiceRenderer.getIdValue(ChoiceRenderer.java:140)
at
org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(AbstractSingleSelectChoice.java:144)
at
org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:797)
at
org.apache.wicket.markup.html.form.RadioChoice.onComponentTagBody(RadioChoice.java:407)
at org.apache.wicket.Component.renderComponent(Component.java:2480)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411)
at org.apache.wicket.Component.render(Component.java:2317)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1297)
...


Re: Custom model for lists

2009-11-04 Thread Sven Meier

Hi Steffen,

use an IConverter on your textfield.

Sven

Steffen Dienst wrote:

Hi,

I need a model to represent a list of integers. I'd like to represent 
this list as a comma separated string in a text field. Is there any 
model I can use as a foundation? Where can I learn about implementing 
this (converting list to comma separated string and back)?


Thanks in advance,

Steffen

-
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



Re: CompoundPropertyModel in conjunction with RadioChoiceChoiceRenderers

2009-11-04 Thread Sven Meier

Hi Xavier,


I suppose this error comes from having a ModelObject of type
String and also having a ChoiceRenderer refering to 'id' property


your choice is working on SimpleElementDTOs while your Person class has a 
String property - this cannot work.
Ideally you would just set a Department instance into your Person objects, but 
what you're trying to do can only be accomplished with a custom model.

Sven


Xavier López wrote:

Hi,

I have a question regarding the use of RadioChoice and ChoiceRenderer's in
conjunction with CompoundPropertyModel. I'm new to Wicket (but already a
convinced user ;) ), so maybe my approach on this one is not at all as it
should be... Any comments are welcome !

I'll get into details. Let's say I have a class in my domain model named
Person. This entity has a property named 'deptId' of type String. The Person
entity is the backing for a CompundPropertyModel applied to the whole form.
The 'deptId' field is inputted by the user, let's say, by means of a
RadioChoice (I guess it makes no difference from a DropDownChoice taking
into account the point of the question). The choice list for the RadioChoice
component is a List made up of DTO objects with properties id and
description. To ensure proper rendering of labels, I use a suitable
ChoiceRenderer.

Now, problems come when the 'deptId' property has a value in the Person
entity used in the CompoundPropertyModel. I get an error saying that class
String does not have any property called 'id' (I suppose this error comes
from having a ModelObject of type String and also having a ChoiceRenderer
refering to 'id' property).

I'll provide some sample code:

markup
-
...
form wicket:id=form
...
span valign=top wicket:id=deptId/span
...
/form
...

Java
-

...
ListSimpleElementDTO choices = contextData.getChoices();
Person p = new Person(...);
Form f = new Form(form){...};
f.setModel(new CompoundPropertyModel(p));
ChoiceRenderer cr = new ChoiceRenderer(deptId, choices, new
ChoiceRenderer(id, description));
f.add(cr);
...


I suppose the 'normal' way of doing things would be providing a custom Model
to 'cr', but I'd like to know if there is a possibility to achieve this
point still using CompoundPropertyModel...

The stack trace I get is the following:

WicketMessage: No get method defined for class: class java.lang.String
expression: id
Root cause:
org.apache.wicket.WicketRuntimeException: No get method defined for class:
class java.lang.String expression: id
at
org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440)
at
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282)
at
org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91)
at
org.apache.wicket.markup.html.form.ChoiceRenderer.getIdValue(ChoiceRenderer.java:140)
at
org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(AbstractSingleSelectChoice.java:144)
at
org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:797)
at
org.apache.wicket.markup.html.form.RadioChoice.onComponentTagBody(RadioChoice.java:407)
at org.apache.wicket.Component.renderComponent(Component.java:2480)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411)
at org.apache.wicket.Component.render(Component.java:2317)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1297)
...

  



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



Re: CompoundPropertyModel in conjunction with RadioChoiceChoiceRenderers

2009-11-04 Thread Pedro Santos
Hi Sven, he stell can write some specialized render... but I think the best
way is you have your depid property of type Department. Than all this thread
would not have started :)

class YourCustomRender
{
@Override
public String getIdValue(Object object, int index)
{
if (object instanceof DTO)
{
return ((DTO)object).getDeptId()
}
else
{
return (String)object;//already is the depid string
}
}

@Override
public Object getDisplayValue(Object object)
{
if (object instanceof DTO)
{
return ((DTO)object).getDescription();
}
else
{
return contextData.getDTOBasedOnDepid(object);
}
}
}

On Wed, Nov 4, 2009 at 1:29 PM, Xavier López xavil...@gmail.com wrote:

 Hi,

 I have a question regarding the use of RadioChoice and ChoiceRenderer's in
 conjunction with CompoundPropertyModel. I'm new to Wicket (but already a
 convinced user ;) ), so maybe my approach on this one is not at all as it
 should be... Any comments are welcome !

 I'll get into details. Let's say I have a class in my domain model named
 Person. This entity has a property named 'deptId' of type String. The
 Person
 entity is the backing for a CompundPropertyModel applied to the whole form.
 The 'deptId' field is inputted by the user, let's say, by means of a
 RadioChoice (I guess it makes no difference from a DropDownChoice taking
 into account the point of the question). The choice list for the
 RadioChoice
 component is a List made up of DTO objects with properties id and
 description. To ensure proper rendering of labels, I use a suitable
 ChoiceRenderer.

 Now, problems come when the 'deptId' property has a value in the Person
 entity used in the CompoundPropertyModel. I get an error saying that class
 String does not have any property called 'id' (I suppose this error comes
 from having a ModelObject of type String and also having a ChoiceRenderer
 refering to 'id' property).

 I'll provide some sample code:

 markup
 -
 ...
 form wicket:id=form
...
span valign=top wicket:id=deptId/span
...
 /form
 ...

 Java
 -

 ...
 ListSimpleElementDTO choices = contextData.getChoices();
 Person p = new Person(...);
 Form f = new Form(form){...};
 f.setModel(new CompoundPropertyModel(p));
 ChoiceRenderer cr = new ChoiceRenderer(deptId, choices, new
 ChoiceRenderer(id, description));
 f.add(cr);
 ...


 I suppose the 'normal' way of doing things would be providing a custom
 Model
 to 'cr', but I'd like to know if there is a possibility to achieve this
 point still using CompoundPropertyModel...

 The stack trace I get is the following:

 WicketMessage: No get method defined for class: class java.lang.String
 expression: id
 Root cause:
 org.apache.wicket.WicketRuntimeException: No get method defined for class:
 class java.lang.String expression: id
 at

 org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440)
 at

 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282)
 at

 org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91)
 at

 org.apache.wicket.markup.html.form.ChoiceRenderer.getIdValue(ChoiceRenderer.java:140)
 at

 org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(AbstractSingleSelectChoice.java:144)
 at

 org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:797)
 at

 org.apache.wicket.markup.html.form.RadioChoice.onComponentTagBody(RadioChoice.java:407)
 at org.apache.wicket.Component.renderComponent(Component.java:2480)
 at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411)
 at org.apache.wicket.Component.render(Component.java:2317)
 at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1297)
 ...




-- 
Pedro Henrique Oliveira dos Santos


Re: CompoundPropertyModel in conjunction with RadioChoiceChoiceRenderers

2009-11-04 Thread Sven Meier

Hi Pedro,

with your condition inside the renderer you've beaten me by originality ;).

But I doubt that the choice will be able to store the selected DTO in 
the entity's String property.


Sven

Pedro Santos wrote:

Hi Sven, he stell can write some specialized render... but I think the best
way is you have your depid property of type Department. Than all this thread
would not have started :)

class YourCustomRender
{
@Override
public String getIdValue(Object object, int index)
{
if (object instanceof DTO)
{
return ((DTO)object).getDeptId()
}
else
{
return (String)object;//already is the depid string
}
}

@Override
public Object getDisplayValue(Object object)
{
if (object instanceof DTO)
{
return ((DTO)object).getDescription();
}
else
{
return contextData.getDTOBasedOnDepid(object);
}
}
}

On Wed, Nov 4, 2009 at 1:29 PM, Xavier López xavil...@gmail.com wrote:

  

Hi,

I have a question regarding the use of RadioChoice and ChoiceRenderer's in
conjunction with CompoundPropertyModel. I'm new to Wicket (but already a
convinced user ;) ), so maybe my approach on this one is not at all as it
should be... Any comments are welcome !

I'll get into details. Let's say I have a class in my domain model named
Person. This entity has a property named 'deptId' of type String. The
Person
entity is the backing for a CompundPropertyModel applied to the whole form.
The 'deptId' field is inputted by the user, let's say, by means of a
RadioChoice (I guess it makes no difference from a DropDownChoice taking
into account the point of the question). The choice list for the
RadioChoice
component is a List made up of DTO objects with properties id and
description. To ensure proper rendering of labels, I use a suitable
ChoiceRenderer.

Now, problems come when the 'deptId' property has a value in the Person
entity used in the CompoundPropertyModel. I get an error saying that class
String does not have any property called 'id' (I suppose this error comes
from having a ModelObject of type String and also having a ChoiceRenderer
refering to 'id' property).

I'll provide some sample code:

markup
-
...
form wicket:id=form
   ...
   span valign=top wicket:id=deptId/span
   ...
/form
...

Java
-

...
ListSimpleElementDTO choices = contextData.getChoices();
Person p = new Person(...);
Form f = new Form(form){...};
f.setModel(new CompoundPropertyModel(p));
ChoiceRenderer cr = new ChoiceRenderer(deptId, choices, new
ChoiceRenderer(id, description));
f.add(cr);
...


I suppose the 'normal' way of doing things would be providing a custom
Model
to 'cr', but I'd like to know if there is a possibility to achieve this
point still using CompoundPropertyModel...

The stack trace I get is the following:

WicketMessage: No get method defined for class: class java.lang.String
expression: id
Root cause:
org.apache.wicket.WicketRuntimeException: No get method defined for class:
class java.lang.String expression: id
at

org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440)
at

org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282)
at

org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91)
at

org.apache.wicket.markup.html.form.ChoiceRenderer.getIdValue(ChoiceRenderer.java:140)
at

org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(AbstractSingleSelectChoice.java:144)
at

org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:797)
at

org.apache.wicket.markup.html.form.RadioChoice.onComponentTagBody(RadioChoice.java:407)
at org.apache.wicket.Component.renderComponent(Component.java:2480)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411)
at org.apache.wicket.Component.render(Component.java:2317)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1297)
...






  



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



Wicket tester mock server name

2009-11-04 Thread Ted Vinke

Hi!

Seems a bit dumb I can't seem to get the following working. In my 
application I have to so something special based on the domain the app 
is running on. I ask for that domain in the following manner:


   String serverName = 
getWebRequestCycle().getWebRequest().getHttpServletRequest().getServerName();

   // serverName is e.g. 'www.somedomain.com'

The problem: when testing in the Wicket tester serverName results in 
'localhost'.


How can I set / mock 
getWebRequestCycle().getWebRequest().getHttpServletRequest().getServerName() 
to return a preset value, such as 'www.somedomain.com',  when accessing 
my page in my unit test?


Any tips or hints to examples are greatly appreciated!!

Kind regards,
Ted

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



OT: Relational database + Hibenate vs Content Repository (Jackrabbit)

2009-11-04 Thread danisevsky
Hallo, I am thinking about learning and using Jackrabbit instead of
relational database (+ Hibernate) in my new wicket application (which will
be build on Brix CMS).
Is it very wrong idea?
Thanks


Re: CompoundPropertyModel in conjunction with RadioChoiceChoiceRenderers

2009-11-04 Thread Xavier López
Hi Sven, Pedro,

Thanks both for your quick reply.

Ideally you would just set a Department instance into your Person objects


the best way is you have your depid property of type Department

This was the first approach to take into account, but the idea was discarded
in benefit of SimpleElementDTO, in order to provide only the necessary
information to Wicket Models, with the intention of not wasting any memory
on PageMaps due to Department object serializations... Also, this
SimpleElementDTO would be reusable throughout the whole application when
it's about Radio and DropDown Choices...

write some specialized render

This kinda 'dirty-fix' idea was already crawling in my mind, trying to come
out someway. Thanks for providing a concrete implementation.

So, in the end I'm trying to provide a custom model. Something like:

Java

final Person p;

Model crModel = new Model(){
  getObject(){
 return p.getDeptId();
   }
  setObject(Object o){
 // o is String!
 p.setDeptId( (String) o);
  }
};
ChoiceRenderer cr = new ChoiceRenderer(deptId, choices, new
ChoiceRenderer(id, description));
cr.setModel(crModel);

But i'm stucking into the same error, as this Model it's kind like a
PropertyModel which would be assumed by having the former
CompoundPropertyModel...

Any thoughts ? Maybe rendering labels independently ?

It's strange nobody has bumped into this situation before.. Maybe it's
because i'm still thinking like I was using Struts...

Thanks to both again,
Cheers !


2009/11/4 Pedro Santos pedros...@gmail.com

 Hi Sven, he stell can write some specialized render... but I think the best
 way is you have your depid property of type Department. Than all this
 thread
 would not have started :)

 class YourCustomRender
{
@Override
public String getIdValue(Object object, int index)
{
if (object instanceof DTO)
{
return ((DTO)object).getDeptId()
}
else
{
return (String)object;//already is the depid string
}
}

@Override
public Object getDisplayValue(Object object)
{
if (object instanceof DTO)
{
return ((DTO)object).getDescription();
}
else
{
return contextData.getDTOBasedOnDepid(object);
 }
}
}

 On Wed, Nov 4, 2009 at 1:29 PM, Xavier López xavil...@gmail.com wrote:

  Hi,
 
  I have a question regarding the use of RadioChoice and ChoiceRenderer's
 in
  conjunction with CompoundPropertyModel. I'm new to Wicket (but already a
  convinced user ;) ), so maybe my approach on this one is not at all as it
  should be... Any comments are welcome !
 
  I'll get into details. Let's say I have a class in my domain model named
  Person. This entity has a property named 'deptId' of type String. The
  Person
  entity is the backing for a CompundPropertyModel applied to the whole
 form.
  The 'deptId' field is inputted by the user, let's say, by means of a
  RadioChoice (I guess it makes no difference from a DropDownChoice taking
  into account the point of the question). The choice list for the
  RadioChoice
  component is a List made up of DTO objects with properties id and
  description. To ensure proper rendering of labels, I use a suitable
  ChoiceRenderer.
 
  Now, problems come when the 'deptId' property has a value in the Person
  entity used in the CompoundPropertyModel. I get an error saying that
 class
  String does not have any property called 'id' (I suppose this error comes
  from having a ModelObject of type String and also having a ChoiceRenderer
  refering to 'id' property).
 
  I'll provide some sample code:
 
  markup
  -
  ...
  form wicket:id=form
 ...
 span valign=top wicket:id=deptId/span
 ...
  /form
  ...
 
  Java
  -
 
  ...
  ListSimpleElementDTO choices = contextData.getChoices();
  Person p = new Person(...);
  Form f = new Form(form){...};
  f.setModel(new CompoundPropertyModel(p));
  ChoiceRenderer cr = new ChoiceRenderer(deptId, choices, new
  ChoiceRenderer(id, description));
  f.add(cr);
  ...
 
 
  I suppose the 'normal' way of doing things would be providing a custom
  Model
  to 'cr', but I'd like to know if there is a possibility to achieve this
  point still using CompoundPropertyModel...
 
  The stack trace I get is the following:
 
  WicketMessage: No get method defined for class: class java.lang.String
  expression: id
  Root cause:
  org.apache.wicket.WicketRuntimeException: No get method defined for
 class:
  class java.lang.String expression: id
  at
 
 
 org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440)
  at
 
 
 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282)
  at
 
 
 

Re: CompoundPropertyModel in conjunction with RadioChoiceChoiceRenderers

2009-11-04 Thread Pedro Santos
Model crModel = new Model(){
 getObject(){
return contextData.getDTO(p.getDeptId());
  }
 setObject(Object o){
p.setDeptId( ((DTO) o).getId());
 }
};

On Wed, Nov 4, 2009 at 2:32 PM, Xavier López xavil...@gmail.com wrote:

 Hi Sven, Pedro,

 Thanks both for your quick reply.

 Ideally you would just set a Department instance into your Person objects


 the best way is you have your depid property of type Department

 This was the first approach to take into account, but the idea was
 discarded
 in benefit of SimpleElementDTO, in order to provide only the necessary
 information to Wicket Models, with the intention of not wasting any memory
 on PageMaps due to Department object serializations... Also, this
 SimpleElementDTO would be reusable throughout the whole application when
 it's about Radio and DropDown Choices...

 write some specialized render
 
 This kinda 'dirty-fix' idea was already crawling in my mind, trying to come
 out someway. Thanks for providing a concrete implementation.

 So, in the end I'm trying to provide a custom model. Something like:

 Java
 
 final Person p;

 Model crModel = new Model(){
  getObject(){
 return p.getDeptId();
   }
  setObject(Object o){
 // o is String!
 p.setDeptId( (String) o);
   }
 };
 ChoiceRenderer cr = new ChoiceRenderer(deptId, choices, new
 ChoiceRenderer(id, description));
 cr.setModel(crModel);

 But i'm stucking into the same error, as this Model it's kind like a
 PropertyModel which would be assumed by having the former
 CompoundPropertyModel...

 Any thoughts ? Maybe rendering labels independently ?

 It's strange nobody has bumped into this situation before.. Maybe it's
 because i'm still thinking like I was using Struts...

 Thanks to both again,
 Cheers !


 2009/11/4 Pedro Santos pedros...@gmail.com

  Hi Sven, he stell can write some specialized render... but I think the
 best
  way is you have your depid property of type Department. Than all this
  thread
  would not have started :)
 
  class YourCustomRender
 {
 @Override
 public String getIdValue(Object object, int index)
 {
 if (object instanceof DTO)
 {
 return ((DTO)object).getDeptId()
 }
 else
 {
 return (String)object;//already is the depid string
 }
 }
 
 @Override
 public Object getDisplayValue(Object object)
 {
 if (object instanceof DTO)
 {
 return ((DTO)object).getDescription();
 }
 else
 {
 return contextData.getDTOBasedOnDepid(object);
  }
 }
 }
 
  On Wed, Nov 4, 2009 at 1:29 PM, Xavier López xavil...@gmail.com wrote:
 
   Hi,
  
   I have a question regarding the use of RadioChoice and ChoiceRenderer's
  in
   conjunction with CompoundPropertyModel. I'm new to Wicket (but already
 a
   convinced user ;) ), so maybe my approach on this one is not at all as
 it
   should be... Any comments are welcome !
  
   I'll get into details. Let's say I have a class in my domain model
 named
   Person. This entity has a property named 'deptId' of type String. The
   Person
   entity is the backing for a CompundPropertyModel applied to the whole
  form.
   The 'deptId' field is inputted by the user, let's say, by means of a
   RadioChoice (I guess it makes no difference from a DropDownChoice
 taking
   into account the point of the question). The choice list for the
   RadioChoice
   component is a List made up of DTO objects with properties id and
   description. To ensure proper rendering of labels, I use a suitable
   ChoiceRenderer.
  
   Now, problems come when the 'deptId' property has a value in the Person
   entity used in the CompoundPropertyModel. I get an error saying that
  class
   String does not have any property called 'id' (I suppose this error
 comes
   from having a ModelObject of type String and also having a
 ChoiceRenderer
   refering to 'id' property).
  
   I'll provide some sample code:
  
   markup
   -
   ...
   form wicket:id=form
  ...
  span valign=top wicket:id=deptId/span
  ...
   /form
   ...
  
   Java
   -
  
   ...
   ListSimpleElementDTO choices = contextData.getChoices();
   Person p = new Person(...);
   Form f = new Form(form){...};
   f.setModel(new CompoundPropertyModel(p));
   ChoiceRenderer cr = new ChoiceRenderer(deptId, choices, new
   ChoiceRenderer(id, description));
   f.add(cr);
   ...
  
  
   I suppose the 'normal' way of doing things would be providing a custom
   Model
   to 'cr', but I'd like to know if there is a possibility to achieve this
   point still using CompoundPropertyModel...
  
   The stack trace I get is the following:
  
   WicketMessage: No get method defined for class: class java.lang.String
   expression: 

Re: Wicket tester mock server name

2009-11-04 Thread Igor Vaynberg
you can create your own subclass of mockhttpservletrequest and return
whatever you want. hooking it into wickettester should not be that
bad... if it is we can see if we can make it easier.

-igor

On Wed, Nov 4, 2009 at 8:27 AM, Ted Vinke tvi...@first8.nl wrote:
 Hi!

 Seems a bit dumb I can't seem to get the following working. In my
 application I have to so something special based on the domain the app is
 running on. I ask for that domain in the following manner:

   String serverName =
 getWebRequestCycle().getWebRequest().getHttpServletRequest().getServerName();
   // serverName is e.g. 'www.somedomain.com'

 The problem: when testing in the Wicket tester serverName results in
 'localhost'.

 How can I set / mock
 getWebRequestCycle().getWebRequest().getHttpServletRequest().getServerName()
 to return a preset value, such as 'www.somedomain.com',  when accessing my
 page in my unit test?

 Any tips or hints to examples are greatly appreciated!!

 Kind regards,
 Ted

 -
 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



Re: CompoundPropertyModel in conjunction with RadioChoiceChoiceRenderers

2009-11-04 Thread Xavier López
Wonderful !

Now I understand better. If only I could set the String deptId in an inner
variable inside the Model and link it to the property with another model !
This comes from the fact that the building of the RadioChoice is made inside
a Helper Class...

Probably this is an atrocity, but I hope it'll transmit the idea...

Helper.java
--
public static RadioChoice getDeptRadioChoice(String id){
RadioChoice cr = new RadioChoice(id,
getDeptsAsDTOList(),
new SimpleElementChoiceRenderer());

Model crModel = new Model(){
String id;
getObject(){
return getDptDTO(id);
}
setObject(Object o){
id = ( ((DTO) o).getId());
}
};
cr.setModel(crModel);
return cr;
}

PersonForm.java
-

RadioChoice cr = Helper.getDeptRadioChoice(deptId);
cr.setModel(new Model(cr.getModel()){
public Object getObject(){
return ((Model)super.getObject()).getObject();
}
public void setObject(Object o){
((Model)getObject()).setObject(o);
p.setDeptId((String)m.getObject());
}
});

Thanks !

2009/11/4 Pedro Santos pedros...@gmail.com

 Model crModel = new Model(){
 getObject(){
 return contextData.getDTO(p.getDeptId());
  }
 setObject(Object o){
p.setDeptId( ((DTO) o).getId());
 }
 };

 On Wed, Nov 4, 2009 at 2:32 PM, Xavier López xavil...@gmail.com wrote:

  Hi Sven, Pedro,
 
  Thanks both for your quick reply.
 
  Ideally you would just set a Department instance into your Person objects
 
 
  the best way is you have your depid property of type Department
 
  This was the first approach to take into account, but the idea was
  discarded
  in benefit of SimpleElementDTO, in order to provide only the necessary
  information to Wicket Models, with the intention of not wasting any
 memory
  on PageMaps due to Department object serializations... Also, this
  SimpleElementDTO would be reusable throughout the whole application when
  it's about Radio and DropDown Choices...
 
  write some specialized render
  
  This kinda 'dirty-fix' idea was already crawling in my mind, trying to
 come
  out someway. Thanks for providing a concrete implementation.
 
  So, in the end I'm trying to provide a custom model. Something like:
 
  Java
  
  final Person p;
 
  Model crModel = new Model(){
   getObject(){
  return p.getDeptId();
}
   setObject(Object o){
  // o is String!
  p.setDeptId( (String) o);
}
  };
  ChoiceRenderer cr = new ChoiceRenderer(deptId, choices, new
  ChoiceRenderer(id, description));
  cr.setModel(crModel);
 
  But i'm stucking into the same error, as this Model it's kind like a
  PropertyModel which would be assumed by having the former
  CompoundPropertyModel...
 
  Any thoughts ? Maybe rendering labels independently ?
 
  It's strange nobody has bumped into this situation before.. Maybe it's
  because i'm still thinking like I was using Struts...
 
  Thanks to both again,
  Cheers !
 
 
  2009/11/4 Pedro Santos pedros...@gmail.com
 
   Hi Sven, he stell can write some specialized render... but I think the
  best
   way is you have your depid property of type Department. Than all this
   thread
   would not have started :)
  
   class YourCustomRender
  {
  @Override
  public String getIdValue(Object object, int index)
  {
  if (object instanceof DTO)
  {
  return ((DTO)object).getDeptId()
  }
  else
  {
  return (String)object;//already is the depid string
  }
  }
  
  @Override
  public Object getDisplayValue(Object object)
  {
  if (object instanceof DTO)
  {
  return ((DTO)object).getDescription();
  }
  else
  {
  return contextData.getDTOBasedOnDepid(object);
   }
  }
  }
  
   On Wed, Nov 4, 2009 at 1:29 PM, Xavier López xavil...@gmail.com
 wrote:
  
Hi,
   
I have a question regarding the use of RadioChoice and
 ChoiceRenderer's
   in
conjunction with CompoundPropertyModel. I'm new to Wicket (but
 already
  a
convinced user ;) ), so maybe my approach on this one is not at all
 as
  it
should be... Any comments are welcome !
   
I'll get into details. Let's say I have a class in my domain model
  named
Person. This entity has a property named 'deptId' of type String. The
Person
entity is the backing for a CompundPropertyModel applied to the whole
   form.
The 'deptId' field is inputted by the user, let's say, by means of a
RadioChoice (I guess 

Re: Asynchronous construction of page

2009-11-04 Thread Kaspar Fischer


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


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.


It's definitely not nice and it would be cool if there were some way  
to do this in Wicket without having to spawn a thread from the HTTP  
request itself.


Nonetheless, here's a blog post on handling requests in separate  
threads:


  http://blog.miau.biz/2008/12/wicket-and-slow-running-process-in.html

Kaspar

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



Re: Asynchronous construction of page

2009-11-04 Thread Pedro Santos
One question:
if component renderComponent method wasn't final
if Kaspar page structure was
 -page
- panel1
- paneln
if page renderComponent method implementation was
buildPanel1.start()
buildPaneln.start()

and renderClosingComponentTag implementation was
allPanelReady.join()
super.(...)

and if the buildPanel1 thread implementation write to response the component
html on it finish?
Only a very crude idea... can it work?

On Wed, Nov 4, 2009 at 4:09 PM, Kaspar Fischer
kaspar.fisc...@dreizak.comwrote:


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

  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.


 It's definitely not nice and it would be cool if there were some way to do
 this in Wicket without having to spawn a thread from the HTTP request
 itself.

 Nonetheless, here's a blog post on handling requests in separate threads:

  http://blog.miau.biz/2008/12/wicket-and-slow-running-process-in.html


 Kaspar

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




-- 
Pedro Henrique Oliveira dos Santos


If IE comments

2009-11-04 Thread Neil Curzon
Hi all,

We're currently migrating some legacy HTML pages into a sexy Wicket app.
Unfortunately, the pages use a few !--[if IE 7]![endif]-- sections for
browser compatibility. Sometimes this caused mismatched tags, as in the
following example:

!--[if IE 7]!--/a!--![endif]--
...blahblah...
!--[if lte IE 6]/a![endif]--

Ie we close a tag for IE 6 in one place, and other browsers in a different
place. We're not sure whether this is the best way to accomplish the goal,
but the site is tested and working, so we'd rather just make the final HTML
output the same rather than test a new version in different browsers.

This causes wicket errors because of unmatched tags (for some reason the
/a seems to be interpreted despite the fact that it's inside an HTML
comment, which I don't really understand). Has anybody found a good approach
to outputting if ie comments?

Thanks,
Neil


Re: If IE comments

2009-11-04 Thread Martin Makundi
Hi!

You can output them from code... at least. For example as a label ors omething.

**
Martin

2009/11/4 Neil Curzon neil.cur...@gmail.com:
 Hi all,

 We're currently migrating some legacy HTML pages into a sexy Wicket app.
 Unfortunately, the pages use a few !--[if IE 7]![endif]-- sections for
 browser compatibility. Sometimes this caused mismatched tags, as in the
 following example:

 !--[if IE 7]!--/a!--![endif]--
 ...blahblah...
 !--[if lte IE 6]/a![endif]--

 Ie we close a tag for IE 6 in one place, and other browsers in a different
 place. We're not sure whether this is the best way to accomplish the goal,
 but the site is tested and working, so we'd rather just make the final HTML
 output the same rather than test a new version in different browsers.

 This causes wicket errors because of unmatched tags (for some reason the
 /a seems to be interpreted despite the fact that it's inside an HTML
 comment, which I don't really understand). Has anybody found a good approach
 to outputting if ie comments?

 Thanks,
 Neil


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



Re: javax.crypto.BadPaddingException on expired sessions using CryptedUrlWebRequestCodingStrategy

2009-11-04 Thread fatefree


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

I tried to use the fix suggested in the previous thread, but it was just
throwing a different exception and not really helping the situation. A
temporary solution is the web application class is this:

@Override
protected IRequestCycleProcessor newRequestCycleProcessor() {
return new WebRequestCycleProcessor() {
@Override
protected IRequestCodingStrategy newRequestCodingStrategy() {
return new CryptedUrlWebRequestCodingStrategy(new
WebRequestCodingStrategy()) {
@Override
protected String onError(final 
Exception ex, String url) { 
return onError(ex); 
} 
@Override
protected String onError(final 
Exception ex) { 
return null;
} 
};
}
};
}

With this code no exception is thrown, but on the user end nothing happens.
So the link fails, there is no indication of anything happening, and a
strange random parameter and a long value is appended to the url. Its
better than the app failing I suppose, but not the best usability. It would
be manageable if I could leave a session level message but I don't have any
reference to a session at this point.

I'm curious if anyone else is having this problem currently, it was
indicated that it was fixed in the past.
-- 
View this message in context: 
http://old.nabble.com/javax.crypto.BadPaddingException-on-expired-sessions-using--CryptedUrlWebRequestCodingStrategy-tp26190032p26206434.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



table inside a td in wicket table

2009-11-04 Thread Swarnim Ranjitkar

 I'm trying put a table inside a td in datatable so that my column can have 
more than one row I overode  the createLableModel method and tried to but html 
tag like this
wicket:panel 
tabletbodytrtdfads/td/trtrtdfdsafas/td/tr/tbody/tabletable
 /table/wicket:panel
look like it everything in a cell is put under 
td wicket:id=cells  span wicket:id=cell

because it of  span wicket:id=cell it gets displayed as text. Is there 
anyway you could overide this or any better way of doing this
thank you



  

Re: table inside a td in wicket table

2009-11-04 Thread Igor Vaynberg
show us some code.

-igor

On Wed, Nov 4, 2009 at 5:06 PM, Swarnim Ranjitkar swarn...@hotmail.com wrote:

  I'm trying put a table inside a td in datatable so that my column can have 
 more than one row I overode  the createLableModel method and tried to but 
 html tag like this
 wicket:panel 
 tabletbodytrtdfads/td/trtrtdfdsafas/td/tr/tbody/tabletable
  /table/wicket:panel
 look like it everything in a cell is put under
 td wicket:id=cells  span wicket:id=cell

 because it of  span wicket:id=cell it gets displayed as text. Is there 
 anyway you could overide this or any better way of doing this
 thank you





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



RE: table inside a td in wicket table

2009-11-04 Thread Swarnim Ranjitkar

Here are the two classes. What I was thinking was i would overide 
createLabelModel and create table with the tag like below.


import java.math.BigDecimal;

import 
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.markup.html.basic.Label
;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.link.PopupSettings;
import org.apache.wicket.markup.html.panel.Panel; 
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;

public class TablePropertyColumn extends PropertyColumn {



public TablePropertyColumn(IModel displayModel,
final String sortProperty, final String propertyExpression) {
super(displayModel, sortProperty, propertyExpression);
// TODO Auto-generated constructor stub
}



protected IModel createLabelModel(final IModel rowModel) {
final IModel prop = super.createLabelModel(rowModel);
return new AbstractReadOnlyModel() {
public Object getObject() {
String data = (String) prop.getObject();
// will get it from the object and create table
dataString = wicket:panel 
tabletbodytrtdfads/td/trtrtdfdsafas/td/tr/tbody/tabletable
 /table/wicket:panel;
   
return dataString;

}
};
}

}



import java.util.ArrayList;
import java.util.List;

import org.apache.wicket.markup.html.panel.Panel;
import 
org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn; 
import 
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn; 
import org.apache.wicket.model.Model;

import com.swishmark.tugboat.util.ReportTemplateListProvider;
import com.swishmark.tugboat.util.TablePropertyColumn;

// http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html
// AJAX: 
http://www.wicket-library.com/wicket-examples/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.AjaxDataTablePage

public class RelatedProductListPanel extends Panel {

public RelatedProductListPanel(String id, int transNodeId) {
super(id);

ListIColumn? columns = new ArrayListIColumn?();
columns.add(new PropertyColumn(new Model(product_id), product_id, 
product_id));
columns.add(new PropertyColumn(new Model(Name), name, name));
columns.add(new PropertyColumn(new Model(Status), status, 
status));
columns.add(new PropertyColumn(new Model(vertical), vertical, 
vertical));
columns.add(new TablePropertyColumn(new Model(transname), 
transname, transname));
add(new AjaxFallbackDefaultDataTable(relatedProductListTable, 
columns, new RelatedProductListProvider(transNodeId), 8));
}
}
-
Even though I use a panel and write my own and populate my panel i
think  it will put everything inside wicket:cell . I'm looking
for a way so that it doesn't write the tag.

public void populateItem(Item item, String componentId, IModel model) {

item.add(new TablePanel(item, componentId, model));



wicket:panel

table

 tr wicket:id=tablerow

   td wicket:id=tabletd/td

 /tr

 /table

/wicket:panel


 From: igor.vaynb...@gmail.com
 Date: Wed, 4 Nov 2009 17:37:59 -0800
 Subject: Re: table inside a td in wicket table
 To: users@wicket.apache.org
 
 show us some code.
 
 -igor
 
 On Wed, Nov 4, 2009 at 5:06 PM, Swarnim Ranjitkar swarn...@hotmail.com 
 wrote:
 
   I'm trying put a table inside a td in datatable so that my column can 
  have more than one row I overode  the createLableModel method and tried to 
  but html tag like this
  wicket:panel 
  tabletbodytrtdfads/td/trtrtdfdsafas/td/tr/tbody/tabletable
   /table/wicket:panel
  look like it everything in a cell is put under
  td wicket:id=cells  span wicket:id=cell
 
  because it of  span wicket:id=cell it gets displayed as text. Is there 
  anyway you could overide this or any better way of doing this
  thank you
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
  

Re: table inside a td in wicket table

2009-11-04 Thread Igor Vaynberg
you should start by subclassing abstractcolumn and adding a panel that
contains a table in populateitem()

-igor

On Wed, Nov 4, 2009 at 5:53 PM, Swarnim Ranjitkar swarn...@hotmail.com wrote:

 Here are the two classes. What I was thinking was i would overide 
 createLabelModel and create table with the tag like below.


 import java.math.BigDecimal;

 import 
 org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
 import org.apache.wicket.markup.html.basic.Label
 ;
 import org.apache.wicket.markup.html.link.Link;
 import org.apache.wicket.markup.html.link.PopupSettings;
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.model.AbstractReadOnlyModel;
 import org.apache.wicket.model.IModel;

 public class TablePropertyColumn extends PropertyColumn {



    public TablePropertyColumn(IModel displayModel,
            final String sortProperty, final String propertyExpression) {
        super(displayModel, sortProperty, propertyExpression);
        // TODO Auto-generated constructor stub
    }



    protected IModel createLabelModel(final IModel rowModel) {
        final IModel prop = super.createLabelModel(rowModel);
        return new AbstractReadOnlyModel() {
            public Object getObject() {
                String data = (String) prop.getObject();
            // will get it from the object and create table
                    dataString = wicket:panel 
 tabletbodytrtdfads/td/trtrtdfdsafas/td/tr/tbody/tabletable
  /table/wicket:panel;

                return dataString;

            }
        };
    }

 }



 import java.util.ArrayList;
 import java.util.List;

 import org.apache.wicket.markup.html.panel.Panel;
 import 
 org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import 
 org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
 import org.apache.wicket.model.Model;

 import com.swishmark.tugboat.util.ReportTemplateListProvider;
 import com.swishmark.tugboat.util.TablePropertyColumn;

 // http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html
 // AJAX: 
 http://www.wicket-library.com/wicket-examples/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.AjaxDataTablePage

 public class RelatedProductListPanel extends Panel {

    public RelatedProductListPanel(String id, int transNodeId) {
        super(id);

        ListIColumn? columns = new ArrayListIColumn?();
        columns.add(new PropertyColumn(new Model(product_id), product_id, 
 product_id));
        columns.add(new PropertyColumn(new Model(Name), name, name));
        columns.add(new PropertyColumn(new Model(Status), status, 
 status));
        columns.add(new PropertyColumn(new Model(vertical), vertical, 
 vertical));
        columns.add(new TablePropertyColumn(new Model(transname), 
 transname, transname));
        add(new AjaxFallbackDefaultDataTable(relatedProductListTable, 
 columns, new RelatedProductListProvider(transNodeId), 8));
    }
 }
 -
 Even though I use a panel and write my own and populate my panel i
 think  it will put everything inside wicket:cell . I'm looking
 for a way so that it doesn't write the tag.

 public void populateItem(Item item, String componentId, IModel model) {

        item.add(new TablePanel(item, componentId, model));



 wicket:panel

 table

  tr wicket:id=tablerow

   td wicket:id=tabletd/td

  /tr

  /table

 /wicket:panel


 From: igor.vaynb...@gmail.com
 Date: Wed, 4 Nov 2009 17:37:59 -0800
 Subject: Re: table inside a td in wicket table
 To: users@wicket.apache.org

 show us some code.

 -igor

 On Wed, Nov 4, 2009 at 5:06 PM, Swarnim Ranjitkar swarn...@hotmail.com 
 wrote:
 
   I'm trying put a table inside a td in datatable so that my column can 
  have more than one row I overode  the createLableModel method and tried to 
  but html tag like this
  wicket:panel 
  tabletbodytrtdfads/td/trtrtdfdsafas/td/tr/tbody/tabletable
   /table/wicket:panel
  look like it everything in a cell is put under
  td wicket:id=cells  span wicket:id=cell
 
  because it of  span wicket:id=cell it gets displayed as text. Is there 
  anyway you could overide this or any better way of doing this
  thank you
 
 
 
 

 -
 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



RE: table inside a td in wicket table

2009-11-04 Thread Swarnim Ranjitkar

If you do that will it not put the panel with table inside span 
wicket:id=cell which will make anything inside it as literal string.

 From: igor.vaynb...@gmail.com
 Date: Wed, 4 Nov 2009 17:58:16 -0800
 Subject: Re: table inside a td in wicket table
 To: users@wicket.apache.org
 
 you should start by subclassing abstractcolumn and adding a panel that
 contains a table in populateitem()
 
 -igor
 
 On Wed, Nov 4, 2009 at 5:53 PM, Swarnim Ranjitkar swarn...@hotmail.com 
 wrote:
 
  Here are the two classes. What I was thinking was i would overide 
  createLabelModel and create table with the tag like below.
 
 
  import java.math.BigDecimal;
 
  import 
  org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
  import org.apache.wicket.markup.html.basic.Label
  ;
  import org.apache.wicket.markup.html.link.Link;
  import org.apache.wicket.markup.html.link.PopupSettings;
  import org.apache.wicket.markup.html.panel.Panel;
  import org.apache.wicket.markup.repeater.Item;
  import org.apache.wicket.model.AbstractReadOnlyModel;
  import org.apache.wicket.model.IModel;
 
  public class TablePropertyColumn extends PropertyColumn {
 
 
 
 public TablePropertyColumn(IModel displayModel,
 final String sortProperty, final String propertyExpression) {
 super(displayModel, sortProperty, propertyExpression);
 // TODO Auto-generated constructor stub
 }
 
 
 
 protected IModel createLabelModel(final IModel rowModel) {
 final IModel prop = super.createLabelModel(rowModel);
 return new AbstractReadOnlyModel() {
 public Object getObject() {
 String data = (String) prop.getObject();
 // will get it from the object and create table
 dataString = wicket:panel 
  tabletbodytrtdfads/td/trtrtdfdsafas/td/tr/tbody/tabletable
   /table/wicket:panel;
 
 return dataString;
 
 }
 };
 }
 
  }
 
 
 
  import java.util.ArrayList;
  import java.util.List;
 
  import org.apache.wicket.markup.html.panel.Panel;
  import 
  org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
  import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
  import 
  org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
  import org.apache.wicket.model.Model;
 
  import com.swishmark.tugboat.util.ReportTemplateListProvider;
  import com.swishmark.tugboat.util.TablePropertyColumn;
 
  // http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html
  // AJAX: 
  http://www.wicket-library.com/wicket-examples/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.AjaxDataTablePage
 
  public class RelatedProductListPanel extends Panel {
 
 public RelatedProductListPanel(String id, int transNodeId) {
 super(id);
 
 ListIColumn? columns = new ArrayListIColumn?();
 columns.add(new PropertyColumn(new Model(product_id), 
  product_id, product_id));
 columns.add(new PropertyColumn(new Model(Name), name, name));
 columns.add(new PropertyColumn(new Model(Status), status, 
  status));
 columns.add(new PropertyColumn(new Model(vertical), vertical, 
  vertical));
 columns.add(new TablePropertyColumn(new Model(transname), 
  transname, transname));
 add(new AjaxFallbackDefaultDataTable(relatedProductListTable, 
  columns, new RelatedProductListProvider(transNodeId), 8));
 }
  }
  -
  Even though I use a panel and write my own and populate my panel i
  think  it will put everything inside wicket:cell . I'm looking
  for a way so that it doesn't write the tag.
 
  public void populateItem(Item item, String componentId, IModel model) {
 
 item.add(new TablePanel(item, componentId, model));
 
 
 
  wicket:panel
 
  table
 
   tr wicket:id=tablerow
 
td wicket:id=tabletd/td
 
   /tr
 
   /table
 
  /wicket:panel
 
 
  From: igor.vaynb...@gmail.com
  Date: Wed, 4 Nov 2009 17:37:59 -0800
  Subject: Re: table inside a td in wicket table
  To: users@wicket.apache.org
 
  show us some code.
 
  -igor
 
  On Wed, Nov 4, 2009 at 5:06 PM, Swarnim Ranjitkar swarn...@hotmail.com 
  wrote:
  
I'm trying put a table inside a td in datatable so that my column can 
   have more than one row I overode  the createLableModel method and tried 
   to but html tag like this
   wicket:panel 
   tabletbodytrtdfads/td/trtrtdfdsafas/td/tr/tbody/tabletable
/table/wicket:panel
   look like it everything in a cell is put under
   td wicket:id=cells  span wicket:id=cell
  
   because it of  span wicket:id=cell it gets displayed as text. Is 
   there anyway you could overide this or any better way of doing this
   thank you
  
  
  
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: 

Re: Asynchronous construction of page

2009-11-04 Thread jpswain

Wicket is remarkably fast and efficient the way it is used in common
practice.  To do what you are suggesting would be to wreck that big time. 
Why on earth do you want to do this?


Kaspar Fischer-2 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
 
 

-- 
View this message in context: 
http://old.nabble.com/Asynchronous-construction-of-page-tp26171123p26208074.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: table inside a td in wicket table

2009-11-04 Thread Igor Vaynberg
call item.setrenderbodyonly(true)

-igor

On Wed, Nov 4, 2009 at 6:06 PM, Swarnim Ranjitkar swarn...@hotmail.com wrote:

 If you do that will it not put the panel with table inside span 
 wicket:id=cell which will make anything inside it as literal string.

 From: igor.vaynb...@gmail.com
 Date: Wed, 4 Nov 2009 17:58:16 -0800
 Subject: Re: table inside a td in wicket table
 To: users@wicket.apache.org

 you should start by subclassing abstractcolumn and adding a panel that
 contains a table in populateitem()

 -igor

 On Wed, Nov 4, 2009 at 5:53 PM, Swarnim Ranjitkar swarn...@hotmail.com 
 wrote:
 
  Here are the two classes. What I was thinking was i would overide 
  createLabelModel and create table with the tag like below.
 
 
  import java.math.BigDecimal;
 
  import 
  org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
  import org.apache.wicket.markup.html.basic.Label
  ;
  import org.apache.wicket.markup.html.link.Link;
  import org.apache.wicket.markup.html.link.PopupSettings;
  import org.apache.wicket.markup.html.panel.Panel;
  import org.apache.wicket.markup.repeater.Item;
  import org.apache.wicket.model.AbstractReadOnlyModel;
  import org.apache.wicket.model.IModel;
 
  public class TablePropertyColumn extends PropertyColumn {
 
 
 
     public TablePropertyColumn(IModel displayModel,
             final String sortProperty, final String propertyExpression) {
         super(displayModel, sortProperty, propertyExpression);
         // TODO Auto-generated constructor stub
     }
 
 
 
     protected IModel createLabelModel(final IModel rowModel) {
         final IModel prop = super.createLabelModel(rowModel);
         return new AbstractReadOnlyModel() {
             public Object getObject() {
                 String data = (String) prop.getObject();
             // will get it from the object and create table
                     dataString = wicket:panel 
  tabletbodytrtdfads/td/trtrtdfdsafas/td/tr/tbody/tabletable
   /table/wicket:panel;
 
                 return dataString;
 
             }
         };
     }
 
  }
 
 
 
  import java.util.ArrayList;
  import java.util.List;
 
  import org.apache.wicket.markup.html.panel.Panel;
  import 
  org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
  import 
  org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
  import 
  org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
  import org.apache.wicket.model.Model;
 
  import com.swishmark.tugboat.util.ReportTemplateListProvider;
  import com.swishmark.tugboat.util.TablePropertyColumn;
 
  // http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html
  // AJAX: 
  http://www.wicket-library.com/wicket-examples/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.AjaxDataTablePage
 
  public class RelatedProductListPanel extends Panel {
 
     public RelatedProductListPanel(String id, int transNodeId) {
         super(id);
 
         ListIColumn? columns = new ArrayListIColumn?();
         columns.add(new PropertyColumn(new Model(product_id), 
  product_id, product_id));
         columns.add(new PropertyColumn(new Model(Name), name, name));
         columns.add(new PropertyColumn(new Model(Status), status, 
  status));
         columns.add(new PropertyColumn(new Model(vertical), vertical, 
  vertical));
         columns.add(new TablePropertyColumn(new Model(transname), 
  transname, transname));
         add(new AjaxFallbackDefaultDataTable(relatedProductListTable, 
  columns, new RelatedProductListProvider(transNodeId), 8));
     }
  }
  -
  Even though I use a panel and write my own and populate my panel i
  think  it will put everything inside wicket:cell . I'm looking
  for a way so that it doesn't write the tag.
 
  public void populateItem(Item item, String componentId, IModel model) {
 
         item.add(new TablePanel(item, componentId, model));
 
 
 
  wicket:panel
 
  table
 
   tr wicket:id=tablerow
 
    td wicket:id=tabletd/td
 
   /tr
 
   /table
 
  /wicket:panel
 
 
  From: igor.vaynb...@gmail.com
  Date: Wed, 4 Nov 2009 17:37:59 -0800
  Subject: Re: table inside a td in wicket table
  To: users@wicket.apache.org
 
  show us some code.
 
  -igor
 
  On Wed, Nov 4, 2009 at 5:06 PM, Swarnim Ranjitkar swarn...@hotmail.com 
  wrote:
  
    I'm trying put a table inside a td in datatable so that my column 
   can have more than one row I overode  the createLableModel method and 
   tried to but html tag like this
   wicket:panel 
   tabletbodytrtdfads/td/trtrtdfdsafas/td/tr/tbody/tabletable
/table/wicket:panel
   look like it everything in a cell is put under
   td wicket:id=cells  span wicket:id=cell
  
   because it of  span wicket:id=cell it gets displayed as text. Is 
   there anyway you could overide this or any better way of doing this
   thank you