Re: TabbedPanel and model load...

2008-02-11 Thread Martijn Lindhout
because I use the domain objects directly,. without any DTO's, I have to use
the long conversation pattern. That means I have to store the domain object
somewhere in the session and let the loadabledetachable model retrieve it
from there?

2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:

 then you have to use a bean, and on confirm apply changes from the
 bean to the persistent entity. the only other alternative i know of is
 to use the long conversation pattern which i am not really a fan of.

 -igor


 On Feb 10, 2008 11:25 PM, Martijn Lindhout [EMAIL PROTECTED]
 wrote:
  ok, that makes sense.
 
  But what if I have a Hibernate persisted entity that I want to edit in
  multiple actions? Say I have an order with orderlines, and I want to add
 and
  remove them at will, and in the end save or rollback all the changes? I
  don't want the intermediate add and removes propagate directly to the
  database, only at 'confirm'.
 
 
  2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:
  
   the other constructor i presume is getting a persistent entity? so
   hibernate/jpa will flush state back to db at the end of request, thats
   why that works.
  
   -igor
  
  
   On Feb 9, 2008 11:08 AM, Martijn Lindhout [EMAIL PROTECTED]
   wrote:
ok, thanx, that seems to work.
   
And what about the other constructor, when editing an existing
 entity?
   
2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:
   

 setModel(new CompoundPropertyModel(new LoadableDetachableModel(){

 ^ that is bad because ldm is cleared between requests, thats why
 its
 called loadable

 just do this

 setModel(new CPM(new Employee()));

 -igor


 On Feb 9, 2008 10:45 AM, Martijn Lindhout 
 [EMAIL PROTECTED]
 wrote:
  Hi,
 
  I have a page, with those two constructors, the first for
 editing a
   new
  employee, the second for editing an existing.
 
  public EditEmployee() {
  setModel(new CompoundPropertyModel(new
 LoadableDetachableModel(){
  protected Object load() {
  return new Employee();
  }
  }));
  init();
  }
 
  public EditEmployee(final Long id) {
  setModel(new CompoundPropertyModel(new
 LoadableDetachableModel(){
  protected Object load() {
  return empRepository.getEmployee(id);
  }
  }));
  init();
  }
 
  Because the Employee info is relatively much, I separate it in
 two
 panels in
  a tabpanel. The hierarchy is: Page - Form - TabbedPanel -
 several
 Panels
  The problem is, that when I enter the formfields on the panels,
 they
   got
  valided, but then a new Employee instance is created, and the
 FormComponent
  values are not copied to the newly instantiated Employee.
 They're
   null.
 
  I did some tests and it appears that on each panel switch, the
 Model.load is
  called, and a new Employee is returned.
 
  What's going wrong here
  --
  Martijn Lindhout
  JointEffort IT Services
  http://www.jointeffort.nl
  [EMAIL PROTECTED]
  +31 (0)6 18 47 25 29
 


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


   
   
--
   
Martijn Lindhout
JointEffort IT Services
http://www.jointeffort.nl
[EMAIL PROTECTED]
+31 (0)6 18 47 25 29
   
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
  --
  Martijn Lindhout
  JointEffort IT Services
  http://www.jointeffort.nl
  [EMAIL PROTECTED]
  +31 (0)6 18 47 25 29
 

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




-- 
Martijn Lindhout
JointEffort IT Services
http://www.jointeffort.nl
[EMAIL PROTECTED]
+31 (0)6 18 47 25 29


Re: New tooltip component I have created

2008-02-11 Thread Nino Saturnino Martinez Vazquez Wael

Whats wrong with the stuff in maven?

http://wicketstuff.org/maven/repository/org/wicketstuff/wicketstuff-minis/1.3.0-SNAPSHOT/

richardwilko wrote:

Hi, I have added my code to the wicketstuff-minis (package called
org.wicketstuff.minis.prototipbehaviour).  It would be nice to be able to
just download a jar file, rather than have to check out the source.



Martijn Dashorst wrote:
  

Should we create a wicket-minis-1.3 release?
Martijn

On 2/10/08, Igor Vaynberg [EMAIL PROTECTED] wrote:


yep

-igor


On Feb 10, 2008 10:37 AM, richardwilko [EMAIL PROTECTED]
wrote:
  

Ive been looking through some other posts, would I be right in thinking


that
  

I should add my code into the wicketstuff minis project rather than


create a
  

new one.  It is only 3 Java files + some bundled javascript / css /


images.
  

--
View this message in context:


http://www.nabble.com/New-tooltip-component-I-have-created-tp15391312p15399576.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]


  

--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1





  


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


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



Re: Block second click

2008-02-11 Thread Timo Rantalaiho
On Mon, 11 Feb 2008, Johan Compagner wrote:
 this code doesn't work at all.

Ah, thanks for clearing that out :)

The nth rule of the Internets: to find a working solution,
post a wrong solution.

Best wishes,
Timo

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

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



Re: TabbedPanel and model load...

2008-02-11 Thread Timo Rantalaiho
On Mon, 11 Feb 2008, Martijn Lindhout wrote:
 because I use the domain objects directly,. without any DTO's, I have to use
 the long conversation pattern. That means I have to store the domain object
 somewhere in the session and let the loadabledetachable model retrieve it
 from there?

Depends on which session you're talkin about :)

For me the normal way is to store the domain object in a
normal Model during the editing, and then when saving the
changes update it to the database (either by copying the
values or with Hibernate merge, which may or may not work
for you).

Best wishes,
Timo

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

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



Re: n^2 loop in MarkupContainer?

2008-02-11 Thread Al Maw
The children field is private to Component, so I figure we could make
children transient, double the array size each time each time we add
components if it's not big enough (like ArrayList does), and then in
detach() we could copy the children over to a non-transient variable
and null out the transient field. We should do some cleverness to
avoid the copy if things haven't changed between attach()/detach().

Al

On 11/02/2008, Nino Saturnino Martinez Vazquez Wael
[EMAIL PROTECTED] wrote:
 Sorry for previous post.. It was a listview.. not dataview

 Meetesh Karia wrote:
  It appeared to be that way after stepping through the code many times
  in a debugger but that's definitely not conclusive evidence.  I'll try
  and come up with a better measure of what's going on.
 
  Thanks,
  Meetesh
 
  Matej Knopp wrote:
  Indeed, the reason for it is to reduce memory consumption. Right now,
  I don't see any easy way around, are you absolutely sure that it
  causes you performance problems?
 
  -Matej
 
  On Feb 11, 2008 2:15 PM, Meetesh Karia [EMAIL PROTECTED] wrote:
 
  Hi all, I'm using DataView in wicket 1.3 and we have ~400 items that
  are
  returned by a data provider.  I'd expect the adding of the items to be
  rather quick but it turns out that it's not and it looks like the
  culprit might be MarkupContainer.put.  That method expands the children
  array 1 entry at a time which makes the loop of adding the items n^2.
 
  Is there a good reason for this loop to be n^2 (memory conservation
  perhaps)?  Is there any easy way around it?
 
  Thanks,
  Meetesh
 
 
 
 
 
 
 

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


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



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



Re: n^2 loop in MarkupContainer?

2008-02-11 Thread Johan Compagner
no don't introduce a transient field for that. (its not serialized but in
memory its an extra slot)
We could that by using the same field and compress it in detach.

The problem i also see is that we then have to have a count, how much is
already filled, or walk over it to find the first null in the array...(see *
private* *final* *int* children_size())

On Feb 11, 2008 2:56 PM, Al Maw [EMAIL PROTECTED] wrote:

 The children field is private to Component, so I figure we could make
 children transient, double the array size each time each time we add
 components if it's not big enough (like ArrayList does), and then in
 detach() we could copy the children over to a non-transient variable
 and null out the transient field. We should do some cleverness to
 avoid the copy if things haven't changed between attach()/detach().

 Al

 On 11/02/2008, Nino Saturnino Martinez Vazquez Wael
  [EMAIL PROTECTED] wrote:
  Sorry for previous post.. It was a listview.. not dataview
 
  Meetesh Karia wrote:
   It appeared to be that way after stepping through the code many times
   in a debugger but that's definitely not conclusive evidence.  I'll try
   and come up with a better measure of what's going on.
  
   Thanks,
   Meetesh
  
   Matej Knopp wrote:
   Indeed, the reason for it is to reduce memory consumption. Right now,
   I don't see any easy way around, are you absolutely sure that it
   causes you performance problems?
  
   -Matej
  
   On Feb 11, 2008 2:15 PM, Meetesh Karia [EMAIL PROTECTED]
 wrote:
  
   Hi all, I'm using DataView in wicket 1.3 and we have ~400 items that
   are
   returned by a data provider.  I'd expect the adding of the items to
 be
   rather quick but it turns out that it's not and it looks like the
   culprit might be MarkupContainer.put.  That method expands the
 children
   array 1 entry at a time which makes the loop of adding the items
 n^2.
  
   Is there a good reason for this loop to be n^2 (memory conservation
   perhaps)?  Is there any easy way around it?
  
   Thanks,
   Meetesh
  
  
  
  
  
  
  
 
  --
  Nino Martinez Wael
  Java Specialist @ Jayway DK
  http://www.jayway.dk
  +45 2936 7684
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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




Re: Exception occurring in 1.3.1

2008-02-11 Thread Andrew Berman
No, I'm not using Wicket-Stuff.  I am using:


   1. wicket-1.3.1.jar
   2. wicket-datetime-1.3.1.jar
   3. wicket-extensions-1.3.1.jar
   4. wicket-ioc-1.3.1.jar
   5. wicket-spring-1.3.1.jar
   6. wicket-spring-annot-1.3.1.jar
   7. wicket-velocity-1.3.1.jar


On Feb 10, 2008 11:14 AM, Martijn Dashorst [EMAIL PROTECTED]
wrote:

 What additional (wicket stuff?) components are you using?
 Martijn

 On 2/10/08, Andrew Berman [EMAIL PROTECTED] wrote:
 
  I never explicitly reference any WIcket JS in my html.  Whatever the
 Java
  code spits out for JS references is all I'm using.  I searched my code
 and
  I'm not using a single reference any more to the wicket.* packages.  I'm
  not
  really sure what is going on.
 
  On Feb 10, 2008 5:52 AM, Martijn Dashorst [EMAIL PROTECTED]
  wrote:
 
   But your javascript/page or something else is referencing old wicket
   1.2style Wicket-ajax javascript resource.
   java.lang.ClassNotFoundException:
  wicket.ajax.AbstractDefaultAjaxBehavior
  
   Which is not *org.apache.*wicket
  
   Martijn
  
   On 2/10/08, Andrew Berman [EMAIL PROTECTED] wrote:
   
FYI - I do not have any old wicket jars in the classpath, they're
 all
1.3.1versions
   
On Feb 9, 2008 8:41 PM, Andrew Berman [EMAIL PROTECTED] wrote:
   
 Anyone else getting this exception:

 [ERROR] 23:06:32 SharedResourceRequestTarget - shared resource
 wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax.js not found
 [ERROR] 23:08:24 SharedResourceRequestTarget - unable to lazily
   register
 shared resource wicket.ajax.AbstractDefaultAjaxBehavior/wicket-
  ajax.js
 java.lang.ClassNotFoundException:
wicket.ajax.AbstractDefaultAjaxBehavior
 at org.apache.catalina.loader.WebappClassLoader.loadClass(
 WebappClassLoader.java:1358)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(
 WebappClassLoader.java:1204)
 at
org.apache.wicket.application.DefaultClassResolver.resolveClass
 (DefaultClassResolver.java:103)
 at

   
  
 
 org.apache.wicket.request.target.resource.SharedResourceRequestTarget.respond
 (SharedResourceRequestTarget.java:146)
 at
org.apache.wicket.request.AbstractRequestCycleProcessor.respond
 (AbstractRequestCycleProcessor.java:103)
 at org.apache.wicket.RequestCycle.processEventsAndRespond(
 RequestCycle.java:1172)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java
  :1241)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java
   :1316)
 at org.apache.wicket.RequestCycle.request(
 RequestCycle.java
   :493)
 at org.apache.wicket.protocol.http.WicketFilter.doGet(
 WicketFilter.java:354)
 at org.apache.wicket.protocol.http.WicketServlet.doGet(
 WicketServlet.java:121)


   
  
  
  
   --
   Buy Wicket in Action: http://manning.com/dashorst
   Apache Wicket 1.3.1 is released
   Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
  
 



 --
 Buy Wicket in Action: http://manning.com/dashorst
 Apache Wicket 1.3.1 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1



Mounting a CompressedResource

2008-02-11 Thread Ned Collyer

I was hoping to compress my stylesheet and have it available at

/style/mystyle.css

I'm having a great deal of difficulty getting this working. - i can
successfully get it on resource/mypackage.MyClass/whatver, but this is not
appropriate.

I've searched this forum and google, and i guess what I'm after is a concise
example of exactly how to do this.

http://www.nabble.com/wicketstuff-rome-and-mounting-resources-td15266406.html#a15266406
was a bit confusing, as were the links from it, and none really deal with
the compressed resource.
-- 
View this message in context: 
http://www.nabble.com/Mounting-a-CompressedResource-tp15422522p15422522.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: TabbedPanel and model load...

2008-02-11 Thread Scott Swank
The order has methods createMemento():Memento and applyMemento(Memento
m).  These are used to get objects that contain state.  They can in
turn be applied to the order to set it back to that state at a later
point.  So yes, you fetch the Order, detach it, call applyMemento() if
you have unsaved work, make additional changes to the order, call
createMemento(), and then put that in the session.


On Feb 11, 2008 11:44 AM, Martijn Lindhout [EMAIL PROTECTED] wrote:
 ok. never used memento, so I picked the book and read about it. I'm not sure
 how to implement this. When do I retrieve a memento from the order? And in
 the meantime, while adding and removing lines, is the Order updated and
 saved in the DB? If someone reads the database, will he see the intermediate
 changes?

 Or do I for each add/remove/change the user makes:
 - load the original order,
 - apply any memento's present in a temp space (session)
 - apply new changes
 - create a memento
 - discard changes to DB


 2008/2/11, Scott Swank [EMAIL PROTECTED]:
 
  The order has one or more order mementos (pre/post editing) and each
  order memento has a collection of orderline mementos.  The mementos
  are completely opaque, and only the Order  OrderLine are able to
  inspect them and extract their content -- perhaps by implementing them
  a static inner classes with private mutators.
 
  On Feb 11, 2008 10:36 AM, Martijn Lindhout [EMAIL PROTECTED]
  wrote:
   sounds interesting. Can you explain a bit more? How does this work for
   example in an Order-OrderLine situation where you edit an existing order
  by
   adding and removing orderlines and finally do a commit or rollback?
  
   2008/2/11, Scott Swank [EMAIL PROTECTED]:
  
   
I suggest using the GoF memento pattern here.  You keep your changes
in one or more mementos, which can be kept in the session.  Then you
push the changes back to the domain model when you are happy with
them.  We use this approach for modifying hotel reservations --
particularly because we need to see the price before the change as
well as with the change to generate e-mails, faxes, etc.
   
   
On Feb 11, 2008 10:06 AM, Martijn Lindhout [EMAIL PROTECTED]
wrote:
 I agree that it is *easier*, but I got bored by duplicating my
  domain
model
 in a DTO like structure. And that's cumbersome.
 I saw this hapening in several projects, and in the end we had two
almost
 equals object structures, one with rich behavior, and one with just
  data
and
 structure.

 that's sad or not?


 2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:
 
  well, you will have to disconnect the hibernate session, and store
  it
  in the http session - or some other place. then your model would
  have
  to reconnect the session and pull the entity out of it. its much
  easier to create a bean imho.
 
  -igor
 
 
  On Feb 11, 2008 12:13 AM, Martijn Lindhout 
  [EMAIL PROTECTED]
  wrote:
   because I use the domain objects directly,. without any DTO's, I
have to
  use
   the long conversation pattern. That means I have to store the
  domain
  object
   somewhere in the session and let the loadabledetachable model
retrieve
  it
   from there?
  
   2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:
  
   
then you have to use a bean, and on confirm apply changes from
  the
bean to the persistent entity. the only other alternative i
  know
of is
to use the long conversation pattern which i am not really a
  fan
of.
   
-igor
   
   
On Feb 10, 2008 11:25 PM, Martijn Lindhout 
[EMAIL PROTECTED]
wrote:
 ok, that makes sense.

 But what if I have a Hibernate persisted entity that I want
  to
edit
  in
 multiple actions? Say I have an order with orderlines, and I
want to
  add
and
 remove them at will, and in the end save or rollback all the
  changes? I
 don't want the intermediate add and removes propagate
  directly
to
  the
 database, only at 'confirm'.


 2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:
 
  the other constructor i presume is getting a persistent
entity? so
  hibernate/jpa will flush state back to db at the end of
request,
  thats
  why that works.
 
  -igor
 
 
  On Feb 9, 2008 11:08 AM, Martijn Lindhout 
  [EMAIL PROTECTED]
  wrote:
   ok, thanx, that seems to work.
  
   And what about the other constructor, when editing an
existing
entity?
  
   2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:
  
   
setModel(new CompoundPropertyModel(new
  LoadableDetachableModel(){
   
^ that is bad because ldm is 

Re: wicket-security, everybodyprincipal and only securepages

2008-02-11 Thread Maurice Marrink
also the
 first page a user hits after logging in (usually the home page) is a
 candidate.
Sorry this is not correct, usually that page (the home page) is a
secure page to trigger the automatic login.
I was trying to find more examples of pages typically not secure but i
guess besides public pages on your app / site only the login page has
a valid reason to not be secure.

Maurice

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



Re: TabbedPanel tab names

2008-02-11 Thread James Carman
Oops.  That's what I meant. I had to use StringResourceModel in my
case because I had to supply parameters.

On 2/11/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
 or just ResourceModel

 -igor


 On Feb 11, 2008 11:59 AM, James Carman [EMAIL PROTECTED] wrote:
  Have you tried StringResourceModel?
 
 
  On 2/11/08, Michael Mehrle [EMAIL PROTECTED] wrote:
   Assuming the typical tabbed panel example below - is there a good way to
   grab the tab name from the page's properties file? What I need to do is
   to internationalize the tab name. I guess I could do my own call to grab
   it from the classpath + the property file name. Was hoping
  
   List tabs = new ArrayList();
   tabs.add(new AbstractTab(new Model(first tab))
   { ^^
   public Panel getPanel(String panelId)
   {
   return new TabPanel1(panelId);
   }
   });
  
   -
   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: TabbedPanel tab names

2008-02-11 Thread James Carman
Have you tried StringResourceModel?

On 2/11/08, Michael Mehrle [EMAIL PROTECTED] wrote:
 Assuming the typical tabbed panel example below - is there a good way to
 grab the tab name from the page's properties file? What I need to do is
 to internationalize the tab name. I guess I could do my own call to grab
 it from the classpath + the property file name. Was hoping

 List tabs = new ArrayList();
 tabs.add(new AbstractTab(new Model(first tab))
 { ^^
 public Panel getPanel(String panelId)
 {
 return new TabPanel1(panelId);
 }
 });

 -
 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: TabbedPanel and model load...

2008-02-11 Thread Igor Vaynberg
that sadness is an artifact of how hibernate works. it is
easier/cheaper to create a bean than keep a disconnected session in
your http session, which can be quiet memory intensive. of course
which way you go is up to you.

in a lot of these cases i have noticed that the mapping isnt always
1:1 between what is in the domain model and what is in the ui anyways,
so a bean also makes your ui code a lot leaner.

just my two cents.

-igor


On Feb 11, 2008 10:06 AM, Martijn Lindhout [EMAIL PROTECTED] wrote:
 I agree that it is *easier*, but I got bored by duplicating my domain model
 in a DTO like structure. And that's cumbersome.
 I saw this hapening in several projects, and in the end we had two almost
 equals object structures, one with rich behavior, and one with just data and
 structure.

 that's sad or not?


 2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:
 
  well, you will have to disconnect the hibernate session, and store it
  in the http session - or some other place. then your model would have
  to reconnect the session and pull the entity out of it. its much
  easier to create a bean imho.
 
  -igor
 
 
  On Feb 11, 2008 12:13 AM, Martijn Lindhout [EMAIL PROTECTED]
  wrote:
   because I use the domain objects directly,. without any DTO's, I have to
  use
   the long conversation pattern. That means I have to store the domain
  object
   somewhere in the session and let the loadabledetachable model retrieve
  it
   from there?
  
   2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:
  
   
then you have to use a bean, and on confirm apply changes from the
bean to the persistent entity. the only other alternative i know of is
to use the long conversation pattern which i am not really a fan of.
   
-igor
   
   
On Feb 10, 2008 11:25 PM, Martijn Lindhout [EMAIL PROTECTED]
wrote:
 ok, that makes sense.

 But what if I have a Hibernate persisted entity that I want to edit
  in
 multiple actions? Say I have an order with orderlines, and I want to
  add
and
 remove them at will, and in the end save or rollback all the
  changes? I
 don't want the intermediate add and removes propagate directly to
  the
 database, only at 'confirm'.


 2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:
 
  the other constructor i presume is getting a persistent entity? so
  hibernate/jpa will flush state back to db at the end of request,
  thats
  why that works.
 
  -igor
 
 
  On Feb 9, 2008 11:08 AM, Martijn Lindhout 
  [EMAIL PROTECTED]
  wrote:
   ok, thanx, that seems to work.
  
   And what about the other constructor, when editing an existing
entity?
  
   2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:
  
   
setModel(new CompoundPropertyModel(new
  LoadableDetachableModel(){
   
^ that is bad because ldm is cleared between requests, thats
  why
its
called loadable
   
just do this
   
setModel(new CPM(new Employee()));
   
-igor
   
   
On Feb 9, 2008 10:45 AM, Martijn Lindhout 
[EMAIL PROTECTED]
wrote:
 Hi,

 I have a page, with those two constructors, the first for
editing a
  new
 employee, the second for editing an existing.

 public EditEmployee() {
 setModel(new CompoundPropertyModel(new
LoadableDetachableModel(){
 protected Object load() {
 return new Employee();
 }
 }));
 init();
 }

 public EditEmployee(final Long id) {
 setModel(new CompoundPropertyModel(new
LoadableDetachableModel(){
 protected Object load() {
 return empRepository.getEmployee(id);
 }
 }));
 init();
 }

 Because the Employee info is relatively much, I separate it
  in
two
panels in
 a tabpanel. The hierarchy is: Page - Form - TabbedPanel -
several
Panels
 The problem is, that when I enter the formfields on the
  panels,
they
  got
 valided, but then a new Employee instance is created, and
  the
FormComponent
 values are not copied to the newly instantiated Employee.
They're
  null.

 I did some tests and it appears that on each panel switch,
  the
Model.load is
 called, and a new Employee is returned.

 What's going wrong here
 --
 Martijn Lindhout
 JointEffort IT Services
 http://www.jointeffort.nl
 [EMAIL PROTECTED]
 +31 (0)6 18 47 25 29

   
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
   

wicket-security, everybodyprincipal and only securepages

2008-02-11 Thread Michael Sparer

Hi, 

I'm fiddling around with wasp and swarm. I was wondering if it is possible
to add an EverybodyPrincipal to the current session on session
instantiation.
The problem is the following: I'd like to let my BasePage (from which ALL
pages in my app inherit from) extend SecurePage to be able to control the
actions for all pages with the hive file. But as a SecurePage requires an
authenticated session, I can't let my basepage extend SecurePage.
So I thought, that I could just add a subject containing an
EverybodyPrincipal on session creation. I.e. in the session's constructor or
in the application's newSession method, sothat the session gets
authenticated behind the scenes and the page gets rendered fine.
Unfortunately this results in a Stackoverflow as the Session.get() method
calls the login method and vice-versa... so what's the best way to handle
that?

thanks in advance (to maurice i think ;-))

regards

Michael

-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/wicket-security%2C-everybodyprincipal-and-only-securepages-tp15413102p15413102.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: Again with missing update with AJAX...

2008-02-11 Thread Timo Rantalaiho
On Mon, 11 Feb 2008, Fabrizio Giudici wrote:
 where updateDate() updates the date model. Indeed the model gets  
 correctly updated since I see the new value gets to the database. But  
 the label doesn't get updated. I supposes everything was with the  
 setOutputMarkupId() and eventually with the  
 setOutputMarkupPlaceholderTag(), but clearly I'm missing something else.

Have you looked at whether there is some error in the
ajax debug window (visible in 
-Dwicket.configuration=DEVELOPMENT )?

Have you verified that the date is correct inside the model
object of the Label class after the update? E.g. in the label
do

  @Override public void onBeforeRender() {
  super.onBeforeRender();
  System.out.println(getModelObject());
  }

Best wishes,
Timo

-- 
Timo Rantalaiho   +358-45-6709709
Reaktor Innovations OyURL: http://www.ri.fi/ 

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



Re: n^2 loop in MarkupContainer?

2008-02-11 Thread Nino Saturnino Martinez Vazquez Wael
I've seen this drop in performance too... and with over 2000 items, it 
was very slow.. I fixed it by using something similar to a 
loadabledetachable model.. (turned out that it used the dao on each 
render of an item).. So might not be the same..


regards Nino

Meetesh Karia wrote:
It appeared to be that way after stepping through the code many times 
in a debugger but that's definitely not conclusive evidence.  I'll try 
and come up with a better measure of what's going on.


Thanks,
Meetesh

Matej Knopp wrote:

Indeed, the reason for it is to reduce memory consumption. Right now,
I don't see any easy way around, are you absolutely sure that it
causes you performance problems?

-Matej

On Feb 11, 2008 2:15 PM, Meetesh Karia [EMAIL PROTECTED] wrote:
 
Hi all, I'm using DataView in wicket 1.3 and we have ~400 items that 
are

returned by a data provider.  I'd expect the adding of the items to be
rather quick but it turns out that it's not and it looks like the
culprit might be MarkupContainer.put.  That method expands the children
array 1 entry at a time which makes the loop of adding the items n^2.

Is there a good reason for this loop to be n^2 (memory conservation
perhaps)?  Is there any easy way around it?

Thanks,
Meetesh






  




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


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



Re: n^2 loop in MarkupContainer?

2008-02-11 Thread Meetesh Karia
It appeared to be that way after stepping through the code many times in 
a debugger but that's definitely not conclusive evidence.  I'll try and 
come up with a better measure of what's going on.


Thanks,
Meetesh

Matej Knopp wrote:

Indeed, the reason for it is to reduce memory consumption. Right now,
I don't see any easy way around, are you absolutely sure that it
causes you performance problems?

-Matej

On Feb 11, 2008 2:15 PM, Meetesh Karia [EMAIL PROTECTED] wrote:
  

Hi all, I'm using DataView in wicket 1.3 and we have ~400 items that are
returned by a data provider.  I'd expect the adding of the items to be
rather quick but it turns out that it's not and it looks like the
culprit might be MarkupContainer.put.  That method expands the children
array 1 entry at a time which makes the loop of adding the items n^2.

Is there a good reason for this loop to be n^2 (memory conservation
perhaps)?  Is there any easy way around it?

Thanks,
Meetesh






  


Re: wicket-security, everybodyprincipal and only securepages

2008-02-11 Thread Maurice Marrink
I was wondering if it is possible
 to add an EverybodyPrincipal to the current session on session
 instantiation.

After reading your mail again, trying to recreate the stackoverflow, i
realize you said the EveryBodyPrincipal, the whole time i was reading
is as AllPermissions. :-s
The EveryBodyPrincipal is kind of strange in the sense that you do not
need to add it yourself to a user. It is automatically assigned to
every user if your policy contains one or more
grant
{
.
};
blocks. Note the absence of the principal class and name.
So please don't use it yourself :)

Maurice

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



Re: wicket-tools-extjs

2008-02-11 Thread Jeremy Fergason
I have a simple demo of the guestbook application.  I'll post it online in
the next couple of days.

On Feb 7, 2008 10:54 PM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

 Yes it's normal practice to make a simple project that demonstrates the
 functionality... Like


 http://wicket-stuff.svn.sf.net/svnroot/wicket-stuff/trunk/wicket-contrib-accordion-examples/


 etc.. It usually does not take that long to construct and, is very good
 for users to learn from.


 regards Nino

 Flemming Boller wrote:
  I think you should add HomePage, or something like that, so users can
 see
  how to use this library.
 
  It is not easy to guess that for example many of the components shall
 not be
  in the markup
  when using this library, at least for the normal wicket user.
 
  Anyhow I found out that the ExtJS is a singleton (should it be?) and is
  clearing the children list after rendering.
  I think that is the reason why  the response is rendered empty, when I
 press
  Save button on a ExtJSForm. - just a thought
 
 
  /FLemming
 
  On Feb 7, 2008 11:19 PM, Jeremy Fergason [EMAIL PROTECTED]
 wrote:
 
 
  Yes, that's because I used the wicket archetype to create the project
  originally.  I'll remove TestHomePage.java.
 
  Thanks for the catch!
 
  -Jeremy
 
  On Feb 7, 2008 1:06 PM, Flemming Boller [EMAIL PROTECTED]
 wrote:
 
 
  Hi
 
  Yes, but in your test class (TestHomePage.java) you reference
  HomePage.class
 
  That was why I mentioned it.
 
  /FLemming
 
  On Feb 7, 2008 8:35 PM, Jeremy Fergason [EMAIL PROTECTED]
 
  wrote:
 
  There is no HomePage.java because this is not a wicket application.
 
   It
 
  is
 
  a
  library that you can use in your applications.  If you want to use it
 
  you
 
  can compile it by downloading the source and then compiling with: mvn
  compile, or you can just add the following lines to your applications
 
  POM
 
  and maven will automatically download the appropriate files for you:
 
!-- ExtJS (javascript library) DEPENDENCIES --
 dependency
 groupIdorg.wickettools.extjs/groupId
 artifactIdextjs/artifactId
 version0.1.0/version
 /dependency
 
  also add the following to your repositories section (the files should
 
  be
 
  in
  the global maven repository soon):
 
  repository
  idwicket-tools-exjts/id
namewicket-tools-extjs repository/name
urlhttp://wicket-extjs.sourceforge.net/maven2//url
 /repository
 
 
  On Feb 7, 2008 8:51 AM, Flemming Boller [EMAIL PROTECTED]
 
  wrote:
 
  Hi
 
  I have tried it a little bit, but I think you have forgot to include
 
  some
 
  source files. Like HomePage.java.
 
  /FLemming
 
  On Feb 7, 2008 4:02 AM, Jeremy Fergason [EMAIL PROTECTED]
 
  wrote:
 
  All,
 
  I've been trying to use the ExtJS forms from within wicket.  It
 
  seemed
 
  that
  several people out there were trying to do this with limited
 
  success;
 
  except
  for the occasional person saying they had done it.  I have got the
  integration working OK at this point and would like to make the
  integration
  module available to the community at large.  If you are interested
 
  in
 
  using
  ExtJS forms from within wicket checkout the wicket-tools-extjs
 
  module
 
  at:
 
  www.wickettools.org
 
  I'm pretty new to wicket so please comment on the design with any
  suggestions of how I could improve it.  Also if there is anyone
 
  who
 
  is
 
  interested in helping out I would love to have the support.
 
  Hope you find this useful.
 
  -jdf
 
 
 
 

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


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




TabbedPanel tab names

2008-02-11 Thread Michael Mehrle
Assuming the typical tabbed panel example below - is there a good way to
grab the tab name from the page's properties file? What I need to do is
to internationalize the tab name. I guess I could do my own call to grab
it from the classpath + the property file name. Was hoping 

List tabs = new ArrayList();
tabs.add(new AbstractTab(new Model(first tab)) 
{ ^^
public Panel getPanel(String panelId)
{
return new TabPanel1(panelId);
}
});

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



Re: TabbedPanel tab names

2008-02-11 Thread Igor Vaynberg
or just ResourceModel

-igor


On Feb 11, 2008 11:59 AM, James Carman [EMAIL PROTECTED] wrote:
 Have you tried StringResourceModel?


 On 2/11/08, Michael Mehrle [EMAIL PROTECTED] wrote:
  Assuming the typical tabbed panel example below - is there a good way to
  grab the tab name from the page's properties file? What I need to do is
  to internationalize the tab name. I guess I could do my own call to grab
  it from the classpath + the property file name. Was hoping
 
  List tabs = new ArrayList();
  tabs.add(new AbstractTab(new Model(first tab))
  { ^^
  public Panel getPanel(String panelId)
  {
  return new TabPanel1(panelId);
  }
  });
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



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



Re: wicket-security, everybodyprincipal and only securepages

2008-02-11 Thread Maurice Marrink
First off i would like to see your code as it should not be possible
to create a StackOverFlow.
Second i am not entirely sure why you would want EVERY page to be a secure page.
For instance the login page should not be a secure page, also the
first page a user hits after logging in (usually the home page) is a
candidate.
Anyway since you probably want every page to extend BasePage why not
have a subclass that implements ISecurePage and have all your pages
that should be secure extend that page.
For the implementation of ISecurePage you can simply redirect all
calls to the SecureComponentHelper.

Another option to grant permissions to every user is to put them in a
grant block without a principal like this:
grant
{
//permissions here
};
Note that you do need a logged in user for this to work.

If this is not what you are looking for then how about a little example.

Maurice

On Feb 11, 2008 4:25 PM, Michael Sparer [EMAIL PROTECTED] wrote:

 Hi,

 I'm fiddling around with wasp and swarm. I was wondering if it is possible
 to add an EverybodyPrincipal to the current session on session
 instantiation.
 The problem is the following: I'd like to let my BasePage (from which ALL
 pages in my app inherit from) extend SecurePage to be able to control the
 actions for all pages with the hive file. But as a SecurePage requires an
 authenticated session, I can't let my basepage extend SecurePage.
 So I thought, that I could just add a subject containing an
 EverybodyPrincipal on session creation. I.e. in the session's constructor or
 in the application's newSession method, sothat the session gets
 authenticated behind the scenes and the page gets rendered fine.
 Unfortunately this results in a Stackoverflow as the Session.get() method
 calls the login method and vice-versa... so what's the best way to handle
 that?

 thanks in advance (to maurice i think ;-))

 regards

 Michael

 -
 Michael Sparer
 http://talk-on-tech.blogspot.com
 --
 View this message in context: 
 http://www.nabble.com/wicket-security%2C-everybodyprincipal-and-only-securepages-tp15413102p15413102.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: ModalWindow with Page memory leak

2008-02-11 Thread Lan Boon Ping
Hi,

More information about this memory leak problem.

This problem doesn't happen in version 1.3 (Development/deployment
mode) and only happens in version 1.3.1 (development/deployment mode).

Thanks.

Regards
Boon Ping.

On Feb 12, 2008 7:36 AM, Henrik Lundahl [EMAIL PROTECTED] wrote:
 Hi,

 In my current project we have a page with six AjaxLinks that open
 different ModalWindows. We had implemented sub-classes of ModalWindow
 which had field references to the content Pages (the source of the
 iframes in the ModalWindows) created by ModalWindow.PageCreators. The
 references were there to extract state from the Pages when the
 ModalWindows were closed. The Pages also had field references to the
 ModalWindows in order to call close on them.

 Using this design, the serialization/deserialization increased
 seemingly exponentially for every opened and closed ModalWindow,
 causing a gigantic memory leak. After opening and closing a number of
 ModalWindows, a single close could consume an additional ~70 MB of
 memory.

 Also, in some situations the Page.numericId was zero in
 Page.writeObject, causing a ClassCastException when the Page field
 references were deserialized. Since the numericId was zero, the wrong
 Page (the initial Page) got deserialized.

 As far as I have been able to understand what's happening, the
 problems arise because of the cycles between components and the fact
 that the Pages are deserialized using different ObjectInputStreams.
 I'm not sure how the numericId could become zero.

 Removing the references to the content Pages from the ModalWindow
 sub-classes and using simple Models instead seems to have solved both
 problems.

 Questions:

 What is happening in the serialization/deserialization when this
 behavior arises?

 How can the numericId become zero in Page.writeObject (and
 sub-sequentially in Page.readObject)?

 Is it generally problematic to have field references to Pages in
 Components (or objects)?

 What would the most decoupled approach (object graph wise), thus
 minimizing serialization, be to implementing this?


 Thanks,
 Henrik Lundahl

 -
 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: TabbedPanel and model load...

2008-02-11 Thread Scott Swank
I suggest using the GoF memento pattern here.  You keep your changes
in one or more mementos, which can be kept in the session.  Then you
push the changes back to the domain model when you are happy with
them.  We use this approach for modifying hotel reservations --
particularly because we need to see the price before the change as
well as with the change to generate e-mails, faxes, etc.


On Feb 11, 2008 10:06 AM, Martijn Lindhout [EMAIL PROTECTED] wrote:
 I agree that it is *easier*, but I got bored by duplicating my domain model
 in a DTO like structure. And that's cumbersome.
 I saw this hapening in several projects, and in the end we had two almost
 equals object structures, one with rich behavior, and one with just data and
 structure.

 that's sad or not?


 2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:
 
  well, you will have to disconnect the hibernate session, and store it
  in the http session - or some other place. then your model would have
  to reconnect the session and pull the entity out of it. its much
  easier to create a bean imho.
 
  -igor
 
 
  On Feb 11, 2008 12:13 AM, Martijn Lindhout [EMAIL PROTECTED]
  wrote:
   because I use the domain objects directly,. without any DTO's, I have to
  use
   the long conversation pattern. That means I have to store the domain
  object
   somewhere in the session and let the loadabledetachable model retrieve
  it
   from there?
  
   2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:
  
   
then you have to use a bean, and on confirm apply changes from the
bean to the persistent entity. the only other alternative i know of is
to use the long conversation pattern which i am not really a fan of.
   
-igor
   
   
On Feb 10, 2008 11:25 PM, Martijn Lindhout [EMAIL PROTECTED]
wrote:
 ok, that makes sense.

 But what if I have a Hibernate persisted entity that I want to edit
  in
 multiple actions? Say I have an order with orderlines, and I want to
  add
and
 remove them at will, and in the end save or rollback all the
  changes? I
 don't want the intermediate add and removes propagate directly to
  the
 database, only at 'confirm'.


 2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:
 
  the other constructor i presume is getting a persistent entity? so
  hibernate/jpa will flush state back to db at the end of request,
  thats
  why that works.
 
  -igor
 
 
  On Feb 9, 2008 11:08 AM, Martijn Lindhout 
  [EMAIL PROTECTED]
  wrote:
   ok, thanx, that seems to work.
  
   And what about the other constructor, when editing an existing
entity?
  
   2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:
  
   
setModel(new CompoundPropertyModel(new
  LoadableDetachableModel(){
   
^ that is bad because ldm is cleared between requests, thats
  why
its
called loadable
   
just do this
   
setModel(new CPM(new Employee()));
   
-igor
   
   
On Feb 9, 2008 10:45 AM, Martijn Lindhout 
[EMAIL PROTECTED]
wrote:
 Hi,

 I have a page, with those two constructors, the first for
editing a
  new
 employee, the second for editing an existing.

 public EditEmployee() {
 setModel(new CompoundPropertyModel(new
LoadableDetachableModel(){
 protected Object load() {
 return new Employee();
 }
 }));
 init();
 }

 public EditEmployee(final Long id) {
 setModel(new CompoundPropertyModel(new
LoadableDetachableModel(){
 protected Object load() {
 return empRepository.getEmployee(id);
 }
 }));
 init();
 }

 Because the Employee info is relatively much, I separate it
  in
two
panels in
 a tabpanel. The hierarchy is: Page - Form - TabbedPanel -
several
Panels
 The problem is, that when I enter the formfields on the
  panels,
they
  got
 valided, but then a new Employee instance is created, and
  the
FormComponent
 values are not copied to the newly instantiated Employee.
They're
  null.

 I did some tests and it appears that on each panel switch,
  the
Model.load is
 called, and a new Employee is returned.

 What's going wrong here
 --
 Martijn Lindhout
 JointEffort IT Services
 http://www.jointeffort.nl
 [EMAIL PROTECTED]
 +31 (0)6 18 47 25 29

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

Re: TabbedPanel and model load...

2008-02-11 Thread Martijn Lindhout
I agree that it is *easier*, but I got bored by duplicating my domain model
in a DTO like structure. And that's cumbersome.
I saw this hapening in several projects, and in the end we had two almost
equals object structures, one with rich behavior, and one with just data and
structure.

that's sad or not?

2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:

 well, you will have to disconnect the hibernate session, and store it
 in the http session - or some other place. then your model would have
 to reconnect the session and pull the entity out of it. its much
 easier to create a bean imho.

 -igor


 On Feb 11, 2008 12:13 AM, Martijn Lindhout [EMAIL PROTECTED]
 wrote:
  because I use the domain objects directly,. without any DTO's, I have to
 use
  the long conversation pattern. That means I have to store the domain
 object
  somewhere in the session and let the loadabledetachable model retrieve
 it
  from there?
 
  2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:
 
  
   then you have to use a bean, and on confirm apply changes from the
   bean to the persistent entity. the only other alternative i know of is
   to use the long conversation pattern which i am not really a fan of.
  
   -igor
  
  
   On Feb 10, 2008 11:25 PM, Martijn Lindhout [EMAIL PROTECTED]
   wrote:
ok, that makes sense.
   
But what if I have a Hibernate persisted entity that I want to edit
 in
multiple actions? Say I have an order with orderlines, and I want to
 add
   and
remove them at will, and in the end save or rollback all the
 changes? I
don't want the intermediate add and removes propagate directly to
 the
database, only at 'confirm'.
   
   
2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:

 the other constructor i presume is getting a persistent entity? so
 hibernate/jpa will flush state back to db at the end of request,
 thats
 why that works.

 -igor


 On Feb 9, 2008 11:08 AM, Martijn Lindhout 
 [EMAIL PROTECTED]
 wrote:
  ok, thanx, that seems to work.
 
  And what about the other constructor, when editing an existing
   entity?
 
  2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:
 
  
   setModel(new CompoundPropertyModel(new
 LoadableDetachableModel(){
  
   ^ that is bad because ldm is cleared between requests, thats
 why
   its
   called loadable
  
   just do this
  
   setModel(new CPM(new Employee()));
  
   -igor
  
  
   On Feb 9, 2008 10:45 AM, Martijn Lindhout 
   [EMAIL PROTECTED]
   wrote:
Hi,
   
I have a page, with those two constructors, the first for
   editing a
 new
employee, the second for editing an existing.
   
public EditEmployee() {
setModel(new CompoundPropertyModel(new
   LoadableDetachableModel(){
protected Object load() {
return new Employee();
}
}));
init();
}
   
public EditEmployee(final Long id) {
setModel(new CompoundPropertyModel(new
   LoadableDetachableModel(){
protected Object load() {
return empRepository.getEmployee(id);
}
}));
init();
}
   
Because the Employee info is relatively much, I separate it
 in
   two
   panels in
a tabpanel. The hierarchy is: Page - Form - TabbedPanel -
   several
   Panels
The problem is, that when I enter the formfields on the
 panels,
   they
 got
valided, but then a new Employee instance is created, and
 the
   FormComponent
values are not copied to the newly instantiated Employee.
   They're
 null.
   
I did some tests and it appears that on each panel switch,
 the
   Model.load is
called, and a new Employee is returned.
   
What's going wrong here
--
Martijn Lindhout
JointEffort IT Services
http://www.jointeffort.nl
[EMAIL PROTECTED]
+31 (0)6 18 47 25 29
   
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
  --
 
  Martijn Lindhout
  JointEffort IT Services
  http://www.jointeffort.nl
  [EMAIL PROTECTED]
  +31 (0)6 18 47 25 29
 


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


   
   
--
Martijn Lindhout
JointEffort IT Services
http://www.jointeffort.nl
[EMAIL PROTECTED]
+31 (0)6 18 47 25 29
   
  
   -
   To 

StringResourceModel - how to pass method call instead of bean

2008-02-11 Thread Michael Mehrle
I actually have a follow up question regarding StringResourceModel - the
tutorial shows this example, which makes sense:

add(new Label(greetings, new StringResourceModel(label.greetings,
this, new Model(user;

Now, if I want to call a method that returns a String instead, like
so...

add(new Label(greetings, new StringResourceModel(label.allAlbums,
this, new Model(getTotalAlbums(;
^^^

...with my properties file having this entry:

label.getTotalAlbums = All Albums: ${someReference}

Obviously, this doesn't work, since the new Model(xxx) call expects a
bean to be passed in. How can I do this with a simple method call? And
what would my someReference var be?

Hope this makes sense - I just want to avoid passing in/creating a bean.

Michael


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of James Carman
Sent: Monday, February 11, 2008 12:04 PM
To: users@wicket.apache.org
Subject: Re: TabbedPanel tab names

Oops.  That's what I meant. I had to use StringResourceModel in my
case because I had to supply parameters.

On 2/11/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
 or just ResourceModel

 -igor


 On Feb 11, 2008 11:59 AM, James Carman [EMAIL PROTECTED]
wrote:
  Have you tried StringResourceModel?
 
 
  On 2/11/08, Michael Mehrle [EMAIL PROTECTED] wrote:
   Assuming the typical tabbed panel example below - is there a good
way to
   grab the tab name from the page's properties file? What I need to
do is
   to internationalize the tab name. I guess I could do my own call
to grab
   it from the classpath + the property file name. Was hoping
  
   List tabs = new ArrayList();
   tabs.add(new AbstractTab(new Model(first tab))
   { ^^
   public Panel getPanel(String panelId)
   {
   return new TabPanel1(panelId);
   }
   });
  
  
-
   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: Block second click

2008-02-11 Thread Matthijs Wensveen

Ah, thanks for clearing that up.
In my case the processing has to be done once and only once, so 
setEnabled(true) need not be called. After successful processing 
setResponsePage(..) is called. So this should still work just for me, 
right? I'll try tomorrow. If that doesn't work, I'll look at JS solutions.


Thanks for all the help,
Matthijs

Johan Compagner wrote:

this code doesn't work at all.

the onclick method isn't called at the same time by 2 request (2 link
clicks)
They are synchronized by wicket itself.

So what happens with the code below is that the first request sets the
enabled to false
then does the processing, then wicket blocks the second request in the mean
time
then the processing is finished, the link is enabled again. That request
does its processing rendering
after it is finished wicket will release the second request and that does
exactly the same thing as the first.

So the heavy stuff is always done twice, but it is done twice in sequence
If you don't want that then the only solution is to block the second click
in the browser using javascript magic.

johan


On Feb 6, 2008 5:12 PM, Timo Rantalaiho [EMAIL PROTECTED] wrote:

  

On Wed, 06 Feb 2008, Matthijs Wensveen wrote:


I have a Link (not Ajax) on a component that does some heavyweight
processing in onClick. During this processing I want to block other
clicks from the same user. Is there a generic way to block multiple
requests on the same link? I would prefer a solution without Ajax /
JavaScript, but if that's impossible then that's okay.
  

Components are stateful, so maybe you could just keep the
state in your Link?

 @Override onClick() {
 if (!isEnabled()) {
 return;  // this shouldnt happen though?
 }
 try {
 setEnabled(false);
 doSomeHeavyWeightProcessing();
 } finally {
 setEnabled(true);
 }
 }

This creates a little race condition but if you can produce
it you could try using a real lock mechanism.

Best wishes,
Timo

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

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





  



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



Re: n^2 loop in MarkupContainer?

2008-02-11 Thread Timo Rantalaiho
Hello all,

Such optimisation should be preceeded by getting hard 
profiling data, right? 

We have some repeaters that get hundreds of Items and the
part of adding child components has not shown up as a
bottleneck when profiling.

It has made us think, though, whether it makes sense to 
output hundreds of rows of data on the screen anyway :)

Best wishes,
Timo

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

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



stateless Image

2008-02-11 Thread Dmitry
How I can create a stateless org.apache.wicket.markup.html.image.Image? 
I thought that just calling new Image(id) will do the job, however 
getStatelessHint() returns false.
It looks like a bug in LocalizedImageResource#isStateless().

I guess it should be 
return resourceReference == null;


wicket-1.3.0
test case

import junit.framework.Assert;import junit.framework.TestCase;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.util.tester.WicketTester;
public class ImageTest extends TestCase {  
public void testStateless() {
WicketTester wt = new WicketTester();
final Image i = new Image(5); 
wt.startComponent(i);
Assert.assertTrue(i.isStateless());  
}
}

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



Again with missing update with AJAX...

2008-02-11 Thread Fabrizio Giudici

Hello.

I've still got problems with updating a page component from AJAX,  
this time from a popup window.


Everything starts with a specific component for entering a date (it's  
a special date, so I can't use the component provided with Wicket):



public class VRCDateField extends Panel
  {
public VRCDateField (final String id, final IModelTVRCDate  
date, final VRCDateModalWindow modal)

  {
super(id);
final String notSet = not set;
final Label label = new Label(label, new  
DefaultModelTString()

  {
@Override
public String getValue()
  {
return DateFormat.format(date.getValue(), notSet);
  }
  });

label.setOutputMarkupId(true);
label.setOutputMarkupPlaceholderTag(true);
add(modal.createOpenLink(edit, date, label));
  }
  }

public class VRCDateModalWindow extends ModalWindow
  {
private VRCDatePage datePage;
private Label label;
private IModelTVRCDate dateModel;

public VRCDateModalWindow (final String id, final Page page)
  {
super(id);
setPageCreator(new ModalWindow.PageCreator()
  {
public Page createPage()
  {
datePage = new VRCDatePage(VRCDateModalWindow.this);
datePage.setDateModel(dateModel);
return datePage;
  }
  });

setInitialWidth(500);
setInitialHeight(170);
setResizable(false);
  }

@Override
public void close (final AjaxRequestTarget target)
  {
super.close(target);
target.addComponent(label);
  }

public AjaxLink createOpenLink (final String id, final  
IModelTVRCDate dateModel, final Label label)

  {
final AjaxLink ajaxLink = new AjaxLink(id)
  {
public void onClick (final AjaxRequestTarget target)
  {
VRCDateModalWindow.this.dateModel = dateModel;
VRCDateModalWindow.this.label = label;
VRCDateModalWindow.super.show(target);
  }
  };

ajaxLink.add(label);

return ajaxLink;
  }
  }

I'm not attaching the whole listing of VRCDatePage, but the key  
points are:



form.add(new AjaxSubmitButton(okButton, form)
  {
protected void onSubmit (final AjaxRequestTarget  
target, final Form form)

  {
updateDate();
modalWindow.close(target);
  }
  });

where updateDate() updates the date model. Indeed the model gets  
correctly updated since I see the new value gets to the database. But  
the label doesn't get updated. I supposes everything was with the  
setOutputMarkupId() and eventually with the  
setOutputMarkupPlaceholderTag(), but clearly I'm missing something else.


--
Fabrizio Giudici, Ph.D. - Java Architect, Project Manager
Tidalwave s.a.s. - We make Java work. Everywhere.
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
[EMAIL PROTECTED] - mobile: +39 348.150.6941




n^2 loop in MarkupContainer?

2008-02-11 Thread Meetesh Karia
Hi all, I'm using DataView in wicket 1.3 and we have ~400 items that are 
returned by a data provider.  I'd expect the adding of the items to be 
rather quick but it turns out that it's not and it looks like the 
culprit might be MarkupContainer.put.  That method expands the children 
array 1 entry at a time which makes the loop of adding the items n^2.


Is there a good reason for this loop to be n^2 (memory conservation 
perhaps)?  Is there any easy way around it?


Thanks,
Meetesh


Re: International char

2008-02-11 Thread Pierre G

Thanks Johan,

I add the doctype :
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;

html xmlns=http://www.w3.org/1999/xhtml;

and now accentued char are directly displayed.

Pierre




Johan Compagner wrote:
 
 i guess if you the output side is correct that then something goes wrong
 in
 the input
 So the files are read as something else, what is the default encoding of
 the
 server itsef?
 Where does java read its file in with?
 
 An xml/xhtml reader doesn't look at meta tag i think. Those only look at
 the
 doctype tag
 
 On Feb 11, 2008 8:55 AM, Pierre G [EMAIL PROTECTED] wrote:
 

 Hello Landry,

 Merci for your help.

 I can be wrong but Apache in not involved in deployment on www.eatj.com.
 It's only Tomcat. The funny thing is if I  access the html directly(
 serve
 by Tomcat), the chars are correctly displayed. But as a Wicket
 componants,
 something goes wrong.

 I am still in the dark ...

 Pierre


 Landry Soules-2 wrote:
 
  Hello Pierre,
 
  I think your problem is due to an Apache mis configuration. This link
  should help you solve it :
 
 http://aide.sivit.fr/index.php?2007/04/21/185-apache2-probleme-de-charset-pages-en-utf-8-vers-iso-8859-1astuce
  It's in french, but i think it won't bother you ;-)
 
  Bon courage !
 
 
 
  Pierre Gilquin a écrit :
  Hi all,
 
  I have legacy html files, I trying to insert in a Wicket app.
 
  The charset is iso-8859-1
  meta HTTP-EQUIV=Content-Type CONTENT=text/html;
 charset=iso-8859-1
 
  The special character (French and German) and not html coded in theses
  files.
  Everything work perfectly on my dev machine. I have try to deploy on a
  www.eatj.com account and I get garbage for theses chars.
 
  What can be possibly wrong ?
 
  Thanks in advance
 
 
 
  Pierre Gilquin
 
  NB:
 
  I have in my WebApplication :
 
  public void init() {
 
  getRequestCycleSettings().setResponseRequestEncoding(iso-8859-1);
 
  }
 
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/International-char-tp15353258p15406958.html
 Sent from the Wicket - User mailing list archive at
 Nabble.comhttp://nabble.com/
 .


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


 
 

-- 
View this message in context: 
http://www.nabble.com/International-char-tp15353258p15410950.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]



Load resource from anywhere on the HDD

2008-02-11 Thread Sébastien Piller

Hello,

I have a little question: my app lets the user upload some files on the 
server side. I would like to put them somewhere on the server hdd, out 
of the context of the application (let say on /dev/etc/uploads), so when 
I redeploy my war (update of the system), all the uploaded files aren't 
going to be deleted.


I just don't know how to reference them, when they are not in any 
package (this files are images, swf, and other binary, and I need to 
display images  swf in html). I searched for some ResourceReference, 
but none of them lookup out of the webapp.


Need I to write my own ResourceLocator/ResourceReference to achieve 
that? Or is there something existant in wicket?


Thank you vm ;)

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



Re: Block second click

2008-02-11 Thread C.
Haven't read the entire thread, but based on a best guess.. Would this
be helpful in some way?


http://blogs.webtide.com/gregw/2006/10/18/116112750.html

Throttling filter
http://jetty.mortbay.org/xref/org/mortbay/servlet/ThrottlingFilter.html


./C


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



Re: Block second click

2008-02-11 Thread Johan Compagner
this code doesn't work at all.

the onclick method isn't called at the same time by 2 request (2 link
clicks)
They are synchronized by wicket itself.

So what happens with the code below is that the first request sets the
enabled to false
then does the processing, then wicket blocks the second request in the mean
time
then the processing is finished, the link is enabled again. That request
does its processing rendering
after it is finished wicket will release the second request and that does
exactly the same thing as the first.

So the heavy stuff is always done twice, but it is done twice in sequence
If you don't want that then the only solution is to block the second click
in the browser using javascript magic.

johan


On Feb 6, 2008 5:12 PM, Timo Rantalaiho [EMAIL PROTECTED] wrote:

 On Wed, 06 Feb 2008, Matthijs Wensveen wrote:
  I have a Link (not Ajax) on a component that does some heavyweight
  processing in onClick. During this processing I want to block other
  clicks from the same user. Is there a generic way to block multiple
  requests on the same link? I would prefer a solution without Ajax /
  JavaScript, but if that's impossible then that's okay.

 Components are stateful, so maybe you could just keep the
 state in your Link?

  @Override onClick() {
  if (!isEnabled()) {
  return;  // this shouldnt happen though?
  }
  try {
  setEnabled(false);
  doSomeHeavyWeightProcessing();
  } finally {
  setEnabled(true);
  }
  }

 This creates a little race condition but if you can produce
 it you could try using a real lock mechanism.

 Best wishes,
 Timo

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

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




Re: PageExpired while ordering DataTable

2008-02-11 Thread Federico Fanton
On Sat, 9 Feb 2008 09:51:45 +0100
Johan Compagner [EMAIL PROTECTED] wrote:

 What wicket version is this?
 
 Normally in 1.3 page expires should never happen, except when your
 page isnt serializeble...

Here it is! My page wasn't serializable, but my Logback configuration hid the 
exception.. :(
Many thanks!
Anyway, what about a setting to turn these exceptions into fatal ones? I 
think it would be useful..


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



Re: International char

2008-02-11 Thread Johan Compagner
i guess if you the output side is correct that then something goes wrong in
the input
So the files are read as something else, what is the default encoding of the
server itsef?
Where does java read its file in with?

An xml/xhtml reader doesn't look at meta tag i think. Those only look at the
doctype tag

On Feb 11, 2008 8:55 AM, Pierre G [EMAIL PROTECTED] wrote:


 Hello Landry,

 Merci for your help.

 I can be wrong but Apache in not involved in deployment on www.eatj.com.
 It's only Tomcat. The funny thing is if I  access the html directly( serve
 by Tomcat), the chars are correctly displayed. But as a Wicket componants,
 something goes wrong.

 I am still in the dark ...

 Pierre


 Landry Soules-2 wrote:
 
  Hello Pierre,
 
  I think your problem is due to an Apache mis configuration. This link
  should help you solve it :
 
 http://aide.sivit.fr/index.php?2007/04/21/185-apache2-probleme-de-charset-pages-en-utf-8-vers-iso-8859-1astuce
  It's in french, but i think it won't bother you ;-)
 
  Bon courage !
 
 
 
  Pierre Gilquin a écrit :
  Hi all,
 
  I have legacy html files, I trying to insert in a Wicket app.
 
  The charset is iso-8859-1
  meta HTTP-EQUIV=Content-Type CONTENT=text/html;
 charset=iso-8859-1
 
  The special character (French and German) and not html coded in theses
  files.
  Everything work perfectly on my dev machine. I have try to deploy on a
  www.eatj.com account and I get garbage for theses chars.
 
  What can be possibly wrong ?
 
  Thanks in advance
 
 
 
  Pierre Gilquin
 
  NB:
 
  I have in my WebApplication :
 
  public void init() {
 
  getRequestCycleSettings().setResponseRequestEncoding(iso-8859-1);
 
  }
 
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/International-char-tp15353258p15406958.html
 Sent from the Wicket - User mailing list archive at 
 Nabble.comhttp://nabble.com/
 .


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




Re: New tooltip component I have created

2008-02-11 Thread Nino Saturnino Martinez Vazquez Wael
presumably on each commit  seperated by a timer.. There is a timer 
checking setting so that bamboo scans each xxx seconds/minutes. Im not 
sure how minis are setup on this..


And btw it seems that the wicket stuff maven repo is a bit hidden from 
the public eyes(I first discovered it this year). Maybe we should write 
something about on the front page of the wiki.


regards Nino

richardwilko wrote:
Ok, I didnt know that that was there.  How often is that jar file produced? 



Nino.Martinez wrote:
  

Whats wrong with the stuff in maven?

http://wicketstuff.org/maven/repository/org/wicketstuff/wicketstuff-minis/1.3.0-SNAPSHOT/






  


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


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



Re: 2 process cant together in a same time - modal window and form in the same page constructor?

2008-02-11 Thread kenixwong

sorry for late reply. johan

i never use the threadpool even the thread as well... To start form the
thread.. i tried for the simple thread program as below

package thread;


import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import java.util.Date;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class GuiThreadRunnable extends JFrame {
 private JLabel lblTime = new JLabel();
 private JButton btnStart = new JButton(Start);
 private JButton btnStop = new JButton(Stop);
 private Thread clock = null;

 public GuiThreadRunnable() {
  initGui();
 }


 public void initGui() {
  setTitle(Runnable);
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  setBounds(200, 200, 400, 400);

  getContentPane().add(lblTime, North);
  JPanel p = new JPanel();

  btnStart.addMouseListener(new MouseAdapter() {
 public void mouseClicked(MouseEvent e) {
  if (clock == null) {
   clock = new Thread (new Clock());
   clock.start();
   System.out.println( clock.start() );
  }
 }
});

  btnStop.addMouseListener(new MouseAdapter() {
 public void mouseClicked(MouseEvent e) {
  if (clock != null  clock.isAlive()) {
   clock.interrupt();
   clock = null;
   System.out.println( clock end );
  }
 }
});
  p.add(btnStart);
  p.add(btnStop);
  getContentPane().add(p, Center);
  setVisible(true);
 }

 public static void main(String[] args) {
  GuiThreadRunnable guiThread = new GuiThreadRunnable();
 }

 class Clock implements Runnable{
  public Clock() {
   super();
  }

  public void run() {
   try {
while (true) {
 lblTime.setText( + new Date());
 System.out.println( run() );
Thread.sleep(1000);
}
   } catch (Exception e) {

   }
  }
 }

}

Fine, it worked. 

Btw, can give me more guide how to implement for your solution given ? 

thanks in advance 
- kenix


Johan Compagner wrote:
 
 no don't touch wicket pages/components in different thread
 Just make a normal threadpool wilt a normal runnable that gets your
 information from that report
 so the page can use that to construct itself after that runnable is done
 and
 informed you about it
 
 generate all the back end data in a thread
 and then construct the report page in a normal request (poll with an ajax
 timer when that data is ready)
 
 There are numerous topics about this in on the wicket list please search.
 
 johan
 
 
 
 On Feb 5, 2008 11:04 AM, kenixwong [EMAIL PROTECTED] wrote:
 

 hi, johan

 Maybe i misunderstood this sentence  so just the parent page with the
 report link 

 that why i moved the report modal component to the child page.

 Can ask one thing here? about the report thread, i need to implement the
 Runnable for the ReportPage or ReportForm ? is that any different ?




 Johan Compagner wrote:
 
  Please reread my previous email. The ajax report link only starts the
  thread and shows the the modal window on the parent page, the report
  page is only set whe the report thread is done
 
  On 2/5/08, kenixwong [EMAIL PROTECTED] wrote:
 
  thanks johan ,
 
  i make a summary here
 
 
   1. report link an ajax link.
 == add a reportAjaxLink  to the parentPage
 
   ajaxLink = new AjaxLink(cancelReportLink){
   public void onClick(AjaxRequestTarget target) {
   if (stopThread == null) {
   stopThread = new Thread
 (ReportPage);
   stopThread.setName
 (ReportPageThread);
   stopThread.setDaemon( true );
   stopThread.start();
   isLoad = true;
   }
   setResponsePage(ReportPage.class);
   }
   };
 
  2. ajax link gets a thread from a thread pool and let that thread
  generate
  the report
== once the link is click, it will start the report page thread
  and
  setResponsePage to the report page
 
  == So, my reportPage will be implements Runnable ( in order put
 in
  thread ) , eg :
 
public ReportPage() extends ParentPage implements Runnble{
 

Re: stateless Image

2008-02-11 Thread Igor Vaynberg
please file a jira issue

-igor


On Feb 11, 2008 6:49 AM, Dmitry [EMAIL PROTECTED] wrote:
 How I can create a stateless org.apache.wicket.markup.html.image.Image?
 I thought that just calling new Image(id) will do the job, however 
 getStatelessHint() returns false.
 It looks like a bug in LocalizedImageResource#isStateless().

 I guess it should be
 return resourceReference == null;


 wicket-1.3.0
 test case

 import junit.framework.Assert;import junit.framework.TestCase;
 import org.apache.wicket.markup.html.image.Image;
 import org.apache.wicket.util.tester.WicketTester;
 public class ImageTest extends TestCase {
 public void testStateless() {
 WicketTester wt = new WicketTester();
 final Image i = new Image(5);
 wt.startComponent(i);
 Assert.assertTrue(i.isStateless());
 }
 }

 -
 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: ModalWindow with Page memory leak

2008-02-11 Thread Matej Knopp
Hi, can you please file a jira bug report and provide a quck start
project that demonstrates this?

-Matej


On Feb 12, 2008 4:15 AM, Lan Boon Ping [EMAIL PROTECTED] wrote:
 Hi,

 More information about this memory leak problem.

 This problem doesn't happen in version 1.3 (Development/deployment
 mode) and only happens in version 1.3.1 (development/deployment mode).

 Thanks.

 Regards
 Boon Ping.


 On Feb 12, 2008 7:36 AM, Henrik Lundahl [EMAIL PROTECTED] wrote:
  Hi,
 
  In my current project we have a page with six AjaxLinks that open
  different ModalWindows. We had implemented sub-classes of ModalWindow
  which had field references to the content Pages (the source of the
  iframes in the ModalWindows) created by ModalWindow.PageCreators. The
  references were there to extract state from the Pages when the
  ModalWindows were closed. The Pages also had field references to the
  ModalWindows in order to call close on them.
 
  Using this design, the serialization/deserialization increased
  seemingly exponentially for every opened and closed ModalWindow,
  causing a gigantic memory leak. After opening and closing a number of
  ModalWindows, a single close could consume an additional ~70 MB of
  memory.
 
  Also, in some situations the Page.numericId was zero in
  Page.writeObject, causing a ClassCastException when the Page field
  references were deserialized. Since the numericId was zero, the wrong
  Page (the initial Page) got deserialized.
 
  As far as I have been able to understand what's happening, the
  problems arise because of the cycles between components and the fact
  that the Pages are deserialized using different ObjectInputStreams.
  I'm not sure how the numericId could become zero.
 
  Removing the references to the content Pages from the ModalWindow
  sub-classes and using simple Models instead seems to have solved both
  problems.
 
  Questions:
 
  What is happening in the serialization/deserialization when this
  behavior arises?
 
  How can the numericId become zero in Page.writeObject (and
  sub-sequentially in Page.readObject)?
 
  Is it generally problematic to have field references to Pages in
  Components (or objects)?
 
  What would the most decoupled approach (object graph wise), thus
  minimizing serialization, be to implementing this?
 
 
  Thanks,
  Henrik Lundahl
 
  -
  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]





-- 
Resizable and reorderable grid components.
http://www.inmethod.com

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



Re: TabbedPanel and model load...

2008-02-11 Thread Martijn Lindhout
ok. never used memento, so I picked the book and read about it. I'm not sure
how to implement this. When do I retrieve a memento from the order? And in
the meantime, while adding and removing lines, is the Order updated and
saved in the DB? If someone reads the database, will he see the intermediate
changes?

Or do I for each add/remove/change the user makes:
- load the original order,
- apply any memento's present in a temp space (session)
- apply new changes
- create a memento
- discard changes to DB

2008/2/11, Scott Swank [EMAIL PROTECTED]:

 The order has one or more order mementos (pre/post editing) and each
 order memento has a collection of orderline mementos.  The mementos
 are completely opaque, and only the Order  OrderLine are able to
 inspect them and extract their content -- perhaps by implementing them
 a static inner classes with private mutators.

 On Feb 11, 2008 10:36 AM, Martijn Lindhout [EMAIL PROTECTED]
 wrote:
  sounds interesting. Can you explain a bit more? How does this work for
  example in an Order-OrderLine situation where you edit an existing order
 by
  adding and removing orderlines and finally do a commit or rollback?
 
  2008/2/11, Scott Swank [EMAIL PROTECTED]:
 
  
   I suggest using the GoF memento pattern here.  You keep your changes
   in one or more mementos, which can be kept in the session.  Then you
   push the changes back to the domain model when you are happy with
   them.  We use this approach for modifying hotel reservations --
   particularly because we need to see the price before the change as
   well as with the change to generate e-mails, faxes, etc.
  
  
   On Feb 11, 2008 10:06 AM, Martijn Lindhout [EMAIL PROTECTED]
   wrote:
I agree that it is *easier*, but I got bored by duplicating my
 domain
   model
in a DTO like structure. And that's cumbersome.
I saw this hapening in several projects, and in the end we had two
   almost
equals object structures, one with rich behavior, and one with just
 data
   and
structure.
   
that's sad or not?
   
   
2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:

 well, you will have to disconnect the hibernate session, and store
 it
 in the http session - or some other place. then your model would
 have
 to reconnect the session and pull the entity out of it. its much
 easier to create a bean imho.

 -igor


 On Feb 11, 2008 12:13 AM, Martijn Lindhout 
 [EMAIL PROTECTED]
 wrote:
  because I use the domain objects directly,. without any DTO's, I
   have to
 use
  the long conversation pattern. That means I have to store the
 domain
 object
  somewhere in the session and let the loadabledetachable model
   retrieve
 it
  from there?
 
  2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:
 
  
   then you have to use a bean, and on confirm apply changes from
 the
   bean to the persistent entity. the only other alternative i
 know
   of is
   to use the long conversation pattern which i am not really a
 fan
   of.
  
   -igor
  
  
   On Feb 10, 2008 11:25 PM, Martijn Lindhout 
   [EMAIL PROTECTED]
   wrote:
ok, that makes sense.
   
But what if I have a Hibernate persisted entity that I want
 to
   edit
 in
multiple actions? Say I have an order with orderlines, and I
   want to
 add
   and
remove them at will, and in the end save or rollback all the
 changes? I
don't want the intermediate add and removes propagate
 directly
   to
 the
database, only at 'confirm'.
   
   
2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:

 the other constructor i presume is getting a persistent
   entity? so
 hibernate/jpa will flush state back to db at the end of
   request,
 thats
 why that works.

 -igor


 On Feb 9, 2008 11:08 AM, Martijn Lindhout 
 [EMAIL PROTECTED]
 wrote:
  ok, thanx, that seems to work.
 
  And what about the other constructor, when editing an
   existing
   entity?
 
  2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:
 
  
   setModel(new CompoundPropertyModel(new
 LoadableDetachableModel(){
  
   ^ that is bad because ldm is cleared between requests,
   thats
 why
   its
   called loadable
  
   just do this
  
   setModel(new CPM(new Employee()));
  
   -igor
  
  
   On Feb 9, 2008 10:45 AM, Martijn Lindhout 
   [EMAIL PROTECTED]
   wrote:
Hi,
   
I have a page, with those two constructors, the
 first
   for
   editing a
 new
employee, the second for editing an existing.
   
public EditEmployee() {
setModel(new 

Re: TabbedPanel and model load...

2008-02-11 Thread Scott Swank
The order has one or more order mementos (pre/post editing) and each
order memento has a collection of orderline mementos.  The mementos
are completely opaque, and only the Order  OrderLine are able to
inspect them and extract their content -- perhaps by implementing them
a static inner classes with private mutators.

On Feb 11, 2008 10:36 AM, Martijn Lindhout [EMAIL PROTECTED] wrote:
 sounds interesting. Can you explain a bit more? How does this work for
 example in an Order-OrderLine situation where you edit an existing order by
 adding and removing orderlines and finally do a commit or rollback?

 2008/2/11, Scott Swank [EMAIL PROTECTED]:

 
  I suggest using the GoF memento pattern here.  You keep your changes
  in one or more mementos, which can be kept in the session.  Then you
  push the changes back to the domain model when you are happy with
  them.  We use this approach for modifying hotel reservations --
  particularly because we need to see the price before the change as
  well as with the change to generate e-mails, faxes, etc.
 
 
  On Feb 11, 2008 10:06 AM, Martijn Lindhout [EMAIL PROTECTED]
  wrote:
   I agree that it is *easier*, but I got bored by duplicating my domain
  model
   in a DTO like structure. And that's cumbersome.
   I saw this hapening in several projects, and in the end we had two
  almost
   equals object structures, one with rich behavior, and one with just data
  and
   structure.
  
   that's sad or not?
  
  
   2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:
   
well, you will have to disconnect the hibernate session, and store it
in the http session - or some other place. then your model would have
to reconnect the session and pull the entity out of it. its much
easier to create a bean imho.
   
-igor
   
   
On Feb 11, 2008 12:13 AM, Martijn Lindhout [EMAIL PROTECTED]
wrote:
 because I use the domain objects directly,. without any DTO's, I
  have to
use
 the long conversation pattern. That means I have to store the domain
object
 somewhere in the session and let the loadabledetachable model
  retrieve
it
 from there?

 2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:

 
  then you have to use a bean, and on confirm apply changes from the
  bean to the persistent entity. the only other alternative i know
  of is
  to use the long conversation pattern which i am not really a fan
  of.
 
  -igor
 
 
  On Feb 10, 2008 11:25 PM, Martijn Lindhout 
  [EMAIL PROTECTED]
  wrote:
   ok, that makes sense.
  
   But what if I have a Hibernate persisted entity that I want to
  edit
in
   multiple actions? Say I have an order with orderlines, and I
  want to
add
  and
   remove them at will, and in the end save or rollback all the
changes? I
   don't want the intermediate add and removes propagate directly
  to
the
   database, only at 'confirm'.
  
  
   2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:
   
the other constructor i presume is getting a persistent
  entity? so
hibernate/jpa will flush state back to db at the end of
  request,
thats
why that works.
   
-igor
   
   
On Feb 9, 2008 11:08 AM, Martijn Lindhout 
[EMAIL PROTECTED]
wrote:
 ok, thanx, that seems to work.

 And what about the other constructor, when editing an
  existing
  entity?

 2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:

 
  setModel(new CompoundPropertyModel(new
LoadableDetachableModel(){
 
  ^ that is bad because ldm is cleared between requests,
  thats
why
  its
  called loadable
 
  just do this
 
  setModel(new CPM(new Employee()));
 
  -igor
 
 
  On Feb 9, 2008 10:45 AM, Martijn Lindhout 
  [EMAIL PROTECTED]
  wrote:
   Hi,
  
   I have a page, with those two constructors, the first
  for
  editing a
new
   employee, the second for editing an existing.
  
   public EditEmployee() {
   setModel(new CompoundPropertyModel(new
  LoadableDetachableModel(){
   protected Object load() {
   return new Employee();
   }
   }));
   init();
   }
  
   public EditEmployee(final Long id) {
   setModel(new CompoundPropertyModel(new
  LoadableDetachableModel(){
   protected Object load() {
   return empRepository.getEmployee(id);
   }
   }));
   init();
   }
  
   Because the Employee info is relatively much, I separate
  it
in
  two
   

Re: TabbedPanel and model load...

2008-02-11 Thread Martijn Lindhout
sounds interesting. Can you explain a bit more? How does this work for
example in an Order-OrderLine situation where you edit an existing order by
adding and removing orderlines and finally do a commit or rollback?

2008/2/11, Scott Swank [EMAIL PROTECTED]:

 I suggest using the GoF memento pattern here.  You keep your changes
 in one or more mementos, which can be kept in the session.  Then you
 push the changes back to the domain model when you are happy with
 them.  We use this approach for modifying hotel reservations --
 particularly because we need to see the price before the change as
 well as with the change to generate e-mails, faxes, etc.


 On Feb 11, 2008 10:06 AM, Martijn Lindhout [EMAIL PROTECTED]
 wrote:
  I agree that it is *easier*, but I got bored by duplicating my domain
 model
  in a DTO like structure. And that's cumbersome.
  I saw this hapening in several projects, and in the end we had two
 almost
  equals object structures, one with rich behavior, and one with just data
 and
  structure.
 
  that's sad or not?
 
 
  2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:
  
   well, you will have to disconnect the hibernate session, and store it
   in the http session - or some other place. then your model would have
   to reconnect the session and pull the entity out of it. its much
   easier to create a bean imho.
  
   -igor
  
  
   On Feb 11, 2008 12:13 AM, Martijn Lindhout [EMAIL PROTECTED]
   wrote:
because I use the domain objects directly,. without any DTO's, I
 have to
   use
the long conversation pattern. That means I have to store the domain
   object
somewhere in the session and let the loadabledetachable model
 retrieve
   it
from there?
   
2008/2/11, Igor Vaynberg [EMAIL PROTECTED]:
   

 then you have to use a bean, and on confirm apply changes from the
 bean to the persistent entity. the only other alternative i know
 of is
 to use the long conversation pattern which i am not really a fan
 of.

 -igor


 On Feb 10, 2008 11:25 PM, Martijn Lindhout 
 [EMAIL PROTECTED]
 wrote:
  ok, that makes sense.
 
  But what if I have a Hibernate persisted entity that I want to
 edit
   in
  multiple actions? Say I have an order with orderlines, and I
 want to
   add
 and
  remove them at will, and in the end save or rollback all the
   changes? I
  don't want the intermediate add and removes propagate directly
 to
   the
  database, only at 'confirm'.
 
 
  2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:
  
   the other constructor i presume is getting a persistent
 entity? so
   hibernate/jpa will flush state back to db at the end of
 request,
   thats
   why that works.
  
   -igor
  
  
   On Feb 9, 2008 11:08 AM, Martijn Lindhout 
   [EMAIL PROTECTED]
   wrote:
ok, thanx, that seems to work.
   
And what about the other constructor, when editing an
 existing
 entity?
   
2008/2/9, Igor Vaynberg [EMAIL PROTECTED]:
   

 setModel(new CompoundPropertyModel(new
   LoadableDetachableModel(){

 ^ that is bad because ldm is cleared between requests,
 thats
   why
 its
 called loadable

 just do this

 setModel(new CPM(new Employee()));

 -igor


 On Feb 9, 2008 10:45 AM, Martijn Lindhout 
 [EMAIL PROTECTED]
 wrote:
  Hi,
 
  I have a page, with those two constructors, the first
 for
 editing a
   new
  employee, the second for editing an existing.
 
  public EditEmployee() {
  setModel(new CompoundPropertyModel(new
 LoadableDetachableModel(){
  protected Object load() {
  return new Employee();
  }
  }));
  init();
  }
 
  public EditEmployee(final Long id) {
  setModel(new CompoundPropertyModel(new
 LoadableDetachableModel(){
  protected Object load() {
  return empRepository.getEmployee(id);
  }
  }));
  init();
  }
 
  Because the Employee info is relatively much, I separate
 it
   in
 two
 panels in
  a tabpanel. The hierarchy is: Page - Form -
 TabbedPanel -
 several
 Panels
  The problem is, that when I enter the formfields on the
   panels,
 they
   got
  valided, but then a new Employee instance is created,
 and
   the
 FormComponent
  values are not copied to the newly instantiated
 Employee.
 They're
   null.
 
  I did some tests and it appears that on each panel
 switch,
   the
 Model.load is
  called, and a new 

Re: AjaxTabbedPanel notworking in IE 6

2008-02-11 Thread Beyonder Unknown

Hi Martijn,

Its the tab that doesn't work when you click it. The ajax debug inspector says:

[some HTML response]

ERROR: Error while parsing response: Object required
INFO: Invoking post-call handler(s)...
INFO: Invoking failure handler(s)...

But it works perfectly in firefox.

Regards,
Wen Tong
 
--
The only constant in life is change.

- Original Message 
From: Martijn Dashorst [EMAIL PROTECTED]
To: users@wicket.apache.org
Sent: Sunday, February 10, 2008 6:10:43 AM
Subject: Re: AjaxTabbedPanel notworking in IE 6


What 
doesn't 
work? 
Have 
you 
looked 
in 
the 
ajax 
debug 
inspector? 
In 
the
application 
logs?
Martijn

On 
2/9/08, 
Beyonder 
Unknown 
[EMAIL PROTECTED] 
wrote:


 
Hi 
All,

 
Have 
you 
guys 
encountered 
problem 
with 
AjaxTabbedPanel? 
The 
link 
doesn't
 
work. 
And 
when 
i 
changed 
it 
to 
TabbedPanel 
it 
worked!

 
Thoughts?

 
Best,
 
Wen 
Tong

 
--
 
The 
only 
constant 
in 
life 
is 
change.





  
  
  
 

 
Never 
miss 
a 
thing.  
Make 
Yahoo 
your 
home 
page.
 
http://www.yahoo.com/r/hs

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




-- 
Buy 
Wicket 
in 
Action: 
http://manning.com/dashorst
Apache 
Wicket 
1.3.1 
is 
released
Get 
it 
now: 
http://www.apache.org/dyn/closer.cgi/wicket/1.3.1





  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


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



RE: TabbedPanel tab names

2008-02-11 Thread Michael Mehrle
That seems to work - thanks guys! Much cleaner than manually accessing a
resource bundle.

Thanks,

Michael

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of James Carman
Sent: Monday, February 11, 2008 12:04 PM
To: users@wicket.apache.org
Subject: Re: TabbedPanel tab names

Oops.  That's what I meant. I had to use StringResourceModel in my
case because I had to supply parameters.

On 2/11/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
 or just ResourceModel

 -igor


 On Feb 11, 2008 11:59 AM, James Carman [EMAIL PROTECTED]
wrote:
  Have you tried StringResourceModel?
 
 
  On 2/11/08, Michael Mehrle [EMAIL PROTECTED] wrote:
   Assuming the typical tabbed panel example below - is there a good
way to
   grab the tab name from the page's properties file? What I need to
do is
   to internationalize the tab name. I guess I could do my own call
to grab
   it from the classpath + the property file name. Was hoping
  
   List tabs = new ArrayList();
   tabs.add(new AbstractTab(new Model(first tab))
   { ^^
   public Panel getPanel(String panelId)
   {
   return new TabPanel1(panelId);
   }
   });
  
  
-
   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: International char

2008-02-11 Thread Pierre G

I guess everything is UTF-8 on the server. I wait for the eatJ support for
confirmation.
I am not sure to have understood your question but
the legacy html files are included in  WebPage components. So reading from
Wicket ...


Johan Compagner wrote:
 
 i guess if you the output side is correct that then something goes wrong
 in
 the input
 So the files are read as something else, what is the default encoding of
 the
 server itsef?
 Where does java read its file in with?
 
 An xml/xhtml reader doesn't look at meta tag i think. Those only look at
 the
 doctype tag
 
 On Feb 11, 2008 8:55 AM, Pierre G [EMAIL PROTECTED] wrote:
 

 Hello Landry,

 Merci for your help.

 I can be wrong but Apache in not involved in deployment on www.eatj.com.
 It's only Tomcat. The funny thing is if I  access the html directly(
 serve
 by Tomcat), the chars are correctly displayed. But as a Wicket
 componants,
 something goes wrong.

 I am still in the dark ...

 Pierre


 Landry Soules-2 wrote:
 
  Hello Pierre,
 
  I think your problem is due to an Apache mis configuration. This link
  should help you solve it :
 
 http://aide.sivit.fr/index.php?2007/04/21/185-apache2-probleme-de-charset-pages-en-utf-8-vers-iso-8859-1astuce
  It's in french, but i think it won't bother you ;-)
 
  Bon courage !
 
 
 
  Pierre Gilquin a écrit :
  Hi all,
 
  I have legacy html files, I trying to insert in a Wicket app.
 
  The charset is iso-8859-1
  meta HTTP-EQUIV=Content-Type CONTENT=text/html;
 charset=iso-8859-1
 
  The special character (French and German) and not html coded in theses
  files.
  Everything work perfectly on my dev machine. I have try to deploy on a
  www.eatj.com account and I get garbage for theses chars.
 
  What can be possibly wrong ?
 
  Thanks in advance
 
 
 
  Pierre Gilquin
 
  NB:
 
  I have in my WebApplication :
 
  public void init() {
 
  getRequestCycleSettings().setResponseRequestEncoding(iso-8859-1);
 
  }
 
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/International-char-tp15353258p15406958.html
 Sent from the Wicket - User mailing list archive at
 Nabble.comhttp://nabble.com/
 .


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


 
 

-- 
View this message in context: 
http://www.nabble.com/International-char-tp15353258p15410689.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: PageExpired while ordering DataTable

2008-02-11 Thread Johan Compagner
i guess we could up the level a bit yes
Because in 1.3 it is pretty serious error if we cant save the page.

johan

On Feb 11, 2008 11:11 AM, Federico Fanton [EMAIL PROTECTED] wrote:

 On Sat, 9 Feb 2008 09:51:45 +0100
 Johan Compagner [EMAIL PROTECTED] wrote:

  What wicket version is this?
 
  Normally in 1.3 page expires should never happen, except when your
  page isnt serializeble...

 Here it is! My page wasn't serializable, but my Logback configuration hid
 the exception.. :(
 Many thanks!
 Anyway, what about a setting to turn these exceptions into fatal ones? I
 think it would be useful..


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




Re: adding context on redirect - Wicket 1.3 on Tomcat behind Apache httpd

2008-02-11 Thread Tim Squires
Hello again,

I'm still really struggling to find why the extra context is being added
to the path.  Could anyone help?  Does anyone have a Wicket 1.3.1 setup on
Tomcat behind Apache2?  Is there a recommended setup e.g. Jetty?

Working my way through the debug for Wicket, it looks like the page
requests for PageLinks and setRedirects are the same.

DEBUG - Page   - ending request for page [Page class =
abcd.app.page.LoginPage, id = 7, version = 0], request [method = POST,
protocol = HTTP/1.0, requestURL = http://www.abcd.com/abcd/app/,
contentType = application/x-www-form-urlencoded, contentLength = 54,
contextPath = /abcd, pathInfo = null, requestURI = /abcd/app/, servletPath
= /app/, pathTranslated = null]
DEBUG - Page   - ending request for page [Page class =
abcd.app.page.NewThingPage, id = 6, version = 0], request [method = POST,
protocol = HTTP/1.0, requestURL = http://www.abcd.com/abcd/app/,
contentType = application/x-www-form-urlencoded, contentLength = 54,
contextPath = /abcd, pathInfo = null, requestURI = /abcd/app/, servletPath
= /app/, pathTranslated = null]


Please, any help would be appreciated.  After hours of working on this,
I'm pulling my hair out.  Please tell me I've missed a comma or
something!!

Thanks,
Tim


 Hi All,

 I have a Wicket 1.3 app running on Tomcat 6 behind an Apache httpd server.
  Most of the app works great but any redirects using
 Component#setResponsePage adds the original web context to the path

 e.g.

 www.abcd.com/app turns to

 www.abcd.com/abcd/app

 and Tomcat complains

 /abcd/abcd/app is not available.

 I thought that in web.xml the filterPath parameter would fix this problem
 but no...

 filter
 filter-nameWicketApplication/filter-name
 
 filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
 init-param
 param-nameapplicationClassName/param-name
   param-valueabcd.app.WicketApplication/param-value
 /init-param
 init-param
 param-namefilterPath/param-name
 param-value//param-value
 /init-param
 /filter

 The apache2 config looks like this...

 VirtualHost abcd.com
 ServerName www.abcd.com
 ServerAdmin [EMAIL PROTECTED]
 ErrorLog /var/log/apache2/abcd_error.log
 ProxyRequests Off

 Proxy *
  AddDefaultCharset off
  Order deny,allow
  Allow from all
 /Proxy

 Location /
 SetOutputFilter proxy-html
 ProxyPass ajp://localhost:8009/abcd/
 ProxyPassReverse ajp://localhost:8009/abcd/
 ProxyPassReverseCookiePath /abcd /
 Order allow,deny
 Allow from all
 /Location
 /VirtualHost


 Could anyone point me in the right direction?

 Thanks for your help,
 Tim


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



different behaviour explorer/firefox windowclosedcallback

2008-02-11 Thread rik rik
Hi all,
I'm using version 1.3.1
I have a ModalWindow and in its method setWindowClosedCallback I pass a 
WindowClosedCallback and then in its method onClose
I replace a panel with another called newPanel and finally I call 
target.addComponent(newPanel)
The code follows
 
box.setWindowClosedCallback(new WindowClosedCallback() {
@Overridepublic void 
onClose(AjaxRequestTarget target) {if (ok){ 
   try {
man.delete(dev); //this call changes the panel  
  GroupPanel newPanel = new GroupPanel();
GroupPanel.this.replaceWith(newPanel);  
  target.addComponent(newPanel);
} catch (Exception e) {
error(e.getMessage());} 
   }}});
 
In firefox the code works perfectly, but it does not in explorer, because the 
panel is not updated
Has anyone ever found this same problem?
Thanks
 
Rik
 
_
Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7!
http://optimizedie7.msn.com/default.aspx?mkt=it-it

ModalWindow with Page memory leak

2008-02-11 Thread Henrik Lundahl
Hi,

In my current project we have a page with six AjaxLinks that open
different ModalWindows. We had implemented sub-classes of ModalWindow
which had field references to the content Pages (the source of the
iframes in the ModalWindows) created by ModalWindow.PageCreators. The
references were there to extract state from the Pages when the
ModalWindows were closed. The Pages also had field references to the
ModalWindows in order to call close on them.

Using this design, the serialization/deserialization increased
seemingly exponentially for every opened and closed ModalWindow,
causing a gigantic memory leak. After opening and closing a number of
ModalWindows, a single close could consume an additional ~70 MB of
memory.

Also, in some situations the Page.numericId was zero in
Page.writeObject, causing a ClassCastException when the Page field
references were deserialized. Since the numericId was zero, the wrong
Page (the initial Page) got deserialized.

As far as I have been able to understand what's happening, the
problems arise because of the cycles between components and the fact
that the Pages are deserialized using different ObjectInputStreams.
I'm not sure how the numericId could become zero.

Removing the references to the content Pages from the ModalWindow
sub-classes and using simple Models instead seems to have solved both
problems.

Questions:

What is happening in the serialization/deserialization when this
behavior arises?

How can the numericId become zero in Page.writeObject (and
sub-sequentially in Page.readObject)?

Is it generally problematic to have field references to Pages in
Components (or objects)?

What would the most decoupled approach (object graph wise), thus
minimizing serialization, be to implementing this?


Thanks,
Henrik Lundahl

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



Re: n^2 loop in MarkupContainer?

2008-02-11 Thread Nino Saturnino Martinez Vazquez Wael

Sorry for previous post.. It was a listview.. not dataview

Meetesh Karia wrote:
It appeared to be that way after stepping through the code many times 
in a debugger but that's definitely not conclusive evidence.  I'll try 
and come up with a better measure of what's going on.


Thanks,
Meetesh

Matej Knopp wrote:

Indeed, the reason for it is to reduce memory consumption. Right now,
I don't see any easy way around, are you absolutely sure that it
causes you performance problems?

-Matej

On Feb 11, 2008 2:15 PM, Meetesh Karia [EMAIL PROTECTED] wrote:
 
Hi all, I'm using DataView in wicket 1.3 and we have ~400 items that 
are

returned by a data provider.  I'd expect the adding of the items to be
rather quick but it turns out that it's not and it looks like the
culprit might be MarkupContainer.put.  That method expands the children
array 1 entry at a time which makes the loop of adding the items n^2.

Is there a good reason for this loop to be n^2 (memory conservation
perhaps)?  Is there any easy way around it?

Thanks,
Meetesh






  




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


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



Re: n^2 loop in MarkupContainer?

2008-02-11 Thread Matej Knopp
Indeed, the reason for it is to reduce memory consumption. Right now,
I don't see any easy way around, are you absolutely sure that it
causes you performance problems?

-Matej

On Feb 11, 2008 2:15 PM, Meetesh Karia [EMAIL PROTECTED] wrote:
 Hi all, I'm using DataView in wicket 1.3 and we have ~400 items that are
 returned by a data provider.  I'd expect the adding of the items to be
 rather quick but it turns out that it's not and it looks like the
 culprit might be MarkupContainer.put.  That method expands the children
 array 1 entry at a time which makes the loop of adding the items n^2.

 Is there a good reason for this loop to be n^2 (memory conservation
 perhaps)?  Is there any easy way around it?

 Thanks,
 Meetesh




-- 
Resizable and reorderable grid components.
http://www.inmethod.com

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



Re: New tooltip component I have created

2008-02-11 Thread richardwilko

Ok, I didnt know that that was there.  How often is that jar file produced? 


Nino.Martinez wrote:
 
 Whats wrong with the stuff in maven?
 
 http://wicketstuff.org/maven/repository/org/wicketstuff/wicketstuff-minis/1.3.0-SNAPSHOT/
 
 
 

-- 
View this message in context: 
http://www.nabble.com/New-tooltip-component-I-have-created-tp15391312p15407791.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: WicketTester gives No WebApplicationContext found: no ContextLoaderListener registered

2008-02-11 Thread Nino Saturnino Martinez Vazquez Wael

btw, I went that way too (moving to an method)..

Ned Collyer wrote:

4 minutes?  You're getting slower!

That kind of worked. I'm not fond of having to reinitialise all the things I
set inside init, so i've moved this method out to a protected void
initSpring().

Thanks for your help.

Rgds

Ned


igor.vaynberg wrote:
  

try the Spring page on the wiki, it shows how to mock spring for
wickettester

-igor




  


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


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