Re: Generics changes in 1.4-rc1

2008-11-20 Thread aditsu


Johan Compagner wrote:
> 
> Please make issues for this in jira
> 

Since you said issues, I created 3 issues: WICKET-1947, WICKET-1948,
WICKET-1949

Adrian
-- 
View this message in context: 
http://www.nabble.com/Generics-changes-in-1.4-rc1-tp20599173p20615568.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Formatting dates in Inmethod DataGrid

2008-11-20 Thread Jurek Piasek
How does one format a date in the inmethod datagrid?

Thanks,
Jurek.


Re: Properties file

2008-11-20 Thread jWeekend

Landry,

If your properties are application wide, create MyApplication.properties
(assuming you called your WebApplication subclass MyApplication) in the same
package as your MyApplication class and use getString if you have a
Component (or subclass, like a Page) to talk to, otherwise use
Applicaion.get().getResourceSettings().getLocalizer().getString ... 

Regards - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk 


landry soules wrote:
> 
> Hello, i have a question about properties files :
> I want to access several variables residing in a property file, from 
> various components of my application. What is the best way to achieve 
> this trivial need ?
> Do you guys use Commons Configuration, or another api ? How do you 
> configure it to work with Wicket ?
> Is there an example somewhere ?
> I know my question sounds dumb, but in my previous job we used an home 
> made api to achieve this...
> Thanks in advance !
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

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


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



Re: Compoundpropertymodel with shadow map?

2008-11-20 Thread Francisco Diaz Trepat - gmail
Don't know, but LOL.
This might be an instancing issue in which special handling is good for this
scenario but seems to be fine for most cases. And in a lazy TDD programming
way it might be good enough.

Although I know from blog and other threads that you look for greatness :-)
and not just code that works. Which is very inspiring now a days, in this
business hour of programming history.

I'll ask arround though, I think I might know someone who might know, and
also is not my mother...

f(t)

On Thu, Nov 20, 2008 at 6:26 PM, Nino Saturnino Martinez Vazquez Wael <
[EMAIL PROTECTED]> wrote:

> I love simple and simple is good. But this approach has issues with
> hibernate if your hibernate sessions are per request and your shadowmodel
> lives in multiple requests and your entities has references to other
> entities for example 1..* etc ...  In "simple" use cases, and possibly also
> when not using hibernate this might be fine. This is what I am exploring
> currently. When not attending seminars or talking with people..
>
> Im wondering how eclipselink & openJPA handles the "hibernate lazy load
> problem", according to a oracle guy theres not a problem when using Toplink
> (which now are eclipselink?)
>
> Input on these things are very welcome...
>
> regards Nino
>
>
> Francisco Diaz Trepat - gmail wrote:
>
>> why?
>> simple is good. doesn't need to be complex.
>>
>> what part you dislike the most?
>>
>> f(t)
>>
>> On Thu, Nov 20, 2008 at 2:29 AM, Nino Saturnino Martinez Vazquez Wael <
>> [EMAIL PROTECTED]> wrote:
>>
>>
>>
>>> BTW this is a flawed approch.. We need something a little more
>>> intelligent.. I'll return on the subject..
>>>
>>>
>>> Nino Saturnino Martinez Vazquez Wael wrote:
>>>
>>>
>>>
 heres the raw and completely untested version of it. probably with a
 whole
 bunch of issues...:

  package zeuzgroup.web.model;
import java.lang.reflect.Field;
  import java.util.HashMap;
  import java.util.Map;
  import java.util.Map.Entry;
import org.apache.wicket.Component;
  import org.apache.wicket.WicketRuntimeException;
  import org.apache.wicket.model.AbstractPropertyModel;
  import org.apache.wicket.model.CompoundPropertyModel;
  import org.apache.wicket.model.IModel;
  import org.apache.wicket.model.IWrapModel;
public class EditorModel extends CompoundPropertyModel {
private final Map newValues = new HashMap>>> Object>();
public EditorModel(IModel underlyingModel) {
  super(underlyingModel);
  }
public void fillOriginal() {
Class c = this.getObject().getClass();
for (Entry entry : newValues.entrySet()) {
  try {
  Field t = c.getDeclaredField(entry.getKey());
  t.set(this.getObject(), entry.getValue());
  } catch (Exception e) {
  throw new WicketRuntimeException("Could not set "
  + entry.getKey(), e);
  }
}
  }
public  IWrapModel wrapOnInheritance(Component component) {
  return new AttachedCompoundPropertyModel(component,
 newValues);
  }
private class AttachedCompoundPropertyModel extends
  AbstractPropertyModel implements IWrapModel {
  private static final long serialVersionUID = 1L;
private final Component owner;
private final Map newValues;
/**
   * Constructor
   *
   * @param owner
   *component that this model has been attached to
   */
  public AttachedCompoundPropertyModel(Component owner,
 Map map) {
  super(EditorModel.this);
  this.owner = owner;
  this.newValues = map;
  }
@Override
  public C getObject() {
  if (EditorModel.this.newValues.containsKey(owner.getId()))
 {
  return (C) newValues.get(owner.getId());
  } else {
  return super.getObject();
  }
  }
@Override
  public void setObject(C object) {
  newValues.put(owner.getId(), object);
  }
/**
   * @see
 org.apache.wicket.model.AbstractPropertyModel#propertyExpression()
   */
  @Override
  protected String propertyExpression() {
  return EditorModel.this.propertyExpression(owner);
  }
/**
   * @see org.apache.wicket.model.IWrapModel#getWrappedModel()
   */
  public IModel getWrappedModel() {
  return EditorModel.this;
  }
/**
   * @see org.apache.wicket.mod

Properties file

2008-11-20 Thread landry soules

Hello, i have a question about properties files :
I want to access several variables residing in a property file, from 
various components of my application. What is the best way to achieve 
this trivial need ?
Do you guys use Commons Configuration, or another api ? How do you 
configure it to work with Wicket ?

Is there an example somewhere ?
I know my question sounds dumb, but in my previous job we used an home 
made api to achieve this...

Thanks in advance !

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



Re: Invalid URLPatternSpec for Ajax Calls in Wicket Portlet

2008-11-20 Thread Thijs Vonk

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

(Though it's still a work in process) and not yet supported by the 
wicket core committers


On 11/20/08 9:17 PM, krisNog wrote:

which portlet 2 patch are you referring to? Where is it available?

Thanks

Thijs wrote:
   

But does it also have a problem if it's running a standalone wicket
application?

Btw I've run wicket portlets (with the portlet 2 patch) in Glassfish&
open portal portlet container(v. rc2 then)  and that worked just fine...
So I don't know what the problem could be...

Thijs

On 11/19/08 8:44 PM, krisNog wrote:
 

The difference appears to be : vs %3A (the URL encoded : ) in urls.

For example wicket seems to be creating test:test2 in Firefox and
test%3Atest2 in IE. Glassfish doesn't like the :

Thijs wrote:

   

Do you know what is send differently to the server in FF2 vs IE
(WireShark?)
And where the error is thrown, why it says that the URLPatternSpec is
invalid...

Thijs

On 18-11-2008 22:57, prasana wrote:

 

Hi all,

We are running Wicket Portlet in Jetspeed Portal deployed in Glassfish.

But whenever we make a Ajax calls, it results in "There are some
problems
in
the request: invalid URLPatternSpec|#" in the server log file and Ajax
Debug
windows shows "ERROR: Received Ajax response with code: 400"

The above error happens only in Firefox 2 and not in IE 6/7

I greatly appreciate any help regarding on what I need to do to see the
workflow actions for assets.

Thanks
Prasanna


   

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




 


   

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



 


   



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



Re: Compoundpropertymodel with shadow map?

2008-11-20 Thread Nino Saturnino Martinez Vazquez Wael
I love simple and simple is good. But this approach has issues with 
hibernate if your hibernate sessions are per request and your 
shadowmodel lives in multiple requests and your entities has references 
to other entities for example 1..* etc ...  In "simple" use cases, and 
possibly also when not using hibernate this might be fine. This is what 
I am exploring currently. When not attending seminars or talking with 
people..


Im wondering how eclipselink & openJPA handles the "hibernate lazy load 
problem", according to a oracle guy theres not a problem when using 
Toplink (which now are eclipselink?)


Input on these things are very welcome...

regards Nino

Francisco Diaz Trepat - gmail wrote:

why?
simple is good. doesn't need to be complex.

what part you dislike the most?

f(t)

On Thu, Nov 20, 2008 at 2:29 AM, Nino Saturnino Martinez Vazquez Wael <
[EMAIL PROTECTED]> wrote:

  

BTW this is a flawed approch.. We need something a little more
intelligent.. I'll return on the subject..


Nino Saturnino Martinez Vazquez Wael wrote:



heres the raw and completely untested version of it. probably with a whole
bunch of issues...:

  package zeuzgroup.web.model;
import java.lang.reflect.Field;
  import java.util.HashMap;
  import java.util.Map;
  import java.util.Map.Entry;
import org.apache.wicket.Component;
  import org.apache.wicket.WicketRuntimeException;
  import org.apache.wicket.model.AbstractPropertyModel;
  import org.apache.wicket.model.CompoundPropertyModel;
  import org.apache.wicket.model.IModel;
  import org.apache.wicket.model.IWrapModel;
public class EditorModel extends CompoundPropertyModel {
private final Map newValues = new HashMap();
public EditorModel(IModel underlyingModel) {
  super(underlyingModel);
  }
public void fillOriginal() {
Class c = this.getObject().getClass();
for (Entry entry : newValues.entrySet()) {
  try {
  Field t = c.getDeclaredField(entry.getKey());
  t.set(this.getObject(), entry.getValue());
  } catch (Exception e) {
  throw new WicketRuntimeException("Could not set "
  + entry.getKey(), e);
  }
}
  }
public  IWrapModel wrapOnInheritance(Component component) {
  return new AttachedCompoundPropertyModel(component,
newValues);
  }
private class AttachedCompoundPropertyModel extends
  AbstractPropertyModel implements IWrapModel {
  private static final long serialVersionUID = 1L;
private final Component owner;
private final Map newValues;
/**
   * Constructor
   *
   * @param owner
   *component that this model has been attached to
   */
  public AttachedCompoundPropertyModel(Component owner,
Map map) {
  super(EditorModel.this);
  this.owner = owner;
  this.newValues = map;
  }
@Override
  public C getObject() {
  if (EditorModel.this.newValues.containsKey(owner.getId())) {
  return (C) newValues.get(owner.getId());
  } else {
  return super.getObject();
  }
  }
@Override
  public void setObject(C object) {
  newValues.put(owner.getId(), object);
  }
/**
   * @see
org.apache.wicket.model.AbstractPropertyModel#propertyExpression()
   */
  @Override
  protected String propertyExpression() {
  return EditorModel.this.propertyExpression(owner);
  }
/**
   * @see org.apache.wicket.model.IWrapModel#getWrappedModel()
   */
  public IModel getWrappedModel() {
  return EditorModel.this;
  }
/**
   * @see org.apache.wicket.model.AbstractPropertyModel#detach()
   */
  @Override
  public void detach() {
  super.detach();
  EditorModel.this.detach();
  }
  }
}
// IComponentAssignedModel / IWrapModel

Francisco Diaz Trepat - gmail wrote:

  

Nice, I was up to something similar.

On Tue, Nov 18, 2008 at 9:43 AM, Nino Saturnino Martinez Vazquez Wael <
[EMAIL PROTECTED]> wrote:





Hi

Im trying todo a compoundpropertymodel which does not change original
values in the "original" model. I need this since I am updating some
stuff
in a wizard but I first want to commit when the user confirms in the end
of
the wizard, and if the model are changed directly the transaction are
automatically committed to the database

So my idea were to todo a shadowCompoundPropertyModel something like
this:

class EditorModel extends CompoundPropertyModel {

 private Map newValues=new HashMap();
   public EditorModel(CompoundPropertyModel underlyingModel,
 Str

Re: Invalid URLPatternSpec for Ajax Calls in Wicket Portlet

2008-11-20 Thread krisNog

which portlet 2 patch are you referring to? Where is it available?

Thanks

Thijs wrote:
> 
> But does it also have a problem if it's running a standalone wicket 
> application?
> 
> Btw I've run wicket portlets (with the portlet 2 patch) in Glassfish & 
> open portal portlet container(v. rc2 then)  and that worked just fine...
> So I don't know what the problem could be...
> 
> Thijs
> 
> On 11/19/08 8:44 PM, krisNog wrote:
>> The difference appears to be : vs %3A (the URL encoded : ) in urls.
>>
>> For example wicket seems to be creating test:test2 in Firefox and
>> test%3Atest2 in IE. Glassfish doesn't like the :
>>
>> Thijs wrote:
>>
>>> Do you know what is send differently to the server in FF2 vs IE
>>> (WireShark?)
>>> And where the error is thrown, why it says that the URLPatternSpec is
>>> invalid...
>>>
>>> Thijs
>>>
>>> On 18-11-2008 22:57, prasana wrote:
>>>  
 Hi all,

 We are running Wicket Portlet in Jetspeed Portal deployed in Glassfish.

 But whenever we make a Ajax calls, it results in "There are some
 problems
 in
 the request: invalid URLPatternSpec|#" in the server log file and Ajax
 Debug
 windows shows "ERROR: Received Ajax response with code: 400"

 The above error happens only in Firefox 2 and not in IE 6/7

 I greatly appreciate any help regarding on what I need to do to see the
 workflow actions for assets.

 Thanks
 Prasanna


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

-- 
View this message in context: 
http://www.nabble.com/Invalid-URLPatternSpec-for-Ajax-Calls-in-Wicket-Portlet-tp20569102p20609170.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior

2008-11-20 Thread Matej Knopp
private Boolean visible = null;

public boolean isVisible()
{
   if (visible == null)
  {
visible = [ put your complicated logic here];
  }
  return visible;
}

public void onDetach()
{
  super.onDetach();
  visible = null;
}

What's wrong with this?

-Matej
On Thu, Nov 20, 2008 at 5:04 PM, Marat Radchenko
<[EMAIL PROTECTED]> wrote:
> I'm trying to choose strategy for handling conditional component
> visibility (and we have complex tree where many components are
> conditionally visible). Overriding isVisible is bad, because many
> calls. overriding onBeforeRender and callOnBeforeRender is bad,
> because children visibility is calculated even when there is no need.
> I'd prefer overriding onBeforeRender and skipping child traversion if
> isVisible = false, but that cannot be done with current
> Component#onBeforeRender implementation.
>
> 2008/11/20 Igor Vaynberg <[EMAIL PROTECTED]>:
>> you havent actually described your usecase yet...
>>
>> -igor
>>
>> On Thu, Nov 20, 2008 at 7:33 AM, Marat Radchenko
>> <[EMAIL PROTECTED]> wrote:
>>> So. Is there any recommended (and hopefully not error-prone) way of
>>> handling conditional visibility?
>>>
>>> 2008/11/20 Matej Knopp <[EMAIL PROTECTED]>:
> That's first confusing point. Javadocs on
> callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be
> called even if component is not visible, but it is a lie.

 Bad, bad javadoc!

 -Matej

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


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

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



Re: Open FAQ/wiki somewhere?

2008-11-20 Thread Casper Bang

Oh wow, that's a virtual gold mine. Thanks!.

/Casper


jWeekend wrote:
> 
> Casper,
> 
> Something like 
> http://cwiki.apache.org/WICKET/how-to-do-things-in-wicket.html this ?
> 
> Regards - Cemal
>  http://www.jWeekend.co.uk http://jWeekend.co.uk 
> 
> 
> 
> Casper Bang wrote:
>> 
>> In "Wicket in Action" it's mentioned briefly how one could use a
>> SimpleAttributeModifier to limit the text length of an input, by binding
>> to a JPA @Column annotation and its length attribute. This sounds nice
>> DRY to me (albeit perhaps a bit expensive?!) so I gave it a try:
>> 
>> protected String getColumnLength(Class entityName, String fieldName){
>> try {
>> Field field = entityName.getDeclaredField(fieldName);
>> field.setAccessible(true);
>> return
>> String.valueOf(field.getAnnotation(Column.class).length());
>> } catch (Exception ex) {
>> return "";
>> }
>> }
>> 
>> Which got me thinking (after spending an hour figuring out I had to use
>> setAccessible) if there's an open FAQ/wiki for these kind of things? I
>> have not been able to find any except the locked down official
>> confluence. Google is nice, but as a newbie it would be nice to have a
>> central place with lots of micro-examples/snippets to get you going.
>> 
>> /Casper 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Open-FAQ-wiki-somewhere--tp20607065p20607796.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Memory consumption per session

2008-11-20 Thread Cristiano Kliemann
Ralf,

If you want to discard the generated text after rendering, you may use a
detachable model, like LoadableDetachableModel:

IModel model = new LoadableDetachableModel() {
public Object load() {
return generateMyHTML();
}
}
add(new Label("raw", model).setEscapeModelStrings(false));

Assigning the text directly to the label (as in Label("raw",
"Foo")) will keep a reference to the String 'forever'. It's ok when
the HTML is short, but it doesn't seem to be your case.

--Cristiano

On Thu, Nov 20, 2008 at 2:08 PM, Martijn Dashorst <
[EMAIL PROTECTED]> wrote:

> add(new Label("raw", "Foo").setEscapeModelStrings(false));
>
> On Thu, Nov 20, 2008 at 5:00 PM, Martin Makundi
> <[EMAIL PROTECTED]> wrote:
> > What is the easiest way of embedding raw html (yes, it could/should
> > use some xml dom which is included with wicket)?
> >
> > Is it possible, for example, to replace a  element
> > on a panel with such raw dom content?
> >
> > **
> > Martin
> >
> > 2008/11/20 Igor Vaynberg <[EMAIL PROTECTED]>:
> >> if you are planning on displaying 1000 rows per page, which is quiet
> >> uncommon for webapps, you should produce output as raw html instead of
> >> using listview and adding components inside.
> >>
> >> -igor
> >>
> >> On Thu, Nov 20, 2008 at 7:15 AM, Ralf Siemon <[EMAIL PROTECTED]>
> wrote:
> >>> Hi,
> >>>
> >>> we have recently launched our new Wicket-based website, and now we are
> >>> experiencing that the memory consumption of the website is very high,
> so
> >>> that it crashes the site regularly.
> >>>
> >>> When profiling the application server, we found out that there are HTTP
> >>> sessions that consume up to 2 MB of memory, mostly because there are
> very
> >>> large ListViews with up to 1000 entries, where each entry consumes
> about 2
> >>> KB.
> >>>
> >>> Our preliminary solution is to limit the size of those ListViews to a
> >>> maximum of 50 entries, but even in those cases the session size is
> still at
> >>> about 200 KB, which seems quite large to us.
> >>>
> >>> I know that there have already been some discussions about memory
> >>> consumption in Wicket due to the fact that the whole Page object of the
> last
> >>> visited page is stored in the session; but what I'd like to know is:
> Have
> >>> you experienced session sizes in a comparable magnitude, or are we
> doing
> >>> something wrong? Or is this something we have to live with when using
> >>> Wicket?
> >>>
> >>> We are using Wicket 1.3.5.
> >>>
> >>>
> >>> Thanks,
> >>>
> >>> Ralf.
> >>>
> >>>
> >>> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.3.4 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Feature idea: sealed flag on MarkupContainer

2008-11-20 Thread John Krasnay
On Thu, Nov 20, 2008 at 07:18:11PM +0100, Peter Ertl wrote:
> for SubPanel the ctor is called that order
> 
> - 
> - Panel
> - BasePanel
  calls MarkupContainer.add()
  calls SubPanel.onComponentAdd() (before SubPanel ctor!)
> - SubPanel
> 
> so the fields will be initialized, eh?!
> 
> 
> Am 20.11.2008 um 16:32 schrieb John Krasnay:
> 
> >Here's the problem (also with sketchy pseudo code :)
> >
> >public class BasePanel extends Panel {
> >   public BasePanel(String id) {
> >   super(id);
> >   add(new Label("foo", ...));
> >   }
> >}
> >
> >public class SubPanel extends BasePanel {
> >   @Override
> >   public void onComponentAdd(Component child) {
> >   // oops, called from BasePanel ctor
> >   // my fields aren't initialized yet
> >   }
> >}
> >
> >jk

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



Re: Open FAQ/wiki somewhere?

2008-11-20 Thread jWeekend

Casper,

Something like 
http://cwiki.apache.org/WICKET/how-to-do-things-in-wicket.html this ?

Regards - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk 



Casper Bang wrote:
> 
> In "Wicket in Action" it's mentioned briefly how one could use a
> SimpleAttributeModifier to limit the text length of an input, by binding
> to a JPA @Column annotation and its length attribute. This sounds nice DRY
> to me (albeit perhaps a bit expensive?!) so I gave it a try:
> 
> protected String getColumnLength(Class entityName, String fieldName){
> try {
> Field field = entityName.getDeclaredField(fieldName);
> field.setAccessible(true);
> return
> String.valueOf(field.getAnnotation(Column.class).length());
> } catch (Exception ex) {
> return "";
> }
> }
> 
> Which got me thinking (after spending an hour figuring out I had to use
> setAccessible) if there's an open FAQ/wiki for these kind of things? I
> have not been able to find any except the locked down official confluence.
> Google is nice, but as a newbie it would be nice to have a central place
> with lots of micro-examples/snippets to get you going.
> 
> /Casper 
> 

-- 
View this message in context: 
http://www.nabble.com/Open-FAQ-wiki-somewhere--tp20607065p20607391.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Open FAQ/wiki somewhere?

2008-11-20 Thread Michael O'Cleirigh

Hi Casper,

Have you seen the reference library documentation on the main wiki:

http://cwiki.apache.org/WICKET/reference-library.html

Any one can create an account and then edit the wiki pages. 


Mike

In "Wicket in Action" it's mentioned briefly how one could use a
SimpleAttributeModifier to limit the text length of an input, by binding to
a JPA @Column annotation and its length attribute. This sounds nice DRY to
me (albeit perhaps a bit expensive?!) so I gave it a try:

protected String getColumnLength(Class entityName, String fieldName){
try {
Field field = entityName.getDeclaredField(fieldName);
field.setAccessible(true);
return
String.valueOf(field.getAnnotation(Column.class).length());
} catch (Exception ex) {
return "";
}
}

Which got me thinking (after spending an hour figuring out I had to use
setAccessible) if there's an open FAQ/wiki for these kind of things? I have
not been able to find any except the locked down official confluence. Google
is nice, but as a newbie it would be nice to have a central place with lots
of micro-examples/snippets to get you going.

/Casper 
  



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



Re: Feature idea: sealed flag on MarkupContainer

2008-11-20 Thread Peter Ertl

for SubPanel the ctor is called that order

- 
- Panel
- BasePanel
- SubPanel

so the fields will be initialized, eh?!


Am 20.11.2008 um 16:32 schrieb John Krasnay:


Here's the problem (also with sketchy pseudo code :)

public class BasePanel extends Panel {
   public BasePanel(String id) {
   super(id);
   add(new Label("foo", ...));
   }
}

public class SubPanel extends BasePanel {
   @Override
   public void onComponentAdd(Component child) {
   // oops, called from BasePanel ctor
   // my fields aren't initialized yet
   }
}

jk

On Thu, Nov 20, 2008 at 12:38:39PM +0100, Peter Ertl wrote:

I was thinking about something like this:

[warning, sketchy pseudo code will follow]

method org.apache.wicket.MarkupContainer.add(Component... children) :

  -> call empty overridable method onComponentAdd(Component child)
for each component
  -> add component

  protected void onComponentAdd(Component child) { /* overridable  
*/ }




Am 20.11.2008 um 12:30 schrieb John Krasnay:


Yeah, I thought about that. The problem is add() is usually called
from
a component's constructor, so you would have a case of a constructor
(indirectly) calling a non-final method,

jk

On Thu, Nov 20, 2008 at 11:27:39AM +0100, Peter Ertl wrote:

Wouldn't it be more powerful to override / hook into the process of
adding a component of a container?

Something like that ...

new WebMarkupContainer(id)
{
@Override
public void onComponentAdd(Component child)
{
 // check the sealed flag, decorate the child, throw exception, or
do [whatever]
}
}




Am 20.11.2008 um 05:25 schrieb John Krasnay:


Hi folks,

In my current Wicket app I have a panel that contains a vertically
stacked list of sub-panels. Because the precise list of sub-panels
is
not known until runtime, I've implemented this with a  
RepeatingView.

My
parent panel has the following methods that I use to build the
list of
sub-panels ("rv" is my RepeatingView instance):

public void addSubPanel(Panel subPanel) { rv.add(subPanel); }
public String newSubPanelId() { return rv.newChildId(); }

I use this same pattern in a number of other instances such as  
menus

and
button bars.

The problem is that I often mistakenly call add instead of
addSubPanel,
which of course fails at render time with an exception that I  
always

find hard to decipher.

It would be nice if there was a way to "seal" a MarkupContainer
once I
had populated it such that any subsequent call to add, remove, or
replace would fail immediately with an exception. This would  
make it

much easier to find out where I had made the mistake.

Does anyone else think this would be a worthwhile feature?

jk

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



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



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



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



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



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



Open FAQ/wiki somewhere?

2008-11-20 Thread Casper Bang

In "Wicket in Action" it's mentioned briefly how one could use a
SimpleAttributeModifier to limit the text length of an input, by binding to
a JPA @Column annotation and its length attribute. This sounds nice DRY to
me (albeit perhaps a bit expensive?!) so I gave it a try:

protected String getColumnLength(Class entityName, String fieldName){
try {
Field field = entityName.getDeclaredField(fieldName);
field.setAccessible(true);
return
String.valueOf(field.getAnnotation(Column.class).length());
} catch (Exception ex) {
return "";
}
}

Which got me thinking (after spending an hour figuring out I had to use
setAccessible) if there's an open FAQ/wiki for these kind of things? I have
not been able to find any except the locked down official confluence. Google
is nice, but as a newbie it would be nice to have a central place with lots
of micro-examples/snippets to get you going.

/Casper 
-- 
View this message in context: 
http://www.nabble.com/Open-FAQ-wiki-somewhere--tp20607065p20607065.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Problems with lists of checkboxes...

2008-11-20 Thread Jeremy Thomerson
Try creating your checkbox like this, with a proper boolean model:

add(new CheckBox("check", new IModel() {
public Boolean getObject() {
return pax.contains((Passenger) item.getModelObject());
}
public void setObject(Boolean bool) {
if (bool) {
pax.add((Passenger) item.getModelObject());
} else {
pax.remove((Passenger) item.getModelObject());
}
}
public void detach() {
// no-op
}
}));


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


On Thu, Nov 20, 2008 at 10:40 AM, Harrison, Andy
<[EMAIL PROTECTED]>wrote:

> Hi...
>
>
>
> I've been having lots of fun trying to get a list of checkboxes to
> display correctly on a page.  What I am attempting to do is to display a
> list of checkboxes based on a list of passengers and when the checkbox
> is checked, add the selected passenger to another object.
>
>
>
> I had great fun trying to figure out why all of the checkboxes are
> checked all of the time and was hoping that overriding the
> onComponentTag and attempting to set checked as true/false or even
> checked/unchecked based on a condition might help, but to no avail.  I'm
> probably missing something really simple, but need pointing in the right
> direction.
>
>
>
>
>
>CheckGroup group = new CheckGroup("group", passengers) {
>
>
>
>@Override
>
>protected void onSelectionChanged(final Collection
> newSelection) {
>
>
>
>Extra extra = (Extra) getParent().getModelObject();
>
>
>
>List pax = extra.getExtraPassengers();
>
>List selection = (List)
> newSelection;
>
>if (pax.containsAll(selection)) {
>
>pax.removeAll(selection);
>
>} else {
>
>pax.addAll(selection);
>
>}
>
>}
>
>
>
>@Override
>
>protected boolean wantOnSelectionChangedNotifications() {
>
>return true;
>
>}
>
>
>
>};
>
>
>
>
>
>ListView people = new ListView("people", passengers) {
>
>
>
>@Override
>
>protected void populateItem(final ListItem item) {
>
>final Passenger pax = (Passenger) item.getModelObject();
>
>Check check = new Check("checkbox", item.getModel()) {
>
>
>
>@Override
>
>protected void onComponentTag(final ComponentTag
> tag) {
>
>super.onComponentTag(tag);
>
>if (extra.getExtraPassengers().contains(pax)) {
>
>tag.put("checked", "checked");
>
>} else {
>
>tag.put("checked", "unchecked");
>
>}
>
>}
>
>
>
>};
>
>item.add(check);
>
>item.add(new Label("name", pax.getDefaultDetails()));
>
>}
>
>};
>
>people.setReuseItems(true);
>
>group.add(people);
>
>
>
>extraItem.add(group);
>
>
>
>boolean displaySelected = extra.isSelectedExtra();
>
>
>
>group.setVisible(displaySelected);
>
>
>
> Regards
>
>
>
> Andrew
>
>
>
>
>
> ..
>
> CarbonNeutral?  office
>
> Thomson.co.uk  for Holidays, Flights, Hotels,
> customer reviews and over 2000 videos. Find us at www.thomson.co.uk, Sky
> 637 or on your high street.
>
> CONFIDENTIALITY NOTICE & DISCLAIMER
>
> This message, together with any attachments, is for the confidential and
> exclusive use of the intended addresses(s). If you receive it in error,
> please delete the message and its attachments from your system immediately
> and notify us by return e-mail. Do not disclose copy, circulate or use any
> information contained in this e-mail.
> (1) The content of this e-mail is to be read subject to our terms of
> business, as applicable.
> (2) E-mail may be intercepted or affected by viruses and we accept no
> responsibility for any interception or liability for any form of viruses
> introduced with this e-mail.
> (3) The sender shall remain solely accountable for any statements,
> representations or opinions that are clearly his or her own and not made in
> the course of employment.
> (4) For risk, protection and security purposes, we may monitor e-mails and
> take appropriate action.
> Registered Office: TUI Travel House, Crawley Business Quarter, Fleming Way,
> Crawley, West Sussex RH10 9QL
>
> TUI Travel PLC, Registered in England and Wales (Number 6072876)
> TUI Northern Europe Limited, Registered in England and Wales (Number
> 3490138)
> TUI UK Limited, Registered in England and Wales (Number 2830117) ; VAT
> Number: 233 3687 62
> Thomsonfly Limited, Registered in England and Wales (Number 444359); VAT
> Number: 490 2120 79
>
> Telephone: +44 (0)24 7628 2828 | Fax: +44 (0)24 7628 2844 | IT Helpdes

RE: Problems with lists of checkboxes...

2008-11-20 Thread Harrison, Andy
Ah..   Sussed it about 5 minutes posting...

It required removing the "checked" attribute from the tag, rather than
changing the value of it:

if (extra.getExtraPassengers().contains(pax)) {

tag.put("checked", "checked");

} else {

tag.remove("checked");

}

Cheers

Andrew

-Original Message-
From: Harrison, Andy 
Sent: 20 November 2008 16:41
To: users@wicket.apache.org
Subject: Problems with lists of checkboxes...

Hi...

 

I've been having lots of fun trying to get a list of checkboxes to
display correctly on a page.  What I am attempting to do is to display a
list of checkboxes based on a list of passengers and when the checkbox
is checked, add the selected passenger to another object.

 

I had great fun trying to figure out why all of the checkboxes are
checked all of the time and was hoping that overriding the
onComponentTag and attempting to set checked as true/false or even
checked/unchecked based on a condition might help, but to no avail.  I'm
probably missing something really simple, but need pointing in the right
direction.

 

 

CheckGroup group = new CheckGroup("group", passengers) {

 

@Override

protected void onSelectionChanged(final Collection
newSelection) {

 

Extra extra = (Extra) getParent().getModelObject();

 

List pax = extra.getExtraPassengers();

List selection = (List)
newSelection;

if (pax.containsAll(selection)) {

pax.removeAll(selection);

} else {

pax.addAll(selection);

}

}

 

@Override

protected boolean wantOnSelectionChangedNotifications() {

return true;

}

 

};

 

 

ListView people = new ListView("people", passengers) {

 

@Override

protected void populateItem(final ListItem item) {

final Passenger pax = (Passenger) item.getModelObject();

Check check = new Check("checkbox", item.getModel()) {

 

@Override

protected void onComponentTag(final ComponentTag
tag) {

super.onComponentTag(tag);

if (extra.getExtraPassengers().contains(pax)) {

tag.put("checked", "checked");

} else {

tag.put("checked", "unchecked");

}

}

 

};

item.add(check);

item.add(new Label("name", pax.getDefaultDetails()));

}

};

people.setReuseItems(true);

group.add(people);

 

extraItem.add(group);

 

boolean displaySelected = extra.isSelectedExtra();

 

group.setVisible(displaySelected);

 

Regards

 

Andrew

 



..

CarbonNeutral?  office

Thomson.co.uk for Holidays, Flights, Hotels, customer reviews and over
2000 videos. Find us at www.thomson.co.uk, Sky 637 or on your high
street.

CONFIDENTIALITY NOTICE & DISCLAIMER

This message, together with any attachments, is for the confidential and
exclusive use of the intended addresses(s). If you receive it in error,
please delete the message and its attachments from your system
immediately and notify us by return e-mail. Do not disclose copy,
circulate or use any information contained in this e-mail. 
(1) The content of this e-mail is to be read subject to our terms of
business, as applicable. 
(2) E-mail may be intercepted or affected by viruses and we accept no
responsibility for any interception or liability for any form of viruses
introduced with this e-mail. 
(3) The sender shall remain solely accountable for any statements,
representations or opinions that are clearly his or her own and not made
in the course of employment. 
(4) For risk, protection and security purposes, we may monitor e-mails
and take appropriate action. 
Registered Office: TUI Travel House, Crawley Business Quarter, Fleming
Way, Crawley, West Sussex RH10 9QL 

TUI Travel PLC, Registered in England and Wales (Number 6072876)
TUI Northern Europe Limited, Registered in England and Wales (Number
3490138)
TUI UK Limited, Registered in England and Wales (Number 2830117) ; VAT
Number: 233 3687 62
Thomsonfly Limited, Registered in England and Wales (Number 444359); VAT
Number: 490 2120 79  

Telephone: +44 (0)24 7628 2828 | Fax: +44 (0)24 7628 2844 | IT Helpdesk:
+44 (0)20 7383 1555 | IT E-mail: [EMAIL PROTECTED]


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



Problems with lists of checkboxes...

2008-11-20 Thread Harrison, Andy
Hi...

 

I've been having lots of fun trying to get a list of checkboxes to
display correctly on a page.  What I am attempting to do is to display a
list of checkboxes based on a list of passengers and when the checkbox
is checked, add the selected passenger to another object.

 

I had great fun trying to figure out why all of the checkboxes are
checked all of the time and was hoping that overriding the
onComponentTag and attempting to set checked as true/false or even
checked/unchecked based on a condition might help, but to no avail.  I'm
probably missing something really simple, but need pointing in the right
direction.

 

 

CheckGroup group = new CheckGroup("group", passengers) {

 

@Override

protected void onSelectionChanged(final Collection
newSelection) {

 

Extra extra = (Extra) getParent().getModelObject();

 

List pax = extra.getExtraPassengers();

List selection = (List)
newSelection;

if (pax.containsAll(selection)) {

pax.removeAll(selection);

} else {

pax.addAll(selection);

}

}

 

@Override

protected boolean wantOnSelectionChangedNotifications() {

return true;

}

 

};

 

 

ListView people = new ListView("people", passengers) {

 

@Override

protected void populateItem(final ListItem item) {

final Passenger pax = (Passenger) item.getModelObject();

Check check = new Check("checkbox", item.getModel()) {

 

@Override

protected void onComponentTag(final ComponentTag
tag) {

super.onComponentTag(tag);

if (extra.getExtraPassengers().contains(pax)) {

tag.put("checked", "checked");

} else {

tag.put("checked", "unchecked");

}

}

 

};

item.add(check);

item.add(new Label("name", pax.getDefaultDetails()));

}

};

people.setReuseItems(true);

group.add(people);

 

extraItem.add(group);

 

boolean displaySelected = extra.isSelectedExtra();

 

group.setVisible(displaySelected);

 

Regards

 

Andrew

 



..

CarbonNeutral?  office

Thomson.co.uk for Holidays, Flights, Hotels, customer reviews and over 2000 
videos. Find us at www.thomson.co.uk, Sky 637 or on your high street.

CONFIDENTIALITY NOTICE & DISCLAIMER

This message, together with any attachments, is for the confidential and 
exclusive use of the intended addresses(s). If you receive it in error, please 
delete the message and its attachments from your system immediately and notify 
us by return e-mail. Do not disclose copy, circulate or use any information 
contained in this e-mail. 
(1) The content of this e-mail is to be read subject to our terms of business, 
as applicable. 
(2) E-mail may be intercepted or affected by viruses and we accept no 
responsibility for any interception or liability for any form of viruses 
introduced with this e-mail. 
(3) The sender shall remain solely accountable for any statements, 
representations or opinions that are clearly his or her own and not made in the 
course of employment. 
(4) For risk, protection and security purposes, we may monitor e-mails and take 
appropriate action. 
Registered Office: TUI Travel House, Crawley Business Quarter, Fleming Way, 
Crawley, West Sussex RH10 9QL 

TUI Travel PLC, Registered in England and Wales (Number 6072876)
TUI Northern Europe Limited, Registered in England and Wales (Number 3490138)
TUI UK Limited, Registered in England and Wales (Number 2830117) ; VAT Number: 
233 3687 62
Thomsonfly Limited, Registered in England and Wales (Number 444359); VAT 
Number: 490 2120 79  

Telephone: +44 (0)24 7628 2828 | Fax: +44 (0)24 7628 2844 | IT Helpdesk: +44 
(0)20 7383 1555 | IT E-mail: [EMAIL PROTECTED]


Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior

2008-11-20 Thread Igor Vaynberg
i still dont see a concrete usecase

-igor

On Thu, Nov 20, 2008 at 8:04 AM, Marat Radchenko
<[EMAIL PROTECTED]> wrote:
> I'm trying to choose strategy for handling conditional component
> visibility (and we have complex tree where many components are
> conditionally visible). Overriding isVisible is bad, because many
> calls. overriding onBeforeRender and callOnBeforeRender is bad,
> because children visibility is calculated even when there is no need.
> I'd prefer overriding onBeforeRender and skipping child traversion if
> isVisible = false, but that cannot be done with current
> Component#onBeforeRender implementation.
>
> 2008/11/20 Igor Vaynberg <[EMAIL PROTECTED]>:
>> you havent actually described your usecase yet...
>>
>> -igor
>>
>> On Thu, Nov 20, 2008 at 7:33 AM, Marat Radchenko
>> <[EMAIL PROTECTED]> wrote:
>>> So. Is there any recommended (and hopefully not error-prone) way of
>>> handling conditional visibility?
>>>
>>> 2008/11/20 Matej Knopp <[EMAIL PROTECTED]>:
> That's first confusing point. Javadocs on
> callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be
> called even if component is not visible, but it is a lie.

 Bad, bad javadoc!

 -Matej

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


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

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



Re: Memory consumption per session

2008-11-20 Thread Martin Makundi
What is the out-of-the-box xml dom generator for wicket, if I wanted
to use such tool for generating the html structure?

**
Martin

2008/11/20 Martijn Dashorst <[EMAIL PROTECTED]>:
> add(new Label("raw", "Foo").setEscapeModelStrings(false));
>
> On Thu, Nov 20, 2008 at 5:00 PM, Martin Makundi
> <[EMAIL PROTECTED]> wrote:
>> What is the easiest way of embedding raw html (yes, it could/should
>> use some xml dom which is included with wicket)?
>>
>> Is it possible, for example, to replace a  element
>> on a panel with such raw dom content?
>>
>> **
>> Martin
>>
>> 2008/11/20 Igor Vaynberg <[EMAIL PROTECTED]>:
>>> if you are planning on displaying 1000 rows per page, which is quiet
>>> uncommon for webapps, you should produce output as raw html instead of
>>> using listview and adding components inside.
>>>
>>> -igor
>>>
>>> On Thu, Nov 20, 2008 at 7:15 AM, Ralf Siemon <[EMAIL PROTECTED]> wrote:
 Hi,

 we have recently launched our new Wicket-based website, and now we are
 experiencing that the memory consumption of the website is very high, so
 that it crashes the site regularly.

 When profiling the application server, we found out that there are HTTP
 sessions that consume up to 2 MB of memory, mostly because there are very
 large ListViews with up to 1000 entries, where each entry consumes about 2
 KB.

 Our preliminary solution is to limit the size of those ListViews to a
 maximum of 50 entries, but even in those cases the session size is still at
 about 200 KB, which seems quite large to us.

 I know that there have already been some discussions about memory
 consumption in Wicket due to the fact that the whole Page object of the 
 last
 visited page is stored in the session; but what I'd like to know is: Have
 you experienced session sizes in a comparable magnitude, or are we doing
 something wrong? Or is this something we have to live with when using
 Wicket?

 We are using Wicket 1.3.5.


 Thanks,

 Ralf.


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


>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.3.4 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Memory consumption per session

2008-11-20 Thread Martijn Dashorst
add(new Label("raw", "Foo").setEscapeModelStrings(false));

On Thu, Nov 20, 2008 at 5:00 PM, Martin Makundi
<[EMAIL PROTECTED]> wrote:
> What is the easiest way of embedding raw html (yes, it could/should
> use some xml dom which is included with wicket)?
>
> Is it possible, for example, to replace a  element
> on a panel with such raw dom content?
>
> **
> Martin
>
> 2008/11/20 Igor Vaynberg <[EMAIL PROTECTED]>:
>> if you are planning on displaying 1000 rows per page, which is quiet
>> uncommon for webapps, you should produce output as raw html instead of
>> using listview and adding components inside.
>>
>> -igor
>>
>> On Thu, Nov 20, 2008 at 7:15 AM, Ralf Siemon <[EMAIL PROTECTED]> wrote:
>>> Hi,
>>>
>>> we have recently launched our new Wicket-based website, and now we are
>>> experiencing that the memory consumption of the website is very high, so
>>> that it crashes the site regularly.
>>>
>>> When profiling the application server, we found out that there are HTTP
>>> sessions that consume up to 2 MB of memory, mostly because there are very
>>> large ListViews with up to 1000 entries, where each entry consumes about 2
>>> KB.
>>>
>>> Our preliminary solution is to limit the size of those ListViews to a
>>> maximum of 50 entries, but even in those cases the session size is still at
>>> about 200 KB, which seems quite large to us.
>>>
>>> I know that there have already been some discussions about memory
>>> consumption in Wicket due to the fact that the whole Page object of the last
>>> visited page is stored in the session; but what I'd like to know is: Have
>>> you experienced session sizes in a comparable magnitude, or are we doing
>>> something wrong? Or is this something we have to live with when using
>>> Wicket?
>>>
>>> We are using Wicket 1.3.5.
>>>
>>>
>>> Thanks,
>>>
>>> Ralf.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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

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



Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior

2008-11-20 Thread Marat Radchenko
I'm trying to choose strategy for handling conditional component
visibility (and we have complex tree where many components are
conditionally visible). Overriding isVisible is bad, because many
calls. overriding onBeforeRender and callOnBeforeRender is bad,
because children visibility is calculated even when there is no need.
I'd prefer overriding onBeforeRender and skipping child traversion if
isVisible = false, but that cannot be done with current
Component#onBeforeRender implementation.

2008/11/20 Igor Vaynberg <[EMAIL PROTECTED]>:
> you havent actually described your usecase yet...
>
> -igor
>
> On Thu, Nov 20, 2008 at 7:33 AM, Marat Radchenko
> <[EMAIL PROTECTED]> wrote:
>> So. Is there any recommended (and hopefully not error-prone) way of
>> handling conditional visibility?
>>
>> 2008/11/20 Matej Knopp <[EMAIL PROTECTED]>:
 That's first confusing point. Javadocs on
 callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be
 called even if component is not visible, but it is a lie.
>>>
>>> Bad, bad javadoc!
>>>
>>> -Matej
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior

2008-11-20 Thread Marat Radchenko
That's bad because isVisible is invoked many times (50+ sometimes) per
request so no complex logic can be put there.

2008/11/20 Jeremy Thomerson <[EMAIL PROTECTED]>:
> Like this?
>
> new YourComponent(id) {
>@Override
>public boolean isVisible() {
>return yourCondition;
>}
> }
>
> On Thu, Nov 20, 2008 at 9:33 AM, Marat Radchenko <
> [EMAIL PROTECTED]> wrote:
>
>> So. Is there any recommended (and hopefully not error-prone) way of
>> handling conditional visibility?
>>
>> 2008/11/20 Matej Knopp <[EMAIL PROTECTED]>:
>>  >> That's first confusing point. Javadocs on
>> >> callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be
>> >> called even if component is not visible, but it is a lie.
>> >
>> > Bad, bad javadoc!
>> >
>> > -Matej
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>

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



Re: Memory consumption per session

2008-11-20 Thread Martin Makundi
What is the easiest way of embedding raw html (yes, it could/should
use some xml dom which is included with wicket)?

Is it possible, for example, to replace a  element
on a panel with such raw dom content?

**
Martin

2008/11/20 Igor Vaynberg <[EMAIL PROTECTED]>:
> if you are planning on displaying 1000 rows per page, which is quiet
> uncommon for webapps, you should produce output as raw html instead of
> using listview and adding components inside.
>
> -igor
>
> On Thu, Nov 20, 2008 at 7:15 AM, Ralf Siemon <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> we have recently launched our new Wicket-based website, and now we are
>> experiencing that the memory consumption of the website is very high, so
>> that it crashes the site regularly.
>>
>> When profiling the application server, we found out that there are HTTP
>> sessions that consume up to 2 MB of memory, mostly because there are very
>> large ListViews with up to 1000 entries, where each entry consumes about 2
>> KB.
>>
>> Our preliminary solution is to limit the size of those ListViews to a
>> maximum of 50 entries, but even in those cases the session size is still at
>> about 200 KB, which seems quite large to us.
>>
>> I know that there have already been some discussions about memory
>> consumption in Wicket due to the fact that the whole Page object of the last
>> visited page is stored in the session; but what I'd like to know is: Have
>> you experienced session sizes in a comparable magnitude, or are we doing
>> something wrong? Or is this something we have to live with when using
>> Wicket?
>>
>> We are using Wicket 1.3.5.
>>
>>
>> Thanks,
>>
>> Ralf.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Memory consumption per session

2008-11-20 Thread Sergey Didenko
BTW, is it easy to control what wicket stores in session? May be by patching
wicket code?
P.S. Sorry if the question is lame, I have just started studying wicket and
I want to decide whether to use it in production.


> > When profiling the application server, we found out that there are HTTP
> > sessions that consume up to 2 MB of memory, mostly because there are very
> > large ListViews with up to 1000 entries, where each entry consumes about
> 2
> > KB.
>


Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior

2008-11-20 Thread Jeremy Thomerson
Like this?

new YourComponent(id) {
@Override
public boolean isVisible() {
return yourCondition;
}
}

On Thu, Nov 20, 2008 at 9:33 AM, Marat Radchenko <
[EMAIL PROTECTED]> wrote:

> So. Is there any recommended (and hopefully not error-prone) way of
> handling conditional visibility?
>
> 2008/11/20 Matej Knopp <[EMAIL PROTECTED]>:
>  >> That's first confusing point. Javadocs on
> >> callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be
> >> called even if component is not visible, but it is a lie.
> >
> > Bad, bad javadoc!
> >
> > -Matej
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior

2008-11-20 Thread Igor Vaynberg
you havent actually described your usecase yet...

-igor

On Thu, Nov 20, 2008 at 7:33 AM, Marat Radchenko
<[EMAIL PROTECTED]> wrote:
> So. Is there any recommended (and hopefully not error-prone) way of
> handling conditional visibility?
>
> 2008/11/20 Matej Knopp <[EMAIL PROTECTED]>:
>>> That's first confusing point. Javadocs on
>>> callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be
>>> called even if component is not visible, but it is a lie.
>>
>> Bad, bad javadoc!
>>
>> -Matej
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Memory consumption per session

2008-11-20 Thread Igor Vaynberg
if you are planning on displaying 1000 rows per page, which is quiet
uncommon for webapps, you should produce output as raw html instead of
using listview and adding components inside.

-igor

On Thu, Nov 20, 2008 at 7:15 AM, Ralf Siemon <[EMAIL PROTECTED]> wrote:
> Hi,
>
> we have recently launched our new Wicket-based website, and now we are
> experiencing that the memory consumption of the website is very high, so
> that it crashes the site regularly.
>
> When profiling the application server, we found out that there are HTTP
> sessions that consume up to 2 MB of memory, mostly because there are very
> large ListViews with up to 1000 entries, where each entry consumes about 2
> KB.
>
> Our preliminary solution is to limit the size of those ListViews to a
> maximum of 50 entries, but even in those cases the session size is still at
> about 200 KB, which seems quite large to us.
>
> I know that there have already been some discussions about memory
> consumption in Wicket due to the fact that the whole Page object of the last
> visited page is stored in the session; but what I'd like to know is: Have
> you experienced session sizes in a comparable magnitude, or are we doing
> something wrong? Or is this something we have to live with when using
> Wicket?
>
> We are using Wicket 1.3.5.
>
>
> Thanks,
>
> Ralf.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Feature idea: sealed flag on MarkupContainer

2008-11-20 Thread John Krasnay
Here's the problem (also with sketchy pseudo code :)

public class BasePanel extends Panel {
public BasePanel(String id) {
super(id);
add(new Label("foo", ...));
}
}

public class SubPanel extends BasePanel {
@Override
public void onComponentAdd(Component child) {
// oops, called from BasePanel ctor
// my fields aren't initialized yet
}
}

jk

On Thu, Nov 20, 2008 at 12:38:39PM +0100, Peter Ertl wrote:
> I was thinking about something like this:
> 
> [warning, sketchy pseudo code will follow]
> 
>  method org.apache.wicket.MarkupContainer.add(Component... children) :
> 
>-> call empty overridable method onComponentAdd(Component child)  
> for each component
>-> add component
> 
>protected void onComponentAdd(Component child) { /* overridable */ }
> 
> 
> 
> Am 20.11.2008 um 12:30 schrieb John Krasnay:
> 
> >Yeah, I thought about that. The problem is add() is usually called  
> >from
> >a component's constructor, so you would have a case of a constructor
> >(indirectly) calling a non-final method,
> >
> >jk
> >
> >On Thu, Nov 20, 2008 at 11:27:39AM +0100, Peter Ertl wrote:
> >>Wouldn't it be more powerful to override / hook into the process of
> >>adding a component of a container?
> >>
> >>Something like that ...
> >>
> >>new WebMarkupContainer(id)
> >>{
> >> @Override
> >> public void onComponentAdd(Component child)
> >> {
> >>   // check the sealed flag, decorate the child, throw exception, or
> >>do [whatever]
> >> }
> >>}
> >>
> >>
> >>
> >>
> >>Am 20.11.2008 um 05:25 schrieb John Krasnay:
> >>
> >>>Hi folks,
> >>>
> >>>In my current Wicket app I have a panel that contains a vertically
> >>>stacked list of sub-panels. Because the precise list of sub-panels  
> >>>is
> >>>not known until runtime, I've implemented this with a RepeatingView.
> >>>My
> >>>parent panel has the following methods that I use to build the  
> >>>list of
> >>>sub-panels ("rv" is my RepeatingView instance):
> >>>
> >>>public void addSubPanel(Panel subPanel) { rv.add(subPanel); }
> >>>public String newSubPanelId() { return rv.newChildId(); }
> >>>
> >>>I use this same pattern in a number of other instances such as menus
> >>>and
> >>>button bars.
> >>>
> >>>The problem is that I often mistakenly call add instead of
> >>>addSubPanel,
> >>>which of course fails at render time with an exception that I always
> >>>find hard to decipher.
> >>>
> >>>It would be nice if there was a way to "seal" a MarkupContainer  
> >>>once I
> >>>had populated it such that any subsequent call to add, remove, or
> >>>replace would fail immediately with an exception. This would make it
> >>>much easier to find out where I had made the mistake.
> >>>
> >>>Does anyone else think this would be a worthwhile feature?
> >>>
> >>>jk
> >>>
> >>>-
> >>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>-
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

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



Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior

2008-11-20 Thread Marat Radchenko
So. Is there any recommended (and hopefully not error-prone) way of
handling conditional visibility?

2008/11/20 Matej Knopp <[EMAIL PROTECTED]>:
>> That's first confusing point. Javadocs on
>> callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be
>> called even if component is not visible, but it is a lie.
>
> Bad, bad javadoc!
>
> -Matej
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Memory consumption per session

2008-11-20 Thread Johan Compagner
No if you really render 1000 rows (list items) in a list view ands
those listitems have textfields or labels again then yes it could
expand quite a lot

But 1000 listems with maybe 4,5 components in each listitem then that
will be 5000 components on just that page that will cost memory

On 11/20/08, Jeremy Thomerson <[EMAIL PROTECTED]> wrote:
> That was only after he cut the listview sizes - problem is that his sessions
> are 2MB now.  Still should support quite a few (1000 = 2GB), but there is
> probably a memory issue to address there.
>
> On Thu, Nov 20, 2008 at 9:20 AM, Johan Compagner
> <[EMAIL PROTECTED]>wrote:
>
>> 200kb per session sounds very reasonable.
>>
>> Then you should be able to handle quite a lot of concurrent sessions.
>>
>> What kind of hardware do you use?
>>
>> On 11/20/08, Ralf Siemon <[EMAIL PROTECTED]> wrote:
>> > Hi,
>> >
>> > we have recently launched our new Wicket-based website, and now we are
>> > experiencing that the memory consumption of the website is very high, so
>> > that it crashes the site regularly.
>> >
>> > When profiling the application server, we found out that there are HTTP
>> > sessions that consume up to 2 MB of memory, mostly because there are
>> > very large ListViews with up to 1000 entries, where each entry consumes
>> > about 2 KB.
>> >
>> > Our preliminary solution is to limit the size of those ListViews to a
>> > maximum of 50 entries, but even in those cases the session size is still
>> > at about 200 KB, which seems quite large to us.
>> >
>> > I know that there have already been some discussions about memory
>> > consumption in Wicket due to the fact that the whole Page object of the
>> > last visited page is stored in the session; but what I'd like to know
>> > is: Have you experienced session sizes in a comparable magnitude, or are
>> > we doing something wrong? Or is this something we have to live with when
>> > using Wicket?
>> >
>> > We are using Wicket 1.3.5.
>> >
>> >
>> > Thanks,
>> >
>> > Ralf.
>> >
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>

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



Re: Memory consumption per session

2008-11-20 Thread Matej Knopp
200kb is quite a lot for page with listview with 50 entries (unless
there's lot of other components). It's more likely that you don't
detach something properly.

Still, what are you hardware specs and number of concurrent users?

-Matej

On Thu, Nov 20, 2008 at 4:15 PM, Ralf Siemon <[EMAIL PROTECTED]> wrote:
> Hi,
>
> we have recently launched our new Wicket-based website, and now we are
> experiencing that the memory consumption of the website is very high, so
> that it crashes the site regularly.
>
> When profiling the application server, we found out that there are HTTP
> sessions that consume up to 2 MB of memory, mostly because there are very
> large ListViews with up to 1000 entries, where each entry consumes about 2
> KB.
>
> Our preliminary solution is to limit the size of those ListViews to a
> maximum of 50 entries, but even in those cases the session size is still at
> about 200 KB, which seems quite large to us.
>
> I know that there have already been some discussions about memory
> consumption in Wicket due to the fact that the whole Page object of the last
> visited page is stored in the session; but what I'd like to know is: Have
> you experienced session sizes in a comparable magnitude, or are we doing
> something wrong? Or is this something we have to live with when using
> Wicket?
>
> We are using Wicket 1.3.5.
>
>
> Thanks,
>
> Ralf.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Check a checkbox when focus on a textbox

2008-11-20 Thread vishy_sb

Hi all, 

I have a textbox and a checkbox in a form on my web page. I would like to
automatically check the checkbox when the user starts to type something in
the textbox. I believe this can be done by using some javascript. I did some
research over the web and was able to find some code which is shown below.
However I was not able to get it to work.

HTML code:



Javascript code:
function checker(checkbox) {
var checkBox=document.form.contain; 
checkBox.checked = true;

}


Any help will be greatly appreciated.

Thanks a lot
Cheers,
vishy
-- 
View this message in context: 
http://www.nabble.com/Check-a-checkbox-when-focus-on-a-textbox-tp20603583p20603583.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Generics changes in 1.4-rc1

2008-11-20 Thread Johan Compagner
Please make issues for this in jira

On 11/20/08, aditsu <[EMAIL PROTECTED]> wrote:
>
> Hi, I've been using m3 for a while and just tried switching to rc1. I found
> several problems:
> - LabelTree.getNodeTextModel requires IModel and returns IModel. I was
> overriding it and returning a Model, but I can't do that anymore.
> Why not just return IModel ?
> - RatingPanel now requires an IModel for the rating, but I was
> using IModel. How can I show "rated 3.6 from 7 votes" now? Can it
> use IModel instead?
> - BaseTree requires IModel; I was using a Model with a
> DefaultTreeModel object, but I can't do that anymore (TreeModel is not
> necessarily Serializable). Why not just require IModel
> ?
>
> Adrian
> --
> View this message in context:
> http://www.nabble.com/Generics-changes-in-1.4-rc1-tp20599173p20599173.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Memory consumption per session

2008-11-20 Thread Jeremy Thomerson
Your ListView instances must be holding on to domain objects.  You should
use LoadableDetachableModels so that the ListView doesn't hold on to
references to objects.

The most common memory issue is always that your components are holding on
to objects directly or using Model, which holds the object.

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

On Thu, Nov 20, 2008 at 9:15 AM, Ralf Siemon <[EMAIL PROTECTED]> wrote:

> Hi,
>
> we have recently launched our new Wicket-based website, and now we are
> experiencing that the memory consumption of the website is very high, so
> that it crashes the site regularly.
>
> When profiling the application server, we found out that there are HTTP
> sessions that consume up to 2 MB of memory, mostly because there are very
> large ListViews with up to 1000 entries, where each entry consumes about 2
> KB.
>
> Our preliminary solution is to limit the size of those ListViews to a
> maximum of 50 entries, but even in those cases the session size is still at
> about 200 KB, which seems quite large to us.
>
> I know that there have already been some discussions about memory
> consumption in Wicket due to the fact that the whole Page object of the last
> visited page is stored in the session; but what I'd like to know is: Have
> you experienced session sizes in a comparable magnitude, or are we doing
> something wrong? Or is this something we have to live with when using
> Wicket?
>
> We are using Wicket 1.3.5.
>
>
> Thanks,
>
> Ralf.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Memory consumption per session

2008-11-20 Thread Jeremy Thomerson
That was only after he cut the listview sizes - problem is that his sessions
are 2MB now.  Still should support quite a few (1000 = 2GB), but there is
probably a memory issue to address there.

On Thu, Nov 20, 2008 at 9:20 AM, Johan Compagner <[EMAIL PROTECTED]>wrote:

> 200kb per session sounds very reasonable.
>
> Then you should be able to handle quite a lot of concurrent sessions.
>
> What kind of hardware do you use?
>
> On 11/20/08, Ralf Siemon <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > we have recently launched our new Wicket-based website, and now we are
> > experiencing that the memory consumption of the website is very high, so
> > that it crashes the site regularly.
> >
> > When profiling the application server, we found out that there are HTTP
> > sessions that consume up to 2 MB of memory, mostly because there are
> > very large ListViews with up to 1000 entries, where each entry consumes
> > about 2 KB.
> >
> > Our preliminary solution is to limit the size of those ListViews to a
> > maximum of 50 entries, but even in those cases the session size is still
> > at about 200 KB, which seems quite large to us.
> >
> > I know that there have already been some discussions about memory
> > consumption in Wicket due to the fact that the whole Page object of the
> > last visited page is stored in the session; but what I'd like to know
> > is: Have you experienced session sizes in a comparable magnitude, or are
> > we doing something wrong? Or is this something we have to live with when
> > using Wicket?
> >
> > We are using Wicket 1.3.5.
> >
> >
> > Thanks,
> >
> > Ralf.
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: Memory consumption per session

2008-11-20 Thread Johan Compagner
200kb per session sounds very reasonable.

Then you should be able to handle quite a lot of concurrent sessions.

What kind of hardware do you use?

On 11/20/08, Ralf Siemon <[EMAIL PROTECTED]> wrote:
> Hi,
>
> we have recently launched our new Wicket-based website, and now we are
> experiencing that the memory consumption of the website is very high, so
> that it crashes the site regularly.
>
> When profiling the application server, we found out that there are HTTP
> sessions that consume up to 2 MB of memory, mostly because there are
> very large ListViews with up to 1000 entries, where each entry consumes
> about 2 KB.
>
> Our preliminary solution is to limit the size of those ListViews to a
> maximum of 50 entries, but even in those cases the session size is still
> at about 200 KB, which seems quite large to us.
>
> I know that there have already been some discussions about memory
> consumption in Wicket due to the fact that the whole Page object of the
> last visited page is stored in the session; but what I'd like to know
> is: Have you experienced session sizes in a comparable magnitude, or are
> we doing something wrong? Or is this something we have to live with when
> using Wicket?
>
> We are using Wicket 1.3.5.
>
>
> Thanks,
>
> Ralf.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior

2008-11-20 Thread Matej Knopp
> That's first confusing point. Javadocs on
> callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be
> called even if component is not visible, but it is a lie.

Bad, bad javadoc!

-Matej

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



Memory consumption per session

2008-11-20 Thread Ralf Siemon

Hi,

we have recently launched our new Wicket-based website, and now we are 
experiencing that the memory consumption of the website is very high, so 
that it crashes the site regularly.


When profiling the application server, we found out that there are HTTP 
sessions that consume up to 2 MB of memory, mostly because there are 
very large ListViews with up to 1000 entries, where each entry consumes 
about 2 KB.


Our preliminary solution is to limit the size of those ListViews to a 
maximum of 50 entries, but even in those cases the session size is still 
at about 200 KB, which seems quite large to us.


I know that there have already been some discussions about memory 
consumption in Wicket due to the fact that the whole Page object of the 
last visited page is stored in the session; but what I'd like to know 
is: Have you experienced session sizes in a comparable magnitude, or are 
we doing something wrong? Or is this something we have to live with when 
using Wicket?


We are using Wicket 1.3.5.


Thanks,

Ralf.


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



Re: Validation Question

2008-11-20 Thread vishy_sb

Works like a charm 

Thanks a lot

Cheers,
vishy

jWeekend wrote:
> 
> Vishy,
> 
> Add
> 
> IConverter=Invalid Input
> 
> to a properties file in, for example,  MyApplication.properties for your
> whole application or in MyPage.properties if you want this custom message
> on a particular page only ... etc, in the same package as the class with
> the same name.
> 
> Regards - Cemal
>  http://www.jWeekend.co.uk http://jWeekend.co.uk 
> 
> 
> vishy_sb wrote:
>> 
>> Hi all,
>> 
>> I am trying to get some validations to work using the FeedbackPanel. My
>> form has a Textfield and I am trying to use a NumberValidator to check if
>> it is in a given range. The code that I have used is :
>> 
>> TextField pgLongLimit = new TextField("pgLongLimit", new PropertyModel(
>>  pglimit, "longLimit"));
>>  pgLongLimit.setRequired(false);
>>  pgLongLimit.setLabel(new Model("Long Limit"));
>>  validator.addNumberRange(pgLongLimit, 0, 
>> Integer.MAX_VALUE);
>> 
>> My classname.properties file looks has following code:
>> NumberValidator.range = ${label} should have a  positive integer value
>> 
>> 
>> Now whenever I put in a negative input I get the correct error i.e "Long
>> Limit should have a  positive integer value".
>> 
>> However if I put in a char value as an input (say 'a') then the error is
>> "a is not a valid int". I want to change this error to something like
>> "Invalid input". 
>> 
>> Any ideas about how I can do that. I don't know which resource key I
>> would have to use here.
>> 
>> Thanks,
>> vishy
>> 
> 
> 

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


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



Re: Compoundpropertymodel with shadow map?

2008-11-20 Thread Francisco Diaz Trepat - gmail
why?
simple is good. doesn't need to be complex.

what part you dislike the most?

f(t)

On Thu, Nov 20, 2008 at 2:29 AM, Nino Saturnino Martinez Vazquez Wael <
[EMAIL PROTECTED]> wrote:

> BTW this is a flawed approch.. We need something a little more
> intelligent.. I'll return on the subject..
>
>
> Nino Saturnino Martinez Vazquez Wael wrote:
>
>> heres the raw and completely untested version of it. probably with a whole
>> bunch of issues...:
>>
>>   package zeuzgroup.web.model;
>> import java.lang.reflect.Field;
>>   import java.util.HashMap;
>>   import java.util.Map;
>>   import java.util.Map.Entry;
>> import org.apache.wicket.Component;
>>   import org.apache.wicket.WicketRuntimeException;
>>   import org.apache.wicket.model.AbstractPropertyModel;
>>   import org.apache.wicket.model.CompoundPropertyModel;
>>   import org.apache.wicket.model.IModel;
>>   import org.apache.wicket.model.IWrapModel;
>> public class EditorModel extends CompoundPropertyModel {
>> private final Map newValues = new HashMap> Object>();
>> public EditorModel(IModel underlyingModel) {
>>   super(underlyingModel);
>>   }
>> public void fillOriginal() {
>> Class c = this.getObject().getClass();
>> for (Entry entry : newValues.entrySet()) {
>>   try {
>>   Field t = c.getDeclaredField(entry.getKey());
>>   t.set(this.getObject(), entry.getValue());
>>   } catch (Exception e) {
>>   throw new WicketRuntimeException("Could not set "
>>   + entry.getKey(), e);
>>   }
>> }
>>   }
>> public  IWrapModel wrapOnInheritance(Component component) {
>>   return new AttachedCompoundPropertyModel(component,
>> newValues);
>>   }
>> private class AttachedCompoundPropertyModel extends
>>   AbstractPropertyModel implements IWrapModel {
>>   private static final long serialVersionUID = 1L;
>> private final Component owner;
>> private final Map newValues;
>> /**
>>* Constructor
>>*
>>* @param owner
>>*component that this model has been attached to
>>*/
>>   public AttachedCompoundPropertyModel(Component owner,
>> Map map) {
>>   super(EditorModel.this);
>>   this.owner = owner;
>>   this.newValues = map;
>>   }
>> @Override
>>   public C getObject() {
>>   if (EditorModel.this.newValues.containsKey(owner.getId())) {
>>   return (C) newValues.get(owner.getId());
>>   } else {
>>   return super.getObject();
>>   }
>>   }
>> @Override
>>   public void setObject(C object) {
>>   newValues.put(owner.getId(), object);
>>   }
>> /**
>>* @see
>> org.apache.wicket.model.AbstractPropertyModel#propertyExpression()
>>*/
>>   @Override
>>   protected String propertyExpression() {
>>   return EditorModel.this.propertyExpression(owner);
>>   }
>> /**
>>* @see org.apache.wicket.model.IWrapModel#getWrappedModel()
>>*/
>>   public IModel getWrappedModel() {
>>   return EditorModel.this;
>>   }
>> /**
>>* @see org.apache.wicket.model.AbstractPropertyModel#detach()
>>*/
>>   @Override
>>   public void detach() {
>>   super.detach();
>>   EditorModel.this.detach();
>>   }
>>   }
>> }
>> // IComponentAssignedModel / IWrapModel
>>
>> Francisco Diaz Trepat - gmail wrote:
>>
>>> Nice, I was up to something similar.
>>>
>>> On Tue, Nov 18, 2008 at 9:43 AM, Nino Saturnino Martinez Vazquez Wael <
>>> [EMAIL PROTECTED]> wrote:
>>>
>>>
>>>
 Hi

 Im trying todo a compoundpropertymodel which does not change original
 values in the "original" model. I need this since I am updating some
 stuff
 in a wizard but I first want to commit when the user confirms in the end
 of
 the wizard, and if the model are changed directly the transaction are
 automatically committed to the database

 So my idea were to todo a shadowCompoundPropertyModel something like
 this:

 class EditorModel extends CompoundPropertyModel {

  private Map newValues=new HashMap();
public EditorModel(CompoundPropertyModel underlyingModel,
  String propertyName) {
  super(underlyingModel);
  }
  public getObject (String property){
 check if there are something in the map if so return it, otherwise fall
 back to the underlying model

 }  public setObject (String prop, Value){
  put changes in the map...
 }

 public UpdateOrigin

Re: page refresh cleans my page state

2008-11-20 Thread jWeekend

Singh,

Take a look at  http://cwiki.apache.org/WICKET/url-coding-strategies.html
HybridUrlCodingStrategy .

Regards - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk 


Singh Mukesh wrote:
> 
> 
> Hi,
> 
> I am using wicket. I have a page with one links which increase the counter
> value based on user click on the link, for all these actions I am using
> Ajax. For instance user click 5 times on link the counter shows value 5.
> It is ok but if I click on browsers refresh button all changes are lost
> and it shows the counter value 0 instead of 5. How to handle the refresh
> button?
> 
> Please find the code below.
> 
> TestPage.java
> 
> import org.apache.wicket.PageParameters;
> import org.apache.wicket.ajax.AjaxRequestTarget;
> import org.apache.wicket.ajax.markup.html.AjaxLink;
> import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.model.IModel;
> import org.apache.wicket.model.Model;
> 
> public class TestPage extends WebPage {
>   
>   public TestPage(PageParameters parameters) {
>   super(parameters);
>   final Model modell = new Model(new 
> Integer(0));
>   // Slik at telleverdien legges i session
>   setDefaultModel(modell);
>   final Label telleLabel = new Label("teller", modell);
>   telleLabel.setOutputMarkupId(true);
>   final Label hashcodeLabel = new Label("hashcode", new 
> IModel() {
>   private static final long serialVersionUID = 1L;
> 
>   public String getObject() {
>   return 
> String.valueOf(System.identityHashCode(TestPage.this));
>   }
> 
>   public void setObject(String object) {
>   /* NOOP */
>   }
> 
>   public void detach() {
>   /* NOOP */
>   }
>   
>   });
>   hashcodeLabel.setOutputMarkupId(true);
>   add(telleLabel);
>   add(new AjaxLink("link", modell) {
>   private static final long serialVersionUID = 1L;
> 
>   @Override
>   public void onClick(AjaxRequestTarget target) {
>   // Øk det delte modellobjektet
>   Integer tall = getModelObject();
>   int verdi = tall.intValue() + 1;
>   tall = new Integer(verdi);
>   setModelObject(tall);
>   // Fortell klienten hvilken komponent som skal 
> oppdateres
>   target.addComponent(telleLabel);
>   target.addComponent(hashcodeLabel);
>   }   
>   });
>   add(hashcodeLabel);
>   add(new AjaxCheckBox("versioned", new 
> Model(Boolean.TRUE)) {
>   private static final long serialVersionUID = 1L;
> 
>   @Override
>   protected void onUpdate(AjaxRequestTarget target) {
>   
> setVersioned(this.getModelObject().booleanValue());
>   }
>   
>   });
>   setVersioned(true);
>   }
>   
>   
> 
>   
> }
> 
> 
> 
> TestApplication.java
> 
> import org.apache.wicket.Page;
> import org.apache.wicket.Request;
> import org.apache.wicket.Response;
> import org.apache.wicket.Session;
> import org.apache.wicket.protocol.http.WebApplication;
> 
> public class TestApplication extends WebApplication {
> 
>   @Override
>   public Class getHomePage() {
>   return TestPage.class;
>   }
>   
> }
> 
> TestPage.html 
> 
>xmlns="http://www.w3.org/1999/xhtml";  
>   xmlns:wicket="http://wicket.apache.org/";>
> 
>   
>   Testside
> 
> 
># +  0
>   Denne portleten har hashCode lik 34563.
>class="portlet-form-field"
> wicket:id="versioned"> Versjonert
> 
> 
> 
> 
> Please suggest me the way how to handle the refresh button problem.
> 
> Please do the needful.
> 
> 
> Med vennlig hilsen
> 
> MUKESH SINGH
> CAPGEMINI Consultant
> Arrive AS
> T (+47) 46 47 90 16
> E-post: [EMAIL PROTECTED]
> http://servicedesk.arrive.no
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/page-refresh-cleans-my-page-state-tp20598492p20601031.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Display two modal windows in one request

2008-11-20 Thread Newgro

Hi *,

i'm facing a problem i couldn't solve until now. Our base page contain an
modal error window which is used to present the occurred error.

Now i added a password request modal window on a page. If an error occurred
after clicking the request button i would like to display the error window
over the request window. If i click the close button on error window this
should disappear but the request window should stay.

But the error window disappears immidiatly (< 1sec). The request window
stays. After i clicked the request button again the request window gets
closed.

Is there a solution for that issue? I've tried the example (multiple
windows) but there are used pages and cookies for displaying (it seems to be
to heavy for me).

thanks 4 help
Per
-- 
View this message in context: 
http://www.nabble.com/Display-two-modal-windows-in-one-request-tp20600479p20600479.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



RE: DateTimeField - changing the format of the date

2008-11-20 Thread Yazeed Isaacs
Hey guys

Thanks for the help, but I found the solution. Its so easy. :D

The DateTimeField class has a method called
newDateTextField(PropertyModel model, String id). All that I did was
override this method as follows:

DateTimeField dateToField = new DateTimeField("dateToField", new
PropertyModel(this, "dateTo")) {
@Override
public Locale getLocale() {
return new Locale("en");
}

@Override
protected DateTextField newDateTextField(String id,PropertyModel
dateFieldModel) {
return DateTextField.forDatePattern(id,
dateFieldModel,"dd/MM/");
}
};


Regards,
Yazeed Isaacs


-Original Message-
From: Yazeed Isaacs [mailto:[EMAIL PROTECTED] 
Sent: 19 November 2008 10:47 AM
To: users@wicket.apache.org
Subject: DateTimeField - changing the format of the date

Hi

I would like to change the format of the default displayed date
"MM/dd/yy" to "dd/MM/" when using the DateTimeField.

I cannot find any resource online that shows how this is implemented. Is
this even possible?

Yazeed Isaacs - Java Developer
[EMAIL PROTECTED]



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


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



Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior

2008-11-20 Thread Marat Radchenko
Mistake in Scenario #1. Read as: Good, but if A calculates isVisible = _FALSE_

2008/11/20 Marat Radchenko <[EMAIL PROTECTED]>:
> Hello, Wicket team and Wicket users.
>
> We broke our mind this week while trying to understand onBeforeRender 
> behavior.
>
> Scenario #1:
> Parent component A overrides onBeforeRender (and sets visibility
> there) and returns true from callOnBeforeRenderIfNotVisible. Child
> component B does the same. Then, onBeforeRender always happens on both
> components regardless any of them is visible or not.
> Good, but if A calculates isVisible = true then there it is impossible
> for component B to become visible (well, actually B could set
> visibility on A but this is very error-prone) so there's no point in
> invoking onBeforeRender because B won't be rendered.
>
> Scenario #2:
> Parent component A overrides isVisible (and sets visibility there).
> Child component B overrides isVisible too. Then B onBeforeRender will
> be called only if A is visible and B is visible.
> Good, no unnecessary job is done (B won't be processed at all when A
> is not visible).
>
> Scenario #3:
> Parent component A overrides onBeforeRender and
> callOnBeforeRenderIfNotVisible (and sets visibility there to FALSE).
> Child B doesn't override callOnBeforeRenderIfNotVisible and doesn't
> override isVisible. Then B's onBeforeRender will be called unless B is
> not visible.
>
> Scenario #4:
> Parent component A overrides isVisible and doesn't use
> callOnBeforeRenderIfNotVisible. Then, if it visible, all its children
> are recursively processed, otherwise no before/after rendering happens
> to them at all. Even if they override callOnBeforeRenderIfNotVisible.
> That's first confusing point. Javadocs on
> callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be
> called even if component is not visible, but it is a lie.
> onBeforeRender will be called only if (component is visible OR
> callOnBeforeRenderIfNotVisible returns true) AND onBeforeRender was
> called on parent.
>
> Thoughts:
> 1) Javadocs on callOnBeforeRenderIfNotVisible are wrong. See above,
> there are conditions when onBeforeRender on B won't be called even if
> it returns true from callOnBeforeRenderIfNotVisible.
> 2) Child behavior depends on parent's.
> 3) There is no way to set isVisible to FALSE in parent component and
> avoid processing children (because Wicket requires calling
> super.onBeforeRender which processes children). I'm thinking about a
> feature request for this one.
>
> This all seems to be very complicated & confusing. I hope my analisys
> will help to invent better behavior.
>

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



Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior

2008-11-20 Thread Marat Radchenko
Hello, Wicket team and Wicket users.

We broke our mind this week while trying to understand onBeforeRender behavior.

Scenario #1:
Parent component A overrides onBeforeRender (and sets visibility
there) and returns true from callOnBeforeRenderIfNotVisible. Child
component B does the same. Then, onBeforeRender always happens on both
components regardless any of them is visible or not.
Good, but if A calculates isVisible = true then there it is impossible
for component B to become visible (well, actually B could set
visibility on A but this is very error-prone) so there's no point in
invoking onBeforeRender because B won't be rendered.

Scenario #2:
Parent component A overrides isVisible (and sets visibility there).
Child component B overrides isVisible too. Then B onBeforeRender will
be called only if A is visible and B is visible.
Good, no unnecessary job is done (B won't be processed at all when A
is not visible).

Scenario #3:
Parent component A overrides onBeforeRender and
callOnBeforeRenderIfNotVisible (and sets visibility there to FALSE).
Child B doesn't override callOnBeforeRenderIfNotVisible and doesn't
override isVisible. Then B's onBeforeRender will be called unless B is
not visible.

Scenario #4:
Parent component A overrides isVisible and doesn't use
callOnBeforeRenderIfNotVisible. Then, if it visible, all its children
are recursively processed, otherwise no before/after rendering happens
to them at all. Even if they override callOnBeforeRenderIfNotVisible.
That's first confusing point. Javadocs on
callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be
called even if component is not visible, but it is a lie.
onBeforeRender will be called only if (component is visible OR
callOnBeforeRenderIfNotVisible returns true) AND onBeforeRender was
called on parent.

Thoughts:
1) Javadocs on callOnBeforeRenderIfNotVisible are wrong. See above,
there are conditions when onBeforeRender on B won't be called even if
it returns true from callOnBeforeRenderIfNotVisible.
2) Child behavior depends on parent's.
3) There is no way to set isVisible to FALSE in parent component and
avoid processing children (because Wicket requires calling
super.onBeforeRender which processes children). I'm thinking about a
feature request for this one.

This all seems to be very complicated & confusing. I hope my analisys
will help to invent better behavior.

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



Re: Feature idea: sealed flag on MarkupContainer

2008-11-20 Thread Peter Ertl

I was thinking about something like this:

[warning, sketchy pseudo code will follow]

 method org.apache.wicket.MarkupContainer.add(Component... children) :

   -> call empty overridable method onComponentAdd(Component child)  
for each component

   -> add component

   protected void onComponentAdd(Component child) { /* overridable */ }



Am 20.11.2008 um 12:30 schrieb John Krasnay:

Yeah, I thought about that. The problem is add() is usually called  
from

a component's constructor, so you would have a case of a constructor
(indirectly) calling a non-final method,

jk

On Thu, Nov 20, 2008 at 11:27:39AM +0100, Peter Ertl wrote:

Wouldn't it be more powerful to override / hook into the process of
adding a component of a container?

Something like that ...

new WebMarkupContainer(id)
{
 @Override
 public void onComponentAdd(Component child)
 {
   // check the sealed flag, decorate the child, throw exception, or
do [whatever]
 }
}




Am 20.11.2008 um 05:25 schrieb John Krasnay:


Hi folks,

In my current Wicket app I have a panel that contains a vertically
stacked list of sub-panels. Because the precise list of sub-panels  
is

not known until runtime, I've implemented this with a RepeatingView.
My
parent panel has the following methods that I use to build the  
list of

sub-panels ("rv" is my RepeatingView instance):

public void addSubPanel(Panel subPanel) { rv.add(subPanel); }
public String newSubPanelId() { return rv.newChildId(); }

I use this same pattern in a number of other instances such as menus
and
button bars.

The problem is that I often mistakenly call add instead of
addSubPanel,
which of course fails at render time with an exception that I always
find hard to decipher.

It would be nice if there was a way to "seal" a MarkupContainer  
once I

had populated it such that any subsequent call to add, remove, or
replace would fail immediately with an exception. This would make it
much easier to find out where I had made the mistake.

Does anyone else think this would be a worthwhile feature?

jk

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



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



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



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



Re: Feature idea: sealed flag on MarkupContainer

2008-11-20 Thread John Krasnay
Yeah, I thought about that. The problem is add() is usually called from
a component's constructor, so you would have a case of a constructor
(indirectly) calling a non-final method,

jk

On Thu, Nov 20, 2008 at 11:27:39AM +0100, Peter Ertl wrote:
> Wouldn't it be more powerful to override / hook into the process of  
> adding a component of a container?
> 
> Something like that ...
> 
> new WebMarkupContainer(id)
> {
>   @Override
>   public void onComponentAdd(Component child)
>   {
> // check the sealed flag, decorate the child, throw exception, or  
> do [whatever]
>   }
> }
> 
> 
> 
> 
> Am 20.11.2008 um 05:25 schrieb John Krasnay:
> 
> >Hi folks,
> >
> >In my current Wicket app I have a panel that contains a vertically
> >stacked list of sub-panels. Because the precise list of sub-panels is
> >not known until runtime, I've implemented this with a RepeatingView.  
> >My
> >parent panel has the following methods that I use to build the list of
> >sub-panels ("rv" is my RepeatingView instance):
> >
> > public void addSubPanel(Panel subPanel) { rv.add(subPanel); }
> > public String newSubPanelId() { return rv.newChildId(); }
> >
> >I use this same pattern in a number of other instances such as menus  
> >and
> >button bars.
> >
> >The problem is that I often mistakenly call add instead of  
> >addSubPanel,
> >which of course fails at render time with an exception that I always
> >find hard to decipher.
> >
> >It would be nice if there was a way to "seal" a MarkupContainer once I
> >had populated it such that any subsequent call to add, remove, or
> >replace would fail immediately with an exception. This would make it
> >much easier to find out where I had made the mistake.
> >
> >Does anyone else think this would be a worthwhile feature?
> >
> >jk
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

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



Generics changes in 1.4-rc1

2008-11-20 Thread aditsu

Hi, I've been using m3 for a while and just tried switching to rc1. I found
several problems:
- LabelTree.getNodeTextModel requires IModel and returns IModel. I was
overriding it and returning a Model, but I can't do that anymore.
Why not just return IModel ?
- RatingPanel now requires an IModel for the rating, but I was
using IModel. How can I show "rated 3.6 from 7 votes" now? Can it
use IModel instead?
- BaseTree requires IModel; I was using a Model with a
DefaultTreeModel object, but I can't do that anymore (TreeModel is not
necessarily Serializable). Why not just require IModel
?

Adrian
-- 
View this message in context: 
http://www.nabble.com/Generics-changes-in-1.4-rc1-tp20599173p20599173.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket 1.3.5 behind a front-end proxy

2008-11-20 Thread Anton Veretennikov
Resolved. Hosting provider did something.

Thank you all.

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



Re: page refresh cleans my page state

2008-11-20 Thread Ernesto Reinaldo Barreiro
store the value on the session? make it a static member  variable or store
it at application level? it all depends on what you want: the value to
change independently for each user or be the "same" for all users...
Ernesto

On Thu, Nov 20, 2008 at 11:30 AM, Singh Mukesh <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I am using wicket. I have a page with one links which increase the counter
> value based on user click on the link, for all these actions I am using
> Ajax. For instance user click 5 times on link the counter shows value 5. It
> is ok but if I click on browsers refresh button all changes are lost and it
> shows the counter value 0 instead of 5. How to handle the refresh button?
>
> Please find the code below.
>
> TestPage.java
>
> import org.apache.wicket.PageParameters;
> import org.apache.wicket.ajax.AjaxRequestTarget;
> import org.apache.wicket.ajax.markup.html.AjaxLink;
> import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.model.IModel;
> import org.apache.wicket.model.Model;
>
> public class TestPage extends WebPage {
>
>public TestPage(PageParameters parameters) {
>super(parameters);
>final Model modell = new Model(new
> Integer(0));
>// Slik at telleverdien legges i session
>setDefaultModel(modell);
>final Label telleLabel = new Label("teller", modell);
>telleLabel.setOutputMarkupId(true);
>final Label hashcodeLabel = new Label("hashcode", new
> IModel() {
>private static final long serialVersionUID = 1L;
>
>public String getObject() {
>return
> String.valueOf(System.identityHashCode(TestPage.this));
>}
>
>public void setObject(String object) {
>/* NOOP */
>}
>
>public void detach() {
>/* NOOP */
>}
>
>});
>hashcodeLabel.setOutputMarkupId(true);
>add(telleLabel);
>add(new AjaxLink("link", modell) {
>private static final long serialVersionUID = 1L;
>
>@Override
>public void onClick(AjaxRequestTarget target) {
>// Øk det delte modellobjektet
>Integer tall = getModelObject();
>int verdi = tall.intValue() + 1;
>tall = new Integer(verdi);
>setModelObject(tall);
>// Fortell klienten hvilken komponent som
> skal oppdateres
>target.addComponent(telleLabel);
>target.addComponent(hashcodeLabel);
>}
>});
>add(hashcodeLabel);
>add(new AjaxCheckBox("versioned", new
> Model(Boolean.TRUE)) {
>private static final long serialVersionUID = 1L;
>
>@Override
>protected void onUpdate(AjaxRequestTarget target) {
>
>  setVersioned(this.getModelObject().booleanValue());
>}
>
>});
>setVersioned(true);
>}
>
>
>
>
> }
>
>
>
> TestApplication.java
>
> import org.apache.wicket.Page;
> import org.apache.wicket.Request;
> import org.apache.wicket.Response;
> import org.apache.wicket.Session;
> import org.apache.wicket.protocol.http.WebApplication;
>
> public class TestApplication extends WebApplication {
>
>@Override
>public Class getHomePage() {
>return TestPage.class;
>}
>
> }
>
> TestPage.html
>
>   xmlns="http://www.w3.org/1999/xhtml";
>  xmlns:wicket="http://wicket.apache.org/";>
> 
>
>Testside
> 
> 
> wicket:id="link">+ 0
>Denne portleten har hashCode lik  wicket:id="hashcode">34563.
> class="portlet-form-field" wicket:id="versioned">  class="portlet-form-label">Versjonert
> 
> 
>
>
> Please suggest me the way how to handle the refresh button problem.
>
> Please do the needful.
>
>
> Med vennlig hilsen
>
> MUKESH SINGH
> CAPGEMINI Consultant
> Arrive AS
> T (+47) 46 47 90 16
> E-post: [EMAIL PROTECTED]
> http://servicedesk.arrive.no
>
>
>


page refresh cleans my page state

2008-11-20 Thread Singh Mukesh

Hi,

I am using wicket. I have a page with one links which increase the counter 
value based on user click on the link, for all these actions I am using Ajax. 
For instance user click 5 times on link the counter shows value 5. It is ok but 
if I click on browsers refresh button all changes are lost and it shows the 
counter value 0 instead of 5. How to handle the refresh button?

Please find the code below.

TestPage.java

import org.apache.wicket.PageParameters;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

public class TestPage extends WebPage {

public TestPage(PageParameters parameters) {
super(parameters);
final Model modell = new Model(new 
Integer(0));
// Slik at telleverdien legges i session
setDefaultModel(modell);
final Label telleLabel = new Label("teller", modell);
telleLabel.setOutputMarkupId(true);
final Label hashcodeLabel = new Label("hashcode", new 
IModel() {
private static final long serialVersionUID = 1L;

public String getObject() {
return 
String.valueOf(System.identityHashCode(TestPage.this));
}

public void setObject(String object) {
/* NOOP */
}

public void detach() {
/* NOOP */
}

});
hashcodeLabel.setOutputMarkupId(true);
add(telleLabel);
add(new AjaxLink("link", modell) {
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
// Øk det delte modellobjektet
Integer tall = getModelObject();
int verdi = tall.intValue() + 1;
tall = new Integer(verdi);
setModelObject(tall);
// Fortell klienten hvilken komponent som skal 
oppdateres
target.addComponent(telleLabel);
target.addComponent(hashcodeLabel);
}   
});
add(hashcodeLabel);
add(new AjaxCheckBox("versioned", new 
Model(Boolean.TRUE)) {
private static final long serialVersionUID = 1L;

@Override
protected void onUpdate(AjaxRequestTarget target) {

setVersioned(this.getModelObject().booleanValue());
}

});
setVersioned(true);
}




}



TestApplication.java

import org.apache.wicket.Page;
import org.apache.wicket.Request;
import org.apache.wicket.Response;
import org.apache.wicket.Session;
import org.apache.wicket.protocol.http.WebApplication;

public class TestApplication extends WebApplication {

@Override
public Class getHomePage() {
return TestPage.class;
}

}

TestPage.html 

http://www.w3.org/1999/xhtml";  
  xmlns:wicket="http://wicket.apache.org/";>


Testside


+ 0
Denne portleten har hashCode lik 34563.
 Versjonert




Please suggest me the way how to handle the refresh button problem.

Please do the needful.


Med vennlig hilsen

MUKESH SINGH
CAPGEMINI Consultant
Arrive AS
T (+47) 46 47 90 16
E-post: [EMAIL PROTECTED]
http://servicedesk.arrive.no




Re: Feature idea: sealed flag on MarkupContainer

2008-11-20 Thread Peter Ertl
Wouldn't it be more powerful to override / hook into the process of  
adding a component of a container?


Something like that ...

new WebMarkupContainer(id)
{
  @Override
  public void onComponentAdd(Component child)
  {
// check the sealed flag, decorate the child, throw exception, or  
do [whatever]

  }
}




Am 20.11.2008 um 05:25 schrieb John Krasnay:


Hi folks,

In my current Wicket app I have a panel that contains a vertically
stacked list of sub-panels. Because the precise list of sub-panels is
not known until runtime, I've implemented this with a RepeatingView.  
My

parent panel has the following methods that I use to build the list of
sub-panels ("rv" is my RepeatingView instance):

 public void addSubPanel(Panel subPanel) { rv.add(subPanel); }
 public String newSubPanelId() { return rv.newChildId(); }

I use this same pattern in a number of other instances such as menus  
and

button bars.

The problem is that I often mistakenly call add instead of  
addSubPanel,

which of course fails at render time with an exception that I always
find hard to decipher.

It would be nice if there was a way to "seal" a MarkupContainer once I
had populated it such that any subsequent call to add, remove, or
replace would fail immediately with an exception. This would make it
much easier to find out where I had made the mistake.

Does anyone else think this would be a worthwhile feature?

jk

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



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



Re: Two wicket apps

2008-11-20 Thread kan
Any ideas on it?

 Yet another question. In my admin application I want to have a link
 "show client screens". The link must follow to the main site with a
 client already signed it (in other words the WebSession, but from
different app is set to hold
 chosen client id). What is a way to do it?

-- 
WBR, kan.

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