refresh page from an AjaxLink or OnChangeAjaxBehavior

2012-05-07 Thread Mihai Toma
Hi,

 

I have an OnChangeAjaxBehavior on a DropDownChoice component.

 

After I change a value in that drop down I want to reload the page using
setResponse(currentPage.getClass(), currentPage.getPageParameters());

 

themeComp.add(new OnChangeAjaxBehavior() {

private static final long
serialVersionUID = -1973825163343103968L;

 

@Override

protected void
onUpdate(final AjaxRequestTarget arg0) {

 
setAValueInSession();

setResponse(currentPage.getClass(), currentPage.getPageParameters());

}

});

 

The response from ajax debug is ERROR: Wicket.Ajax.Call.failure: Error
while parsing response: Could not find root ajax-response element. I
receive the content from ajax but it is not between ajax-response element.

 

I verify this problem on AjaxLink and the response is the same as from
OnChangeAjaxBehavior.

 

Do you have any idea how to reload the page from an AjaxLink or
OnChangeAjaxBehavior ?

 

Thanks,

Mihai



RE: refresh page from an AjaxLink or OnChangeAjaxBehavior

2012-05-07 Thread Mihai Toma
Forgot to say wicket 1.5.5.

Mihai

-Original Message-
From: Mihai Toma [mailto:mihai.t...@asf.ro] 
Sent: Monday, May 07, 2012 3:47 PM
To: users@wicket.apache.org
Subject: refresh page from an AjaxLink or OnChangeAjaxBehavior

Hi,

 

I have an OnChangeAjaxBehavior on a DropDownChoice component.

 

After I change a value in that drop down I want to reload the page using
setResponse(currentPage.getClass(), currentPage.getPageParameters());

 

themeComp.add(new OnChangeAjaxBehavior() {

private static final long
serialVersionUID = -1973825163343103968L;

 

@Override

protected void
onUpdate(final AjaxRequestTarget arg0) {

 
setAValueInSession();

setResponse(currentPage.getClass(), currentPage.getPageParameters());

}

});

 

The response from ajax debug is ERROR: Wicket.Ajax.Call.failure: Error
while parsing response: Could not find root ajax-response element. I
receive the content from ajax but it is not between ajax-response element.

 

I verify this problem on AjaxLink and the response is the same as from
OnChangeAjaxBehavior.

 

Do you have any idea how to reload the page from an AjaxLink or
OnChangeAjaxBehavior ?

 

Thanks,

Mihai



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



IAjaxIndicatorAware and history.back()

2011-08-25 Thread Mihai Toma
Hi,

 

I have a AjaxSubmitLink in a form with an AjaxFormSubmitIndicator behavior
(AjaxFormSubmitIndicator class extends AjaxFormSubmitBehavior and implements
IAjaxIndicatorAware, used to show a loading image while saving).

 

In the method onSubmit of my AjaxFormSubmitIndicator I save my data from
form and then I make a redirect to previews page using
target.appendJavascript(history.back());

 

The problem Is that this did not work.

 

If I don't add AjaxFormSubmitIndicator on my submit button, the redirect
works fine.

 

Any idea on how can i make this working?

 

Thanks in advance!

Mihai



RE: IAjaxIndicatorAware and history.back()

2011-08-25 Thread Mihai Toma
I forgot to say that I use wicket 1.4.15.

-Original Message-
From: Mihai Toma [mailto:mihai.t...@asf.ro] 
Sent: Thursday, August 25, 2011 5:17 PM
To: users@wicket.apache.org
Subject: IAjaxIndicatorAware and history.back()

Hi,

 

I have a AjaxSubmitLink in a form with an AjaxFormSubmitIndicator behavior
(AjaxFormSubmitIndicator class extends AjaxFormSubmitBehavior and implements
IAjaxIndicatorAware, used to show a loading image while saving).

 

In the method onSubmit of my AjaxFormSubmitIndicator I save my data from
form and then I make a redirect to previews page using
target.appendJavascript(history.back());

 

The problem Is that this did not work.

 

If I don't add AjaxFormSubmitIndicator on my submit button, the redirect
works fine.

 

Any idea on how can i make this working?

 

Thanks in advance!

Mihai



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



close modal window message: Close the top-level modal window first

2011-06-29 Thread Mihai Toma
Hi,

 

I have a problem when I try to close a modal window.

 

The idea is that I have a ModalWindow created with setContent inside a
ModalWindow created with getPageCreator and when  I try to close with
ModalWindow.closeCurren() the javascript alert appear with the message
Close the top-level modal window first.

 

I create first ModalWindow also with setContent and the second one close
correctly (without javascript warning).

 

My problem is that I can't use setContent in first ModalWindow because it
takes too much time to open instead of getPageCreator.

 

Any idea on how to close the second ModalWindow if the first ModalWindow is
created using getPageCreator?

 

Thanks!

 

P.S. - My problem is the same with:
http://apache-wicket.1842946.n4.nabble.com/Fail-to-close-ModalWindow-on-top-
of-ModalWindow-td1879540.html 



RE: close modal window message: Close the top-level modal window first

2011-06-29 Thread Mihai Toma

I forgot to say that I use wicket 1.4.15


Hi,

 

I have a problem when I try to close a modal window.

 

The idea is that I have a ModalWindow created with setContent inside a
ModalWindow created with getPageCreator and when  I try to close with
ModalWindow.closeCurren() the javascript alert appear with the message
Close the top-level modal window first.

 

I create first ModalWindow also with setContent and the second one close
correctly (without javascript warning).

 

My problem is that I can't use setContent in first ModalWindow because it
takes too much time to open instead of getPageCreator.

 

Any idea on how to close the second ModalWindow if the first ModalWindow is
created using getPageCreator?

 

Thanks!

 

P.S. - My problem is the same with:
http://apache-wicket.1842946.n4.nabble.com/Fail-to-close-ModalWindow-on-top-
of-ModalWindow-td1879540.html 



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



HybridUrlCodingStrategy gives 302 in access log

2011-03-18 Thread Mihai Toma
Hi,

 

I have a strange issue with wicket regarding redirection.

 

In Application class I setup all pages with HybridUrlCodingStrategy
(mount(new HybridUrlCodingStrategy(/assets, AssetSearchPage.class)));

 

Everything works fine on my server, but on client server there is a problem
because, sometimes, when I try to acces a page (for example assets page) the
url pass a few page indexes, for example, if now I am on page home.3 and
click on assets link, the page recivied is assets.11. Then if I click on
customers link I get customers.18

 

I look into access.log and I saw that asset.4 to asset.10 were logged with
status 302 (temporary moved).

 

Here are some line from the access.log:

 

10.52.2.109 - - [15/Mar/2011:17:56:01 +0200] GET
/crm-web/app/home.3?wicket:interface=:3:body:headerPanel:menu_panel:assetCon
tainer:assetLink::ILinkListener:: HTTP/1.1 302 287 

10.52.2.109 - - [15/Mar/2011:17:56:01 +0200] GET /crm-web/app/assets
HTTP/1.1 302 291 

10.52.2.109 - - [15/Mar/2011:17:56:01 +0200] GET
/crm-web/themes/red-black/imgs/drop_down_arrow.gif HTTP/1.1 200 80 

10.52.2.109 - - [15/Mar/2011:17:56:01 +0200] GET /crm-web/app/assets.4
HTTP/1.1 302 291 

10.52.2.109 - - [15/Mar/2011:17:56:02 +0200] GET /crm-web/app/assets.5
HTTP/1.1 302 291 

10.52.2.109 - - [15/Mar/2011:17:56:02 +0200] GET /crm-web/app/assets.6
HTTP/1.1 302 291 

10.52.2.109 - - [15/Mar/2011:17:56:03 +0200] GET /crm-web/app/assets.7
HTTP/1.1 302 291 

10.52.2.109 - - [15/Mar/2011:17:56:03 +0200] GET /crm-web/app/assets.8
HTTP/1.1 302 291 

10.52.2.109 - - [15/Mar/2011:17:56:03 +0200] GET /crm-web/app/assets.9
HTTP/1.1 302 293 

10.52.2.109 - - [15/Mar/2011:17:56:04 +0200] GET /crm-web/app/assets.10
HTTP/1.1 302 293 

10.52.2.109 - - [15/Mar/2011:17:56:04 +0200] GET /crm-web/app/assets.11
HTTP/1.1 200 4528 

10.52.2.109 - - [15/Mar/2011:17:56:05 +0200] GET
/crm-web/themes/red-black/imgs/icon_search.gif HTTP/1.1 200 1044 

10.52.2.109 - - [15/Mar/2011:17:56:05 +0200] GET
/crm-web/themes/red-black/imgs/colapse.gif HTTP/1.1 200 116 

10.52.2.109 - - [15/Mar/2011:17:56:05 +0200] GET
/crm-web/themes/red-black/imgs/page_excel.png HTTP/1.1 200 817 

10.52.2.109 - - [15/Mar/2011:17:56:05 +0200] GET
/crm-web/app/assets.11?wicket:interface=:11:body::IBehaviorListener:0:rando
m=0.9913568522425373 HTTP/1.1 200 638 

10.53.18.219 - - [15/Mar/2011:17:56:07 +0200] GET
/crm-web/themes/red-black/imgs/drop_down_arrow.gif HTTP/1.1 304 0

...

10.52.2.109 - - [15/Mar/2011:17:51:26 +0200] GET /crm-web/app/cases.5
HTTP/1.1 302 289 

10.53.14.248 - - [15/Mar/2011:17:51:27 +0200] POST
/crm-web/app/editcustomer.14?wicket:interface=:14:body:pageContent:myForm:ta
bPanel:sections:2:sectionPanel:collapsiblePanel:contentPanel:rows:1:cells:0:
cell:cell:county::IBehaviorListener:0:random=0.7420959949740673 HTTP/1.1
200 1457 

10.52.2.109 - - [15/Mar/2011:17:51:27 +0200] GET /crm-web/app/cases.6
HTTP/1.1 302 289 

10.52.2.109 - - [15/Mar/2011:17:51:27 +0200] GET /crm-web/app/cases.7
HTTP/1.1 302 289 

10.52.2.109 - - [15/Mar/2011:17:51:28 +0200] GET /crm-web/app/cases.8
HTTP/1.1 302 289 

10.52.2.109 - - [15/Mar/2011:17:51:28 +0200] GET /crm-web/app/cases.9
HTTP/1.1 302 291 

10.53.14.248 - - [15/Mar/2011:17:51:29 +0200] POST
/crm-web/app/editcustomer.14?wicket:interface=:14:body:pageContent:myForm:ta
bPanel:sections:2:sectionPanel:collapsiblePanel:contentPanel:rows:2:cells:0:
cell:cell:city::IBehaviorListener:0:-1random=0.0918287288306226 HTTP/1.1
200 93 

10.52.2.109 - - [15/Mar/2011:17:51:29 +0200] GET /crm-web/app/cases.10
HTTP/1.1 302 291 

10.52.2.109 - - [15/Mar/2011:17:51:29 +0200] GET /crm-web/app/cases.11
HTTP/1.1 302 291 

10.52.2.109 - - [15/Mar/2011:17:51:29 +0200] GET /crm-web/app/cases.12
HTTP/1.1 302 291 

10.52.2.109 - - [15/Mar/2011:17:51:30 +0200] GET /crm-web/app/cases.13
HTTP/1.1 302 291 

10.53.14.248 - - [15/Mar/2011:17:51:31 +0200] GET
/crm-web/app/editcustomer.14?wicket:interface=:14:body:pageContent:myForm:bu
ttonPanel:save::IBehaviorListener:0:random=0.801847447519579 HTTP/1.1 200
636

 

The problem appears pretty random and I can't reproduce it every time.

 

Also I would like to mention that the application server is Weblogic 10g and
there is no error into application logs.

 

Can anybody tell me who do this redirect and how can I avoid this?

 

Thanks!



RE: session size

2011-01-20 Thread Mihai Toma
Hi guys!

I resolved the problem.

Here is what I was doing:

- I have a page, let's say HomePage which extends WebPage.
- This HomePage add a MenuPanel which extends Panel (add(new MenuPanel()).
- This MenuPanel add a SubmenuPanel like this menuPanel.add(new
SubmenuPanel(MenuPanel.this)).

Because of this reference the whole page was kept in session and the session
grows very fast.

You can say that I can access the MenuPanel from SubmenuPanel using
getParent() but let's omit this thing.

Is it normal for wicket to keep these pages in session if you have this type
of reference?

Thanks!


-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Monday, January 17, 2011 5:33 PM
To: users@wicket.apache.org
Subject: Re: session size

Okay, so you are storing *every* page in your page map in session.  So,
here's your next path (already partially explained by others):

1 - Consider: must you use http session store?  why?  A lot of folks *think*
that they must, and they switch to it, but they don't really need to.  Some
honestly need to.

2 - run a profiler or memory analyzer and see what's actually being held in
memory.  Probably large domain objects, or sometimes even services.

The reason you're holding these big objects is almost always one or both of
the following:

1 - improper use of models.  Not using detachable models.  Putting things
into new Model(someDomainObject).  Or holding fields references to domain
objects, or other large objects (even services).

2 - using final variables that are declared outside of an anonymous inner
class from within it (which creates a field variable in the anon-inn-class
for that object).


-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


On Mon, Jan 17, 2011 at 9:27 AM, Mihai Toma mihai.t...@asf.ro wrote:

 Yes, I use HttpSessionStore.

 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Monday, January 17, 2011 5:20 PM
 To: users@wicket.apache.org
 Subject: Re: session size

 Are you using HttpSessionStore (this is not the default - which means you
 would have to explicitly set this up in your application class)?

 On Mon, Jan 17, 2011 at 8:41 AM, Martin Grigorov
 mgrigo...@apache.orgwrote:

  Try to find what is stored actually.
  Use memory analyzer tool like Eclipse one - http://www.eclipse.org/mat/
 
  http://www.eclipse.org/mat/I expect that you store some bigger
  collections
  with your data with some of your components.
 
  On Mon, Jan 17, 2011 at 3:16 PM, Mihai Toma mihai.t...@asf.ro wrote:
 
   Hi!
  
  
  
   I have an application build with wicket and I have a session problem.
  
  
  
   If one user browse the application the session (the object WebSession)
   becomes bigger and bigger, so if I browse 20 pages the session size
has
   around 16 Mb.
  
   When I start browsing the session has something less than 100 Kb.
  
  
  
   I read some things about the pages which are stored in session in
  pageMaps
   and versions and I make different settings in Application class
   (getSessionSettings().setMaxPageMaps(10);
   getSessionSettings().setPageMapEvictionStrategy(new
   LeastRecentlyAccessedEvictionStrategy(10));
  
   ) but seems not to resolv my problem.
  
  
  
   Do you have any idea how can I limit the session size or how can I
 limit
   the
   number of pages stored in session?
  
  
  
   I use wicket 1.4.8.
  
  
  
   Thanks!
  
  
 



 --
 Jeremy Thomerson
 http://wickettraining.com
 *Need a CMS for Wicket?  Use Brix! http://brixcms.org*


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




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



session size

2011-01-17 Thread Mihai Toma
Hi!

 

I have an application build with wicket and I have a session problem.

 

If one user browse the application the session (the object WebSession)
becomes bigger and bigger, so if I browse 20 pages the session size has
around 16 Mb.

When I start browsing the session has something less than 100 Kb.

 

I read some things about the pages which are stored in session in pageMaps
and versions and I make different settings in Application class
(getSessionSettings().setMaxPageMaps(10);
getSessionSettings().setPageMapEvictionStrategy(new
LeastRecentlyAccessedEvictionStrategy(10));

) but seems not to resolv my problem.

 

Do you have any idea how can I limit the session size or how can I limit the
number of pages stored in session?

 

I use wicket 1.4.8.

 

Thanks!



RE: session size

2011-01-17 Thread Mihai Toma
Yes, I use HttpSessionStore.

-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Monday, January 17, 2011 5:20 PM
To: users@wicket.apache.org
Subject: Re: session size

Are you using HttpSessionStore (this is not the default - which means you
would have to explicitly set this up in your application class)?

On Mon, Jan 17, 2011 at 8:41 AM, Martin Grigorov
mgrigo...@apache.orgwrote:

 Try to find what is stored actually.
 Use memory analyzer tool like Eclipse one - http://www.eclipse.org/mat/

 http://www.eclipse.org/mat/I expect that you store some bigger
 collections
 with your data with some of your components.

 On Mon, Jan 17, 2011 at 3:16 PM, Mihai Toma mihai.t...@asf.ro wrote:

  Hi!
 
 
 
  I have an application build with wicket and I have a session problem.
 
 
 
  If one user browse the application the session (the object WebSession)
  becomes bigger and bigger, so if I browse 20 pages the session size has
  around 16 Mb.
 
  When I start browsing the session has something less than 100 Kb.
 
 
 
  I read some things about the pages which are stored in session in
 pageMaps
  and versions and I make different settings in Application class
  (getSessionSettings().setMaxPageMaps(10);
  getSessionSettings().setPageMapEvictionStrategy(new
  LeastRecentlyAccessedEvictionStrategy(10));
 
  ) but seems not to resolv my problem.
 
 
 
  Do you have any idea how can I limit the session size or how can I limit
  the
  number of pages stored in session?
 
 
 
  I use wicket 1.4.8.
 
 
 
  Thanks!
 
 




-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


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



RE: session size

2011-01-17 Thread Mihai Toma
Thanks for your recommendations.

-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Monday, January 17, 2011 5:33 PM
To: users@wicket.apache.org
Subject: Re: session size

Okay, so you are storing *every* page in your page map in session.  So,
here's your next path (already partially explained by others):

1 - Consider: must you use http session store?  why?  A lot of folks *think*
that they must, and they switch to it, but they don't really need to.  Some
honestly need to.

2 - run a profiler or memory analyzer and see what's actually being held in
memory.  Probably large domain objects, or sometimes even services.

The reason you're holding these big objects is almost always one or both of
the following:

1 - improper use of models.  Not using detachable models.  Putting things
into new Model(someDomainObject).  Or holding fields references to domain
objects, or other large objects (even services).

2 - using final variables that are declared outside of an anonymous inner
class from within it (which creates a field variable in the anon-inn-class
for that object).


-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


On Mon, Jan 17, 2011 at 9:27 AM, Mihai Toma mihai.t...@asf.ro wrote:

 Yes, I use HttpSessionStore.

 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Monday, January 17, 2011 5:20 PM
 To: users@wicket.apache.org
 Subject: Re: session size

 Are you using HttpSessionStore (this is not the default - which means you
 would have to explicitly set this up in your application class)?

 On Mon, Jan 17, 2011 at 8:41 AM, Martin Grigorov
 mgrigo...@apache.orgwrote:

  Try to find what is stored actually.
  Use memory analyzer tool like Eclipse one - http://www.eclipse.org/mat/
 
  http://www.eclipse.org/mat/I expect that you store some bigger
  collections
  with your data with some of your components.
 
  On Mon, Jan 17, 2011 at 3:16 PM, Mihai Toma mihai.t...@asf.ro wrote:
 
   Hi!
  
  
  
   I have an application build with wicket and I have a session problem.
  
  
  
   If one user browse the application the session (the object WebSession)
   becomes bigger and bigger, so if I browse 20 pages the session size
has
   around 16 Mb.
  
   When I start browsing the session has something less than 100 Kb.
  
  
  
   I read some things about the pages which are stored in session in
  pageMaps
   and versions and I make different settings in Application class
   (getSessionSettings().setMaxPageMaps(10);
   getSessionSettings().setPageMapEvictionStrategy(new
   LeastRecentlyAccessedEvictionStrategy(10));
  
   ) but seems not to resolv my problem.
  
  
  
   Do you have any idea how can I limit the session size or how can I
 limit
   the
   number of pages stored in session?
  
  
  
   I use wicket 1.4.8.
  
  
  
   Thanks!
  
  
 



 --
 Jeremy Thomerson
 http://wickettraining.com
 *Need a CMS for Wicket?  Use Brix! http://brixcms.org*


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




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



FW: servlet request header information

2009-07-29 Thread Mihai Toma
Hi,

 

I want to get some information from request  header using something like the
code bellow but for my requests I receive null.

 

HttpServletRequest request =
((ServletWebRequest) getRequest())

 
.getHttpServletRequest();

System.out.println(Http via:
+request.getHeader(HTTP_VIA));

System.out.println(Remote adr:
+request.getHeader(REMOTE_ADDR));

System.out.println(X_FORWARD adr:
+request.getHeader(HTTP_X_FORWARDED_FOR));

 

 

Can anyone tell me if there is other way to get all these information.

 

In fact I want to get the ip address of the request. Using the
request.getRemoteAddr() I receive only the proxy ip and not the real one.

 

Thanks in advance!

Tomike

 



RE: FW: servlet request header information

2009-07-29 Thread Mihai Toma
Thanks, but we are using here an OC4J server so we can’t add Apache
ProxyPreserveHost Directive.


-Original Message-
From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] 
Sent: Wednesday, July 29, 2009 12:59 PM
To: users@wicket.apache.org
Subject: Re: FW: servlet request header information

Some proxies can be configured to forward the real client address:

  - Apache ProxyPreserveHost Directive
  - Description: Use incoming Host HTTP request header for proxy request
  - Syntax: ProxyPreserveHost On|Off
  - Default: ProxyPreserveHost Off
  - Context: server config, virtual host
  - Status: Extension
  - Module: mod_proxy
  - Compatibility:  Available in Apache 2.0.31 and later.
- mod_header directives:
  • RequestHeader set|append|add|unset header [value]
- ProxyPass / http://backend.covalent.net
  • ProxyPassReverse / http://backend.covalent.net
  • RequestHeader set X-Forwarded-IP %{REMOTE_ADDR}e
  • RequestHeader set X-Request-Scheme %{REQUEST_SCHEME}e


 I want to get some information from request  header using something like
the
 code bellow but for my requests I receive null.

You could use a debugger and see if the whole property map is null or
maybe the names are lowercase?

**
Martin




                                HttpServletRequest request =
 ((ServletWebRequest) getRequest())


 .getHttpServletRequest();

                                System.out..println(Http via:
 +request.getHeader(HTTP_VIA));

                                System.out..println(Remote adr:
 +request.getHeader(REMOTE_ADDR));

                                System.out..println(X_FORWARD adr:
 +request.getHeader(HTTP_X_FORWARDED_FOR));





 Can anyone tell me if there is other way to get all these information.



 In fact I want to get the ip address of the request. Using the
 request.getRemoteAddr() I receive only the proxy ip and not the real one.



 Thanks in advance!

 Tomike





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



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