AW: why is the model empty?

2009-10-21 Thread Peter Arnulf Lustig
wow. Thank you! That's helped a lot!
.getValue() is the key to success if you use setDefaultFormProcessing = false!



- Ursprüngliche Mail 
Von: Jeremy Thomerson jer...@wickettraining.com
An: users@wicket.apache.org
Gesendet: Dienstag, den 20. Oktober 2009, 17:04:57 Uhr
Betreff: Re: why is the model empty?

Well, don't know what to tell you.  It bypasses validation, which is
required in order to set the models to their values.  If you submitted
akj123 in a text field that was an Integer, we could only set it after
validation (which in this case means the value could not be set on the
field).  So, bypassing validation means that you must also bypass getting
your models updated.  You can call textfield.getValue() (or similar - can't
remember exact name) to get the raw submitted value.

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



On Tue, Oct 20, 2009 at 10:00 AM, Peter Arnulf Lustig u...@yahoo.dewrote:

 mhmhm! I got this design pattern from
 http://cwiki.apache.org/WICKET/conditional-validation.html




 - Ursprüngliche Mail 
 Von: Jeremy Thomerson jer...@wickettraining.com
 An: users@wicket.apache.org
 Gesendet: Dienstag, den 20. Oktober 2009, 16:56:38 Uhr
 Betreff: Re: why is the model empty?

 Did you look at the javadoc?  [1]

 It says:
 Sets the defaultFormProcessing property. When false (default is true), all
 validation and
 form updating is bypassed and the onSubmit method of that button is called
 directly, and the
 onSubmit method of the parent form is not called. A common use for this is
 to create a cancel
 button.

 So, yes, that would prevent the model from being updated.

 [1]

 http://fisheye6.atlassian.com/browse/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/Button.java?r=HEAD#l118

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



 On Tue, Oct 20, 2009 at 9:25 AM, Peter Arnulf Lustig u...@yahoo.de
 wrote:

  Does it maybe have something to do with my custom validation?
  I use  setDefaultFormProcessing(false); because I have more submit
 buttons
  on one form
 
 
 
  - Ursprüngliche Mail 
  Von: Jeremy Thomerson jer...@wickettraining.com
  An: users@wicket.apache.org
  Gesendet: Dienstag, den 20. Oktober 2009, 16:20:09 Uhr
  Betreff: Re: why is the model empty?
 
  How about! creating! a quickstart! and sending it! to us!
 
  (Oh, and no need for so many exclamation points.  It could be interpreted
  as
  shouting)
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Tue, Oct 20, 2009 at 9:16 AM, Peter Arnulf Lustig u...@yahoo.de
  wrote:
 
   hey martijn -- But there is a string submitted!
   Actually it must be printed! But it is null.
  
   Is the final declaration correct?
  
  
  
   - Ursprüngliche Mail 
   Von: Martijn Dashorst martijn.dasho...@gmail.com
   An: users@wicket.apache.org
   Gesendet: Dienstag, den 20. Oktober 2009, 16:06:22 Uhr
   Betreff: Re: why is the model empty?
  
   Wicket makes empty strings null by default. See one of the
   Application.getSettings()
  
   Martijn
  
   On Tue, Oct 20, 2009 at 4:04 PM, Jeremy Thomerson
   jer...@wickettraining.com wrote:
Look at the HTTP request - is the value getting submitted?
   
--
Jeremy Thomerson
http://www.wickettraining.com
   
   
   
On Tue, Oct 20, 2009 at 8:17 AM, Peter Arnulf Lustig 
  u...@yahoo.de
   wrote:
   
hi,
   
in the submit logic the getModel().getObject() is an empty string
   although
I set it via textfield:
   
final Button tagSubmit = new Button(tagSubmit, Model.of()) {
   @Override
   public void onSubmit() {
   tagTitle.getModel().getObject() // it is empty!!
   }
   }
   
   };
   
   
that's the textfield:
   
final TextFieldString tagTitle = new TextFieldString(tagTitle,
Model.of());
   
   
   
   
   
 -
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
   
   
   
  
  
  
   --
   Become a Wicket expert, learn from the best: http://wicketinaction.com
   Apache Wicket 1.4 increases type safety for web applications
   Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
  
   -
   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
 
 





 

[offtopic] - Visit to Amsterdam

2009-10-21 Thread Andrew Lombardi
Wicket folk!  I'm currently in Paris making my way over to the  
Netherlands for a short 2 or 3 day visit.  If anyone has suggestions  
on best places to stay?  best things to see?  that would be much  
appreciated!


And if you're in the area, grab a coffee or something.  My Europe #  
+39 345 8329779 ... or just email / twitter / etc


I'm also going to be in Brussels for a few days, Munich and Berlin,  
and then in Prague for TSSJS/E.  If you have time and are in any of  
these cities, I'd love to meet up with some locals.


Cheers!


To our success!

Mystic Coders, LLC | Code Magic | www.mysticcoders.com

ANDREW LOMBARDI | and...@mysticcoders.com
2321 E 4th St. Ste C-128, Santa Ana CA 92705
ofc: 714-816-4488
fax: 714-782-6024
cell: 714-697-8046
linked-in: http://www.linkedin.com/in/andrewlombardi
twitter: http://www.twitter.com/kinabalu

Eco-Tip: Printing e-mails is usually a waste.


This message is for the named person's use only. You must not,  
directly or indirectly, use,
 disclose, distribute, print, or copy any part of this message if you  
are not the intended recipient.





Re: file download using ajaxLink

2009-10-21 Thread Ernesto Reinaldo Barreiro
Maybe this might help
http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html

http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
Ernesto

On Tue, Oct 20, 2009 at 10:12 PM, tubin gen fachh...@gmail.com wrote:

 I do download in traditional way

 here is the code

public void download(String filename, byte[] filedata){
setRedirect(false);
WebResponse response = (WebResponse) getResponse();
response.setAttachmentHeader(filename);
response.setLastModifiedTime(Time.now());
response.setContentType(application/octet-stream);
response.write(
new ByteArrayInputStream(filedata));
response.close();
}


item.add(new LinkVoid(download){
{
add(new Label(filename,
 eaAuditProgramAttachment.getFileName()));
}
@Override
public void onClick() {

 ((BasePage)getPage()).download(eaAuditProgramAttachment.getFileName(),
 eaAuditProgramAttachment.getEaBlob().getBlobData());
}
});


 If I replace this link with AjaxLink it will not work  and I must use  an
 ajaxlinkplease tell me how can I use ajaxLink for download



AW: file download using ajaxLink

2009-10-21 Thread Giambalvo, Christian
Updated 
http://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow

Mit freundlichen Grüßen
Christian Giambalvo
--
Fachinformatiker für Anwendungsentwicklung

EXCELSIS Informationssysteme GmbH
Wilhelmsplatz 8 - 70182 Stuttgart
Mobile +49 176 196 32 406
Office +49 711 6 20 30 406
christian.giamba...@excelsisnet.com
www.excelsisnet.com
www.twitter.com/excelsis_info

Sitz Stuttgart
Amtsgericht Stuttgart, HRB 21104
Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf


-Ursprüngliche Nachricht-
Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Gesendet: Mittwoch, 21. Oktober 2009 09:40
An: users@wicket.apache.org
Betreff: Re: file download using ajaxLink

Maybe this might help
http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html

http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
Ernesto

On Tue, Oct 20, 2009 at 10:12 PM, tubin gen fachh...@gmail.com wrote:

 I do download in traditional way

 here is the code

public void download(String filename, byte[] filedata){
setRedirect(false);
WebResponse response = (WebResponse) getResponse();
response.setAttachmentHeader(filename);
response.setLastModifiedTime(Time.now());
response.setContentType(application/octet-stream);
response.write(
new ByteArrayInputStream(filedata));
response.close();
}


item.add(new LinkVoid(download){
{
add(new Label(filename,
 eaAuditProgramAttachment.getFileName()));
}
@Override
public void onClick() {

 ((BasePage)getPage()).download(eaAuditProgramAttachment.getFileName(),
 eaAuditProgramAttachment.getEaBlob().getBlobData());
}
});


 If I replace this link with AjaxLink it will not work  and I must use  an
 ajaxlinkplease tell me how can I use ajaxLink for download


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



Re: Behind proxy

2009-10-21 Thread nino martinez wael
Hmm Anton im not sure, but dont think so.. BookmarkablePageLinks are just
that, and if session ID were appended they would'nt work..

One of my sites are running a beta 1.4 i'll try to upgrade and see if I can
replicate the error. But it might take some time..

Im taking this issue back to the wicket list as it may speed up responses to
it. So please respond to it there.

2009/10/20 Anton Veretennikov anton.veretenni...@gmail.com

 Nino, seems to me that it has something with BookmarkablePageLinks. I
 use them everywhere except expanding tree links where Ajax is used.
 Look, when you press on +/- signes of tree, jsessionid
 disappears after first click (only in this tree Ajaxed block). After
 that you can press on bookmarkable links and everything will be okey.

 I tried to remove everything about cookies even Google Analytics code,
 this changes nothing.
 So, may be there is something in urlFor, is it possible?

 -- Tony


 On Mon, Oct 19, 2009 at 9:00 PM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
  No problem, please get back and tell if it works now:) im curios.
 
  2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com
 
  I think this may have something with cookies since I try to set cookie
  treeInfo and sometimes see it is set twice in response. May be I'm
  doing something wrong with a way how I do this. I'll try to turn off
  and see if it solves jsessionid problem.
 
  Thank you for your help, Nino
 
  -- Tony
 
  On Mon, Oct 19, 2009 at 5:39 PM, nino martinez wael
  nino.martinez.w...@gmail.com wrote:
   Hmm, then it not Apache HTTP, very wierd. So maybe it is either
   something
   for the wicket list or the Tomcat one, if you can get them to answer..
 I
   saw
   that the jesession id were sat so it should work.
  
   2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com
  
   The same thing 
  
   http://72.249.185.124:8080/FivePinSite-1.0-SNAPSHOT/
  
   very strange...
  
   On Mon, Oct 19, 2009 at 5:13 PM, nino martinez wael
   nino.martinez.w...@gmail.com wrote:
If I were you I would try to take it on the apache http list...
 Since
it's
probably that part which are failing.. If you hit the server
directly,
without the proxy does it work then ? If yes it's probably your
rewrite
rule?
   
2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com
   
May be I need to open this discussion in a wicket list?
   
On Mon, Oct 19, 2009 at 3:57 PM, Anton Veretennikov
anton.veretenni...@gmail.com wrote:
 Thank you, Nino,

 All my apps as I can see use the same method and only in one I
 see
 strange things with jsessionid.
 I need to investigate it somehow but don't know from where to
 start
 and how to know that exactly in that point things are going
 wrong.

 -- Tony


 On Sun, Oct 18, 2009 at 7:40 PM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
 One of mine looks like this:

 VirtualHost *:* 
 ServerName wicketgames.ninosbox.thruhere.net
 ServerAlias *.wicketgames.ninosbox.thruhere.net
 ProxyPass / http://10.0.0.2:8180/WicketGames/
 ProxyPassReverse / http://10.0.0.2:8180/WicketGames/
 ProxyPassReverseCookiePath /WicketGames /
Proxy *
 Order deny,allow
 Allow from all
 /Proxy
 /VirtualHost

 And another:

 VirtualHost *:* 
 ServerName wheresmyevent.com
 ServerAlias www.wheresmyevent.com
 ProxyPass / http://10.0.0.2:8180/socratesTopia/
 ProxyPassReverse / http://10.0.0.2:8180/socratesTopia/
 ProxyPassReverseCookiePath /socratesTopia /
Proxy *
 Order deny,allow
 Allow from all
 /Proxy
 /VirtualHost

 Your seems similar though, im not familiar with rewrite rules
 though..

 2009/10/17 Anton Veretennikov anton.veretenni...@gmail.com

 Hi, Nino,

 Thank you for your response, I'm using rewrite rules, it's
 true.
 My configuration of virtual host is:

 VirtualHost *:80
  ServerName www.5pin.ru
  ServerAlias 5pin.ru
  ProxyPass / ajp://127.0.0.1:8009/FivePinSite-1.0-SNAPSHOT/
  ProxyPassReverse /
 ajp://127.0.0.1:8009/FivePinSite-1.0-SNAPSHOT/
  ProxyPassReverseCookieDomainlocalhost  5pin.ru
  ProxyPassReverseCookiePath /FivePinSite-1.0-SNAPSHOT /
  RewriteEngine  on
  RewriteRule^/FivePinSite-1\.0-SNAPSHOT/(.*)$  /$1  [R]
 /VirtualHost

 What I'm doing wrong?

 -- Tony



   
   
  
  
 
 



Re: Model property name different than wicket:id, is possible?

2009-10-21 Thread Iain Reddick

Hi,

You use it like this:

(assuming myModel is the compound property model)

Label idLabel = new Label(idLabel, myModel.bind(id));

This would  give component  id idLabel, using property id.

CompoundPropertyModel.bind() basically returns a PropertyModel.


iainr


Manuel Corrales wrote:

Ok, I have found a few things but still can't figure this out. Apparently
the BoundCompoundPropertyModel is what i need, but it is deprecated. And I
have read the javadoc but still can't figure out how to achieve having
wicket:id on HTML different than the property name in the model. The javadoc
mentions CompoundPropertyModel bind method, but can't figure out how to use
it.
Any help?

Thanks!

On Tue, Oct 20, 2009 at 3:57 PM, Manuel Corrales
manuelcorra...@gmail.comwrote:

  

Hello. I have a (i hope) reusable panel. This panel has a textField, a
hiddenField and a link that open up a modalWindow. Then you can select an
item from a list in the modal window and the field and hidden field
completes according to the selected value. I want the hidden field to be
binded with a property of the model I am using in a form (using
CompoundPropertyModel). I intend to use this panel in several forms in my
application, the problem I have is that the field name of the model object
is different on every form, and the wicket:id is the same (because it is the
same hiddenField).
How can I solve this? Is there a way of having a wicket:id with a different
name than a model property name?

Please ask for anything you need to help me, I don't know if I was clear on
my problem.

Thanks in advance!
Manuel.




  




Re: Behind proxy

2009-10-21 Thread Anton Veretennikov
Thank you, Nino, I'll repeat then,

The problem is that all Bookmarkable links continue to have
;jsessionid=... string even after first call. The same time, Ajax
links work (jsessionid is removed) as desired but only if they are
not called after any bookmarkable link.

Hope somebody have such a problem and solved it. May be this have
nothing to do with proxy.

-- Tony.

On Wed, Oct 21, 2009 at 5:32 PM, nino martinez wael
nino.martinez.w...@gmail.com wrote:
 Hmm Anton im not sure, but dont think so.. BookmarkablePageLinks are just
 that, and if session ID were appended they would'nt work..

 One of my sites are running a beta 1.4 i'll try to upgrade and see if I can
 replicate the error. But it might take some time..

 Im taking this issue back to the wicket list as it may speed up responses to
 it. So please respond to it there.

 2009/10/20 Anton Veretennikov anton.veretenni...@gmail.com

 Nino, seems to me that it has something with BookmarkablePageLinks. I
 use them everywhere except expanding tree links where Ajax is used.
 Look, when you press on +/- signes of tree, jsessionid
 disappears after first click (only in this tree Ajaxed block). After
 that you can press on bookmarkable links and everything will be okey.

 I tried to remove everything about cookies even Google Analytics code,
 this changes nothing.
 So, may be there is something in urlFor, is it possible?

 -- Tony


 On Mon, Oct 19, 2009 at 9:00 PM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
  No problem, please get back and tell if it works now:) im curios.
 
  2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com
 
  I think this may have something with cookies since I try to set cookie
  treeInfo and sometimes see it is set twice in response. May be I'm
  doing something wrong with a way how I do this. I'll try to turn off
  and see if it solves jsessionid problem.
 
  Thank you for your help, Nino
 
  -- Tony
 
  On Mon, Oct 19, 2009 at 5:39 PM, nino martinez wael
  nino.martinez.w...@gmail.com wrote:
   Hmm, then it not Apache HTTP, very wierd. So maybe it is either
   something
   for the wicket list or the Tomcat one, if you can get them to
   answer.. I
   saw
   that the jesession id were sat so it should work.
  
   2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com
  
   The same thing 
  
   http://72.249.185.124:8080/FivePinSite-1.0-SNAPSHOT/
  
   very strange...
  
   On Mon, Oct 19, 2009 at 5:13 PM, nino martinez wael
   nino.martinez.w...@gmail.com wrote:
If I were you I would try to take it on the apache http list...
Since
it's
probably that part which are failing.. If you hit the server
directly,
without the proxy does it work then ? If yes it's probably your
rewrite
rule?
   
2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com
   
May be I need to open this discussion in a wicket list?
   
On Mon, Oct 19, 2009 at 3:57 PM, Anton Veretennikov
anton.veretenni...@gmail.com wrote:
 Thank you, Nino,

 All my apps as I can see use the same method and only in one I
 see
 strange things with jsessionid.
 I need to investigate it somehow but don't know from where to
 start
 and how to know that exactly in that point things are going
 wrong.

 -- Tony


 On Sun, Oct 18, 2009 at 7:40 PM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
 One of mine looks like this:

 VirtualHost *:* 
 ServerName wicketgames.ninosbox.thruhere.net
 ServerAlias *.wicketgames.ninosbox.thruhere.net
     ProxyPass / http://10.0.0.2:8180/WicketGames/
     ProxyPassReverse / http://10.0.0.2:8180/WicketGames/
     ProxyPassReverseCookiePath /WicketGames /
    Proxy *
     Order deny,allow
     Allow from all
     /Proxy
 /VirtualHost

 And another:

 VirtualHost *:* 
 ServerName wheresmyevent.com
 ServerAlias www.wheresmyevent.com
     ProxyPass / http://10.0.0.2:8180/socratesTopia/
     ProxyPassReverse / http://10.0.0.2:8180/socratesTopia/
     ProxyPassReverseCookiePath /socratesTopia /
    Proxy *
     Order deny,allow
     Allow from all
     /Proxy
 /VirtualHost

 Your seems similar though, im not familiar with rewrite rules
 though..

 2009/10/17 Anton Veretennikov anton.veretenni...@gmail.com

 Hi, Nino,

 Thank you for your response, I'm using rewrite rules, it's
 true.
 My configuration of virtual host is:

 VirtualHost *:80
  ServerName www.5pin.ru
  ServerAlias 5pin.ru
  ProxyPass / ajp://127.0.0.1:8009/FivePinSite-1.0-SNAPSHOT/
  ProxyPassReverse /
 ajp://127.0.0.1:8009/FivePinSite-1.0-SNAPSHOT/
  ProxyPassReverseCookieDomain    localhost  5pin.ru
  ProxyPassReverseCookiePath /FivePinSite-1.0-SNAPSHOT /
  RewriteEngine  on
  RewriteRule    ^/FivePinSite-1\.0-SNAPSHOT/(.*)$  /$1  [R]
 

Re: Audit Trail For Fatal Error

2009-10-21 Thread Pedro H. O. dos Santos

Sorry, I meant set pagemape on your error analysis environment.
If your pages are stateless, it is a trivial work. You can use java.io api


Douglas Ferguson-2 wrote:
 
 What is pagemape error analysis environment?
 
 Or if you are just saying that this is possible, what api calls would  
 I be interested in?
 
 D/
 
 On Oct 20, 2009, at 3:25 PM, Pedro Santos wrote:
 
 if you serialize the pagemap object to an file and attache it on  
 your error
 report email? later you can set pagemape error analysis environment to
 reproduce the user steps, seems possible...

 On Tue, Oct 20, 2009 at 6:15 PM, Douglas Ferguson 
 doug...@douglasferguson.us wrote:

 I have a feature on our error page where users can submit a bug if
 they get a fatal error.

 In some cases the stack trace is not of much value with out
 understanding what the user was doing.

 I looked into the session and the pagemap but at first glance i  
 didn't
 see any way of unraveling any details that may be of help in
 understanding their previous actions, is there something there that's
 maybe not apparent to me?

 Douglas

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




 -- 
 Pedro Henrique Oliveira dos Santos
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Audit-Trail-For-Fatal-Error-tp25981797p25990368.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



how to update a form model when clicking a link

2009-10-21 Thread Antoine van Wel
On a page there's a form with a textarea.
Somewhere else on the page there is a wicket link, which is not inside the form.
The user types something in the textarea and then presses the link.

Now what I'd like to achieve is when the code of the link is executed,
the model of the form is up-to-date - so what the user has typed,
should be inside the model. The form should not be submitted.


Any suggestions how this can be done - preferably without writing Javascript?



Thanks,
Antoine


-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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



AjaxEditableLabel and problem with diacritical marks

2009-10-21 Thread danisevsky
Hello, when I submit AjaxEditableLabel which contains a letter with
diacritical mark (ěščřžýáíé..) I dont get right letter in model, but
something like this '?'.
All my markups contains this:

?xml version=1.0 encoding=UTF-8 ?
html xmlns:wicket
...
/html

Could you give me a advice?

thanks


Re: Secured/Constraint IDataProvider and DropDownChoice choices

2009-10-21 Thread Roman Ilin
Does someone have any fresh idea?



On Tue, Oct 20, 2009 at 10:32 PM, Roman Ilin roman.i...@gmail.com wrote:
 My components should stay visible all time. But data should be
 filtered by customer currently logged in.



 On Tue, Oct 20, 2009 at 10:29 PM, Pedro Santos pedros...@gmail.com wrote:
 I had application with components that override the isVisible method testing
 for

 return session.getUser().hasAccessFor(this)

 but the major access logic is implemented on data access layer

 On Tue, Oct 20, 2009 at 6:26 PM, Pedro Santos pedros...@gmail.com wrote:

 every time for every component
 why not for every query?



 On Tue, Oct 20, 2009 at 6:23 PM, Roman Ilin roman.i...@gmail.com wrote:

 Sure I save my user in session.
 The problem is that I have to implement this filter functionality
 every time for every component.



 On Tue, Oct 20, 2009 at 10:18 PM, Pedro Santos pedros...@gmail.com
 wrote:
  you can put user on session, and use this information as an filter to
  queries than fill the lists on your application models...
 
  On Tue, Oct 20, 2009 at 6:14 PM, Roman Ilin roman.i...@gmail.com
 wrote:
 
  Hi *,
 
  I develop WebApplication where database records belong to different
  organizations.
  I use AjaxFallbackDefaultDataTable to present tabular data. User from
  some organization is allowed to see his organization data only.
  To reach this I implement custom IDataProvider for every table.
 
  Is there some way to have generic IDataProvider which constraints
  shown data rows.
  Pagination and sorting, filtering of data should work as well :)
 
  I have the same problem with DropDownChoice. There choices depend on
  logged in user/organization.
 
  I read Wicket Security Wasp/Swarm tutorials but haven't found this
  functionality there.
  You can have secure model but you can't restrict list of models.
 
  Or I'm wrong?
 
 
  Regards
 
  Roman
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 

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




 --
 Pedro Henrique Oliveira dos Santos




 --
 Pedro Henrique Oliveira dos Santos



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



AW: how to update a form model when clicking a link

2009-10-21 Thread Peter Arnulf Lustig
Have you tried assign a Model to the component which needs to be updated?

ModelString model = new ModelString();
--- assign to the component of the form.
i.e. final TextField tf = new TextField(txt, model);

in Link Execution
- tf.setModel(mode);



- Ursprüngliche Mail 
Von: Antoine van Wel antoine.van@gmail.com
An: users@wicket.apache.org
Gesendet: Mittwoch, den 21. Oktober 2009, 13:22:01 Uhr
Betreff: how to update a form model when clicking a link

On a page there's a form with a textarea.
Somewhere else on the page there is a wicket link, which is not inside the form.
The user types something in the textarea and then presses the link.

Now what I'd like to achieve is when the code of the link is executed,
the model of the form is up-to-date - so what the user has typed,
should be inside the model. The form should not be submitted.


Any suggestions how this can be done - preferably without writing Javascript?



Thanks,
Antoine


-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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




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



Re: how to update a form model when clicking a link

2009-10-21 Thread Pedro Santos
you can add an AjaxFormComponentUpdatingBehavior on your textarea to keep
the model updated

On Wed, Oct 21, 2009 at 9:58 AM, Peter Arnulf Lustig u...@yahoo.dewrote:

 Have you tried assign a Model to the component which needs to be updated?

 ModelString model = new ModelString();
 --- assign to the component of the form.
 i.e. final TextField tf = new TextField(txt, model);

 in Link Execution
 - tf.setModel(mode);



 - Ursprüngliche Mail 
 Von: Antoine van Wel antoine.van@gmail.com
 An: users@wicket.apache.org
 Gesendet: Mittwoch, den 21. Oktober 2009, 13:22:01 Uhr
 Betreff: how to update a form model when clicking a link

 On a page there's a form with a textarea.
 Somewhere else on the page there is a wicket link, which is not inside the
 form.
 The user types something in the textarea and then presses the link.

 Now what I'd like to achieve is when the code of the link is executed,
 the model of the form is up-to-date - so what the user has typed,
 should be inside the model. The form should not be submitted.


 Any suggestions how this can be done - preferably without writing
 Javascript?



 Thanks,
 Antoine


 --
 take your photos everywhere you go - https://www.memolio.com
 follow us on Twitter - http://twitter.com/Memolio

 -
 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




-- 
Pedro Henrique Oliveira dos Santos


Re: Secured/Constraint IDataProvider and DropDownChoice choices

2009-10-21 Thread James Carman
Are you using Hibernate?  If so, you could use filters.  Also, Oracle
has something built in that will automatically rewrite your queries
for you based on the database user that's connected (most people don't
use Oracle usernames to connect, though).

On Wed, Oct 21, 2009 at 7:48 AM, Roman Ilin roman.i...@gmail.com wrote:
 Does someone have any fresh idea?



 On Tue, Oct 20, 2009 at 10:32 PM, Roman Ilin roman.i...@gmail.com wrote:
 My components should stay visible all time. But data should be
 filtered by customer currently logged in.



 On Tue, Oct 20, 2009 at 10:29 PM, Pedro Santos pedros...@gmail.com wrote:
 I had application with components that override the isVisible method testing
 for

 return session.getUser().hasAccessFor(this)

 but the major access logic is implemented on data access layer

 On Tue, Oct 20, 2009 at 6:26 PM, Pedro Santos pedros...@gmail.com wrote:

 every time for every component
 why not for every query?



 On Tue, Oct 20, 2009 at 6:23 PM, Roman Ilin roman.i...@gmail.com wrote:

 Sure I save my user in session.
 The problem is that I have to implement this filter functionality
 every time for every component.



 On Tue, Oct 20, 2009 at 10:18 PM, Pedro Santos pedros...@gmail.com
 wrote:
  you can put user on session, and use this information as an filter to
  queries than fill the lists on your application models...
 
  On Tue, Oct 20, 2009 at 6:14 PM, Roman Ilin roman.i...@gmail.com
 wrote:
 
  Hi *,
 
  I develop WebApplication where database records belong to different
  organizations.
  I use AjaxFallbackDefaultDataTable to present tabular data. User from
  some organization is allowed to see his organization data only.
  To reach this I implement custom IDataProvider for every table.
 
  Is there some way to have generic IDataProvider which constraints
  shown data rows.
  Pagination and sorting, filtering of data should work as well :)
 
  I have the same problem with DropDownChoice. There choices depend on
  logged in user/organization.
 
  I read Wicket Security Wasp/Swarm tutorials but haven't found this
  functionality there.
  You can have secure model but you can't restrict list of models.
 
  Or I'm wrong?
 
 
  Regards
 
  Roman
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 

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




 --
 Pedro Henrique Oliveira dos Santos




 --
 Pedro Henrique Oliveira dos Santos



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



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



Re: Model property name different than wicket:id, is possible?

2009-10-21 Thread James Carman
Do you have to use CompoundPropertyModel?  Why not use explicit models
instead?  This is one reason why I don't like to use
CompoundPropertyModels.

On Tue, Oct 20, 2009 at 2:57 PM, Manuel Corrales
manuelcorra...@gmail.com wrote:
 Hello. I have a (i hope) reusable panel. This panel has a textField, a
 hiddenField and a link that open up a modalWindow. Then you can select an
 item from a list in the modal window and the field and hidden field
 completes according to the selected value. I want the hidden field to be
 binded with a property of the model I am using in a form (using
 CompoundPropertyModel). I intend to use this panel in several forms in my
 application, the problem I have is that the field name of the model object
 is different on every form, and the wicket:id is the same (because it is the
 same hiddenField).
 How can I solve this? Is there a way of having a wicket:id with a different
 name than a model property name?

 Please ask for anything you need to help me, I don't know if I was clear on
 my problem.

 Thanks in advance!
 Manuel.


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



Re: Secured/Constraint IDataProvider and DropDownChoice choices

2009-10-21 Thread Roman Ilin
No I use plain Spring JDBC in one of my projects (there is old legacy DB)
but probably I'm going to use Hibernate in next one.



On Wed, Oct 21, 2009 at 2:13 PM, James Carman
jcar...@carmanconsulting.com wrote:
 Are you using Hibernate?  If so, you could use filters.  Also, Oracle
 has something built in that will automatically rewrite your queries
 for you based on the database user that's connected (most people don't
 use Oracle usernames to connect, though).

 On Wed, Oct 21, 2009 at 7:48 AM, Roman Ilin roman.i...@gmail.com wrote:
 Does someone have any fresh idea?



 On Tue, Oct 20, 2009 at 10:32 PM, Roman Ilin roman.i...@gmail.com wrote:
 My components should stay visible all time. But data should be
 filtered by customer currently logged in.



 On Tue, Oct 20, 2009 at 10:29 PM, Pedro Santos pedros...@gmail.com wrote:
 I had application with components that override the isVisible method 
 testing
 for

 return session.getUser().hasAccessFor(this)

 but the major access logic is implemented on data access layer

 On Tue, Oct 20, 2009 at 6:26 PM, Pedro Santos pedros...@gmail.com wrote:

 every time for every component
 why not for every query?



 On Tue, Oct 20, 2009 at 6:23 PM, Roman Ilin roman.i...@gmail.com wrote:

 Sure I save my user in session.
 The problem is that I have to implement this filter functionality
 every time for every component.



 On Tue, Oct 20, 2009 at 10:18 PM, Pedro Santos pedros...@gmail.com
 wrote:
  you can put user on session, and use this information as an filter to
  queries than fill the lists on your application models...
 
  On Tue, Oct 20, 2009 at 6:14 PM, Roman Ilin roman.i...@gmail.com
 wrote:
 
  Hi *,
 
  I develop WebApplication where database records belong to different
  organizations.
  I use AjaxFallbackDefaultDataTable to present tabular data. User from
  some organization is allowed to see his organization data only.
  To reach this I implement custom IDataProvider for every table.
 
  Is there some way to have generic IDataProvider which constraints
  shown data rows.
  Pagination and sorting, filtering of data should work as well :)
 
  I have the same problem with DropDownChoice. There choices depend on
  logged in user/organization.
 
  I read Wicket Security Wasp/Swarm tutorials but haven't found this
  functionality there.
  You can have secure model but you can't restrict list of models.
 
  Or I'm wrong?
 
 
  Regards
 
  Roman
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 

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




 --
 Pedro Henrique Oliveira dos Santos




 --
 Pedro Henrique Oliveira dos Santos



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



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



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



Re: Secured/Constraint IDataProvider and DropDownChoice choices

2009-10-21 Thread Martijn Dashorst
We use a thread local to store the organization of our user, and have
custom createCriteria() methods in our DAO's to add restrictions on
the organization.

Martijn

On Tue, Oct 20, 2009 at 10:14 PM, Roman Ilin roman.i...@gmail.com wrote:
 Hi *,

 I develop WebApplication where database records belong to different
 organizations.
 I use AjaxFallbackDefaultDataTable to present tabular data. User from
 some organization is allowed to see his organization data only.
 To reach this I implement custom IDataProvider for every table.

 Is there some way to have generic IDataProvider which constraints
 shown data rows.
 Pagination and sorting, filtering of data should work as well :)

 I have the same problem with DropDownChoice. There choices depend on
 logged in user/organization.

 I read Wicket Security Wasp/Swarm tutorials but haven't found this
 functionality there.
 You can have secure model but you can't restrict list of models.

 Or I'm wrong?


 Regards

 Roman

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





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

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



Re: how to update a form model when clicking a link

2009-10-21 Thread Antoine van Wel
Thanks for the replies.

Peter: that won't work - the contents of the textarea are not
transferred to the wicket app without some javascript / ajax magic
happening under the hood

Pedro: Using that I could let the component listen to onchange event
but that would cause an unacceptable load. I really want the model
update action to be initiated by the link. Or can I let clicking the
link generate an event which then will be picked up by the component?




Antoine


On Wed, Oct 21, 2009 at 2:03 PM, Pedro Santos pedros...@gmail.com wrote:
 you can add an AjaxFormComponentUpdatingBehavior on your textarea to keep
 the model updated

 On Wed, Oct 21, 2009 at 9:58 AM, Peter Arnulf Lustig u...@yahoo.dewrote:

 Have you tried assign a Model to the component which needs to be updated?

 ModelString model = new ModelString();
 --- assign to the component of the form.
 i.e. final TextField tf = new TextField(txt, model);

 in Link Execution
 - tf.setModel(mode);



 - Ursprüngliche Mail 
 Von: Antoine van Wel antoine.van@gmail.com
 An: users@wicket.apache.org
 Gesendet: Mittwoch, den 21. Oktober 2009, 13:22:01 Uhr
 Betreff: how to update a form model when clicking a link

 On a page there's a form with a textarea.
 Somewhere else on the page there is a wicket link, which is not inside the
 form.
 The user types something in the textarea and then presses the link.

 Now what I'd like to achieve is when the code of the link is executed,
 the model of the form is up-to-date - so what the user has typed,
 should be inside the model. The form should not be submitted.


 Any suggestions how this can be done - preferably without writing
 Javascript?



 Thanks,
 Antoine


 --
 take your photos everywhere you go - https://www.memolio.com
 follow us on Twitter - http://twitter.com/Memolio

 -
 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




 --
 Pedro Henrique Oliveira dos Santos




-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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



Re: Secured/Constraint IDataProvider and DropDownChoice choices

2009-10-21 Thread Roman Ilin
Two questions:
1) why do you use thread local and don't store organization in session
2) to pass organization to your createCriteria() you have to have
organization as parameter in every DAO method where it is appropriate,
right?



On Wed, Oct 21, 2009 at 2:17 PM, Martijn Dashorst
martijn.dasho...@gmail.com wrote:
 We use a thread local to store the organization of our user, and have
 custom createCriteria() methods in our DAO's to add restrictions on
 the organization.

 Martijn

 On Tue, Oct 20, 2009 at 10:14 PM, Roman Ilin roman.i...@gmail.com wrote:
 Hi *,

 I develop WebApplication where database records belong to different
 organizations.
 I use AjaxFallbackDefaultDataTable to present tabular data. User from
 some organization is allowed to see his organization data only.
 To reach this I implement custom IDataProvider for every table.

 Is there some way to have generic IDataProvider which constraints
 shown data rows.
 Pagination and sorting, filtering of data should work as well :)

 I have the same problem with DropDownChoice. There choices depend on
 logged in user/organization.

 I read Wicket Security Wasp/Swarm tutorials but haven't found this
 functionality there.
 You can have secure model but you can't restrict list of models.

 Or I'm wrong?


 Regards

 Roman

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





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

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



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



Re: how to update a form model when clicking a link

2009-10-21 Thread Pedro Santos
 Or can I let clicking the link generate an event which then will be picked
up by the component

you can, but is an workaround:
1 - add AjaxFormComponentUpdatingBehavior on your textarea for 'metal' event
2 - add
eval(Wicket.$('mytextareamarkupid').getAttribute('metal'))
on 'onclick' event of your link

But... seems very natural require the user submit the form that contains the
textarea.

On Wed, Oct 21, 2009 at 10:18 AM, Antoine van Wel antoine.van@gmail.com
 wrote:

 Thanks for the replies.

 Peter: that won't work - the contents of the textarea are not
 transferred to the wicket app without some javascript / ajax magic
 happening under the hood

 Pedro: Using that I could let the component listen to onchange event
 but that would cause an unacceptable load. I really want the model
 update action to be initiated by the link. Or can I let clicking the
 link generate an event which then will be picked up by the component?




 Antoine


 On Wed, Oct 21, 2009 at 2:03 PM, Pedro Santos pedros...@gmail.com wrote:
  you can add an AjaxFormComponentUpdatingBehavior on your textarea to keep
  the model updated
 
  On Wed, Oct 21, 2009 at 9:58 AM, Peter Arnulf Lustig u...@yahoo.de
 wrote:
 
  Have you tried assign a Model to the component which needs to be
 updated?
 
  ModelString model = new ModelString();
  --- assign to the component of the form.
  i.e. final TextField tf = new TextField(txt, model);
 
  in Link Execution
  - tf.setModel(mode);
 
 
 
  - Ursprüngliche Mail 
  Von: Antoine van Wel antoine.van@gmail.com
  An: users@wicket.apache.org
  Gesendet: Mittwoch, den 21. Oktober 2009, 13:22:01 Uhr
  Betreff: how to update a form model when clicking a link
 
  On a page there's a form with a textarea.
  Somewhere else on the page there is a wicket link, which is not inside
 the
  form.
  The user types something in the textarea and then presses the link.
 
  Now what I'd like to achieve is when the code of the link is executed,
  the model of the form is up-to-date - so what the user has typed,
  should be inside the model. The form should not be submitted.
 
 
  Any suggestions how this can be done - preferably without writing
  Javascript?
 
 
 
  Thanks,
  Antoine
 
 
  --
  take your photos everywhere you go - https://www.memolio.com
  follow us on Twitter - http://twitter.com/Memolio
 
  -
  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
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 



 --
 take your photos everywhere you go - https://www.memolio.com
 follow us on Twitter - http://twitter.com/Memolio

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




-- 
Pedro Henrique Oliveira dos Santos


Re: Secured/Constraint IDataProvider and DropDownChoice choices

2009-10-21 Thread James Carman
On Wed, Oct 21, 2009 at 8:22 AM, Roman Ilin roman.i...@gmail.com wrote:
 Two questions:
 1) why do you use thread local and don't store organization in session

If you store it in your session, you have to mix your data access
layer with your web layer.  With thread-local variables, you don't
(you just have to make sure you set/clear them properly).

 2) to pass organization to your createCriteria() you have to have
 organization as parameter in every DAO method where it is appropriate,
 right?

Not with the thread-locals, no.

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



Re: Behind proxy

2009-10-21 Thread Anton Veretennikov
Additional info to jsessionid problem:

This is seen on Tomcat 6.0.18 WITHOUT any proxy on bookmarkable links.
Glassfish 2.1 seems not appending jsessionid to url even on first call
(I have default settings) so there is no such behaviour.

-- Tony

On Wed, Oct 21, 2009 at 6:20 PM, Anton Veretennikov
anton.veretenni...@gmail.com wrote:
 Thank you, Nino, I'll repeat then,

 The problem is that all Bookmarkable links continue to have
 ;jsessionid=... string even after first call. The same time, Ajax
 links work (jsessionid is removed) as desired but only if they are
 not called after any bookmarkable link.

 Hope somebody have such a problem and solved it. May be this have
 nothing to do with proxy.

 -- Tony.

 On Wed, Oct 21, 2009 at 5:32 PM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
 Hmm Anton im not sure, but dont think so.. BookmarkablePageLinks are just
 that, and if session ID were appended they would'nt work..

 One of my sites are running a beta 1.4 i'll try to upgrade and see if I can
 replicate the error. But it might take some time..

 Im taking this issue back to the wicket list as it may speed up responses to
 it. So please respond to it there.

 2009/10/20 Anton Veretennikov anton.veretenni...@gmail.com

 Nino, seems to me that it has something with BookmarkablePageLinks. I
 use them everywhere except expanding tree links where Ajax is used.
 Look, when you press on +/- signes of tree, jsessionid
 disappears after first click (only in this tree Ajaxed block). After
 that you can press on bookmarkable links and everything will be okey.

 I tried to remove everything about cookies even Google Analytics code,
 this changes nothing.
 So, may be there is something in urlFor, is it possible?

 -- Tony


 On Mon, Oct 19, 2009 at 9:00 PM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
  No problem, please get back and tell if it works now:) im curios.
 
  2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com
 
  I think this may have something with cookies since I try to set cookie
  treeInfo and sometimes see it is set twice in response. May be I'm
  doing something wrong with a way how I do this. I'll try to turn off
  and see if it solves jsessionid problem.
 
  Thank you for your help, Nino
 
  -- Tony
 
  On Mon, Oct 19, 2009 at 5:39 PM, nino martinez wael
  nino.martinez.w...@gmail.com wrote:
   Hmm, then it not Apache HTTP, very wierd. So maybe it is either
   something
   for the wicket list or the Tomcat one, if you can get them to
   answer.. I
   saw
   that the jesession id were sat so it should work.
  
   2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com
  
   The same thing 
  
   http://72.249.185.124:8080/FivePinSite-1.0-SNAPSHOT/
  
   very strange...
  
   On Mon, Oct 19, 2009 at 5:13 PM, nino martinez wael
   nino.martinez.w...@gmail.com wrote:
If I were you I would try to take it on the apache http list...
Since
it's
probably that part which are failing.. If you hit the server
directly,
without the proxy does it work then ? If yes it's probably your
rewrite
rule?
   
2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com
   
May be I need to open this discussion in a wicket list?
   
On Mon, Oct 19, 2009 at 3:57 PM, Anton Veretennikov
anton.veretenni...@gmail.com wrote:
 Thank you, Nino,

 All my apps as I can see use the same method and only in one I
 see
 strange things with jsessionid.
 I need to investigate it somehow but don't know from where to
 start
 and how to know that exactly in that point things are going
 wrong.

 -- Tony


 On Sun, Oct 18, 2009 at 7:40 PM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
 One of mine looks like this:

 VirtualHost *:* 
 ServerName wicketgames.ninosbox.thruhere.net
 ServerAlias *.wicketgames.ninosbox.thruhere.net
     ProxyPass / http://10.0.0.2:8180/WicketGames/
     ProxyPassReverse / http://10.0.0.2:8180/WicketGames/
     ProxyPassReverseCookiePath /WicketGames /
    Proxy *
     Order deny,allow
     Allow from all
     /Proxy
 /VirtualHost

 And another:

 VirtualHost *:* 
 ServerName wheresmyevent.com
 ServerAlias www.wheresmyevent.com
     ProxyPass / http://10.0.0.2:8180/socratesTopia/
     ProxyPassReverse / http://10.0.0.2:8180/socratesTopia/
     ProxyPassReverseCookiePath /socratesTopia /
    Proxy *
     Order deny,allow
     Allow from all
     /Proxy
 /VirtualHost

 Your seems similar though, im not familiar with rewrite rules
 though..

 2009/10/17 Anton Veretennikov anton.veretenni...@gmail.com

 Hi, Nino,

 Thank you for your response, I'm using rewrite rules, it's
 true.
 My configuration of virtual host is:

 VirtualHost *:80
  ServerName www.5pin.ru
  ServerAlias 5pin.ru
  ProxyPass / 

Re: How to throw new PageExpiredException?

2009-10-21 Thread Linda van der Pal
When I ran into this problem myself with 1.4-rc4, I remembered this 
message and upgraded to rc7. But I still get the Unexpected 
RuntimeException page instead of my custom SessionExpiredPage. Am I 
doing something wrong?


Regards,
Linda

public class WicketApplication extends AuthenticatedWebApplication {
   @Override
   public ClassHomePage getHomePage() {
   return HomePage.class;
   }

   @Override
   protected Class? extends WebPage getSignInPageClass() {
   return LoginPage.class;
   }

   @Override
   protected Class? extends AuthenticatedWebSession 
getWebSessionClass() {

   return LunaSession.class;
   }

   @Override
   protected void init() {
   super.init();
   IApplicationSettings settings = getApplicationSettings();
   settings.setPageExpiredErrorPage(SessionExpiredPage.class);
   }

public class SessionExpiredPage extends WebPage {

   private static final long serialVersionUID = 1L;
  
   /**

* Constructor that is invoked when page is invoked without a session.
* @param parameters Page parameters
*/
   public SessionExpiredPage(final PageParameters parameters) {
   super(parameters);
  
   add(new StyleSheetReference(stylesheet, HomePage.class, 
luna.css));
   add(new Image(bookshelf, new ResourceReference(HomePage.class, 
bookshelf.png)));
  
  
   }

}

Major Péter wrote:
Which wicket version are you using? With 1.4-rc7 this behaviour should 
be fixed.


Peter



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



Re: Behind proxy

2009-10-21 Thread nino martinez wael
Strange I have tomcat 5.5 here, it does not have that problem.. Could it be
that it's tomcat related?

2009/10/21 Anton Veretennikov anton.veretenni...@gmail.com

 Additional info to jsessionid problem:

 This is seen on Tomcat 6.0.18 WITHOUT any proxy on bookmarkable links.
 Glassfish 2.1 seems not appending jsessionid to url even on first call
 (I have default settings) so there is no such behaviour.

 -- Tony

 On Wed, Oct 21, 2009 at 6:20 PM, Anton Veretennikov
 anton.veretenni...@gmail.com wrote:
  Thank you, Nino, I'll repeat then,
 
  The problem is that all Bookmarkable links continue to have
  ;jsessionid=... string even after first call. The same time, Ajax
  links work (jsessionid is removed) as desired but only if they are
  not called after any bookmarkable link.
 
  Hope somebody have such a problem and solved it. May be this have
  nothing to do with proxy.
 
  -- Tony.
 
  On Wed, Oct 21, 2009 at 5:32 PM, nino martinez wael
  nino.martinez.w...@gmail.com wrote:
  Hmm Anton im not sure, but dont think so.. BookmarkablePageLinks are
 just
  that, and if session ID were appended they would'nt work..
 
  One of my sites are running a beta 1.4 i'll try to upgrade and see if I
 can
  replicate the error. But it might take some time..
 
  Im taking this issue back to the wicket list as it may speed up
 responses to
  it. So please respond to it there.
 
  2009/10/20 Anton Veretennikov anton.veretenni...@gmail.com
 
  Nino, seems to me that it has something with BookmarkablePageLinks. I
  use them everywhere except expanding tree links where Ajax is used.
  Look, when you press on +/- signes of tree, jsessionid
  disappears after first click (only in this tree Ajaxed block). After
  that you can press on bookmarkable links and everything will be okey.
 
  I tried to remove everything about cookies even Google Analytics code,
  this changes nothing.
  So, may be there is something in urlFor, is it possible?
 
  -- Tony
 
 
  On Mon, Oct 19, 2009 at 9:00 PM, nino martinez wael
  nino.martinez.w...@gmail.com wrote:
   No problem, please get back and tell if it works now:) im curios.
  
   2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com
  
   I think this may have something with cookies since I try to set
 cookie
   treeInfo and sometimes see it is set twice in response. May be I'm
   doing something wrong with a way how I do this. I'll try to turn off
   and see if it solves jsessionid problem.
  
   Thank you for your help, Nino
  
   -- Tony
  
   On Mon, Oct 19, 2009 at 5:39 PM, nino martinez wael
   nino.martinez.w...@gmail.com wrote:
Hmm, then it not Apache HTTP, very wierd. So maybe it is either
something
for the wicket list or the Tomcat one, if you can get them to
answer.. I
saw
that the jesession id were sat so it should work.
   
2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com
   
The same thing 
   
http://72.249.185.124:8080/FivePinSite-1.0-SNAPSHOT/
   
very strange...
   
On Mon, Oct 19, 2009 at 5:13 PM, nino martinez wael
nino.martinez.w...@gmail.com wrote:
 If I were you I would try to take it on the apache http list...
 Since
 it's
 probably that part which are failing.. If you hit the server
 directly,
 without the proxy does it work then ? If yes it's probably your
 rewrite
 rule?

 2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com

 May be I need to open this discussion in a wicket list?

 On Mon, Oct 19, 2009 at 3:57 PM, Anton Veretennikov
 anton.veretenni...@gmail.com wrote:
  Thank you, Nino,
 
  All my apps as I can see use the same method and only in one
 I
  see
  strange things with jsessionid.
  I need to investigate it somehow but don't know from where
 to
  start
  and how to know that exactly in that point things are going
  wrong.
 
  -- Tony
 
 
  On Sun, Oct 18, 2009 at 7:40 PM, nino martinez wael
  nino.martinez.w...@gmail.com wrote:
  One of mine looks like this:
 
  VirtualHost *:* 
  ServerName wicketgames.ninosbox.thruhere.net
  ServerAlias *.wicketgames.ninosbox.thruhere.net
  ProxyPass / http://10.0.0.2:8180/WicketGames/
  ProxyPassReverse / http://10.0.0.2:8180/WicketGames/
  ProxyPassReverseCookiePath /WicketGames /
 Proxy *
  Order deny,allow
  Allow from all
  /Proxy
  /VirtualHost
 
  And another:
 
  VirtualHost *:* 
  ServerName wheresmyevent.com
  ServerAlias www.wheresmyevent.com
  ProxyPass / http://10.0.0.2:8180/socratesTopia/
  ProxyPassReverse / http://10.0.0.2:8180/socratesTopia/
  ProxyPassReverseCookiePath /socratesTopia /
 Proxy *
  Order deny,allow
  Allow from all
  /Proxy
  /VirtualHost
 
  Your seems similar though, im not familiar with rewrite
 rules
  though..
  

Wicket, Tooltips and IE 8

2009-10-21 Thread Callum MacGregor
Hi there,

I have a wicket application (using wicket 1.4.1)  that uses tooltips and
have been using Prototip up to this point. However I now find that with IE 8
they won't work, even in IE7 compatibility mode. As most of the users run
IE this is a major problem. I have tried switching to Mootips and that
doesn't seem to help. I have also tried upgrading to Prototype 1.6.1rc but
doesn't seem to help. Prototip 2.1 with Prototype 1.6.1rc is supposed to
work but the wicket-stuff-minis-prototip uses Prototip 1.2.1 and Prototype
1.6.0.2. I need to use Panels in my tooltips and was hoping to avoid having
to render them to Strings in order to usethem and so was hoping to use a
tooltip library that was already integrated with Wicket.  Does anyone have
any tips on either: a) a wicket tooltip plugin to use or b) any other ways
to achieve this...

Cheers,

Callum


Re: Page instantiated twice

2009-10-21 Thread Esteban Masoero
That is correct. I'm openning the page in a new tab just because of the 
process registration I'm doing:

- user registers
- app sends him an email with a generated link
- user clicks that link from his email page, which it's oppened in a new 
window/tab (there's no way It can be openned in its previous app page, 
where he recently registered)


And as I said in another email, I've found out that setting 
getPageSettings().setAutomaticMultiWindowSupport(false); solves the 
problem. However, I'm lossing the multi-window feature and I'm not sure 
I want that.


Isn't a way that the new page can use a copy of the session used by the 
old page? (although I guess a copy of the session should be made before 
its feeedback messages are consumed) Because as I see, there's no way 
that I can leave a feedback message to the session and so that message 
can be shown in a new window, because of this feature.


Thanks,

Esteban



Igor Vaynberg escribió:

are you opening the page in a new tab? this script is part of wicket
auto-multi-window support, it detects if the page has been opened in a
new tab and redirects to a url that will point to the same page but in
a new pagemap.

-igor

On Tue, Oct 20, 2009 at 4:23 PM, Esteban Masoero
emaso...@getsense.com.ar wrote:
  

First of all, thanks to all of you for your help.
I haven't solved the problem, but I'm getting closer to it.
(something like: new PageLink(new MyPage()); = I checked it and I'm not
doing that. )

Here's what I've found out:

After debugging a lot, I find out that TWO REQUESTS are made. The first one
as a consecuence of the user asking for that page, and the second one
because in that page the following script is added at the end of head tag:
script type=text/javascript !--/*--![CDATA[/*!--*/
if (window.name=='' || (window.name.indexOf('wicket')  -1 
window.name!='wicket-wicket:default')) {
window.location=?wicket:bookmarkablePage=wicket-6:ar.com.getsense.latamvalley.pages.LoginPage
+ (window.location.hash != null ? window.location.hash : ); }
/*--]]*//script

Can anyone tell me why is Wicket doing that? or what am I doing wrong?


|||
Here's the complete detailed description about what I am doing:

   A UserStatusPanel that is always shown does *new Link(register)*
with:
   @Override
   public void onClick() {
   throw new
RestartResponseAtInterceptPageException(UserRegistrationPage.class);
   }

   When the user gets to the page, submmits its registration data and
the page sends an email with a link like:
http://localhost:8080/ua?ua=2baab43f784b5b530b5347a50490bb0a


   In my webApp, I've done:
   this.mount(new QueryStringUrlCodingStrategy(/ua,
UserActivationPage.class));

   When the user goes to the previous mentioned link by a new tab, the
following happens:

   ___
   GET /ua?ua=2e129db15b6d6db5342ba5d328642262 HTTP/1.1
   Host: localhost:8080
   
   Connection: keep-alive
   Cookie: JSESSIONID=78ehtk0o3y0w
   ___
   === IN org.apache.wicket.RequestCycle.processEventsAndRespond() ===
   --processor.processEvents(this);
    UserActivationPage is constructed, and the page activates the
user
    UserActivationPage does: setResponsePage(LoginPage.class);
   --processor.respond(this);
   LoginPage is constructed (messages exists in session and are
properly rendered to somewhere)
   ===
   [I can see in firebug that the correct response reaches the browser!]

   Strangely, In the page, wicket adds:script
type=text/javascript !--/*--![CDATA[/*!--*/
if (window.name=='' || (window.name.indexOf('wicket')  -1 
window.name!='wicket-wicket:default')) {
window.location=?wicket:bookmarkablePage=wicket-6:ar.com.getsense.latamvalley.pages.LoginPage
+ (window.location.hash != null ? window.location.hash : ); }
/*--]]*//script

   [So a new request is made!]
   ___
   GET
/ua?wicket:bookmarkablePage=wicket-6:ar.com.getsense.latamvalley.pages.LoginPage
HTTP/1.1
   Host: localhost:8080
   ...
   Connection: keep-alive
   Referer: http://localhost:8080/ua?ua=2e129db15b6d6db5342ba5d328642262
   Cookie: JSESSIONID=78ehtk0o3y0w
   
   === IN org.apache.wicket.RequestCycle.processEventsAndRespond() ===
   --processor.processEvents(this);
    LoginPage is constructed (not UserActivationPage like it did
before) (this time, messages from the session are gonne)
   --processor.respond(this); finally this page is shown without my
messages :(
   ===

Thanks in advance,


Esteban






Martin Grigorov escribió:


El mar, 

Re: Wicket, Tooltips and IE 8

2009-10-21 Thread Martin Grigorov
checkout wicketstuff-minis-prototip and upgrade the dependencies
tune it, polish it and donate it back to community ;-)

El mié, 21-10-2009 a las 15:03 +0100, Callum MacGregor escribió:
 Hi there,
 
 I have a wicket application (using wicket 1.4.1)  that uses tooltips and
 have been using Prototip up to this point. However I now find that with IE 8
 they won't work, even in IE7 compatibility mode. As most of the users run
 IE this is a major problem. I have tried switching to Mootips and that
 doesn't seem to help. I have also tried upgrading to Prototype 1.6.1rc but
 doesn't seem to help. Prototip 2.1 with Prototype 1.6.1rc is supposed to
 work but the wicket-stuff-minis-prototip uses Prototip 1.2.1 and Prototype
 1.6.0.2. I need to use Panels in my tooltips and was hoping to avoid having
 to render them to Strings in order to usethem and so was hoping to use a
 tooltip library that was already integrated with Wicket.  Does anyone have
 any tips on either: a) a wicket tooltip plugin to use or b) any other ways
 to achieve this...
 
 Cheers,
 
 Callum


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



Re: Behind proxy

2009-10-21 Thread Anton Veretennikov
1. I checked it with Tomcat 5.5. Problem remained. All my bookmarkable
links to Home page with parameters contained jsessionid.

2. I got 1.5-SNAPSHOT, compiled, tried, problem remained.

3. I removed lines in WebResponse::encodeURL and
ServletWebResponse::encodeURL with logic about bug in apache tomcat
5.5:

@Override
public String encodeURL(String url)
{
if (url != null)
{
return 
httpServletResponse.encodeURL(url.toString());
}   
return httpServletResponse.encodeURL(url);
 }

and  miracle. jsessionid disappeared!

I don't know may be this workaround for 5.5 is not correct?

-- Tony


On Wed, Oct 21, 2009 at 10:02 PM, nino martinez wael
nino.martinez.w...@gmail.com wrote:
 Strange I have tomcat 5.5 here, it does not have that problem.. Could it be
 that it's tomcat related?

 2009/10/21 Anton Veretennikov anton.veretenni...@gmail.com

 Additional info to jsessionid problem:

 This is seen on Tomcat 6.0.18 WITHOUT any proxy on bookmarkable links.
 Glassfish 2.1 seems not appending jsessionid to url even on first call
 (I have default settings) so there is no such behaviour.

 -- Tony

 On Wed, Oct 21, 2009 at 6:20 PM, Anton Veretennikov
 anton.veretenni...@gmail.com wrote:
  Thank you, Nino, I'll repeat then,
 
  The problem is that all Bookmarkable links continue to have
  ;jsessionid=... string even after first call. The same time, Ajax
  links work (jsessionid is removed) as desired but only if they are
  not called after any bookmarkable link.
 
  Hope somebody have such a problem and solved it. May be this have
  nothing to do with proxy.
 
  -- Tony.
 
  On Wed, Oct 21, 2009 at 5:32 PM, nino martinez wael
  nino.martinez.w...@gmail.com wrote:
  Hmm Anton im not sure, but dont think so.. BookmarkablePageLinks are
 just
  that, and if session ID were appended they would'nt work..
 
  One of my sites are running a beta 1.4 i'll try to upgrade and see if I
 can
  replicate the error. But it might take some time..
 
  Im taking this issue back to the wicket list as it may speed up
 responses to
  it. So please respond to it there.
 
  2009/10/20 Anton Veretennikov anton.veretenni...@gmail.com
 
  Nino, seems to me that it has something with BookmarkablePageLinks. I
  use them everywhere except expanding tree links where Ajax is used.
  Look, when you press on +/- signes of tree, jsessionid
  disappears after first click (only in this tree Ajaxed block). After
  that you can press on bookmarkable links and everything will be okey.
 
  I tried to remove everything about cookies even Google Analytics code,
  this changes nothing.
  So, may be there is something in urlFor, is it possible?
 
  -- Tony
 
 
  On Mon, Oct 19, 2009 at 9:00 PM, nino martinez wael
  nino.martinez.w...@gmail.com wrote:
   No problem, please get back and tell if it works now:) im curios.
  
   2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com
  
   I think this may have something with cookies since I try to set
 cookie
   treeInfo and sometimes see it is set twice in response. May be I'm
   doing something wrong with a way how I do this. I'll try to turn off
   and see if it solves jsessionid problem.
  
   Thank you for your help, Nino
  
   -- Tony
  
   On Mon, Oct 19, 2009 at 5:39 PM, nino martinez wael
   nino.martinez.w...@gmail.com wrote:
Hmm, then it not Apache HTTP, very wierd. So maybe it is either
something
for the wicket list or the Tomcat one, if you can get them to
answer.. I
saw
that the jesession id were sat so it should work.
   
2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com
   
The same thing 
   
http://72.249.185.124:8080/FivePinSite-1.0-SNAPSHOT/
   
very strange...
   
On Mon, Oct 19, 2009 at 5:13 PM, nino martinez wael
nino.martinez.w...@gmail.com wrote:
 If I were you I would try to take it on the apache http list...
 Since
 it's
 probably that part which are failing.. If you hit the server
 directly,
 without the proxy does it work then ? If yes it's probably your
 rewrite
 rule?

 2009/10/19 Anton Veretennikov anton.veretenni...@gmail.com

 May be I need to open this discussion in a wicket list?

 On Mon, Oct 19, 2009 at 3:57 PM, Anton Veretennikov
 anton.veretenni...@gmail.com wrote:
  Thank you, Nino,
 
  All my apps as I can see use the same method and only in one
 I
  see
  strange things with jsessionid.
  I need to investigate it somehow but don't know from where
 to
  start
  and how to know that exactly in that point things are going
  wrong.
 
  -- Tony
 
 
  On Sun, Oct 18, 2009 at 7:40 PM, nino martinez wael
  nino.martinez.w...@gmail.com wrote:
  One of mine looks like this:
 
  VirtualHost *:* 
  ServerName wicketgames.ninosbox.thruhere.net
  

Re: Model property name different than wicket:id, is possible?

2009-10-21 Thread Manuel Corrales
Hey, thanks!! I solved the issue using Iain advice. Thanks for your help!
Best regards.

On Wed, Oct 21, 2009 at 9:15 AM, James Carman
jcar...@carmanconsulting.comwrote:

 Do you have to use CompoundPropertyModel?  Why not use explicit models
 instead?  This is one reason why I don't like to use
 CompoundPropertyModels.

 On Tue, Oct 20, 2009 at 2:57 PM, Manuel Corrales
 manuelcorra...@gmail.com wrote:
  Hello. I have a (i hope) reusable panel. This panel has a textField, a
  hiddenField and a link that open up a modalWindow. Then you can select an
  item from a list in the modal window and the field and hidden field
  completes according to the selected value. I want the hidden field to be
  binded with a property of the model I am using in a form (using
  CompoundPropertyModel). I intend to use this panel in several forms in my
  application, the problem I have is that the field name of the model
 object
  is different on every form, and the wicket:id is the same (because it is
 the
  same hiddenField).
  How can I solve this? Is there a way of having a wicket:id with a
 different
  name than a model property name?
 
  Please ask for anything you need to help me, I don't know if I was clear
 on
  my problem.
 
  Thanks in advance!
  Manuel.
 

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




Wicket Eclipse plugin, is there another?

2009-10-21 Thread Nicolas Melendez
Hi, is there another wicket plugin for eclipse?Wicket Bench project seems to
have low activity.
Any sugestion?
Thanks.
NM


wicketAjaxGet callback?

2009-10-21 Thread Vytautas Čivilis
Hi.

Is there any way wicketAjaxGet can call the provided callback function
with parameters from the backend?

Now, as far as I can see, there are only options to:
1. update component using AjaxRequestTarget
2. execute javascript using AjaxRequestTarget

What I need is to call the particular function (not the global one),
with parameters from backend.
The only possible way to achieve that (in my view), is to use 2nd option
combined with storing the callback function in some global map. Then I
would be able to call the correct callback function.

Is there any easier (not hacky) way?

Vytautas

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



WebRequestCycle is creating a HTTP 400/Bad request

2009-10-21 Thread Wayne Pope
Hi,

firstly I'm sure this is something we are doing wrong here and is not
an issue with wicket however we're lost as to what to do to solve it.

We have a page mounted like this:
mount(new MixedParamUrlCodingStrategy(/cube/todos, WhichTaskPage.class,.

We then request this page:
http://locolhost:8080/cube/todos/1/116

In the constructor of WhichTaskPage with throw a
RestartResponseAtInterceptPageException (and I have tried just using
setResponsePage) to another page.

Now in WebRequestCycle.redirectTo(final Page page) the line:
redirectUrl = page.urlFor(IRedirectListener.INTERFACE).toString();

creates the following url: ../../../?wicket:interface=:13

further up the call stack Jetty/Tomcat returns a HTTP 302 with the location:
http://localhost:8080/../../../?wicket:interface=:13


Now the issue:

Firefox seems to be smart enough to then request the following url
(I'm using a the sniffer call fiddler for this):
GET /?wicket:interface=:3 HTTP/1.1
this resolves and works fine.
However Internet Explorer does what its asked and redirect to:
GET /../../../?wicket:interface=:3 HTTP/1.1

This url does exists and Tomcat/Jetty returns HTTP 400


This is effecting all our IE users and we're in a bit of a panic as
how to solve it. Any ideas?
many thanks
Wayne

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



Re: Too Many Files Wicket 1.4.1

2009-10-21 Thread adambender

I was able to distill the problem down to what I think is the core issue
here. 

When an AJAX Wicket page is rendered it contains a reference to two .js
files as Igor had mentioned, the Web URLs of these files look like this:

App Context
Root/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js
App Context
Root/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-ajax.js

These requests are of course fielded by the Wicket filter which ends up
trying to load the resources using the UrlResourceStream. In order to
actually load these files Wicket gets the JAR URL for each file, converts
them to a URIs and then passes them to the File constructor. The problem is
that the URI that is created is opaque - 
http://www.docjar.com/docs/api/java/net/URI.html  see here for a good
explanation  in the case of wicket-event.js the URI string is like the
following :

jar:file:/absolute-path-tojar/wicket-1.4.1.jar!/org/apache/wicket/markup/html/wicket-event.js

It is similar for the case of wicket-ajax.js

A quick glance at the File constructor shows that an opaque URL cannot be
used to create a File as it is considered non-hierarchical. This of course
leaves you with lots of requests to load this file, none of which can be
completed and results in a lot of open URL connections which can never be
closed.

I guess my question is, should this loading mechanism be working because it
doesnt seem like it could the way it is currently written? Is it possible to
configure how Wicket finds these files embedded in the jar? Have I missed
something? 


Adam Bender-2 wrote:
 
 Thanks for the explanation I think that helps shed some light... The  
 tests are actually JMeter tests driving load by emulating a web  
 browser - the application the are testing is running in Deployment  
 mode set up as though it were a production server. After a little more  
 digging I have been able to determine that is only a problem on pages  
 which use Ajax - and it looks like there is a related debug message  
 coming from an exception handler regarding the wicket-event.js file  
 not being accessible (URI is not hierarchical). This would actually  
 explain  why the problem only manifests when the JMeter tests are set  
 to request embedded assets as wicket ajax pages embed requests for  
 additional pieces of javascript - which in the case of wicket-event.js  
 are causing exceptions to be thrown and the JVM bug you mentioned is  
 probably preventing these resources from being cleaned up properly.
 
 Does that sound right?
 
 Adam
 
 
 On Oct 20, 2009, at 8:41 PM, Igor Vaynberg wrote:
 
 when you are requesting an embedded resource wicket needs to stream
 the file out of a jar, the way the jvm handles that is by creating a
 jar url connection object that streams the file. unfortunately, there
 is a bug in the jdk where the url connection does not have a close
 method and so wicket or any other java app cannot release the
 connection. this is addressed, afair, in jdk 7.

 i have many apps deployed in production and have not managed yet to
 run out of the handles with the limit set about 4K. not sure why this
 is different in your case. you mentioned tests, are those unit tests
 and is wicket there running in deployment mode?

 the resource watcher, which should be disabled, will cause the handles
 to run out because it continuously monitors markup files for changes
 (hot reloading in dev mode) and everytime it checks a markup file in a
 jar it creates the url connection and leaks it. by default it is
 disabled in deployment mode but if you manually set the poll frequency
 in your settings it will be reenabled.

 -igor


 On Tue, Oct 20, 2009 at 4:07 PM, Adam Bender a...@magpieti.com  
 wrote:
 We have run with a limit as high as 10,000 files and our tests can  
 bring it
 to the limit in 20 minutes, but that still doesn't explain why so  
 many
 copies of the jar are needed - and only when we are also requesting  
 embedded
 assets...

 On Oct 20, 2009, at 5:04 PM, Major Péter wrote:

 resolution - solution...
 Just set the ulimit in the initscript and run it with start-stop- 
 daemon,
 it will make the problem disappear (but still there would be many  
 open
 files...)

 Peter

 2009-10-21 00:38 keltezéssel, Major Péter írta:

 Hi,

 we also had this issue, because (I think) we are running two  
 different
 wicket application in only one glassfish domain. Our resolution  
 was,
 that we are running now the glassfish domains with custom init  
 scripts
 with ulimit settings. Maybe this will help for you.

 Best Regards,
 Peter

 2009-10-21 00:14 keltezéssel, Martin Grigorov írta:

 Hi Adam,

 You may try to debug what is the problem with
 https://wiki.sdn.sap.com/wiki/display/Java/JPicus

 El mar, 20-10-2009 a las 15:39 -0600, Adam Bender escribió:

 Greetings all,

 Recently I have been performance testing a Wicket application  
 (1.4.1)
 and I
 am running into the dreaded Too Many Files Open issue. I have  

Re: wicketAjaxGet callback?

2009-10-21 Thread nino martinez wael
http://blog.jayway.com/2008/09/26/wicket-javascript-internals-dissected/

and also check the mootips on wicketstuff..

2009/10/21 Vytautas Čivilis vytautas.civi...@gmail.com

 Hi.

 Is there any way wicketAjaxGet can call the provided callback function
 with parameters from the backend?

 Now, as far as I can see, there are only options to:
 1. update component using AjaxRequestTarget
 2. execute javascript using AjaxRequestTarget

 What I need is to call the particular function (not the global one),
 with parameters from backend.
 The only possible way to achieve that (in my view), is to use 2nd option
 combined with storing the callback function in some global map. Then I
 would be able to call the correct callback function.

 Is there any easier (not hacky) way?

 Vytautas

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




Re: Too Many Files Wicket 1.4.1

2009-10-21 Thread Igor Vaynberg
where in wicket code do you see us doing new File(uri). afaik, we
always use streams and dont try to convert to a file...

-igor

On Wed, Oct 21, 2009 at 8:57 AM, adambender adamben...@gmail.com wrote:

 I was able to distill the problem down to what I think is the core issue
 here.

 When an AJAX Wicket page is rendered it contains a reference to two .js
 files as Igor had mentioned, the Web URLs of these files look like this:

 App Context
 Root/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js
 App Context
 Root/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-ajax.js

 These requests are of course fielded by the Wicket filter which ends up
 trying to load the resources using the UrlResourceStream. In order to
 actually load these files Wicket gets the JAR URL for each file, converts
 them to a URIs and then passes them to the File constructor. The problem is
 that the URI that is created is opaque -
 http://www.docjar.com/docs/api/java/net/URI.html  see here for a good
 explanation  in the case of wicket-event.js the URI string is like the
 following :

 jar:file:/absolute-path-tojar/wicket-1.4.1.jar!/org/apache/wicket/markup/html/wicket-event.js

 It is similar for the case of wicket-ajax.js

 A quick glance at the File constructor shows that an opaque URL cannot be
 used to create a File as it is considered non-hierarchical. This of course
 leaves you with lots of requests to load this file, none of which can be
 completed and results in a lot of open URL connections which can never be
 closed.

 I guess my question is, should this loading mechanism be working because it
 doesnt seem like it could the way it is currently written? Is it possible to
 configure how Wicket finds these files embedded in the jar? Have I missed
 something?


 Adam Bender-2 wrote:

 Thanks for the explanation I think that helps shed some light... The
 tests are actually JMeter tests driving load by emulating a web
 browser - the application the are testing is running in Deployment
 mode set up as though it were a production server. After a little more
 digging I have been able to determine that is only a problem on pages
 which use Ajax - and it looks like there is a related debug message
 coming from an exception handler regarding the wicket-event.js file
 not being accessible (URI is not hierarchical). This would actually
 explain  why the problem only manifests when the JMeter tests are set
 to request embedded assets as wicket ajax pages embed requests for
 additional pieces of javascript - which in the case of wicket-event.js
 are causing exceptions to be thrown and the JVM bug you mentioned is
 probably preventing these resources from being cleaned up properly.

 Does that sound right?

 Adam


 On Oct 20, 2009, at 8:41 PM, Igor Vaynberg wrote:

 when you are requesting an embedded resource wicket needs to stream
 the file out of a jar, the way the jvm handles that is by creating a
 jar url connection object that streams the file. unfortunately, there
 is a bug in the jdk where the url connection does not have a close
 method and so wicket or any other java app cannot release the
 connection. this is addressed, afair, in jdk 7.

 i have many apps deployed in production and have not managed yet to
 run out of the handles with the limit set about 4K. not sure why this
 is different in your case. you mentioned tests, are those unit tests
 and is wicket there running in deployment mode?

 the resource watcher, which should be disabled, will cause the handles
 to run out because it continuously monitors markup files for changes
 (hot reloading in dev mode) and everytime it checks a markup file in a
 jar it creates the url connection and leaks it. by default it is
 disabled in deployment mode but if you manually set the poll frequency
 in your settings it will be reenabled.

 -igor


 On Tue, Oct 20, 2009 at 4:07 PM, Adam Bender a...@magpieti.com
 wrote:
 We have run with a limit as high as 10,000 files and our tests can
 bring it
 to the limit in 20 minutes, but that still doesn't explain why so
 many
 copies of the jar are needed - and only when we are also requesting
 embedded
 assets...

 On Oct 20, 2009, at 5:04 PM, Major Péter wrote:

 resolution - solution...
 Just set the ulimit in the initscript and run it with start-stop-
 daemon,
 it will make the problem disappear (but still there would be many
 open
 files...)

 Peter

 2009-10-21 00:38 keltezéssel, Major Péter írta:

 Hi,

 we also had this issue, because (I think) we are running two
 different
 wicket application in only one glassfish domain. Our resolution
 was,
 that we are running now the glassfish domains with custom init
 scripts
 with ulimit settings. Maybe this will help for you.

 Best Regards,
 Peter

 2009-10-21 00:14 keltezéssel, Martin Grigorov írta:

 Hi Adam,

 You may try to debug what is the problem with
 https://wiki.sdn.sap.com/wiki/display/Java/JPicus

 El mar, 20-10-2009 a las 15:39 -0600, Adam 

Re: Wicket Eclipse plugin, is there another?

2009-10-21 Thread Fernando Wermus
I know, but I havent tested it, that netbeans comes with a plug in for
wicket.

On Wed, Oct 21, 2009 at 1:00 PM, Nicolas Melendez nmelen...@getsense.com.ar
 wrote:

 Hi, is there another wicket plugin for eclipse?Wicket Bench project seems
 to
 have low activity.
 Any sugestion?
 Thanks.
 NM




-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: Too Many Files Wicket 1.4.1

2009-10-21 Thread adambender

This issue looks like it is directly related to
http://issues.apache.org/jira/browse/WICKET-438 and the access of the
lastModified header. Every time a URLResourceStream is constructed the
lastModified time is requested at line 85 and the number of file handles
goes up by one. The solution to the jira issue indicated that upgrading the
version of linux fixed the problem but it doesnt seem to be the case with OS
X or Red Hat Enterprise Linux...


adambender wrote:
 
 I was able to distill the problem down to what I think is the core issue
 here. 
 
 When an AJAX Wicket page is rendered it contains a reference to two .js
 files as Igor had mentioned, the Web URLs of these files look like this:
 
 App Context
 Root/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js
 App Context
 Root/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-ajax.js
 
 These requests are of course fielded by the Wicket filter which ends up
 trying to load the resources using the UrlResourceStream. In order to
 actually load these files Wicket gets the JAR URL for each file, converts
 them to a URIs and then passes them to the File constructor. The problem
 is that the URI that is created is opaque - 
 http://www.docjar.com/docs/api/java/net/URI.html  see here for a good
 explanation  in the case of wicket-event.js the URI string is like the
 following :
 
 jar:file:/absolute-path-tojar/wicket-1.4.1.jar!/org/apache/wicket/markup/html/wicket-event.js
 
 It is similar for the case of wicket-ajax.js
 
 A quick glance at the File constructor shows that an opaque URL cannot be
 used to create a File as it is considered non-hierarchical. This of course
 leaves you with lots of requests to load this file, none of which can be
 completed and results in a lot of open URL connections which can never be
 closed.
 
 I guess my question is, should this loading mechanism be working because
 it doesnt seem like it could the way it is currently written? Is it
 possible to configure how Wicket finds these files embedded in the jar?
 Have I missed something? 
 
 
 Adam Bender-2 wrote:
 
 Thanks for the explanation I think that helps shed some light... The  
 tests are actually JMeter tests driving load by emulating a web  
 browser - the application the are testing is running in Deployment  
 mode set up as though it were a production server. After a little more  
 digging I have been able to determine that is only a problem on pages  
 which use Ajax - and it looks like there is a related debug message  
 coming from an exception handler regarding the wicket-event.js file  
 not being accessible (URI is not hierarchical). This would actually  
 explain  why the problem only manifests when the JMeter tests are set  
 to request embedded assets as wicket ajax pages embed requests for  
 additional pieces of javascript - which in the case of wicket-event.js  
 are causing exceptions to be thrown and the JVM bug you mentioned is  
 probably preventing these resources from being cleaned up properly.
 
 Does that sound right?
 
 Adam
 
 
 On Oct 20, 2009, at 8:41 PM, Igor Vaynberg wrote:
 
 when you are requesting an embedded resource wicket needs to stream
 the file out of a jar, the way the jvm handles that is by creating a
 jar url connection object that streams the file. unfortunately, there
 is a bug in the jdk where the url connection does not have a close
 method and so wicket or any other java app cannot release the
 connection. this is addressed, afair, in jdk 7.

 i have many apps deployed in production and have not managed yet to
 run out of the handles with the limit set about 4K. not sure why this
 is different in your case. you mentioned tests, are those unit tests
 and is wicket there running in deployment mode?

 the resource watcher, which should be disabled, will cause the handles
 to run out because it continuously monitors markup files for changes
 (hot reloading in dev mode) and everytime it checks a markup file in a
 jar it creates the url connection and leaks it. by default it is
 disabled in deployment mode but if you manually set the poll frequency
 in your settings it will be reenabled.

 -igor


 On Tue, Oct 20, 2009 at 4:07 PM, Adam Bender a...@magpieti.com  
 wrote:
 We have run with a limit as high as 10,000 files and our tests can  
 bring it
 to the limit in 20 minutes, but that still doesn't explain why so  
 many
 copies of the jar are needed - and only when we are also requesting  
 embedded
 assets...

 On Oct 20, 2009, at 5:04 PM, Major Péter wrote:

 resolution - solution...
 Just set the ulimit in the initscript and run it with start-stop- 
 daemon,
 it will make the problem disappear (but still there would be many  
 open
 files...)

 Peter

 2009-10-21 00:38 keltezéssel, Major Péter írta:

 Hi,

 we also had this issue, because (I think) we are running two  
 different
 wicket application in only one glassfish domain. Our resolution  
 was,
 that we are running now the 

Re: WebRequestCycle is creating a HTTP 400/Bad request

2009-10-21 Thread Igor Vaynberg
so is it jetty/tomcat doing the conversion of relative url to
absolute? because looks like they are doing it incorrectly...

-igor

On Wed, Oct 21, 2009 at 9:11 AM, Wayne Pope
waynemailingli...@googlemail.com wrote:
 Hi,

 firstly I'm sure this is something we are doing wrong here and is not
 an issue with wicket however we're lost as to what to do to solve it.

 We have a page mounted like this:
 mount(new MixedParamUrlCodingStrategy(/cube/todos, WhichTaskPage.class,.

 We then request this page:
 http://locolhost:8080/cube/todos/1/116

 In the constructor of WhichTaskPage with throw a
 RestartResponseAtInterceptPageException (and I have tried just using
 setResponsePage) to another page.

 Now in WebRequestCycle.redirectTo(final Page page) the line:
 redirectUrl = page.urlFor(IRedirectListener.INTERFACE).toString();

 creates the following url: ../../../?wicket:interface=:13

 further up the call stack Jetty/Tomcat returns a HTTP 302 with the location:
 http://localhost:8080/../../../?wicket:interface=:13


 Now the issue:

 Firefox seems to be smart enough to then request the following url
 (I'm using a the sniffer call fiddler for this):
 GET /?wicket:interface=:3 HTTP/1.1
 this resolves and works fine.
 However Internet Explorer does what its asked and redirect to:
 GET /../../../?wicket:interface=:3 HTTP/1.1

 This url does exists and Tomcat/Jetty returns HTTP 400


 This is effecting all our IE users and we're in a bit of a panic as
 how to solve it. Any ideas?
 many thanks
 Wayne

 -
 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



Idiomatic way to reference shared images?

2009-10-21 Thread Ceki Gulcu

Hello,

I am trying to defined shared images in a Wicket application.

In my prokect, the image file help.gif is located under the
src/main/java/com/foo/ folder of my project. I have created an empty
class called Images.

package com.foo;
public class Images {
}

In the init() method of my web-application, I add help.gif as a shared resource:

public class MyApplication extends WebApplication {


  @Override
  protected void init() {
...
PackageResource pr = PackageResource.get(Images.class, help.gif);
sharedResources.add(help.gif, pr);
  }
}

In markup, I attempt to access the images as

   wicket:link
 tdimg src=/resources/help.gif align=top//td
   /wicket:link

Unfortunately, this does not seem to work. However, the following
markup works just fine but it's too cumbersome to write.

   wicket:link
 img src=resources/org.apache.wicket.Application/help.gif/
   /wicket:link

Reading page 229 of the Wicket in Action book, I would have thought
that the /resources/help.gif reference would have worked. Quoting
from the book:

  The resource is then available through a stable URL (/resources/discounts),
  independent of components. (page 229)

What is the idiomatic way in Wicket to reference shared images?

Many thanks in advance for your response,

--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch

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



Re: Too Many Files Wicket 1.4.1

2009-10-21 Thread Igor Vaynberg
i just dont see what we can do about this... we are calling
connection.getLastModified(), we are not creating a file, etc...

-igor

On Wed, Oct 21, 2009 at 10:18 AM, adambender adamben...@gmail.com wrote:

 This issue looks like it is directly related to
 http://issues.apache.org/jira/browse/WICKET-438 and the access of the
 lastModified header. Every time a URLResourceStream is constructed the
 lastModified time is requested at line 85 and the number of file handles
 goes up by one. The solution to the jira issue indicated that upgrading the
 version of linux fixed the problem but it doesnt seem to be the case with OS
 X or Red Hat Enterprise Linux...


 adambender wrote:

 I was able to distill the problem down to what I think is the core issue
 here.

 When an AJAX Wicket page is rendered it contains a reference to two .js
 files as Igor had mentioned, the Web URLs of these files look like this:

 App Context
 Root/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js
 App Context
 Root/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-ajax.js

 These requests are of course fielded by the Wicket filter which ends up
 trying to load the resources using the UrlResourceStream. In order to
 actually load these files Wicket gets the JAR URL for each file, converts
 them to a URIs and then passes them to the File constructor. The problem
 is that the URI that is created is opaque -
 http://www.docjar.com/docs/api/java/net/URI.html  see here for a good
 explanation  in the case of wicket-event.js the URI string is like the
 following :

 jar:file:/absolute-path-tojar/wicket-1.4.1.jar!/org/apache/wicket/markup/html/wicket-event.js

 It is similar for the case of wicket-ajax.js

 A quick glance at the File constructor shows that an opaque URL cannot be
 used to create a File as it is considered non-hierarchical. This of course
 leaves you with lots of requests to load this file, none of which can be
 completed and results in a lot of open URL connections which can never be
 closed.

 I guess my question is, should this loading mechanism be working because
 it doesnt seem like it could the way it is currently written? Is it
 possible to configure how Wicket finds these files embedded in the jar?
 Have I missed something?


 Adam Bender-2 wrote:

 Thanks for the explanation I think that helps shed some light... The
 tests are actually JMeter tests driving load by emulating a web
 browser - the application the are testing is running in Deployment
 mode set up as though it were a production server. After a little more
 digging I have been able to determine that is only a problem on pages
 which use Ajax - and it looks like there is a related debug message
 coming from an exception handler regarding the wicket-event.js file
 not being accessible (URI is not hierarchical). This would actually
 explain  why the problem only manifests when the JMeter tests are set
 to request embedded assets as wicket ajax pages embed requests for
 additional pieces of javascript - which in the case of wicket-event.js
 are causing exceptions to be thrown and the JVM bug you mentioned is
 probably preventing these resources from being cleaned up properly.

 Does that sound right?

 Adam


 On Oct 20, 2009, at 8:41 PM, Igor Vaynberg wrote:

 when you are requesting an embedded resource wicket needs to stream
 the file out of a jar, the way the jvm handles that is by creating a
 jar url connection object that streams the file. unfortunately, there
 is a bug in the jdk where the url connection does not have a close
 method and so wicket or any other java app cannot release the
 connection. this is addressed, afair, in jdk 7.

 i have many apps deployed in production and have not managed yet to
 run out of the handles with the limit set about 4K. not sure why this
 is different in your case. you mentioned tests, are those unit tests
 and is wicket there running in deployment mode?

 the resource watcher, which should be disabled, will cause the handles
 to run out because it continuously monitors markup files for changes
 (hot reloading in dev mode) and everytime it checks a markup file in a
 jar it creates the url connection and leaks it. by default it is
 disabled in deployment mode but if you manually set the poll frequency
 in your settings it will be reenabled.

 -igor


 On Tue, Oct 20, 2009 at 4:07 PM, Adam Bender a...@magpieti.com
 wrote:
 We have run with a limit as high as 10,000 files and our tests can
 bring it
 to the limit in 20 minutes, but that still doesn't explain why so
 many
 copies of the jar are needed - and only when we are also requesting
 embedded
 assets...

 On Oct 20, 2009, at 5:04 PM, Major Péter wrote:

 resolution - solution...
 Just set the ulimit in the initscript and run it with start-stop-
 daemon,
 it will make the problem disappear (but still there would be many
 open
 files...)

 Peter

 2009-10-21 00:38 keltezéssel, Major Péter írta:

 Hi,

 we also had this 

Re: AW: file download using ajaxLink

2009-10-21 Thread Sven Meier

I've added an alternative solution with a behavior.

Thanks for the original idea.

Sven

Giambalvo, Christian wrote:

Updated 
http://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow

Mit freundlichen Grüßen
Christian Giambalvo
--
Fachinformatiker für Anwendungsentwicklung

EXCELSIS Informationssysteme GmbH
Wilhelmsplatz 8 - 70182 Stuttgart
Mobile +49 176 196 32 406
Office +49 711 6 20 30 406
christian.giamba...@excelsisnet.com
www.excelsisnet.com
www.twitter.com/excelsis_info

Sitz Stuttgart
Amtsgericht Stuttgart, HRB 21104
Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf


-Ursprüngliche Nachricht-
Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Gesendet: Mittwoch, 21. Oktober 2009 09:40

An: users@wicket.apache.org
Betreff: Re: file download using ajaxLink

Maybe this might help
http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html

http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
Ernesto

On Tue, Oct 20, 2009 at 10:12 PM, tubin gen fachh...@gmail.com wrote:

  

I do download in traditional way

here is the code

   public void download(String filename, byte[] filedata){
   setRedirect(false);
   WebResponse response = (WebResponse) getResponse();
   response.setAttachmentHeader(filename);
   response.setLastModifiedTime(Time.now());
   response.setContentType(application/octet-stream);
   response.write(
   new ByteArrayInputStream(filedata));
   response.close();
   }


   item.add(new LinkVoid(download){
   {
   add(new Label(filename,
eaAuditProgramAttachment.getFileName()));
   }
   @Override
   public void onClick() {

((BasePage)getPage()).download(eaAuditProgramAttachment.getFileName(),
eaAuditProgramAttachment.getEaBlob().getBlobData());
   }
   });


If I replace this link with AjaxLink it will not work  and I must use  an
ajaxlinkplease tell me how can I use ajaxLink for download




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

  



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



Re: Page instantiated twice

2009-10-21 Thread Esteban Masoero
Any comments about this? could It be a bug? If there's no other way of 
achieving the multiwindow feature that doesn't include instanciating the 
page again, maybe something could be done to avoid that the first 
instance consumes the session messages, because as we see this first 
page instance isn't the one that will be seen in the browser.


what do you think?

Esteban


Esteban Masoero escribió:
That is correct. I'm openning the page in a new tab just because of 
the process registration I'm doing:

- user registers
- app sends him an email with a generated link
- user clicks that link from his email page, which it's oppened in a 
new window/tab (there's no way It can be openned in its previous app 
page, where he recently registered)


And as I said in another email, I've found out that setting 
getPageSettings().setAutomaticMultiWindowSupport(false); solves the 
problem. However, I'm lossing the multi-window feature and I'm not 
sure I want that.


Isn't a way that the new page can use a copy of the session used by 
the old page? (although I guess a copy of the session should be made 
before its feeedback messages are consumed) Because as I see, there's 
no way that I can leave a feedback message to the session and so that 
message can be shown in a new window, because of this feature.


Thanks,

Esteban



Igor Vaynberg escribió:

are you opening the page in a new tab? this script is part of wicket
auto-multi-window support, it detects if the page has been opened in a
new tab and redirects to a url that will point to the same page but in
a new pagemap.

-igor

On Tue, Oct 20, 2009 at 4:23 PM, Esteban Masoero
emaso...@getsense.com.ar wrote:
 

First of all, thanks to all of you for your help.
I haven't solved the problem, but I'm getting closer to it.
(something like: new PageLink(new MyPage()); = I checked it and I'm 
not

doing that. )

Here's what I've found out:

After debugging a lot, I find out that TWO REQUESTS are made. The 
first one

as a consecuence of the user asking for that page, and the second one
because in that page the following script is added at the end of 
head tag:

script type=text/javascript !--/*--![CDATA[/*!--*/
if (window.name=='' || (window.name.indexOf('wicket')  -1 
window.name!='wicket-wicket:default')) {
window.location=?wicket:bookmarkablePage=wicket-6:ar.com.getsense.latamvalley.pages.LoginPage 


+ (window.location.hash != null ? window.location.hash : ); }
/*--]]*//script

Can anyone tell me why is Wicket doing that? or what am I doing wrong?


||| 


Here's the complete detailed description about what I am doing:

   A UserStatusPanel that is always shown does *new 
Link(register)*

with:
   @Override
   public void onClick() {
   throw new
RestartResponseAtInterceptPageException(UserRegistrationPage.class);
   }

   When the user gets to the page, submmits its registration 
data and

the page sends an email with a link like:
http://localhost:8080/ua?ua=2baab43f784b5b530b5347a50490bb0a


   In my webApp, I've done:
   this.mount(new QueryStringUrlCodingStrategy(/ua,
UserActivationPage.class));

   When the user goes to the previous mentioned link by a new 
tab, the

following happens:

   ___
   GET /ua?ua=2e129db15b6d6db5342ba5d328642262 HTTP/1.1
   Host: localhost:8080
   
   Connection: keep-alive
   Cookie: JSESSIONID=78ehtk0o3y0w
   ___
   === IN 
org.apache.wicket.RequestCycle.processEventsAndRespond() ===

   --processor.processEvents(this);
    UserActivationPage is constructed, and the page 
activates the

user
    UserActivationPage does: setResponsePage(LoginPage.class);
   --processor.respond(this);
   LoginPage is constructed (messages exists in session and are
properly rendered to somewhere)
   
===
   [I can see in firebug that the correct response reaches the 
browser!]


   Strangely, In the page, wicket adds:script
type=text/javascript !--/*--![CDATA[/*!--*/
if (window.name=='' || (window.name.indexOf('wicket')  -1 
window.name!='wicket-wicket:default')) {
window.location=?wicket:bookmarkablePage=wicket-6:ar.com.getsense.latamvalley.pages.LoginPage 


+ (window.location.hash != null ? window.location.hash : ); }
/*--]]*//script

   [So a new request is made!]
   ___
   GET
/ua?wicket:bookmarkablePage=wicket-6:ar.com.getsense.latamvalley.pages.LoginPage 


HTTP/1.1
   Host: localhost:8080
   ...
   Connection: keep-alive
   Referer: 
http://localhost:8080/ua?ua=2e129db15b6d6db5342ba5d328642262

   Cookie: JSESSIONID=78ehtk0o3y0w
   
   === IN 

Re: Too Many Files Wicket 1.4.1

2009-10-21 Thread adambender

For what it is worth I saw a file being created in the URLResourceStream
constructor at line 88 but it doesn't look like this is the source of any
problems, its just a way to figure out how to check the lastModified time
later on. 

While I can't claim any kind of expertise on the inner workings of Wicket it
seems that this problem would be solved if it wasn't required to check the
last modification time on those resources which are embedded in the Wicket
jar. Of course I have no idea what else this would affect so it may not be
so simple. It may also be possible to just cache the stream or the actual
.js string for use by later requests so that it is not necessary to try and
reload files like this from the jar every time they are requested.

For our use what we are likely going to do is pull the .js files out and
place them where httpd can serve them and then use some url rewriting magic
to prevent Wicket from serving them.


Adam


igor.vaynberg wrote:
 
 i just dont see what we can do about this... we are calling
 connection.getLastModified(), we are not creating a file, etc...
 
 -igor
 
 On Wed, Oct 21, 2009 at 10:18 AM, adambender adamben...@gmail.com wrote:

 This issue looks like it is directly related to
 http://issues.apache.org/jira/browse/WICKET-438 and the access of the
 lastModified header. Every time a URLResourceStream is constructed the
 lastModified time is requested at line 85 and the number of file handles
 goes up by one. The solution to the jira issue indicated that upgrading
 the
 version of linux fixed the problem but it doesnt seem to be the case with
 OS
 X or Red Hat Enterprise Linux...


 adambender wrote:

 I was able to distill the problem down to what I think is the core issue
 here.

 When an AJAX Wicket page is rendered it contains a reference to two .js
 files as Igor had mentioned, the Web URLs of these files look like this:

 App Context
 Root/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js
 App Context
 Root/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-ajax.js

 These requests are of course fielded by the Wicket filter which ends up
 trying to load the resources using the UrlResourceStream. In order to
 actually load these files Wicket gets the JAR URL for each file,
 converts
 them to a URIs and then passes them to the File constructor. The problem
 is that the URI that is created is opaque -
 http://www.docjar.com/docs/api/java/net/URI.html  see here for a good
 explanation  in the case of wicket-event.js the URI string is like the
 following :

 jar:file:/absolute-path-tojar/wicket-1.4.1.jar!/org/apache/wicket/markup/html/wicket-event.js

 It is similar for the case of wicket-ajax.js

 A quick glance at the File constructor shows that an opaque URL cannot
 be
 used to create a File as it is considered non-hierarchical. This of
 course
 leaves you with lots of requests to load this file, none of which can be
 completed and results in a lot of open URL connections which can never
 be
 closed.

 I guess my question is, should this loading mechanism be working because
 it doesnt seem like it could the way it is currently written? Is it
 possible to configure how Wicket finds these files embedded in the jar?
 Have I missed something?


 Adam Bender-2 wrote:

 Thanks for the explanation I think that helps shed some light... The
 tests are actually JMeter tests driving load by emulating a web
 browser - the application the are testing is running in Deployment
 mode set up as though it were a production server. After a little more
 digging I have been able to determine that is only a problem on pages
 which use Ajax - and it looks like there is a related debug message
 coming from an exception handler regarding the wicket-event.js file
 not being accessible (URI is not hierarchical). This would actually
 explain  why the problem only manifests when the JMeter tests are set
 to request embedded assets as wicket ajax pages embed requests for
 additional pieces of javascript - which in the case of wicket-event.js
 are causing exceptions to be thrown and the JVM bug you mentioned is
 probably preventing these resources from being cleaned up properly.

 Does that sound right?

 Adam


 On Oct 20, 2009, at 8:41 PM, Igor Vaynberg wrote:

 when you are requesting an embedded resource wicket needs to stream
 the file out of a jar, the way the jvm handles that is by creating a
 jar url connection object that streams the file. unfortunately, there
 is a bug in the jdk where the url connection does not have a close
 method and so wicket or any other java app cannot release the
 connection. this is addressed, afair, in jdk 7.

 i have many apps deployed in production and have not managed yet to
 run out of the handles with the limit set about 4K. not sure why this
 is different in your case. you mentioned tests, are those unit tests
 and is wicket there running in deployment mode?

 the resource watcher, which should be disabled, will 

Re: how to update a form model when clicking a link

2009-10-21 Thread Antoine van Wel
Thanks, it works!

In my case submitting the form is not natural at all - the form submit
does a lot of actions while all I want is the text that the user
entered to show up in the next page. (The link that is being clicked
is not directly related to the form.)

Now I got a new question related to this... Instead of attaching this
behavior to a link, I want this behavior attached to a form submit. So
got 2 forms on the page, that event needs to get triggered on form
submit.. Guess I need to put the same hook in the action of the
form. But how to do that and afterwards continue with the original
action? (The headache is caused when pressing the enter key in that
second form.)



Antoine

On Wed, Oct 21, 2009 at 2:52 PM, Pedro Santos pedros...@gmail.com wrote:
  Or can I let clicking the link generate an event which then will be picked
 up by the component

 you can, but is an workaround:
 1 - add AjaxFormComponentUpdatingBehavior on your textarea for 'metal' event
 2 - add
 eval(Wicket.$('mytextareamarkupid').getAttribute('metal'))
 on 'onclick' event of your link

 But... seems very natural require the user submit the form that contains the
 textarea.

 On Wed, Oct 21, 2009 at 10:18 AM, Antoine van Wel antoine.van@gmail.com
 wrote:

 Thanks for the replies.

 Peter: that won't work - the contents of the textarea are not
 transferred to the wicket app without some javascript / ajax magic
 happening under the hood

 Pedro: Using that I could let the component listen to onchange event
 but that would cause an unacceptable load. I really want the model
 update action to be initiated by the link. Or can I let clicking the
 link generate an event which then will be picked up by the component?




 Antoine


 On Wed, Oct 21, 2009 at 2:03 PM, Pedro Santos pedros...@gmail.com wrote:
  you can add an AjaxFormComponentUpdatingBehavior on your textarea to keep
  the model updated
 
  On Wed, Oct 21, 2009 at 9:58 AM, Peter Arnulf Lustig u...@yahoo.de
 wrote:
 
  Have you tried assign a Model to the component which needs to be
 updated?
 
  ModelString model = new ModelString();
  --- assign to the component of the form.
  i.e. final TextField tf = new TextField(txt, model);
 
  in Link Execution
  - tf.setModel(mode);
 
 
 
  - Ursprüngliche Mail 
  Von: Antoine van Wel antoine.van@gmail.com
  An: users@wicket.apache.org
  Gesendet: Mittwoch, den 21. Oktober 2009, 13:22:01 Uhr
  Betreff: how to update a form model when clicking a link
 
  On a page there's a form with a textarea.
  Somewhere else on the page there is a wicket link, which is not inside
 the
  form.
  The user types something in the textarea and then presses the link.
 
  Now what I'd like to achieve is when the code of the link is executed,
  the model of the form is up-to-date - so what the user has typed,
  should be inside the model. The form should not be submitted.
 
 
  Any suggestions how this can be done - preferably without writing
  Javascript?
 
 
 
  Thanks,
  Antoine
 
 
  --
  take your photos everywhere you go - https://www.memolio.com
  follow us on Twitter - http://twitter.com/Memolio
 
  -
  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
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 



 --
 take your photos everywhere you go - https://www.memolio.com
 follow us on Twitter - http://twitter.com/Memolio

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




 --
 Pedro Henrique Oliveira dos Santos




-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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



Re: Page instantiated twice

2009-10-21 Thread Igor Vaynberg
we could not think of a different solution, maybe you can come up with
one. we do not know if the page is opened in a new tab until it is
fully loaded and we can check via javascript the name of the window.

to fix this you can try storing your messages in your own collection
and somehow figuring out when to clear them.

-igor

On Wed, Oct 21, 2009 at 12:25 PM, Esteban Masoero
emaso...@getsense.com.ar wrote:
 Any comments about this? could It be a bug? If there's no other way of
 achieving the multiwindow feature that doesn't include instanciating the
 page again, maybe something could be done to avoid that the first instance
 consumes the session messages, because as we see this first page instance
 isn't the one that will be seen in the browser.

 what do you think?

 Esteban


 Esteban Masoero escribió:

 That is correct. I'm openning the page in a new tab just because of the
 process registration I'm doing:
 - user registers
 - app sends him an email with a generated link
 - user clicks that link from his email page, which it's oppened in a new
 window/tab (there's no way It can be openned in its previous app page, where
 he recently registered)

 And as I said in another email, I've found out that setting
 getPageSettings().setAutomaticMultiWindowSupport(false); solves the problem.
 However, I'm lossing the multi-window feature and I'm not sure I want that.

 Isn't a way that the new page can use a copy of the session used by the
 old page? (although I guess a copy of the session should be made before its
 feeedback messages are consumed) Because as I see, there's no way that I can
 leave a feedback message to the session and so that message can be shown in
 a new window, because of this feature.

 Thanks,

 Esteban



 Igor Vaynberg escribió:

 are you opening the page in a new tab? this script is part of wicket
 auto-multi-window support, it detects if the page has been opened in a
 new tab and redirects to a url that will point to the same page but in
 a new pagemap.

 -igor

 On Tue, Oct 20, 2009 at 4:23 PM, Esteban Masoero
 emaso...@getsense.com.ar wrote:


 First of all, thanks to all of you for your help.
 I haven't solved the problem, but I'm getting closer to it.
 (something like: new PageLink(new MyPage()); = I checked it and I'm not
 doing that. )

 Here's what I've found out:

 After debugging a lot, I find out that TWO REQUESTS are made. The first
 one
 as a consecuence of the user asking for that page, and the second one
 because in that page the following script is added at the end of head
 tag:
 script type=text/javascript !--/*--![CDATA[/*!--*/
 if (window.name=='' || (window.name.indexOf('wicket')  -1 
 window.name!='wicket-wicket:default')) {

 window.location=?wicket:bookmarkablePage=wicket-6:ar.com.getsense.latamvalley.pages.LoginPage
 + (window.location.hash != null ? window.location.hash : ); }
 /*--]]*//script

 Can anyone tell me why is Wicket doing that? or what am I doing wrong?



 |||
 Here's the complete detailed description about what I am doing:

       A UserStatusPanel that is always shown does *new Link(register)*
 with:
       @Override
               public void onClick() {
                       throw new
 RestartResponseAtInterceptPageException(UserRegistrationPage.class);
               }

       When the user gets to the page, submmits its registration data and
 the page sends an email with a link like:
 http://localhost:8080/ua?ua=2baab43f784b5b530b5347a50490bb0a


       In my webApp, I've done:
       this.mount(new QueryStringUrlCodingStrategy(/ua,
 UserActivationPage.class));

       When the user goes to the previous mentioned link by a new tab,
 the
 following happens:

       ___
       GET /ua?ua=2e129db15b6d6db5342ba5d328642262 HTTP/1.1
       Host: localhost:8080
       
       Connection: keep-alive
       Cookie: JSESSIONID=78ehtk0o3y0w
       ___
       === IN org.apache.wicket.RequestCycle.processEventsAndRespond()
 ===
       --processor.processEvents(this);
        UserActivationPage is constructed, and the page activates the
 user
        UserActivationPage does: setResponsePage(LoginPage.class);
       --processor.respond(this);
       LoginPage is constructed (messages exists in session and are
 properly rendered to somewhere)

 ===
       [I can see in firebug that the correct response reaches the
 browser!]

       Strangely, In the page, wicket adds:        script
 type=text/javascript !--/*--![CDATA[/*!--*/
 if (window.name=='' || (window.name.indexOf('wicket')  -1 
 window.name!='wicket-wicket:default')) {

 window.location=?wicket:bookmarkablePage=wicket-6:ar.com.getsense.latamvalley.pages.LoginPage
 + (window.location.hash != null ? window.location.hash : ); }
 /*--]]*//script

       [So a new request is made!]
       

Re: how to update a form model when clicking a link

2009-10-21 Thread Antoine van Wel
Problem solved, no need to touch the action attribute, just put the
call in onsubmit and leave the action untouched.



Antoine


On Wed, Oct 21, 2009 at 10:30 PM, Antoine van Wel
antoine.van@gmail.com wrote:
 Thanks, it works!

 In my case submitting the form is not natural at all - the form submit
 does a lot of actions while all I want is the text that the user
 entered to show up in the next page. (The link that is being clicked
 is not directly related to the form.)

 Now I got a new question related to this... Instead of attaching this
 behavior to a link, I want this behavior attached to a form submit. So
 got 2 forms on the page, that event needs to get triggered on form
 submit.. Guess I need to put the same hook in the action of the
 form. But how to do that and afterwards continue with the original
 action? (The headache is caused when pressing the enter key in that
 second form.)



 Antoine

 On Wed, Oct 21, 2009 at 2:52 PM, Pedro Santos pedros...@gmail.com wrote:
  Or can I let clicking the link generate an event which then will be picked
 up by the component

 you can, but is an workaround:
 1 - add AjaxFormComponentUpdatingBehavior on your textarea for 'metal' event
 2 - add
 eval(Wicket.$('mytextareamarkupid').getAttribute('metal'))
 on 'onclick' event of your link

 But... seems very natural require the user submit the form that contains the
 textarea.

 On Wed, Oct 21, 2009 at 10:18 AM, Antoine van Wel antoine.van@gmail.com
 wrote:

 Thanks for the replies.

 Peter: that won't work - the contents of the textarea are not
 transferred to the wicket app without some javascript / ajax magic
 happening under the hood

 Pedro: Using that I could let the component listen to onchange event
 but that would cause an unacceptable load. I really want the model
 update action to be initiated by the link. Or can I let clicking the
 link generate an event which then will be picked up by the component?




 Antoine


 On Wed, Oct 21, 2009 at 2:03 PM, Pedro Santos pedros...@gmail.com wrote:
  you can add an AjaxFormComponentUpdatingBehavior on your textarea to keep
  the model updated
 
  On Wed, Oct 21, 2009 at 9:58 AM, Peter Arnulf Lustig u...@yahoo.de
 wrote:
 
  Have you tried assign a Model to the component which needs to be
 updated?
 
  ModelString model = new ModelString();
  --- assign to the component of the form.
  i.e. final TextField tf = new TextField(txt, model);
 
  in Link Execution
  - tf.setModel(mode);
 
 
 
  - Ursprüngliche Mail 
  Von: Antoine van Wel antoine.van@gmail.com
  An: users@wicket.apache.org
  Gesendet: Mittwoch, den 21. Oktober 2009, 13:22:01 Uhr
  Betreff: how to update a form model when clicking a link
 
  On a page there's a form with a textarea.
  Somewhere else on the page there is a wicket link, which is not inside
 the
  form.
  The user types something in the textarea and then presses the link.
 
  Now what I'd like to achieve is when the code of the link is executed,
  the model of the form is up-to-date - so what the user has typed,
  should be inside the model. The form should not be submitted.
 
 
  Any suggestions how this can be done - preferably without writing
  Javascript?
 
 
 
  Thanks,
  Antoine
 
 
  --
  take your photos everywhere you go - https://www.memolio.com
  follow us on Twitter - http://twitter.com/Memolio
 
  -
  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
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 



 --
 take your photos everywhere you go - https://www.memolio.com
 follow us on Twitter - http://twitter.com/Memolio

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




 --
 Pedro Henrique Oliveira dos Santos




 --
 take your photos everywhere you go - https://www.memolio.com
 follow us on Twitter - http://twitter.com/Memolio




-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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



Re: Wicket Eclipse plugin, is there another?

2009-10-21 Thread Nicolas Melendez
I'm not very fan of netbeans  :)

Thanks, for answer.

another sugggestion?



On Wed, Oct 21, 2009 at 6:57 PM, Fernando Wermus
fernando.wer...@gmail.comwrote:

 I know, but I havent tested it, that netbeans comes with a plug in for
 wicket.

 On Wed, Oct 21, 2009 at 1:00 PM, Nicolas Melendez 
 nmelen...@getsense.com.ar
  wrote:

  Hi, is there another wicket plugin for eclipse?Wicket Bench project seems
  to
  have low activity.
  Any sugestion?
  Thanks.
  NM
 



 --
 Fernando Wermus.

 www.linkedin.com/in/fernandowermus



Re: Page instantiated twice

2009-10-21 Thread Esteban Masoero

Ok, I understand.
In case I come up with a solution, I'll let you know to see what you think.
In the meantime, I'll do some workaround considering your suggestion.

Thanks!

Esteban

Igor Vaynberg escribió:

we could not think of a different solution, maybe you can come up with
one. we do not know if the page is opened in a new tab until it is
fully loaded and we can check via javascript the name of the window.

to fix this you can try storing your messages in your own collection
and somehow figuring out when to clear them.

-igor

On Wed, Oct 21, 2009 at 12:25 PM, Esteban Masoero
emaso...@getsense.com.ar wrote:
  

Any comments about this? could It be a bug? If there's no other way of
achieving the multiwindow feature that doesn't include instanciating the
page again, maybe something could be done to avoid that the first instance
consumes the session messages, because as we see this first page instance
isn't the one that will be seen in the browser.

what do you think?

Esteban


Esteban Masoero escribió:


That is correct. I'm openning the page in a new tab just because of the
process registration I'm doing:
- user registers
- app sends him an email with a generated link
- user clicks that link from his email page, which it's oppened in a new
window/tab (there's no way It can be openned in its previous app page, where
he recently registered)

And as I said in another email, I've found out that setting
getPageSettings().setAutomaticMultiWindowSupport(false); solves the problem.
However, I'm lossing the multi-window feature and I'm not sure I want that.

Isn't a way that the new page can use a copy of the session used by the
old page? (although I guess a copy of the session should be made before its
feeedback messages are consumed) Because as I see, there's no way that I can
leave a feedback message to the session and so that message can be shown in
a new window, because of this feature.

Thanks,

Esteban



Igor Vaynberg escribió:
  

are you opening the page in a new tab? this script is part of wicket
auto-multi-window support, it detects if the page has been opened in a
new tab and redirects to a url that will point to the same page but in
a new pagemap.

-igor

On Tue, Oct 20, 2009 at 4:23 PM, Esteban Masoero
emaso...@getsense.com.ar wrote:



First of all, thanks to all of you for your help.
I haven't solved the problem, but I'm getting closer to it.
(something like: new PageLink(new MyPage()); = I checked it and I'm not
doing that. )

Here's what I've found out:

After debugging a lot, I find out that TWO REQUESTS are made. The first
one
as a consecuence of the user asking for that page, and the second one
because in that page the following script is added at the end of head
tag:
script type=text/javascript !--/*--![CDATA[/*!--*/
if (window.name=='' || (window.name.indexOf('wicket')  -1 
window.name!='wicket-wicket:default')) {

window.location=?wicket:bookmarkablePage=wicket-6:ar.com.getsense.latamvalley.pages.LoginPage
+ (window.location.hash != null ? window.location.hash : ); }
/*--]]*//script

Can anyone tell me why is Wicket doing that? or what am I doing wrong?



|||
Here's the complete detailed description about what I am doing:

  A UserStatusPanel that is always shown does *new Link(register)*
with:
  @Override
  public void onClick() {
  throw new
RestartResponseAtInterceptPageException(UserRegistrationPage.class);
  }

  When the user gets to the page, submmits its registration data and
the page sends an email with a link like:
http://localhost:8080/ua?ua=2baab43f784b5b530b5347a50490bb0a


  In my webApp, I've done:
  this.mount(new QueryStringUrlCodingStrategy(/ua,
UserActivationPage.class));

  When the user goes to the previous mentioned link by a new tab,
the
following happens:

  ___
  GET /ua?ua=2e129db15b6d6db5342ba5d328642262 HTTP/1.1
  Host: localhost:8080
  
  Connection: keep-alive
  Cookie: JSESSIONID=78ehtk0o3y0w
  ___
  === IN org.apache.wicket.RequestCycle.processEventsAndRespond()
===
  --processor.processEvents(this);
   UserActivationPage is constructed, and the page activates the
user
   UserActivationPage does: setResponsePage(LoginPage.class);
  --processor.respond(this);
  LoginPage is constructed (messages exists in session and are
properly rendered to somewhere)

===
  [I can see in firebug that the correct response reaches the
browser!]

  Strangely, In the page, wicket adds:script
type=text/javascript !--/*--![CDATA[/*!--*/
if (window.name=='' || (window.name.indexOf('wicket')  -1 
window.name!='wicket-wicket:default')) {


Re: Wicket Eclipse plugin, is there another?

2009-10-21 Thread Pedro Santos

You can write one

Enviado de meu iPhone

Em 21/10/2009, às 18:10, Nicolas Melendez nmelen...@getsense.com.ar  
escreveu:



I'm not very fan of netbeans  :)

Thanks, for answer.

another sugggestion?



On Wed, Oct 21, 2009 at 6:57 PM, Fernando Wermus
fernando.wer...@gmail.comwrote:

I know, but I havent tested it, that netbeans comes with a plug in  
for

wicket.

On Wed, Oct 21, 2009 at 1:00 PM, Nicolas Melendez 
nmelen...@getsense.com.ar

wrote:


Hi, is there another wicket plugin for eclipse?Wicket Bench  
project seems

to
have low activity.
Any sugestion?
Thanks.
NM





--
Fernando Wermus.

www.linkedin.com/in/fernandowermus



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



Re: Wicket Eclipse plugin, is there another?

2009-10-21 Thread dtoffe

Hi,

Being a Netbeans user myself I've tried the plug-in some time ago and
even submitted a small patch to one of the examples included in the plugin.
I don't remember the specific features now, but I've read in some Wicket
Bench docs or article about features that the Netbeans plugin doesn't have.
In my opinion, writing another one as Pedro suggest would be a waste, I
don't know how good or bad Wicket Bench is but you can always contribute
features and/or fixes to it, you know, good patches are welcomed mostly
everywhere.
By the way, just out of curiosity, what are the specific features you
are missing in Wicket Bench ??

Regards,

Daniel



Nicolas Melendez wrote:
 
 I'm not very fan of netbeans  :)
 
 Thanks, for answer.
 
 another sugggestion?
 
 
 On Wed, Oct 21, 2009 at 6:57 PM, Fernando Wermus
 fernando.wer...@gmail.comwrote:
 
 I know, but I havent tested it, that netbeans comes with a plug in for
 wicket.

 On Wed, Oct 21, 2009 at 1:00 PM, Nicolas Melendez 
 nmelen...@getsense.com.ar
  wrote:

  Hi, is there another wicket plugin for eclipse?Wicket Bench project
 seems
  to
  have low activity.
  Any sugestion?
  Thanks.
  NM
 

 
 

-- 
View this message in context: 
http://www.nabble.com/Wicket-Eclipse-plugin%2C-is-there-another--tp25994243p26000875.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Too Many Files Wicket 1.4.1

2009-10-21 Thread adambender

Is it possible to use this 
http://www.mail-archive.com/wicket-u...@lists.sourceforge.net/msg20951.html
workaround  in the URLResourceStream constructor - similar to how it is done
in URLResourceStream#lastModifiedTime()? 



adambender wrote:
 
 For what it is worth I saw a file being created in the URLResourceStream
 constructor at line 88 but it doesn't look like this is the source of any
 problems, its just a way to figure out how to check the lastModified time
 later on. 
 
 While I can't claim any kind of expertise on the inner workings of Wicket
 it seems that this problem would be solved if it wasn't required to check
 the last modification time on those resources which are embedded in the
 Wicket jar. Of course I have no idea what else this would affect so it may
 not be so simple. It may also be possible to just cache the stream or the
 actual .js string for use by later requests so that it is not necessary to
 try and reload files like this from the jar every time they are requested.
 
 For our use what we are likely going to do is pull the .js files out and
 place them where httpd can serve them and then use some url rewriting
 magic to prevent Wicket from serving them.
 
 
 Adam
 
 
 igor.vaynberg wrote:
 
 i just dont see what we can do about this... we are calling
 connection.getLastModified(), we are not creating a file, etc...
 
 -igor
 
 On Wed, Oct 21, 2009 at 10:18 AM, adambender adamben...@gmail.com
 wrote:

 This issue looks like it is directly related to
 http://issues.apache.org/jira/browse/WICKET-438 and the access of the
 lastModified header. Every time a URLResourceStream is constructed the
 lastModified time is requested at line 85 and the number of file handles
 goes up by one. The solution to the jira issue indicated that upgrading
 the
 version of linux fixed the problem but it doesnt seem to be the case
 with OS
 X or Red Hat Enterprise Linux...


 adambender wrote:

 I was able to distill the problem down to what I think is the core
 issue
 here.

 When an AJAX Wicket page is rendered it contains a reference to two .js
 files as Igor had mentioned, the Web URLs of these files look like
 this:

 App Context
 Root/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js
 App Context
 Root/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-ajax.js

 These requests are of course fielded by the Wicket filter which ends up
 trying to load the resources using the UrlResourceStream. In order to
 actually load these files Wicket gets the JAR URL for each file,
 converts
 them to a URIs and then passes them to the File constructor. The
 problem
 is that the URI that is created is opaque -
 http://www.docjar.com/docs/api/java/net/URI.html  see here for a good
 explanation  in the case of wicket-event.js the URI string is like the
 following :

 jar:file:/absolute-path-tojar/wicket-1.4.1.jar!/org/apache/wicket/markup/html/wicket-event.js

 It is similar for the case of wicket-ajax.js

 A quick glance at the File constructor shows that an opaque URL cannot
 be
 used to create a File as it is considered non-hierarchical. This of
 course
 leaves you with lots of requests to load this file, none of which can
 be
 completed and results in a lot of open URL connections which can never
 be
 closed.

 I guess my question is, should this loading mechanism be working
 because
 it doesnt seem like it could the way it is currently written? Is it
 possible to configure how Wicket finds these files embedded in the jar?
 Have I missed something?


 Adam Bender-2 wrote:

 Thanks for the explanation I think that helps shed some light... The
 tests are actually JMeter tests driving load by emulating a web
 browser - the application the are testing is running in Deployment
 mode set up as though it were a production server. After a little more
 digging I have been able to determine that is only a problem on pages
 which use Ajax - and it looks like there is a related debug message
 coming from an exception handler regarding the wicket-event.js file
 not being accessible (URI is not hierarchical). This would actually
 explain  why the problem only manifests when the JMeter tests are set
 to request embedded assets as wicket ajax pages embed requests for
 additional pieces of javascript - which in the case of wicket-event.js
 are causing exceptions to be thrown and the JVM bug you mentioned is
 probably preventing these resources from being cleaned up properly.

 Does that sound right?

 Adam


 On Oct 20, 2009, at 8:41 PM, Igor Vaynberg wrote:

 when you are requesting an embedded resource wicket needs to stream
 the file out of a jar, the way the jvm handles that is by creating a
 jar url connection object that streams the file. unfortunately, there
 is a bug in the jdk where the url connection does not have a close
 method and so wicket or any other java app cannot release the
 connection. this is addressed, afair, in jdk 7.

 i have many apps deployed in 

Re: Too Many Files Wicket 1.4.1

2009-10-21 Thread adambender

Sorry to keep replying to myself but this fix does appear to work... It kept
my open file handles down to 5 or 6 for the duration of the load suite.

public UrlResourceStream(final URL url)
{
// Save URL
this.url = url;
URLConnection connection = null;
try
{
connection = url.openConnection();
contentLength = connection.getContentLength();
contentType = connection.getContentType();
if (connection instanceof JarURLConnection)
{
  JarURLConnection jarUrlConnection = 
(JarURLConnection)connection;
  URL jarFileUrl = 
jarUrlConnection.getJarFileURL();
  URLConnection jarFileConnection = 
jarFileUrl.openConnection();
  try
  {
  lastModified = 
jarFileConnection.getLastModified();
  }
  finally
  {
  
jarFileConnection.getInputStream().close();
  }
}
else
{
  lastModified = connection.getLastModified();
}
try
{
file = new File(new URI(url.toExternalForm()));
}
catch (Exception ex)
{
log.debug(cannot convert url:  + url +  to 
file ( + ex.getMessage()
+
), falling back to the inputstream for 
polling);
}
if (file != null  !file.exists())
{
file = null;
}
}
catch (IOException ex)
{
// It should be impossible to get here or the original 
URL
// couldn't have been constructed. But we re-throw with 
details
// anyway.
final IllegalArgumentException illegalArgumentException 
= new
IllegalArgumentException(
Invalid URL parameter  + url);
illegalArgumentException.initCause(ex);
throw illegalArgumentException;
}
finally
{
// if applicable, disconnect
if (connection != null)
{
if (connection instanceof HttpURLConnection)
{

((HttpURLConnection)connection).disconnect();
}
else
{
try
{

connection.getInputStream().close();
}
catch (Exception ex)
{
// ignore
}
}
}
}
}






adambender wrote:
 
 Is it possible to use this 
 http://www.mail-archive.com/wicket-u...@lists.sourceforge.net/msg20951.html
 workaround  in the URLResourceStream constructor - similar to how it is
 done in URLResourceStream#lastModifiedTime()? 
 
 
 
 adambender wrote:
 
 For what it is worth I saw a file being created in the URLResourceStream
 constructor at line 88 but it doesn't look like this is the source of any
 problems, its just a way to figure out how to check the lastModified time
 later on. 
 
 While I can't claim any kind of expertise on the inner workings of Wicket
 it seems that this problem would be solved if it wasn't required to check
 the last modification time on those resources which are embedded in the
 Wicket jar. Of course I have no idea what else this would affect so it
 may not be so simple. It may also be possible to just cache the stream or
 the actual .js string for use by later requests so that it is not
 necessary to try and reload files like this from the jar every time they
 are requested.
 
 For our use what we are likely going to do is pull the .js files out and
 place them where httpd can serve them and then use some url rewriting
 magic to prevent Wicket from serving them.
 
 
 Adam
 
 
 igor.vaynberg wrote:
 
 i just dont see what we can do about this... we are calling
 

Re: Too Many Files Wicket 1.4.1

2009-10-21 Thread Igor Vaynberg
please file a jira so we can track this.

-igor

On Wed, Oct 21, 2009 at 3:47 PM, adambender adamben...@gmail.com wrote:

 Sorry to keep replying to myself but this fix does appear to work... It kept
 my open file handles down to 5 or 6 for the duration of the load suite.

 public UrlResourceStream(final URL url)
        {
                // Save URL
                this.url = url;
                URLConnection connection = null;
                try
                {
                        connection = url.openConnection();
                        contentLength = connection.getContentLength();
                        contentType = connection.getContentType();
                        if (connection instanceof JarURLConnection)
                        {
                              JarURLConnection jarUrlConnection = 
 (JarURLConnection)connection;
                              URL jarFileUrl = 
 jarUrlConnection.getJarFileURL();
                              URLConnection jarFileConnection = 
 jarFileUrl.openConnection();
                              try
                              {
                                      lastModified = 
 jarFileConnection.getLastModified();
                              }
                              finally
                              {
                                      
 jarFileConnection.getInputStream().close();
                              }
                        }
                        else
                        {
                              lastModified = connection.getLastModified();
                        }
                        try
                        {
                                file = new File(new URI(url.toExternalForm()));
                        }
                        catch (Exception ex)
                        {
                                log.debug(cannot convert url:  + url +  to 
 file ( + ex.getMessage()
 +
                                        ), falling back to the inputstream 
 for polling);
                        }
                        if (file != null  !file.exists())
                        {
                                file = null;
                        }
                }
                catch (IOException ex)
                {
                        // It should be impossible to get here or the original 
 URL
                        // couldn't have been constructed. But we re-throw 
 with details
                        // anyway.
                        final IllegalArgumentException 
 illegalArgumentException = new
 IllegalArgumentException(
                                Invalid URL parameter  + url);
                        illegalArgumentException.initCause(ex);
                        throw illegalArgumentException;
                }
                finally
                {
                        // if applicable, disconnect
                        if (connection != null)
                        {
                                if (connection instanceof HttpURLConnection)
                                {
                                        
 ((HttpURLConnection)connection).disconnect();
                                }
                                else
                                {
                                        try
                                        {
                                                
 connection.getInputStream().close();
                                        }
                                        catch (Exception ex)
                                        {
                                                // ignore
                                        }
                                }
                        }
                }
        }






 adambender wrote:

 Is it possible to use this
 http://www.mail-archive.com/wicket-u...@lists.sourceforge.net/msg20951.html
 workaround  in the URLResourceStream constructor - similar to how it is
 done in URLResourceStream#lastModifiedTime()?



 adambender wrote:

 For what it is worth I saw a file being created in the URLResourceStream
 constructor at line 88 but it doesn't look like this is the source of any
 problems, its just a way to figure out how to check the lastModified time
 later on.

 While I can't claim any kind of expertise on the inner workings of Wicket
 it seems that this problem would be solved if it wasn't required to check
 the last modification time on those resources which are embedded in the
 Wicket jar. Of course I have no idea what else this would affect so it
 may not be so simple. It may also be possible to just cache the stream or
 the actual .js string for use by later requests so that it is not
 necessary to try and reload files like this from the jar every time they
 are requested.

 For our use what we are likely going to do is pull the .js files out and
 place them where httpd can serve them and then use some url rewriting
 magic to prevent Wicket from 

Re: Idiomatic way to reference shared images?

2009-10-21 Thread John Krasnay
On Wed, Oct 21, 2009 at 07:57:12PM +0200, Ceki Gulcu wrote:
 Hello,

 I am trying to defined shared images in a Wicket application.

 In my prokect, the image file help.gif is located under the
 src/main/java/com/foo/ folder of my project. I have created an empty
 class called Images.

 package com.foo;
 public class Images {
 }

 In the init() method of my web-application, I add help.gif as a shared 
 resource:

 public class MyApplication extends WebApplication {


   @Override
   protected void init() {
 ...
 PackageResource pr = PackageResource.get(Images.class, help.gif);
 sharedResources.add(help.gif, pr);
   }
 }


I normally don't need to do anything in my app's init() method for images.

 In markup, I attempt to access the images as

wicket:link
  tdimg src=/resources/help.gif align=top//td
/wicket:link


You would use wicket:link when the image is in the same package as the
markup. In this case, you would just put in img src=help.gif and Wicket
will re-write the src attribute to the right value. This works well if you like
to preview your markup in a browser.

Since your images are (I think) in a different package, you should get rid of
the wicket:link tag.

(Actually, I think using a relative path to the right package in src might
work with wicket:link, but I never do it that way. See below.)

 Unfortunately, this does not seem to work. However, the following
 markup works just fine but it's too cumbersome to write.

wicket:link
  img src=resources/org.apache.wicket.Application/help.gif/
/wicket:link

 Reading page 229 of the Wicket in Action book, I would have thought
 that the /resources/help.gif reference would have worked. Quoting
 from the book:

   The resource is then available through a stable URL (/resources/discounts),
   independent of components. (page 229)

 What is the idiomatic way in Wicket to reference shared images?


Here's my idiom. First, in the same package as my images, I create a class that
extends ResourceReference:

public class MyImage extends ResourceReference {
public MyImage(String name) {
super(MyImage.class, name);
}
}

Then, I attach an Image component to the img tag:

img wicket:id=smiley/

add(new Image(smiley, new MyImage(smiley.gif)));

No code needed in Application.init(), and no wicket:link tags required.

jk

 Many thanks in advance for your response,

 -- 
 Ceki Gülcü
 Logback: The reliable, generic, fast and flexible logging framework for Java.
 http://logback.qos.ch

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


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



Re: WebRequestCycle is creating a HTTP 400/Bad request

2009-10-21 Thread Clint Checketts
I've been hitting a similar bug with MixedParamUrlCodingStrategy and
Stateless forms. I haven't had a chance to create a sample yet so I just
changed encoding strategies for the time being.

I believe your bug is similar to the one I''m hitting. I'm using Wicket
version 1.3.7. I'll try to post a simple case to see if it really is
identical.

-Clint

On Wed, Oct 21, 2009 at 12:51 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 so is it jetty/tomcat doing the conversion of relative url to
 absolute? because looks like they are doing it incorrectly...

 -igor

 On Wed, Oct 21, 2009 at 9:11 AM, Wayne Pope
 waynemailingli...@googlemail.com wrote:
  Hi,
 
  firstly I'm sure this is something we are doing wrong here and is not
  an issue with wicket however we're lost as to what to do to solve it.
 
  We have a page mounted like this:
  mount(new MixedParamUrlCodingStrategy(/cube/todos,
 WhichTaskPage.class,.
 
  We then request this page:
  http://locolhost:8080/cube/todos/1/116
 
  In the constructor of WhichTaskPage with throw a
  RestartResponseAtInterceptPageException (and I have tried just using
  setResponsePage) to another page.
 
  Now in WebRequestCycle.redirectTo(final Page page) the line:
  redirectUrl = page.urlFor(IRedirectListener.INTERFACE).toString();
 
  creates the following url: ../../../?wicket:interface=:13
 
  further up the call stack Jetty/Tomcat returns a HTTP 302 with the
 location:
  http://localhost:8080/../../../?wicket:interface=:13
 
 
  Now the issue:
 
  Firefox seems to be smart enough to then request the following url
  (I'm using a the sniffer call fiddler for this):
  GET /?wicket:interface=:3 HTTP/1.1
  this resolves and works fine.
  However Internet Explorer does what its asked and redirect to:
  GET /../../../?wicket:interface=:3 HTTP/1.1
 
  This url does exists and Tomcat/Jetty returns HTTP 400
 
 
  This is effecting all our IE users and we're in a bit of a panic as
  how to solve it. Any ideas?
  many thanks
  Wayne
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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




Re: AW: file download using ajaxLink

2009-10-21 Thread Ernesto Reinaldo Barreiro
Can you share your solution with the rest of us? I can imagine using a
behavior for adding the resource listener part... but it will be nice to see
what you are doing.

Best,

Ernesto

On Wed, Oct 21, 2009 at 9:12 PM, Sven Meier s...@meiers.net wrote:

 I've added an alternative solution with a behavior.

 Thanks for the original idea.

 Sven


 Giambalvo, Christian wrote:

 Updated
 http://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow

 Mit freundlichen Grüßen
 Christian Giambalvo
 --
 Fachinformatiker für Anwendungsentwicklung

 EXCELSIS Informationssysteme GmbH
 Wilhelmsplatz 8 - 70182 Stuttgart
 Mobile +49 176 196 32 406
 Office +49 711 6 20 30 406
 christian.giamba...@excelsisnet.com
 www.excelsisnet.com
 www.twitter.com/excelsis_info

 Sitz Stuttgart
 Amtsgericht Stuttgart, HRB 21104
 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf


 -Ursprüngliche Nachricht-
 Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet:
 Mittwoch, 21. Oktober 2009 09:40
 An: users@wicket.apache.org
 Betreff: Re: file download using ajaxLink

 Maybe this might help

 http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html

 
 http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
 
 Ernesto

 On Tue, Oct 20, 2009 at 10:12 PM, tubin gen fachh...@gmail.com wrote:



 I do download in traditional way

 here is the code

   public void download(String filename, byte[] filedata){
   setRedirect(false);
   WebResponse response = (WebResponse) getResponse();
   response.setAttachmentHeader(filename);
   response.setLastModifiedTime(Time.now());
   response.setContentType(application/octet-stream);
   response.write(
   new ByteArrayInputStream(filedata));
   response.close();
   }


   item.add(new LinkVoid(download){
   {
   add(new Label(filename,
 eaAuditProgramAttachment.getFileName()));
   }
   @Override
   public void onClick() {

 ((BasePage)getPage()).download(eaAuditProgramAttachment.getFileName(),
 eaAuditProgramAttachment.getEaBlob().getBlobData());
   }
   });


 If I replace this link with AjaxLink it will not work  and I must use  an
 ajaxlinkplease tell me how can I use ajaxLink for download




 -
 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