Re: Loading global resources in test?

2007-08-21 Thread Erik Underbjerg

Right, sorry for the typo. I do have both:

src/main/java/base/MyApplication.java
src/main/java/base/MyApplication.properties

The application works as intended: When I start MyApplication, I can  
access all constants in MyApplication.properties from various pages  
and components throughout the application. So far so good.


However, when I try to access the same pages from my tests, I get  
errors similar to:


	wicket.WicketRuntimeException: Error attaching this container for  
rendering: [MarkupContainer [Component id = basket_item, page =  
base.BasketPage, path = 0:basket:basket_form:basket_item.BasketPanel 
$BasketEditForm$1, isVisible = true, isVersioned = false]]

at wicket.MarkupContainer.internalAttach(MarkupContainer.java:361)

[..]

	Caused by: java.util.MissingResourceException: Unable to find  
resource: MODEL_RELEASED for component:


MODEL_RESOURCE is a string constant defined in  
MyApplication.properties, and it works fine when I run the app in the  
normal way.


The tests are run a subclass of WicketTester, in src/test/java/base  
with the initialization method:


public void initialize() {
	getResourceSettings().addStringResourceLoader(new  
ClassStringResourceLoader(this, MyApplication.class));

}

That is what I've tried, in order to load the  
MyApplication.properties for my subclass of WicketTester. It just  
doesn't work.


So my question is: How can I load the MyApplication.properties file,  
so the constants in it are accessible in my tests? I'm using wicket  
1.2.6.


Thanks in advance.


/Erik


On 20/08/2007, at 22.55, Igor Vaynberg wrote:


it should probably be MyApplication.properties unless you have
myApplication.java

-igor


On 8/20/07, Erik Underbjerg [EMAIL PROTECTED] wrote:


Hello,

I have just moved some localized string resources to a
myApplication.properties file, because they need to accessed by
different panels and pages, and it works fine.

However, when running my unit tests with WicketTester, it can't find
the resources in myApplication.properties. I have been unsuccessful
in finding a way to add the myApplication.properties file to the
resource path of my WicketTester subclass. This is what I've tried,
in my subclass of WicketTester:

public void initialize() {
getResourceSettings().addStringResourceLoader(new
ClassStringResourceLoader(this, PolFotoApplication.class));
}

So: How do I add myApplication.properties to the resource path of my
WicketTester?

Kind regards,

Erik



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



AjaxEventBehavior onfocus

2007-08-21 Thread fhagen
Hi,

i'm trying to implement a kind of onfocus event for a TextField but I 
don't know how to do this exactly.

I found the AjaxEventBehavior in the mailinglist but don't know how to use 
it right.

Here is my sample:

public class MyAjaxTextField extends TextField{

public MyAjaxTextField(String arg0) {
super(arg0);
 
}
 
public MyAjaxTextField(String arg0, IModel model) {
super(arg0,model);
PropertyModel pm = (PropertyModel)model;
Person person = (Person)pm.getTarget();
 
this.add(new MyAjaxEventBehavior(onfocus));
}
}

#

public class MyAjaxEventBehavior extends AjaxEventBehavior{

public MyAjaxEventBehavior(String event) {
super(event);
}

@Override
protected void onEvent(AjaxRequestTarget target) {
System.out.println(MyAjaxEventBehavior called.);
 
}
}


So this works fine an the MyAjaxEventBehavior called is written to the 
console but it is written every time. It doesn't matter if it is onfocus 
or onblur or whatever.

How do I have to change things that only by onfocus the System.out part 
is being displayed?

Fabian

Re: Wicket-Stuff Tinymce-Editor: No toolbars in IE6

2007-08-21 Thread Benjamin Ernst
Hi Thijs,
Thank you for opening the JIRA. At least there is someone who has the same
error.

So let's hope for the best.

Benjamin

2007/8/20, Thijs [EMAIL PROTECTED]:

 He Benjamin,

 I have the same problem. I have opened a JIRA issue for it:
 http://wicketstuff.org/jira/browse/WCTINYMCE-2 But no response so far. I
 can't help you any further but lets hoop the maintainer of the tinymce
 project picks it up...

 Thijs

 Benjamin Ernst wrote:
  Hi,
 
  has nobody an idea? Any help would be great!
 
  Thanks,
  Benjamin
 
  2007/8/16, Benjamin Ernst [EMAIL PROTECTED]:
 
  Hi,
 
  I have a problem with the wicket-stuff Tinymce-Editor in the
  InternetExplorer:
 
  the first time the page is loaded, there are no tool-icons, just the
  text-area. And IE gives the following Error:
 
  Error: 'tinyMCE is undefined'
 
  It' s an Java-Script-Error and it might be, that the scripts are not
  loaded the right way. But I don´t know how to fix this. Here are the
 scripts
  from generated the HTML-Source:
 
  script type=text/javascript id=import!--/*--![CDATA[/*!--*/
  var script = document.createElement('script');
  script.id='tinyMCEScript ';
 
 
 script.src='resources/wicket.contrib.tinymce.TinyMCEPanel/tiny_mce/tiny_mce_src.js
  ';
  script.type='text/javascript';
  document.getElementsByTagName ('head')[0].appendChild(script);
 
  /*--]]*//script
 
  script type=text/javascript id=init!--/*--![CDATA[/*!--*/
  tinyMCE.init({
  mode : specific_textareas,
  editor_selector : mceEditor,
  theme : advanced,
  language : en,
  plugins : contextmenu, save, paste, searchreplace, insertdatetime,
  preview, zoom, table, emotions, iespell, flash, print, directionality,
  fullscreen, spellchecker,
  theme_advanced_buttons1_add_before : save, newdocument,
 separator,
  theme_advanced_buttons1_add : fontselect, fontsizeselect,
  theme_advanced_buttons2_add_before: cut, copy, paste, pastetext,
  pasteword, separator, search, replace, separator,
  theme_advanced_buttons2_add : separator, inserttime, insertdate,
  separator, preview, zoom, separator, forecolor, backcolor,
  theme_advanced_buttons3_add_before : tablecontrols,
  theme_advanced_buttons3_add : emotions, iespell, flash, separator,
  print, separator, ltr, rtl, separator, fullscreen,
  theme_advanced_buttons4 : spellchecker,
  theme_advanced_toolbar_location : top,
  theme_advanced_statusbar_location : bottom,
  theme_advanced_toolbar_align : left,
  theme_advanced_resizing : true,
  theme_advanced_resize_horizontal : false,
  plugin_insertdate_timeFormat : Time: %H:%M,
  plugin_insertdate_dateFormat : Date: %m-%d-%Y,
  fullpage_default_xml_pi : false,
  spellchecker_languages : +English=en
  });
 
  /*--]]*//script
 
  Sometimes when the page is loaded again, the tool-icons are there. In
  FireFox it works fine, but unfortunately I have to use IE for this
 project.
 
  Thanks in advance,
  Benjamin
 
 


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




Re: AjaxEventBehavior onfocus

2007-08-21 Thread fhagen
Hi again, 

well I think i got the Problem.

Everytime I switch between Eclipse an Firefox the onfocus - Event is 
triggered. Am I right?

So that's the reason why the MyAjaxEventBehavior called will be 
displayed that often?

Wouldn't that be a problem in a productiv environment?
For example:

A user starts his application within a browser an activates an onfocus 
field.
Whyever he has to change from his webbrowser to another app and when he 
returns the onfocus - Event is triggered again. Is this a normal 
onfocus behavior?


Freundliche Grüße / With kind regards
Fabian Hagen

SN AG
Klingenderstr. 5
D 33100 Paderborn

voice +49 5251/1581- 862
fax   +49 5251/1581-71
eMail [EMAIL PROTECTED]
web   http://www.s-und-n.de

Vorstand
Klaus Beverungen
Josef Tillmann 

Vorsitzender des Aufsichtsrates
Heinz-Dieter Wendorff

Handelsregister
Amtsgericht Paderborn HRB 3270 

Re: Wicket-Stuff Tinymce-Editor: No toolbars in IE6

2007-08-21 Thread Iulian Costan
hey guys,

i am supposed to be the maintainer of tinymce module but lately i didnt put
much effort into it.
let me take a look and see how i can fix that issue.

/iulian

On 8/21/07, Benjamin Ernst [EMAIL PROTECTED] wrote:

 Hi Thijs,
 Thank you for opening the JIRA. At least there is someone who has the same
 error.

 So let's hope for the best.

 Benjamin

 2007/8/20, Thijs [EMAIL PROTECTED]:
 
  He Benjamin,
 
  I have the same problem. I have opened a JIRA issue for it:
  http://wicketstuff.org/jira/browse/WCTINYMCE-2 But no response so far. I
  can't help you any further but lets hoop the maintainer of the tinymce
  project picks it up...
 
  Thijs
 
  Benjamin Ernst wrote:
   Hi,
  
   has nobody an idea? Any help would be great!
  
   Thanks,
   Benjamin
  
   2007/8/16, Benjamin Ernst [EMAIL PROTECTED]:
  
   Hi,
  
   I have a problem with the wicket-stuff Tinymce-Editor in the
   InternetExplorer:
  
   the first time the page is loaded, there are no tool-icons, just the
   text-area. And IE gives the following Error:
  
   Error: 'tinyMCE is undefined'
  
   It' s an Java-Script-Error and it might be, that the scripts are not
   loaded the right way. But I don´t know how to fix this. Here are the
  scripts
   from generated the HTML-Source:
  
   script type=text/javascript
 id=import!--/*--![CDATA[/*!--*/
   var script = document.createElement('script');
   script.id='tinyMCEScript ';
  
  
 
 script.src='resources/wicket.contrib.tinymce.TinyMCEPanel/tiny_mce/tiny_mce_src.js
   ';
   script.type='text/javascript';
   document.getElementsByTagName ('head')[0].appendChild(script);
  
   /*--]]*//script
  
   script type=text/javascript id=init!--/*--![CDATA[/*!--*/
   tinyMCE.init({
   mode : specific_textareas,
   editor_selector : mceEditor,
   theme : advanced,
   language : en,
   plugins : contextmenu, save, paste, searchreplace,
 insertdatetime,
   preview, zoom, table, emotions, iespell, flash, print,
 directionality,
   fullscreen, spellchecker,
   theme_advanced_buttons1_add_before : save, newdocument,
  separator,
   theme_advanced_buttons1_add : fontselect, fontsizeselect,
   theme_advanced_buttons2_add_before: cut, copy, paste, pastetext,
   pasteword, separator, search, replace, separator,
   theme_advanced_buttons2_add : separator, inserttime, insertdate,
   separator, preview, zoom, separator, forecolor, backcolor,
   theme_advanced_buttons3_add_before : tablecontrols,
   theme_advanced_buttons3_add : emotions, iespell, flash,
 separator,
   print, separator, ltr, rtl, separator, fullscreen,
   theme_advanced_buttons4 : spellchecker,
   theme_advanced_toolbar_location : top,
   theme_advanced_statusbar_location : bottom,
   theme_advanced_toolbar_align : left,
   theme_advanced_resizing : true,
   theme_advanced_resize_horizontal : false,
   plugin_insertdate_timeFormat : Time: %H:%M,
   plugin_insertdate_dateFormat : Date: %m-%d-%Y,
   fullpage_default_xml_pi : false,
   spellchecker_languages : +English=en
   });
  
   /*--]]*//script
  
   Sometimes when the page is loaded again, the tool-icons are there. In
   FireFox it works fine, but unfortunately I have to use IE for this
  project.
  
   Thanks in advance,
   Benjamin
  
  
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



A Relative path question

2007-08-21 Thread Chris Lintz

Hi all,

I have a non-Wicket domain lets say, www.mydomain.com .  This domain passes
requests to the Wicket filter via mod_jk to this path:
www.mydomain.com/myapp .  The home page on www.mydomain.com is completely
static except for a wicket form that is dyamically written via a Java script
document write (i.e. script
src=/myapp?wicket:bookmarkablePage=:com.mysite.LoginFormSnippet.).  We
dont want the entire domain of www.mydomain.com to be Wicketized, hence
the small snipppet writen via the script tag.  

The problem is everything wicket related is written from the relative path
(i.e. / ) not with the /myapp prefixed in front. Therefore, the component,
Wicket Javascript references, etc are broke because of the relative path. 
What can I possibly do to over come this?   

I have received nothing but great responses from this forum, hopefully I can
get one here because I really dont want to mount the entire app at the root
of the domain in Apache for various reasons :)

thanks in advance.

chris
-- 
View this message in context: 
http://www.nabble.com/A-Relative-path-question-tf4303862.html#a12250696
Sent from the Wicket - User mailing list archive at Nabble.com.


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



NullPointerException when resolving a class

2007-08-21 Thread David Leangen

I am trying to upgrade to wicket 1.3. I was running 1.2.6 with no
problems.

When trying to resolve the class for this markup:
bundleresource://88/com/company/package/MyClass$WelcomeLabel.html

in MarkupResourceStream, the method:

  public Class getMarkupClass()
  {
  return Classes.resolveClass(markupClassName);
  }

is returning null. In other words, for some reason, it's not finding the
class.

The class isn't changed, so I'm suspecting it may be related to some new
way paths are being handled, or something. I'm not sure.


Any ideas how I can solve this?

The problem is happening here (I unchained the huge lines in an attempt
to debug):

In org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader:

private Markup checkForMarkupInheritance(final MarkupContainer
container, final Markup markup,
final boolean enforceReload)
{
// Check if markup contains wicket:extend which tells us that
// we need to read the inherited markup as well.
int extendIndex = requiresBaseMarkup(markup);
if (extendIndex == -1)
{
// return a MarkupStream for the markup
return markup;
}

// get the base markup
final IMarkupSettings markupSettings =
Application.get().getMarkupSettings();
final IMarkupCache markupCache = 
markupSettings.getMarkupCache();

final MarkupResourceData markupResourceData =
markup.getMarkupResourceData();
final MarkupResourceStream resource =
markupResourceData.getResource();

*** here *
final Class markupClass = resource.getMarkupClass();
*** here *
final Markup baseMarkup = markupCache.getMarkup(container,
markupClass.getSuperclass(),
enforceReload);

if (baseMarkup == Markup.NO_MARKUP)
{
throw new MarkupNotFoundException(
Base markup of inherited markup not 
found. Component class:  +

markup.getMarkupResourceData().getResource().getContainerInfo()

.getContainerClass().getName() +
 Enable debug messages 
for
org.apache.wicket.util.resource.Resource to get a list of all filenames
tried.);
}

// Merge base and derived markup
return new MergedMarkup(markup, baseMarkup, extendIndex);
}



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



Re: Double clicking on a table row

2007-08-21 Thread Federico Fanton
On Mon, 20 Aug 2007 15:53:15 -0300
Damian Mendez Romera [EMAIL PROTECTED] wrote:

 Have you tried with AjaxEventBehavior(ondblclick) on the newRowItem?

I thought about it but for some reason the idea of a trip to the server led me 
away.. X-) Many thanks for your help!


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



Re: Reacting to DateField change

2007-08-21 Thread Federico Fanton
On Thu, 9 Aug 2007 17:18:37 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 In 1.3 DatePicker was replaced with DateField, they are completely different 
 components.. I will try with your suggestion ASAP though, thanks again :)

I tried with

DateField field = ...
field.add(new AjaxFormComponentUpdatingBehavior(onchange){
protected void onUpdate(AjaxRequestTarget target) {
// do stuff
}
});

The original relevant HTML is

span wicket:id=endDate/

while the resulting HTML is

span wicket:id=endDate name=endDate onchange=var 
wcall=wicketAjaxPost('?wicket:interface=:10:frmSearch:endDate::IBehaviorListener:0:',
 wicketSerialize(Wicket.$('endDate7')), function() { }.bind(this), function() { 
}.bind(this)); id=endDate7
wicket:panel
span style=white-space: nowrap;
input value= type=text wicket:id=date size=8 name=endDate:date 
id=date2/
spannbsp;div style=display:none;z-index: 9;position:absolute; 
id=date2Dp/div
img style=cursor: pointer; border: none; id=date2Icon 
src=resources/org.apache.wicket.extensions.yui.calendar.DatePicker/icon1.gif 
//span
input type=hidden/
/span
/wicket:panel
/span

So, the onchange is bound to the span element.. Maybe I should use a 
different markup in my HTML? I'd like the event to fire when I select a date 
from the popup calendar..
Many thanks again for your attention!


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



Re: TreeTable...how to refect a label change on TreeNode

2007-08-21 Thread Matej Knopp
Your treemodel must fire the appropriate treeNodesChanged events on
the listeners. And then you need to call
tree.updateTree(ajaxRequestTarget);

-Matej

On 8/20/07, Doug Leeper [EMAIL PROTECTED] wrote:

 I am using the TreeTable in Wicket Extensions.  When selecting on a node, a
 page allowing the user to edit the node value (and other useful info).  Upon
 saving, I would like the associated TreeNode to show the new value.  How
 would one go about having the TreeNode get its value again?

 Thanks
 --
 View this message in context: 
 http://www.nabble.com/TreeTable...how-to-refect-a-label-change-on-TreeNode-tf4300479.html#a12240766
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Reacting to DateField change

2007-08-21 Thread Gerolf Seitz
are you using trunk?
in earlier versions of trunk you had to override
DatePicker#notifyComponentOnDateSelected to return true.
now it returns true by default. don't worry too much about the javascript
code generated by DatePicker, it should work well.

also, DateField consists of a DateTextField and automatically adds a
DatePicker behavior to that DateTextField, but you can provide your own
DateTextField (e.g. with an added
AjaxFormComponentUpdatingBehavior(onchange) ) by overriding
DateField#newDateTextField(String, PropertyModel)

hth,
  gerolf

On 8/21/07, Federico Fanton [EMAIL PROTECTED] wrote:

 On Tue, 21 Aug 2007 11:58:19 +0200
 Federico Fanton [EMAIL PROTECTED] wrote:

  So, the onchange is bound to the span element.. Maybe I should use a
 different markup in my HTML? I'd like the event to fire when I select a date
 from the popup calendar..

 I see that the code for the datepicker popup contains

 // fire onchange notification
 if (wasVisible  false) {
 YAHOO.util.Dom.get(date2).onchange();
 }

 So maybe I should bind the behavior to the textfield instead (date2 is
 its id) and.. Well, figure out what that  false is about X-)


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




Re: back button processing doesn't work in Opera

2007-08-21 Thread Andrew Klochkov

Matej Knopp wrote:

Hi, I don't really see where the problem is. I've tested wicket ajax
links with both browsers and it seems to work well. So I'll need a
quickstart to reproduce.

  

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

--
Andrew Klochkov


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



keyboard shortcuts in wicket ?

2007-08-21 Thread Steen Larsen
Hi,

I am doing an evaluation of wicket and would like to know if there is any
support for keyboard shortcuts besides the standard html accesskey. Is it
for instance possible to define a key kombination for an AJAX component ?

/Steen


Re: Reacting to DateField change

2007-08-21 Thread Federico Fanton
On Tue, 21 Aug 2007 12:50:32 +0200
Gerolf Seitz [EMAIL PROTECTED] wrote:

 are you using trunk?

No, beta2

 in earlier versions of trunk you had to override
 DatePicker#notifyComponentOnDateSelected to return true.

Great, now everything is ok! :)

 also, DateField consists of a DateTextField and automatically adds a
 DatePicker behavior to that DateTextField, but you can provide your own
 DateTextField (e.g. with an added
 AjaxFormComponentUpdatingBehavior(onchange) ) by overriding
 DateField#newDateTextField(String, PropertyModel)

I see.. When beta3 ships I'll change my code to use the new method.

Many thanks :)


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



Re: A Relative path question

2007-08-21 Thread Al Maw

Chris Lintz wrote:

I have a non-Wicket domain lets say, www.mydomain.com .  This domain passes
requests to the Wicket filter via mod_jk to this path:
www.mydomain.com/myapp .  The home page on www.mydomain.com is completely
static except for a wicket form that is dyamically written via a Java script
document write (i.e. script
src=/myapp?wicket:bookmarkablePage=:com.mysite.LoginFormSnippet.).  We
dont want the entire domain of www.mydomain.com to be Wicketized, hence
the small snipppet writen via the script tag.  


The problem is everything wicket related is written from the relative path
(i.e. / ) not with the /myapp prefixed in front. Therefore, the component,
Wicket Javascript references, etc are broke because of the relative path. 
What can I possibly do to over come this?


Are you using Wicket 1.2.x?

In 1.3.0 all the paths wicket generates are relative not absolute, so 
this should all Just Work.


An alternative here is to use Wicket 1.3's filter support, so you map it 
to /* but let most requests just fall through to your static resources.


Regards,

Al

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



Re: AjaxEventBehavior onfocus

2007-08-21 Thread Al Maw

[EMAIL PROTECTED] wrote:
Everytime I switch between Eclipse an Firefox the onfocus - Event is 
triggered. Am I right?


Yep, that's normal.

You should also receive the corresponding onblur event when the user 
alt+tabs away. This is nothing to do with Wicket - it's how the browsers 
work.


Regards,

Al


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



Re: keyboard shortcuts in wicket ?

2007-08-21 Thread Ryan Sonnek
There are plenty of javascript solutions out there and wicket integrates
very well with these types of libraries (scriptaculous, prototype, dojo,
etc).  prototype has a pretty amazing Event API that should do what you
need, but there are plenty of options out there.  ex:
http://www.openjs.com/scripts/events/keyboard_shortcuts/

On 8/21/07, Steen Larsen [EMAIL PROTECTED] wrote:

 Hi,

 I am doing an evaluation of wicket and would like to know if there is any
 support for keyboard shortcuts besides the standard html accesskey. Is it
 for instance possible to define a key kombination for an AJAX component ?

 /Steen



Re: Loading global resources in test?

2007-08-21 Thread Igor Vaynberg
wicket tester uses a mock web application - not yours - so it cannot load
those properties. i think in 1.3 we refactored it to support custom
application subclasses. i think as far as you can make it work in 1.2.6 is
to change resource settings not to throw exceptions on not-found-resources
while testing. or you can add your own stringresourceloader to the mock
application and make it load properties from your application's property
file. im not sure we can properly fix this in 1.2.6 because we cannot break
api.

-igor


On 8/20/07, Erik Underbjerg [EMAIL PROTECTED] wrote:

 Right, sorry for the typo. I do have both:

 src/main/java/base/MyApplication.java
 src/main/java/base/MyApplication.properties

 The application works as intended: When I start MyApplication, I can
 access all constants in MyApplication.properties from various pages
 and components throughout the application. So far so good.

 However, when I try to access the same pages from my tests, I get
 errors similar to:

 wicket.WicketRuntimeException: Error attaching this container for
 rendering: [MarkupContainer [Component id = basket_item, page =
 base.BasketPage, path = 0:basket:basket_form:basket_item.BasketPanel
 $BasketEditForm$1, isVisible = true, isVersioned = false]]
 at wicket.MarkupContainer.internalAttach(MarkupContainer.java:361)

 [..]

 Caused by: java.util.MissingResourceException: Unable to find
 resource: MODEL_RELEASED for component:

 MODEL_RESOURCE is a string constant defined in
 MyApplication.properties, and it works fine when I run the app in the
 normal way.

 The tests are run a subclass of WicketTester, in src/test/java/base
 with the initialization method:

 public void initialize() {
 getResourceSettings().addStringResourceLoader(new
 ClassStringResourceLoader(this, MyApplication.class));
 }

 That is what I've tried, in order to load the
 MyApplication.properties for my subclass of WicketTester. It just
 doesn't work.

 So my question is: How can I load the MyApplication.properties file,
 so the constants in it are accessible in my tests? I'm using wicket
 1.2.6.

 Thanks in advance.


 /Erik


 On 20/08/2007, at 22.55, Igor Vaynberg wrote:

  it should probably be MyApplication.properties unless you have
  myApplication.java
 
  -igor
 
 
  On 8/20/07, Erik Underbjerg [EMAIL PROTECTED] wrote:
 
  Hello,
 
  I have just moved some localized string resources to a
  myApplication.properties file, because they need to accessed by
  different panels and pages, and it works fine.
 
  However, when running my unit tests with WicketTester, it can't find
  the resources in myApplication.properties. I have been unsuccessful
  in finding a way to add the myApplication.properties file to the
  resource path of my WicketTester subclass. This is what I've tried,
  in my subclass of WicketTester:
 
  public void initialize() {
  getResourceSettings().addStringResourceLoader(new
  ClassStringResourceLoader(this, PolFotoApplication.class));
  }
 
  So: How do I add myApplication.properties to the resource path of my
  WicketTester?
 
  Kind regards,
 
  Erik


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




Re: DownloadLink hanging

2007-08-21 Thread Igor Vaynberg
On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:

 Hi Igor,

  yep, DownloadLinks will block because requests to the same page are
  serialized.

 Sorry, I don't understand, why links to downloadable resources should be
 blocking or serialized. Usually downloads are the larger parts of an
 application and hence should never lock the application.


because this is how this component is designed to work. if you dont like it
you can build your own that doesnt block.

 to work around it register a shared resource or create a servlet that can
  stream the file (resoureces in wicket are not serialized), then create a
  link component that can build a download url.

 Well, I guess, we can't use a servlet, because wicket is registered to
 /*, so it will get everything.


wicket is a filter, so even though it is mapped to /* it will let urls that
are not wicket urls pass through. how do you think it lets you download
static images...
so if you map your wicket filter on /* and the servlet on /download and yo
have no download mount in wicket the filter will let /download/* requests
go to the servlet.

-igor


Could you please give some more hints
 about shared resources? I've tried to search
 http://cwiki.apache.org/WICKET/ without luck.

 Alternatively, is it possible to complete shut off the serialization
 (which seems to cause this and maybe even other blocking problems)?

 --
 Best regards
 Thomas Singer
 _
 SyntEvo GmbH
 Brunnfeld 11
 83404 Ainring
 Germany


 Igor Vaynberg wrote:
  yep, DownloadLinks will block because requests to the same page are
  serialized.
 
  to work around it register a shared resource or create a servlet that
 can
  stream the file (resoureces in wicket are not serialized), then create a
  link component that can build a download url.
 
  -igor
 
 
  On 8/20/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Hi,
 
  We are using Wicket 1.3 beta 2 running in Tomcat and have a couple of
  DownloadLinks on a page (created with 'new DownloadPage(parameters)')
 for
  larger files (a couple of MB). I open different tabs of the same page
 in
  Opera and click these download links, so the downloads should happen in
  parallel. Unfortunately, the web-application seems to hang until the
  previous files were completely downloaded. Even normal pages do not
 show
  up.
 
  This does not happen for other websites (so our internet connection
  couldn't
  be the reason) and not for the same project with
  old-JSP-/Servlet-technology
  at a different server running in the same version of Tomcat.
 
  Is this a known problem? How to work around?
 
  --
  Best regards,
  Thomas Singer
  _
  SyyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
  www.syntevo.com
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

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




Re: Loading global resources in test?

2007-08-21 Thread Erik Underbjerg

Thanks for the reply.

I did figure out that the WicketTester is not a subclass of  
MyApplication, and therefore doesn't have access to the  
MyApplication.properties file.


That's also why I was trying to do as you suggest, and add my own  
StringResourceLoader to the WicketTester subclass, and load the  
MyApplication.properties file manually. So as far as I can see, I'm  
doing what you said, but I just can't make it work.


For some reason, even though I add a new StringResourceLoader in the  
WicketTester, I can't access the resources in MyApplication.properties.


Am I adding it in the wrong way?

/Erik

On 21/08/2007, at 15.51, Igor Vaynberg wrote:

wicket tester uses a mock web application - not yours - so it  
cannot load

those properties. i think in 1.3 we refactored it to support custom
application subclasses. i think as far as you can make it work in  
1.2.6 is
to change resource settings not to throw exceptions on not-found- 
resources
while testing. or you can add your own stringresourceloader to the  
mock
application and make it load properties from your application's  
property
file. im not sure we can properly fix this in 1.2.6 because we  
cannot break

api.

-igor


On 8/20/07, Erik Underbjerg [EMAIL PROTECTED] wrote:


Right, sorry for the typo. I do have both:

src/main/java/base/MyApplication.java
src/main/java/base/MyApplication.properties

The application works as intended: When I start MyApplication, I can
access all constants in MyApplication.properties from various pages
and components throughout the application. So far so good.

However, when I try to access the same pages from my tests, I get
errors similar to:

wicket.WicketRuntimeException: Error attaching this  
container for

rendering: [MarkupContainer [Component id = basket_item, page =
base.BasketPage, path = 0:basket:basket_form:basket_item.BasketPanel
$BasketEditForm$1, isVisible = true, isVersioned = false]]
at wicket.MarkupContainer.internalAttach 
(MarkupContainer.java:361)


[..]

Caused by: java.util.MissingResourceException: Unable to find
resource: MODEL_RELEASED for component:

MODEL_RESOURCE is a string constant defined in
MyApplication.properties, and it works fine when I run the app in the
normal way.

The tests are run a subclass of WicketTester, in src/test/java/base
with the initialization method:

public void initialize() {
getResourceSettings().addStringResourceLoader(new
ClassStringResourceLoader(this, MyApplication.class));
}

That is what I've tried, in order to load the
MyApplication.properties for my subclass of WicketTester. It just
doesn't work.

So my question is: How can I load the MyApplication.properties file,
so the constants in it are accessible in my tests? I'm using wicket
1.2.6.

Thanks in advance.


/Erik


On 20/08/2007, at 22.55, Igor Vaynberg wrote:


it should probably be MyApplication.properties unless you have
myApplication.java

-igor


On 8/20/07, Erik Underbjerg [EMAIL PROTECTED] wrote:


Hello,

I have just moved some localized string resources to a
myApplication.properties file, because they need to accessed by
different panels and pages, and it works fine.

However, when running my unit tests with WicketTester, it can't  
find

the resources in myApplication.properties. I have been unsuccessful
in finding a way to add the myApplication.properties file to the
resource path of my WicketTester subclass. This is what I've tried,
in my subclass of WicketTester:

public void initialize() {
getResourceSettings().addStringResourceLoader(new
ClassStringResourceLoader(this, PolFotoApplication.class));
}

So: How do I add myApplication.properties to the resource path  
of my

WicketTester?

Kind regards,

Erik



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





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



Re: Loading global resources in test?

2007-08-21 Thread Igor Vaynberg
it looks like you are doing it properly. not sure why it doesnt work. you
will have to debug it and see. maybe you have to do it every time because it
might be creating new application instances?

-igor


On 8/21/07, Erik Underbjerg [EMAIL PROTECTED] wrote:

 Thanks for the reply.

 I did figure out that the WicketTester is not a subclass of
 MyApplication, and therefore doesn't have access to the
 MyApplication.properties file.

 That's also why I was trying to do as you suggest, and add my own
 StringResourceLoader to the WicketTester subclass, and load the
 MyApplication.properties file manually. So as far as I can see, I'm
 doing what you said, but I just can't make it work.

 For some reason, even though I add a new StringResourceLoader in the
 WicketTester, I can't access the resources in MyApplication.properties.

 Am I adding it in the wrong way?

 /Erik

 On 21/08/2007, at 15.51, Igor Vaynberg wrote:

  wicket tester uses a mock web application - not yours - so it
  cannot load
  those properties. i think in 1.3 we refactored it to support custom
  application subclasses. i think as far as you can make it work in
  1.2.6 is
  to change resource settings not to throw exceptions on not-found-
  resources
  while testing. or you can add your own stringresourceloader to the
  mock
  application and make it load properties from your application's
  property
  file. im not sure we can properly fix this in 1.2.6 because we
  cannot break
  api.
 
  -igor
 
 
  On 8/20/07, Erik Underbjerg [EMAIL PROTECTED] wrote:
 
  Right, sorry for the typo. I do have both:
 
  src/main/java/base/MyApplication.java
  src/main/java/base/MyApplication.properties
 
  The application works as intended: When I start MyApplication, I can
  access all constants in MyApplication.properties from various pages
  and components throughout the application. So far so good.
 
  However, when I try to access the same pages from my tests, I get
  errors similar to:
 
  wicket.WicketRuntimeException: Error attaching this
  container for
  rendering: [MarkupContainer [Component id = basket_item, page =
  base.BasketPage, path = 0:basket:basket_form:basket_item.BasketPanel
  $BasketEditForm$1, isVisible = true, isVersioned = false]]
  at wicket.MarkupContainer.internalAttach
  (MarkupContainer.java:361)
 
  [..]
 
  Caused by: java.util.MissingResourceException: Unable to find
  resource: MODEL_RELEASED for component:
 
  MODEL_RESOURCE is a string constant defined in
  MyApplication.properties, and it works fine when I run the app in the
  normal way.
 
  The tests are run a subclass of WicketTester, in src/test/java/base
  with the initialization method:
 
  public void initialize() {
  getResourceSettings().addStringResourceLoader(new
  ClassStringResourceLoader(this, MyApplication.class));
  }
 
  That is what I've tried, in order to load the
  MyApplication.properties for my subclass of WicketTester. It just
  doesn't work.
 
  So my question is: How can I load the MyApplication.properties file,
  so the constants in it are accessible in my tests? I'm using wicket
  1.2.6.
 
  Thanks in advance.
 
 
  /Erik
 
 
  On 20/08/2007, at 22.55, Igor Vaynberg wrote:
 
  it should probably be MyApplication.properties unless you have
  myApplication.java
 
  -igor
 
 
  On 8/20/07, Erik Underbjerg [EMAIL PROTECTED] wrote:
 
  Hello,
 
  I have just moved some localized string resources to a
  myApplication.properties file, because they need to accessed by
  different panels and pages, and it works fine.
 
  However, when running my unit tests with WicketTester, it can't
  find
  the resources in myApplication.properties. I have been unsuccessful
  in finding a way to add the myApplication.properties file to the
  resource path of my WicketTester subclass. This is what I've tried,
  in my subclass of WicketTester:
 
  public void initialize() {
  getResourceSettings().addStringResourceLoader(new
  ClassStringResourceLoader(this, PolFotoApplication.class));
  }
 
  So: How do I add myApplication.properties to the resource path
  of my
  WicketTester?
 
  Kind regards,
 
  Erik
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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




Using ClientProperties Object for User selectable Timezone.

2007-08-21 Thread gumnaam
Currently ClientProperties object has a getTimeZone() method, that 
uses BrowserInfoPage's response, to calculate a client's Timezone.

Would it be too much trouble to add a setTimeZone() method, so that
the TimeZone property is user settable ?

I can save a user's preferred timezone, in a user profile object and store that 
in 
a session. But the wicket-datetime java classes, depend on the 
ClientProperties.timeZone
field, to properly convert dates to--fro between the server and client 
timezones.

So the best place to store a user's preferred timezone seems to be the 
ClientProperties object .

thanks

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



Wicketstuff-minis Veil

2007-08-21 Thread Federico Fanton
Hi everyone!
I'm sorry, is there a screenshot of what the veil behavior looks like, 
somewhere?
Many thanks!


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



Re: Wicketstuff-minis Veil

2007-08-21 Thread Igor Vaynberg
why dont you just drop it into your project and see

-igor


On 8/21/07, Federico Fanton [EMAIL PROTECTED] wrote:

 Hi everyone!
 I'm sorry, is there a screenshot of what the veil behavior looks like,
 somewhere?
 Many thanks!


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




Re: A Relative path question

2007-08-21 Thread Al Maw

Chris Lintz wrote:

Thanks for the response.  Yes I am using Wicket 1.3 Beta 2.  I First mapped
the WAR at root, and let everything fall through Apache with JkUnMounts
(i.e. JkUnMount /images default), but the issue is I could not solve the
problem of I did not want / served by wicket.

Basically it comes down to this.  I cannot seem to make a reference to
Wicket page on a path www.mydomain.com/myapp  from my static home page
www.mydomain.com because the relative path is / .  I need the Wicket
components to render under /myapp even from requests coming from / .


OK. I'm slightly confused at the moment, because you haven't quite 
specified well enough how you're trying to achieve this. Please could 
you clarify the following points:


 - What context path is your app running in? Is it the root?
 - Is Wicket running using a filter or a servlet?
 - Is Wicket mapped to /myapp/* in web.xml?
 - What is your mod_jk forwarding set-up, exactly?
   - You say you're forwarding from www.mydomain.com to
 www.mydomain.com/myapp, but obviously you're not quite,
 as otherwise you'd just get an infinite loop there. ;)
   - Specifically, where are your wildcards if there are any?

You seem to be concentrate too much on the specifics of what's wrong 
with your set-up, rather than what you're trying to achieve here.


As far as I can tell, you want to do the following:
 - Run a Wicket webapp on http://appserver.com:8080/
   (Note that's a root context path.)
 - Map Wicket to the root using servlet mapping/filter mapping of /*.
 - Pass requests from an Apache which land on www.mydomain.com through
   to the Apache, unless they land on /myapp/*, in which case send them
   to Wicket.
 - You don't want your static resources served from within Tomcat.

Is that right?

Even if that's so, I still don't understand what specific issue you're 
having. Actually giving us some URLs might be illustrative here.


If you get a request for this:
 - www.myserver.com/myapp/path/to/mounted/page/

Assuming your context path is /, that will get mapped to:
 - appserver.com:8080/path/to/mounted/page/

If you add a HeaderContributor with a ResourceReferences, or something 
similar, Wicket will give you URLs relative to that, so something like 
this in your generated HTML:

 - href=../../../../resources/com.company.HomePage/foo.css

This will resolve to the following in your browser:
 - www.myserver.com/myapp/resources/com.company.HomePage/foo.css

...which is perfectly correct, as obviously Wicket needs to handle that.

So what exactly is going wrong for you here?

You say:

The problem is everything wicket related is written from the 
relative path (i.e. / ) not with the /myapp prefixed in front. 
Therefore, the component, Wicket Javascript references, etc are 
broke because of the relative path.


Broken how? Give us some specifics. This stuff should work just fine. 
You may be having issues with 302 redirects going to the wrong place, or 
cookie paths, but it doesn't sound like it. See the wiki page on 
mod_proxy for details.


Sorry, but better and less ambiguous question asking is required here...

Regards,

Al

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



Re: Question about using UploadWebRequest

2007-08-21 Thread Oliver Henlich

Al Maw wrote:

oliver.henlich wrote:

The javadoc on
org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest 

explains how to install it (Note: javadoc has problems with 
it...maybe the @

symbol?).

class MyApplication extends WebApplication {
...
  @Override
  protected WebRequest newWebRequest(HttpServletRequest 
servletRequest) {

 return new UploadWebRequest(servletRequest);
  }
 ...
}


Does this not mean that _all_ requests handled by this application 
will be

using UploadWebRequests?

If so, is this fine? Is this how everyone does it? Overheads?


Yes, this is fine.

The only reason you need to set this up and we haven't baked it into 
the core standard set-up is that the AJAX progress bar stuff is in 
Wicket-extensions. IMO, maybe it's time to move that to core.


Regards,

Al
Ah ok thanks. I was just worried that there would some extra overhead 
for all normal requests.

Cheers
Oliver


smime.p7s
Description: S/MIME Cryptographic Signature


Re: A Relative path question

2007-08-21 Thread Chris Lintz

Ok, I think may see the start of my problem.  I have been unable to setup a
WicketFilter with JkMount /myapp* .   I have only been able to successfully
use the WicketWilter if my JkMount is JkMount /* default for example.  I
have been trying exactly what you mention below but to no success (sorry for
the confusion):

-- Run a Wicket webapp on http://appserver.com:8080/
--(Note that's a root context path.)
--  - Map Wicket to the root using servlet mapping/filter mapping of /*.
--  - Pass requests from an Apache which land on www.mydomain.com through
--to the Apache, unless they land on /myapp/*, in which case send them
--to Wicket.

Here is my filter:

   filter
filter-nameMyWebsite/filter-name

filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
init-param
param-nameapplicationClassName/param-name
param-valuecom.mywebsite.MyApplication/param-value
/init-param
init-param
 param-namefilterMappingUrlPattern/param-name
param-value/*/param-value
 /init-param
/filter

filter-mapping
   filter-nameMyWebsite/filter-name
   url-pattern/*/url-pattern
/filter-mapping

Here is JkMount:
 IfModule mod_jk.c
 JkMount /myapp* default
 JkMount /myapp/* default
 JkUnMount /images default
 JkUnMount 
/IfModule

If i could get this to work, I bet all of my hard to explain issues go away. 
Those JkMounts above result in 404 errors.  I have no mod_rewrites of any
sort that would be interfering.  If I do this though, it works 

  IfModule mod_jk.c
 JkMount  /* default
 JkUnMount /images
  /IfModule

I have no mod_rewrites or anything that would conflict.  I am viewing the
source of the WicketFilter and see the filterMappingUrlPattern which i why I
included it web.xml init params, although it is not mentioned on the
migration docs: 
http://cwiki.apache.org/WICKET/migrate-13.html#Migrate-1.3-FilterinsteadofaServlet
.

So, rather than confuse you any more, is it obvious from the the above why
the Filter only works when I JkMount /* default ?  If I could get it to
JkMount /myapp* default, all of my relative path issues would most likely go
away according to what you have explained. 

Thanks again




Al Maw wrote:
 
 Chris Lintz wrote:
 Thanks for the response.  Yes I am using Wicket 1.3 Beta 2.  I First
 mapped
 the WAR at root, and let everything fall through Apache with JkUnMounts
 (i.e. JkUnMount /images default), but the issue is I could not solve the
 problem of I did not want / served by wicket.
 
 Basically it comes down to this.  I cannot seem to make a reference to
 Wicket page on a path www.mydomain.com/myapp  from my static home page
 www.mydomain.com because the relative path is / .  I need the Wicket
 components to render under /myapp even from requests coming from / .
 
 OK. I'm slightly confused at the moment, because you haven't quite 
 specified well enough how you're trying to achieve this. Please could 
 you clarify the following points:
 
   - What context path is your app running in? Is it the root?
   - Is Wicket running using a filter or a servlet?
   - Is Wicket mapped to /myapp/* in web.xml?
   - What is your mod_jk forwarding set-up, exactly?
 - You say you're forwarding from www.mydomain.com to
   www.mydomain.com/myapp, but obviously you're not quite,
   as otherwise you'd just get an infinite loop there. ;)
 - Specifically, where are your wildcards if there are any?
 
 You seem to be concentrate too much on the specifics of what's wrong 
 with your set-up, rather than what you're trying to achieve here.
 
 As far as I can tell, you want to do the following:
   - Run a Wicket webapp on http://appserver.com:8080/
 (Note that's a root context path.)
   - Map Wicket to the root using servlet mapping/filter mapping of /*.
   - Pass requests from an Apache which land on www.mydomain.com through
 to the Apache, unless they land on /myapp/*, in which case send them
 to Wicket.
   - You don't want your static resources served from within Tomcat.
 
 Is that right?
 
 Even if that's so, I still don't understand what specific issue you're 
 having. Actually giving us some URLs might be illustrative here.
 
 If you get a request for this:
   - www.myserver.com/myapp/path/to/mounted/page/
 
 Assuming your context path is /, that will get mapped to:
   - appserver.com:8080/path/to/mounted/page/
 
 If you add a HeaderContributor with a ResourceReferences, or something 
 similar, Wicket will give you URLs relative to that, so something like 
 this in your generated HTML:
   - href=../../../../resources/com.company.HomePage/foo.css
 
 This will resolve to the following in your browser:
   - www.myserver.com/myapp/resources/com.company.HomePage/foo.css
 
 ...which is perfectly correct, as obviously 

Does anyone develop Wicket app using IRAD and Websphere

2007-08-21 Thread juliez

It's fairly easy to work with Wicket (1.3 beta2) using Jetty as the web
server. However, when I tried to do the same thing using IRAD and Websphere,
I always got file not found or Error 404. Then I tried to deploy the
wicket-examples-1.3.0-beta2.war to Websphere (6.1.0.2 Build Number:
cf20633.22), the example can't work correctly too - got Error 404: Error
reported: 404. 

Is there anything special need to be set for IBM's stuff? Any suggestion?

Thanks,
Julie
-- 
View this message in context: 
http://www.nabble.com/Does-anyone-develop-Wicket-app-using-IRAD-and-Websphere-tf4307950.html#a12263560
Sent from the Wicket - User mailing list archive at Nabble.com.


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



HeaderContributor for conditional comments

2007-08-21 Thread Rüdiger Schulz
Hello everybody,

is there a HeaderContributor for conditional comments in Wicket, or has
anyone already done this? I'd like to serve MSIE with
CompressedResourceReferences...

If not, I'd be happy to contribute! Doesn't look too hard to implement.

-- 
greetings from Berlin,

Rüdiger Schulz

www.2rue.de


Re: HeaderContributor for conditional comments

2007-08-21 Thread Matej Knopp
Just beware that while conditional comments will work on regular
request, they will not work during ajax header contribution.

Also I don't understand what you mean by
I'd like to serve MSIE with
CompressedResourceReferences

-Matej

On 8/21/07, Rüdiger Schulz [EMAIL PROTECTED] wrote:
 Hello everybody,

 is there a HeaderContributor for conditional comments in Wicket, or has
 anyone already done this? I'd like to serve MSIE with
 CompressedResourceReferences...

 If not, I'd be happy to contribute! Doesn't look too hard to implement.

 --
 greetings from Berlin,

 Rüdiger Schulz

 www.2rue.de


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



Re: IndicatingAjaxSubmitButton and download after form submission problem

2007-08-21 Thread Igor Vaynberg
you cannot stream back from ajax request directly, instead try doing
something like

window.location=somedownloadurl for ajax requests;

-igor


On 8/21/07, Martin Bednář [EMAIL PROTECTED] wrote:

 Hi,
 I have problem when I use IndicatingAjaxSubmitButton for dowload after
 form submission.

 I use this code, normal Button working correctly. it's bug in
 IndicatingAjaxSubmitButton or I'm doing something wrong ?

 ...

   //This dosn't work
 form.add(new IndicatingAjaxSubmitButton(submit, form) {
 @Override
  protected void onSubmit(AjaxRequestTarget target, Form form)
 {
  processSubmit(); }
   });
   //This working
form.add(new Button(submit) {
@Override
protected void onSubmit() {
processSubmit();
}
});




 private void processSubmit() {
final String zipArchiveFilename = /tmp/sample.zip;
RequestCycle requestCycle = this.getRequestCycle();

final ResourceStreamRequestTarget exportTarget = new
 ResourceStreamRequestTarget(
new FileResourceStream(new wicket.util.file.File(
zipArchiveFilename)), application/zip) {
@Override
protected void configure(Response arg0, IResourceStream arg1) {
super.configure(arg0, arg1);
WebResponse response = (WebResponse) arg0;
setFileName(sample.zip);
}
};

requestCycle.setRequestTarget(exportTarget);
}




SOLVED !! Re: Problem following TextField example

2007-08-21 Thread dtoffe

Browsing the forum archive I've found a clue to this issue: In web.xml
I've changed the line url-pattern/wicket/url-pattern, adding a
url-pattern//url-pattern as another url pattern and now it doesn't give
an error.

Thanks !!!

Daniel


dtoffe wrote:
 
 
 Eelco Hillenius wrote:
 
 Yes, as I said in my last post, I'm using 1.2.6, last stable version
 as
 of some two or three days ago.
 Thanks for your example !!
 
 That's why those two URLs are so different.
 
 What is not clear to me is what exactly goes wrong? Do you get
 exceptions? Or do your models not get upated right?
 
 Eelco
 
 
 
 The server log shows no exception trace or error message at all, and
 the page turns to HTTP Status 404 (The requested resource () is not
 available.)
 
 I've deleted the closing tag in the LT html
 xmlns=http://www.w3.org/1999/xhtml; GT line, notice the lacking of a
 slash sign just before the greater than sign. This way I've received a
 very long Unexpected RuntimeException trace, and at the end, this dump
 (sorry for the long size and formatting):
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-following-TextField-example-tf4302594.html#a12265590
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: SOLVED !! Re: Problem following TextField example

2007-08-21 Thread Eelco Hillenius
 Browsing the forum archive I've found a clue to this issue: In web.xml
 I've changed the line url-pattern/wicket/url-pattern, adding a
 url-pattern//url-pattern as another url pattern and now it doesn't give
 an error.

Can you give us your whole url-pattern section please? Note that it
should end in a star, like url-pattern/*/url-pattern.

Eelco

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



Re: SOLVED !! Re: Problem following TextField example

2007-08-21 Thread dtoffe



Eelco Hillenius wrote:
 
 Browsing the forum archive I've found a clue to this issue: In
 web.xml
 I've changed the line url-pattern/wicket/url-pattern, adding a
 url-pattern//url-pattern as another url pattern and now it doesn't
 give
 an error.
 
 Can you give us your whole url-pattern section please? Note that it
 should end in a star, like url-pattern/*/url-pattern.
 
 Eelco
 
 

Sure !!  It is like this:

servlet-mapping
servlet-nameWicketApplication/servlet-name
url-pattern/wicket/url-pattern
/servlet-mapping
servlet-mapping
servlet-nameWicketApplication/servlet-name
url-pattern//url-pattern
/servlet-mapping

I'm using Netbeans 5.5.1 with the Wicket support plugin, so I didn't
edited this file by hand but rather I added a / in the edit field in a comma
separated list as instructed, like /wicket,/, and the editor converted
that to the xml tags.
The /wicket part seems to be put there at the creation of the example
Wicket project, which is handled by the support plugin. BTW I've used just
/, not /*, but since my example was just one page, perhaps that's why it
worked anyway. I'll change that to /*.

Hope this helps,

I want to add... well, as you all might have noticed, I'm newbie in all
this, in the last weeks I've been suffering all the pains of JSP, JSF, XML
and all that nightmare.
I've found Wicket last thursday night and right now I'm rather confident
about the things that I, with all my newbieness on my shoulders, can do in
the next days.
Thanks for doing such great work !!!

Daniel

-- 
View this message in context: 
http://www.nabble.com/Problem-following-TextField-example-tf4302594.html#a12267558
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: SOLVED !! Re: Problem following TextField example

2007-08-21 Thread Eelco Hillenius
 servlet-mapping
 servlet-nameWicketApplication/servlet-name
 url-pattern/wicket/url-pattern
 /servlet-mapping
 servlet-mapping
 servlet-nameWicketApplication/servlet-name
 url-pattern//url-pattern
 /servlet-mapping

 I'm using Netbeans 5.5.1 with the Wicket support plugin, so I didn't
 edited this file by hand but rather I added a / in the edit field in a comma
 separated list as instructed, like /wicket,/, and the editor converted
 that to the xml tags.

Tbh, I don't see why you would need two mappings. Maybe it is
something the plugin requires, but typically one should be enough.

 The /wicket part seems to be put there at the creation of the example
 Wicket project, which is handled by the support plugin. BTW I've used just
 /, not /*, but since my example was just one page, perhaps that's why it
 worked anyway. I'll change that to /*.

You need /* (or /wicket/*) to let Wicket handle things like
javascript/ css contributions and serve packaged images etc. Wicket
simply doesn't work properly if you don't put that star in.

 I want to add... well, as you all might have noticed, I'm newbie in all
 this, in the last weeks I've been suffering all the pains of JSP, JSF, XML
 and all that nightmare.

 I've found Wicket last thursday night and right now I'm rather confident
 about the things that I, with all my newbieness on my shoulders, can do in
 the next days.
 Thanks for doing such great work !!!

Good, keep on struggeling and eventually you'll get there :)

Eelco

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



Re: DownloadLink hanging

2007-08-21 Thread Thomas Singer

Disclaimer: I'm not experienced with filters or wicket resources.

Is it possible to create a (shared) wicket resource which can be filtered, 
so it only is accessible when the right flag is set in OurWebSession?


Or would you suggest to write an own javax.servlet.Filter which does this 
flag-check and redirects internally to a hidden location which then is send 
to the client by Tomcat when the right flag is set?


Thanks in advance.

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:

Hi Igor,


yep, DownloadLinks will block because requests to the same page are
serialized.

Sorry, I don't understand, why links to downloadable resources should be
blocking or serialized. Usually downloads are the larger parts of an
application and hence should never lock the application.



because this is how this component is designed to work. if you dont like it
you can build your own that doesnt block.


to work around it register a shared resource or create a servlet that can

stream the file (resoureces in wicket are not serialized), then create a
link component that can build a download url.

Well, I guess, we can't use a servlet, because wicket is registered to
/*, so it will get everything.



wicket is a filter, so even though it is mapped to /* it will let urls that
are not wicket urls pass through. how do you think it lets you download
static images...
so if you map your wicket filter on /* and the servlet on /download and yo
have no download mount in wicket the filter will let /download/* requests
go to the servlet.

-igor


Could you please give some more hints

about shared resources? I've tried to search
http://cwiki.apache.org/WICKET/ without luck.

Alternatively, is it possible to complete shut off the serialization
(which seems to cause this and maybe even other blocking problems)?

--
Best regards
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany


Igor Vaynberg wrote:

yep, DownloadLinks will block because requests to the same page are
serialized.

to work around it register a shared resource or create a servlet that

can

stream the file (resoureces in wicket are not serialized), then create a
link component that can build a download url.

-igor


On 8/20/07, Thomas Singer [EMAIL PROTECTED] wrote:

Hi,

We are using Wicket 1.3 beta 2 running in Tomcat and have a couple of
DownloadLinks on a page (created with 'new DownloadPage(parameters)')

for

larger files (a couple of MB). I open different tabs of the same page

in

Opera and click these download links, so the downloads should happen in
parallel. Unfortunately, the web-application seems to hang until the
previous files were completely downloaded. Even normal pages do not

show

up.

This does not happen for other websites (so our internet connection
couldn't
be the reason) and not for the same project with
old-JSP-/Servlet-technology
at a different server running in the same version of Tomcat.

Is this a known problem? How to work around?

--
Best regards,
Thomas Singer
_
SyyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com

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



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






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



How to set wicket's locale?

2007-08-21 Thread smithfox

I used RequiredTextField, when the field is empty, the feedback show some
meesage in English, How to  change it to Chinese. 
-- 
View this message in context: 
http://www.nabble.com/How-to-set-wicket%27s-locale--tf4309547.html#a12268483
Sent from the Wicket - User mailing list archive at Nabble.com.


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