Re: [IE7] Shrinked popup calendar when inside a table

2008-08-26 Thread Federico Fanton
On Mon, 25 Aug 2008 09:32:33 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 On Fri, 22 Aug 2008 15:26:03 +0200
 Federico Fanton [EMAIL PROTECTED] wrote:
 
  Should I open a JIRA issue? I have a quickstart ready.
 
 If nobody has something against it, I'll go on and open it ^^

Done, https://issues.apache.org/jira/browse/WICKET-1803


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



Re: [IE7] Shrinked popup calendar when inside a table

2008-08-25 Thread Federico Fanton
On Fri, 22 Aug 2008 15:26:03 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 Should I open a JIRA issue? I have a quickstart ready.

If nobody has something against it, I'll go on and open it ^^


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



Re: Document is null or not an object after PDF from ModalWindow

2008-08-22 Thread Federico Fanton
On Fri, 22 Aug 2008 05:43:28 +0300
Timo Rantalaiho [EMAIL PROTECTED] wrote:

 On Thu, 21 Aug 2008, Federico Fanton wrote:
  Should I open a JIRA issue?
 
 Yes please, with all this information and the quickstart
 attached.

Thanks :) Here it is https://issues.apache.org/jira/browse/WICKET-1798

 If it only fails on IE7 it sounds like an IE7 compatibility bug.

I hope I'm not doing Something Wrong X-)
Thanks for your help!


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



[IE7] Shrinked popup calendar when inside a table

2008-08-22 Thread Federico Fanton
Hey everyone!
Another IE7-related weird problem, I'm sorry ^^;
I found that if I use a DateField inside a table, when I click the calendar 
icon (17) using IE7, the calendar pops up shrinked in width, even if 
there's plenty of screen space.. When I close the popup and re-open it, it 
shows up with the right width..

Debugging, I think I found the culprit being a

YAHOO.util.Dom.setX(subject, targetPos[0])

inside wicket-date.js (wicket-datetime) line 115, so _maybe_ it's YUI's 
problem.. Anyway, maybe a simple

if(YAHOO.util.Dom.getX(subject) != targetPos[0])

before the call would prevent the error..
Should I open a JIRA issue? I have a quickstart ready.

Many thanks!


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



Re: Document is null or not an object after PDF from ModalWindow

2008-08-21 Thread Federico Fanton
On Wed, 20 Aug 2008 12:11:49 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 Sorry, forgot to mention: I'm using Wicket 1.3.4, and according to 
 Companion.JS the stacktrace for the error is (most recent call first):
 
 wicket-ajax.js:51
 wicket-event.js:110
 wicket-event.js:29

I wrote a little Quickstart that shows the problem, there's a running instance 
here:
http://80.66.211.218:8080/testpdf

Should I open a JIRA issue?
As always, many thanks for your time!


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



Document is null or not an object after PDF from ModalWindow

2008-08-20 Thread Federico Fanton
Hi everyone!
I'm sorry, I need to have the browser open PDFs automatically (no open or 
save dialogs) and in a new window (either a browser window or the standalone 
PDF viewer).
So far I've been using this method:

IResourceStream stream = new ByteArrayResource(application/pdf, 
pdf.toByteArray()).getResourceStream();
RequestCycle.get().setRequestTarget(new ResourceStreamRequestTarget(stream));   


Everything works fine with Firefox 2 (on Ubuntu and on XPsp2), and even on IE7 
most of the times, but if I try to open a PDF from a submit Button in a 
ModalWindow, IE7 starts throwing weird javascript errors (document is null or 
not an object *_*; ) and basically AJAX stops working..
I'm using Acrobat 8.1.2 with show PDF in browser disabled.. Any ideas of 
what's going on?
Many thanks for your attention!


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



Re: Document is null or not an object after PDF from ModalWindow

2008-08-20 Thread Federico Fanton
Sorry, forgot to mention: I'm using Wicket 1.3.4, and according to Companion.JS 
the stacktrace for the error is (most recent call first):

wicket-ajax.js:51
wicket-event.js:110
wicket-event.js:29


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



Re: Button with confirmation with IE7

2008-08-13 Thread Federico Fanton
On Tue, 12 Aug 2008 17:07:40 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 I tried that, but nothing changed :/ Same Invalid procedure call or 
 argument under IE7.. (still Ok in FF2)

After a bit of debugging, I found the offending command inside wicket-ajax.js:

t.setRequestHeader(Wicket-FocusedElementId, Wicket.Focus.lastFocusId || );

I think the problem arises when lastFocusId is empty.. I tried replacing the 
command with 

t.setRequestHeader(Wicket-FocusedElementId, );

and the error is still there.. So, it looks like the AJAX transport of IE7 
doesn't allow empty header values.. Would a patch like the following be ok?

if(Wicket.Focus.lastFocusId != '')
   t.setRequestHeader(Wicket-FocusedElementId, Wicket.Focus.lastFocusId);

Or is there something that expects that header to be there (even if with empty 
value)?


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



Re: Button with confirmation with IE7

2008-08-13 Thread Federico Fanton
On Wed, 13 Aug 2008 09:56:56 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 if(Wicket.Focus.lastFocusId != '')
t.setRequestHeader(Wicket-FocusedElementId, Wicket.Focus.lastFocusId);

Oops, better to check for null too:

if(Wicket.Focus.lastFocusId  Wicket.Focus.lastFocusId != '')
t.setRequestHeader(Wicket-FocusedElementId, Wicket.Focus.lastFocusId);


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



Button with confirmation with IE7

2008-08-12 Thread Federico Fanton
Hi everyone!
I have a Button that shows a JS alert and then executes an AJAX call.
It works fine under Firefox 2, but fails under IE7.. The alert appears, I click 
ok and then I get the Initiating Ajax GET request... inside WICKET AJAX 
DEBUG, but it doesn't reach my serverside handler..
Here's the code:

Button button = new Button(btn);
button.add(new AjaxEventBehavior(onclick){

@Override
protected void onEvent(AjaxRequestTarget target) {
System.out.println(Ajax call works);
}

@Override
protected CharSequence getEventHandler() {
return alert('Press OK and check server 
log');+super.getEventHandler();
}
});
add(button);


So basically, with IE7 after the alert there's no Ajax call works in the 
serverside log.. Everything is OK with FF2.
Am I doing something wrong? Should I open a JIRA issue? (I have a quickstart 
ready)
Many thanks for your attention!


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



Re: Button with confirmation with IE7

2008-08-12 Thread Federico Fanton
On Tue, 12 Aug 2008 15:18:49 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 Hi everyone!
 I have a Button that shows a JS alert and then executes an AJAX call.
 It works fine under Firefox 2, but fails under IE7.. The alert appears, I 
 click ok and then I get the Initiating Ajax GET request... inside WICKET 
 AJAX DEBUG, but it doesn't reach my serverside handler..

Just noticed:
After clicking ok, in the bottom-left corner of the window appears a 
javascript error: Invalid procedure call or argument, line 849, code 0... 
Does it mean inside wicket-ajax.js? ^^;


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



Re: Button with confirmation with IE7

2008-08-12 Thread Federico Fanton
On Tue, 12 Aug 2008 07:58:13 -0700 (PDT)
Michael Sparer [EMAIL PROTECTED] wrote:

 try overriding
 
   @Override
   protected IAjaxCallDecorator getAjaxCallDecorator() {

Hi, thanks for your suggestion :)
I tried that, but nothing changed :/ Same Invalid procedure call or argument 
under IE7.. (still Ok in FF2)


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



Re: Button with confirmation with IE7

2008-08-12 Thread Federico Fanton
On Tue, 12 Aug 2008 17:07:40 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 On Tue, 12 Aug 2008 07:58:13 -0700 (PDT)
 Michael Sparer [EMAIL PROTECTED] wrote:
 
  try overriding
  
  @Override
  protected IAjaxCallDecorator getAjaxCallDecorator() {
 
 Hi, thanks for your suggestion :)
 I tried that, but nothing changed :/ Same Invalid procedure call or 
 argument under IE7.. (still Ok in FF2)

Looks like my issue is like the one at 
https://issues.apache.org/jira/browse/WICKET-1585, but on line 849 instead (I'm 
using Wicket 1.3.4).. Any opinion?


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



Re: Extending BrowserInfoForm

2008-08-11 Thread Federico Fanton
On Fri, 8 Aug 2008 08:29:37 -0700
[EMAIL PROTECTED] wrote:

 should be fine

Done, https://issues.apache.org/jira/browse/WICKET-1786
Thanks!


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



Extending BrowserInfoForm

2008-08-08 Thread Federico Fanton
Hi everyone!
I'd like to extend BrowserInfoForm to detect if the browser supports SVGs 
(javascript method here 
http://thomas.tanrei.ca/modern-script-based-svg-detection/), but it looks like 
it cannot be easily extended.. Should I try to write a patch for Wicket 
instead? Would it be useful? Am I going the wrong way maybe? X-)
Many thanks for your opinions!


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



Re: Interrupting AJAX calls

2008-07-29 Thread Federico Fanton
On Fri, 25 Jul 2008 12:20:13 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 I'm sorry, I just noticed that if I press ESC during an AJAX call in 
 Wicket, it gets interrupted (and the onFailure script gets run, I think)
 
 To reproduce, just head to
 http://wicketstuff.org/wicket13/ajax/modal-window.1
 and click on a link, then quickly press ESC, the popup window shouldn't 
 show up (or block in mid-rendering).

Am I the only one seeing this behavior? 


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



Re: Interrupting AJAX calls

2008-07-29 Thread Federico Fanton
On Tue, 29 Jul 2008 10:01:41 +0200
Martijn Dashorst [EMAIL PROTECTED] wrote:

 This is nothing we can do anything about: the browser cancels
 rendering. And with good cause. I've had my share of websites that
 took hold of my browser for too long. especially when they are getting
 ads from remote servers.

 In this case: just ensure that your responses are quick enough.

I see, but the customer found this problem during an AJAX call that shows a 
big DIV with a please wait message.. That is, I can't speed things up :/
I see in the DOM reference an event.preventDefault, I think I'll try that..
Many thanks for your answer! :)


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



Interrupting AJAX calls

2008-07-25 Thread Federico Fanton
Hi everyone!
I'm sorry, I just noticed that if I press ESC during an AJAX call in Wicket, 
it gets interrupted (and the onFailure script gets run, I think)

To reproduce, just head to
http://wicketstuff.org/wicket13/ajax/modal-window.1
and click on a link, then quickly press ESC, the popup window shouldn't show 
up (or block in mid-rendering).

I don't know if this is Wicket-related or Firefox-related (tried v2 and v3) 
or.. :) My question is: any hint on how to prevent it?

Many thanks!


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



Setting focus in DateField

2008-07-17 Thread Federico Fanton
Hi everyone!
I'm sorry, is there a way to set the focus to the textfield of a DateField 
component, whenever the user picks a date from the popup?
I mean:
- the user clicks on the calendar icon
- she chooses a date from the popup calendar
- the popup closes
- the focus goes to the corresponding textfield

What should I try to investigate? Is this a Wicket-side matter or YUI's?
Many thanks for your attention!


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



Re: Setting focus in DateField

2008-07-17 Thread Federico Fanton
On Thu, 17 Jul 2008 15:42:14 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 Hi everyone!
 I'm sorry, is there a way to set the focus to the textfield of a DateField 
 component, whenever the user picks a date from the popup?
 I mean:
 - the user clicks on the calendar icon
 - she chooses a date from the popup calendar
 - the popup closes
 - the focus goes to the corresponding textfield
 
 What should I try to investigate? Is this a Wicket-side matter or YUI's?

I think I'll try hooking into the Calendar's beforeHideEvent via Javascript.. 
Am I on the right track? :)


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



Re: Setting focus in DateField

2008-07-17 Thread Federico Fanton
On Thu, 17 Jul 2008 16:40:18 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 I think I'll try hooking into the Calendar's beforeHideEvent via 
 Javascript.. Am I on the right track? :)

It works! Thanks to Wicket and its customizability *_*
And sorry for the noise X-)


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



Re: Wikcet Freechart and SVG

2008-06-30 Thread Federico Fanton
On Sun, 29 Jun 2008 21:03:29 -0300
Manuel Corrales [EMAIL PROTECTED] wrote:

 Hey, great!! But still having issues, sorry to bother you again. Now i added
 the svg to the page, but the browser do not display it. The image is there,
 because when i right click the broken image that is displayed by the broser
 and press save as, i can save the svg and is good. Should my html tag be
 different, or should i set something else on my code:

Not every browser handles SVGs directly, some need a plugin (guess which one :) 
).. In our project I use the object .../ tag, so for example when the page is 
rendered it has a

object style=height: 32px; width: 32px; data=images/logo.svg/

Bye!


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



Clicking a tree leaf and confirmation

2008-04-24 Thread Federico Fanton
Hi all!
First of all, I'd like to celebrate the achieved complete elimination of JSF 
from our project here, thanks to Wicket :)

Next, I'm facing a little problem..
I have a LinkTree and I'd like to make it ask for confirmation (via a JS alert) 
whenever the user clicks on a leaf.. If the user confirms, a component of the 
page should be AJAX-refreshed, otherwise nothing happens.
The AJAX part works right now, I need to add the confirmation bit.. I thought 
I'd override BaseTree.newLink and decorate the AJAX call, but from that method 
I can't tell if the link will be related to a leaf or a folder.. Am I going the 
wrong way? Maybe newLink(id, callback) could be expanded to something like 
newLink(id, callback, model)?

Many thanks for your attention!


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



Re: Clicking a tree leaf and confirmation

2008-04-24 Thread Federico Fanton
On Thu, 24 Apr 2008 13:44:15 +0200
Thomas Kappler [EMAIL PROTECTED] wrote:

 Hi Federico,
 
 you gain a lot of flexibility when overriding newNodeComponent()
 instead.  There, you return a custom Panel where you can do what you
 want, i.e., add the link with all desired functionality.  And you can
 of course give your Panel any constructor you like.

I see, thanks for your answer :)
I knew about newNodeComponent, but since the only difference between the 
standard LinkTree and my implementation is in the AJAX call, I was looking for 
a solution that could touch just that part.. I'll go with your suggestion 
though, thanks again!


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



Re: Handling lost connection

2008-04-21 Thread Federico Fanton
On Fri, 18 Apr 2008 09:15:52 -0700
Igor Vaynberg [EMAIL PROTECTED] wrote:

 create a jira issue

Done, WICKET-1557.. Thanks again!


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



Re: WicketTester.startPage(page) throws No requestCycle is currently set

2008-04-21 Thread Federico Fanton
On Sat, 19 Apr 2008 10:39:41 +0200
Johan Compagner [EMAIL PROTECTED] wrote:

 Somehow something detaches everything when it shouldnt have done it
 yet in your example. Upload your test to a jira issue

Done, WICKET-1558, thanks!


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



Handling lost connection

2008-04-18 Thread Federico Fanton
Hi all,
is there a way to handle a connection lost problem from AJAX buttons? I mean, 
right now when I click on an AJAX button and the server is down, nothing 
happens. I'd like to show an alert instead..
I tried registering a handler with registerFailureHandler, but it doesn't fire 
_only_ on connection lost, I receive alerts on other Ajax errors too.. Inside 
Wicket AJAX debug I see NS_ERROR_NOT_AVAILABLE errors, even with the server 
up.. Am I doing something wrong?
Many thanks for your time!


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



WicketTester.startPage(page) throws No requestCycle is currently set

2008-04-16 Thread Federico Fanton
Hi to all,
I'm receiving a strange message with WicketTester in 1.3.3.. Whenever I use 
startPage(Page) I get a No requestcycle is currently set! logged..
To reproduce, just use a QuickStart with a completely static Homepage.html (no 
wicket:id's) and an empty Homepage.class (just a Homepage extends WebPage), 
while the test itself is

new WicketTester().startPage(new HomePage());

with

log4j.logger.org.apache.wicket=DEBUG

inside log4j.properties, to enable logging.

Am I missing something?
Many thanks for your time!


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



Re: DateTimeField and zero padding hours

2008-04-15 Thread Federico Fanton
On Tue, 15 Apr 2008 08:59:44 +0200
Johan Compagner [EMAIL PROTECTED] wrote:

 I dont know exatly dont see an  example here, but i just guess you
 dont comply completely with the format and then the formatter just
 tries to interperd it.

Problem found, Wicket is using my custom converter for Integers to populate the 
hours field, and since in that converter I translate zeroes to empty 
string... So, many thanks for your patience! And sorry for not providing a 
Quickstart :/


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



DateTimeField and zero padding hours

2008-04-11 Thread Federico Fanton
Hi everyone!
Just a quick question.. If I type inside a DateTimeField a 0 in the hours and 
minutes field, on submit the minutes field is padded to 00, while the 
hours field becomes blank.. Is this an intended behavior? I'm using Wicket 
1.3.3..
Thanks for your time!


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



Re: Inspecting AjaxRequestTarget

2008-03-31 Thread Federico Fanton
On Fri, 28 Mar 2008 09:31:39 -0700
Igor Vaynberg [EMAIL PROTECTED] wrote:

 fine by me

Great, I'll keep an eye on SVN then, thanks to everyone :)


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



Re: Inspecting AjaxRequestTarget

2008-03-31 Thread Federico Fanton
On Mon, 31 Mar 2008 09:57:51 +0200
Johan Compagner [EMAIL PROTECTED] wrote:

 done and fixed

And very quickly! Kudos to the Wicket devs!


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



Re: Inspecting AjaxRequestTarget

2008-03-28 Thread Federico Fanton
On Fri, 28 Mar 2008 12:56:44 +0100
Martijn Dashorst [EMAIL PROTECTED] wrote:

 You could replace the original ajax request target with a new one:
 
 AjaxRequestTarget newAjax = new AjaxRequestTarget(getPage());
 getRequestCycle().setRequestTarget(newAjax);
 newAjax.addComponent(table);

I see, but I can't confidently replace the target that way, since there could 
be _other_ components being updated, unrelated to the table.. I'm sorry, I 
wasn't clear previously :(
Would it be a Bad Thing to add a protected 
AjaxRequestTarget.getMarkupToIdComponents() ?
Many thanks for your time!


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



Re: Dynamic form components and disabling them

2008-02-28 Thread Federico Fanton
On Wed, 27 Feb 2008 17:16:46 -0800
Igor Vaynberg [EMAIL PROTECTED] wrote:

 yes, you are correct. fixed in trunk.

Ok, thanks :)


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



Re: Dynamic form components and disabling them

2008-02-26 Thread Federico Fanton
On Mon, 25 Feb 2008 08:58:11 -0800
Igor Vaynberg [EMAIL PROTECTED] wrote:

 yeah, the components are recreated. you have to set an item reuse
 strategy for the gridview, see setItemReuseStrategy ...

I'm sorry, while trying to figure out how reuse strategies work I stumbled upon
GridView$ItemsIterator.. Here's its findNext() method:

private void findNext()
{
   next = null;

   if (cells != null  cells.hasNext())
   {
  next = (Item)cells.next();
   }

   while (rows.hasNext())
   {
  MarkupContainer row = (MarkupContainer)rows.next();
  cells = ((MarkupContainer)row.iterator().next()).iterator();
  if (cells.hasNext())
  {
 next = (Item)cells.next();
 break;
  }
   }
}

Shouldn't there be an else or something like that, between the outmost if and 
the while? ?_? Isn't this method supposed to iterate over every cell of every 
row?
(Wicket 1.3.1, but this class hasn't changed since rev 584925)

Thanks for your attention


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



Dynamic form components and disabling them

2008-02-25 Thread Federico Fanton
Hi everyone!
I have a form built dynamically using a GridView and a bunch of in-panel 
components.. It works pretty fine, but I have to alter its behavior in this 
way: I need to initialise every component to be disabled, and enable them by 
pressing an enable form button..
My problem is that even if on submit I call setEnable(true) on every component, 
afterwards they are still disabled.. Is this because the GridView recreates the 
components every time, so the state is lost? Or is it supposed to work? (which 
would mean I'm doing something wrong of course :) )
Many thanks for your time!


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



Re: Dynamic form components and disabling them

2008-02-25 Thread Federico Fanton
On Mon, 25 Feb 2008 08:58:11 -0800
Igor Vaynberg [EMAIL PROTECTED] wrote:

 yeah, the components are recreated. you have to set an item reuse
 strategy for the gridview, see setItemReuseStrategy ...

Yes, I'm using ReuseIfModelsEqualStrategy.. I'll try to tweak it a little then!
Many thanks!


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



Re: AJAX validation and multiple requests

2008-02-20 Thread Federico Fanton
On Wed, 20 Feb 2008 08:42:14 +0200
Timo Rantalaiho [EMAIL PROTECTED] wrote:

 I think that we just stored the Component instances in that
 case, thogh you should be wary with that and especially with
 a repeater it might get difficult.
 
 A more dynamic way might be to use a marker interface for the
 relevant components and always check their states with a
 visitor. There again you should be careful with the repeater.
 However, for your form handling to work at all I suppose
 that the repeater items must not be recreated until  the form
 is submitted or canceled anyway.

Nice idea! Many thanks for your help :)


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



Re: AJAX validation and multiple requests

2008-02-19 Thread Federico Fanton
On Tue, 19 Feb 2008 06:49:04 +0200
Timo Rantalaiho [EMAIL PROTECTED] wrote:

 We have done something similar with OnChangeAjaxBehavior and
 keeping in some component or validator the state of 
 validities of each FormComponent. When everything is valid,
 the whole form can be submitted.

I see.. I'm trying this way too (alongside the Javascript one that Igor 
Vaynberg pointed out), so I have a Map that maps every component to its state, 
but I have a doubt.. How do you identify uniquely a Component? I can't use 
getId() since I'm inside a repeater and every component has the same id.. Right 
now I'm using getPath() and it works quite well, but I don't know if it's the 
right choice, since I'm refreshing the table with Ajax.. Do you store the 
component itself?

Thanks for your time!


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



AJAX validation and multiple requests

2008-02-18 Thread Federico Fanton
Hi everyone!
I'm having a little problem..
I have an Ajax editable table made with rows of custom components similar to 
AjaxEditableLabel, that while in edit mode use a behavior like this one:

protected class EditorBehavior extends AbstractDefaultAjaxBehavior{
   @Override
   protected void onComponentTag(ComponentTag tag) {
  super.onComponentTag(tag);
  String js={wicketAjaxGet(' + getCallbackUrl() + 
'+this.name+'='+wicketEncode(this.value)); return false;};
  tag.put(onblur, js);
   }

   @Override
   protected void respond(AjaxRequestTarget target) {
  FormComponent c = (FormComponent) getEditorComponent();
  c.processInput();
  if(c.hasErrorMessage()){
 Serializable msg = c.getFeedbackMessage().getMessage();
 Util.showAlert(target, c, msg.toString());
  }
   }
}


(Util.showAlert adds to the component a behavior that shows an alert)

Everything works fine, but I need to add another behavior to intercept when the 
user presses Enter (bound to onkeyup), so that I can validate the row as a 
whole.
When I press enter, two requests are fired: one for onblur and one for onkeyup. 
My problem is that even if the onblur request finds an error during validation 
(and shows the corresponding alert), the second request has no way to know 
that, since feedback messages are cleaned up at the end of each request..
Any hint on how I could handle this? Should I put a flag somewhere? Or maybe 
there's a way to stop the second request when my EditorBehavior finds a 
validation error?

Many thanks for your time!


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



Re: PageExpired while ordering DataTable

2008-02-12 Thread Federico Fanton
On Mon, 11 Feb 2008 13:01:47 +0100
Johan Compagner [EMAIL PROTECTED] wrote:

 i guess we could up the level a bit yes
 Because in 1.3 it is pretty serious error if we cant save the page.

Great! Should I open a JIRA issue to track this?


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



Re: PageExpired while ordering DataTable

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

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

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


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



PageExpired while ordering DataTable

2008-02-08 Thread Federico Fanton
Hi everyone!
I'm looking for a little help please..
I have a search page with a form and a custom DataTable (with 
SortableDataProvider).
Everything works fine: I can set filters from the form, order the table by 
clicking on column headers, browse through the table pages, etc.. My problem is 
that if I _quickly_ doubleclick on a column header (even with no data in the 
table), i get a PageExpiredException. I tried debugging this, so I saw that 
WicketServlet receives two calls, and the second one triggers the exception.. 
What method should I try to debug this? Is there a guide somewhere on how to 
track down page expired errors?
Many thanks for your time!


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



Re: PageExpired while ordering DataTable

2008-02-08 Thread Federico Fanton
On Fri, 8 Feb 2008 12:50:34 +0100
Federico Fanton [EMAIL PROTECTED] wrote:

 My problem is that if I _quickly_ doubleclick
 on a column header (even with no data in the table),
 I get a PageExpiredException. I tried debugging
 this, so I saw that WicketServlet receives two
 calls, and the second one triggers the exception..

I see that every click on the column header triggers a request for a different 
version of the current page, but SecondLevelCacheSessionStore holds only the 
last one.. Am I right? So, a doubleclick generates two requests for the same 
version, but the first one removes it, so the second one misses.. Am I doing 
something wrong?


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



Re: PageExpired while ordering DataTable

2008-02-08 Thread Federico Fanton
On Fri, 8 Feb 2008 15:49:58 +0100
Maurice Marrink [EMAIL PROTECTED] wrote:

 If I recall correctly we had a similar problem a little while ago.
 As it turned out the page was requested twice but only the first was rendered.
 The reason the page was requested twice was because we had something
 like this on our page img src /
 For some reason the absence of a valid source tag triggers the browser
 into requesting the page again which it then tries to use as the image
 (which will fail offcourse).
 This behavior is documented somewhere but i forgot where.
 
 Maybe this is the case with your page as well.

I see.. My case is different though, since I receive (as expected) one request 
per click.. If I click one time and wait for the page to refresh, then click 
again, everything is fine.. I get the exception when I click twice quickly on 
the same page.
Thanks for your time anyway :)


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



Re: Customizing the navigator panel LF

2008-02-07 Thread Federico Fanton
On Thu, 7 Feb 2008 14:17:38 +0100
Fabrizio Giudici [EMAIL PROTECTED] wrote:

 My navigator panels (e.g. from AjaxFallbackDefaultDataTable,  
 GridView, etc... looks like   1 2 3  . I'd like to replace the  
 lt and gt with icons, and to control the style of the numbers. How do  
 I do that?

In a DataTable you can customize toolbars by overriding newPagingNavigator and 
providing your own implementation, by extending the default PagingNavigator and 
overriding newPagingNavigation* methods.

Ciao!


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



Re: WicketTester Doesn't Support setDefaultFormProcessing(false)

2008-01-28 Thread Federico Fanton
On Tue, 15 Jan 2008 23:45:42 +0100
Martijn Dashorst [EMAIL PROTECTED] wrote:

 Probably a missing feature. Could you open a JIRA issue please?

For reference: http://issues.apache.org/jira/browse/WICKET-1291
I'm interested in this issue too, if there's some way I could help..


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



Re: Setting focus to a TextField

2008-01-14 Thread Federico Fanton
On Thu, 20 Sep 2007 20:21:20 -0400
John Krasnay [EMAIL PROTECTED] wrote:

 I include this little script in my base page to always auto-focus the
 first text box.

Pretty! Thanks :)


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



Re: DatePicker NaN

2008-01-03 Thread Federico Fanton
On Wed, 19 Sep 2007 18:19:15 +0200
Gerolf Seitz [EMAIL PROTECTED] wrote:

 ivana filed an issue today (WICKET-989) and i already attached a patch to
 it.
 so either you persuade any of the committers to apply the patch and commit
 it, or you do an svn checkout and apply the patch to your local copy of
 wicket-datetime.
 
   Gerolf
 
 On 9/19/07, Philip Köster [EMAIL PROTECTED] wrote:
 
 
 
  ivana wrote:
  
   Hi
   I have a problem with the DatePicker. It works fine if the input is a
   valid date or if the input is very wrong, for example: ''xxx.
   But when the input consists of numbers and but is not a valid date, the
   calendar is rendered with NaN in every field.



I'm sorry, could it be that somehow this patch wasn't included in 1.3.0? I 
upgraded today and I'm still having the same problem.. If I write 123 in the 
text box and I press the calendar icon, the datepicker is full of NaNs. I 
checked wicket-date.js and it looks like it doesn't check for NaNs..
Thanks for your time!


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



Re: DatePicker NaN

2008-01-03 Thread Federico Fanton
On Thu, 3 Jan 2008 21:29:18 +0100
Gerolf Seitz [EMAIL PROTECTED] wrote:

 Federico, is it possibly that you try it with the latest trunk?
 the fix is in and it will be included in 1.3.1

I'll try it ASAP, many thanks! :)


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



Re: [OT] Howto load external resource (pdf) best?

2007-11-23 Thread Federico Fanton
On Fri, 23 Nov 2007 05:06:29 -0800 (PST)
Newgro [EMAIL PROTECTED] wrote:

 So i'm looking for a solution like - load the template for fix-location.
 And if a new template arrives i can simply put it to the fix-location.
 
 But how can i do this - espacially with the wicket framework.

If I understand correctly it looks to me that this isn't Wicket-related at all 
:) Just put the files under /any/path/for/templates and use
new File(/any/path/for/templates/templatename.jrxml)
to pass them to JasperReports..


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



Re: Tracking InlineFrame status

2007-11-23 Thread Federico Fanton
On Thu, 22 Nov 2007 18:52:28 +0100
Federico Fanton [EMAIL PROTECTED] wrote:

 I have a Wicket page with an InlineFrame pointing to another Wicket page on 
 the same servlet.. In the inner one I have a button that calls 
 setResponsePage, thus changing the inner page.. Is there a way for the 
 outer page to gain access to the new inner one? I mean, the actual WebPage 
 object.. Using PageMaps maybe?


For posterity, I think this can be solved by passing a new PageMap to the 
InlineFrame and using it to istantiate inner pages, then from the outer one:
IPageMap m = iFrame.getPageMap();
int id = m.nextId()-1; // ugly hack to get last page id, probably there's a 
better way
Page actPage = m.get(id, -1); // -1 means last version (undocumented?)

Bye!


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



Aborting Ajax component replacing

2007-11-23 Thread Federico Fanton
Hi everyone!
I'm sorry, I'm triying to implement this workflow:
- user presses on Ajax button
- if server-side check returns false, refresh component X
- if server-side check returns true, ask confirmation to user via JS confirm(), 
and eventually refresh component X

I tried using something like

if(check())
ajaxTarget.prependJavascript(if(!confirm('You sure?')) return false;);
ajaxTarget.addComponent(componentX);

but in Ajax Debug Window i get SyntaxError: invalid return.. Is there a way 
to abort ajax component replacing from prependJavascript?
(I'll use a ModalWindow if it's not possible, but I'd like to avoid it ^^ )

Many thanks for your time!


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



Re: [OT] Howto load external resource (pdf) best?

2007-11-23 Thread Federico Fanton
On Fri, 23 Nov 2007 03:55:32 -0800 (PST)
Newgro [EMAIL PROTECTED] wrote:

 But i look for a solution where i
 can exchange the template without redeploying the whole application.

I see.. When testing inside Eclipse I just use
new File(/path/to/template.jasper)
Maybe something like that would do the trick :)


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



Re: Aborting Ajax component replacing

2007-11-23 Thread Federico Fanton
On Fri, 23 Nov 2007 11:04:26 +0100
Federico Fanton [EMAIL PROTECTED] wrote:

 but in Ajax Debug Window i get SyntaxError: invalid return.. Is there a way 
 to abort ajax component replacing from prependJavascript?

Mmh.. This

 r579593 | knopp | 2007-09-26 13:16:51 +0200 (Wed, 26 Sep 2007) | 1 line

 Allow arbitrary delaying of Ajax pipeline using prepend/append javascript

inside wicket-ajax.js changelog looks promising.. Am I mistaken? ^^;


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



Tracking InlineFrame status

2007-11-22 Thread Federico Fanton
Hi everyone!
I'm looking for a hint please :)
I have a Wicket page with an InlineFrame pointing to another Wicket page on the 
same servlet.. In the inner one I have a button that calls setResponsePage, 
thus changing the inner page.. Is there a way for the outer page to gain 
access to the new inner one? I mean, the actual WebPage object.. Using PageMaps 
maybe?
Many thanks for your attention!


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



Using LinkTree to show subtrees

2007-11-20 Thread Federico Fanton
Hi everyone!
I'm looking for a hint please :)
I have a somewhat complex chain of TreeNodes that I need to show by subtree 
(not in its entirety), so I figured I'd just find my subroot TreeNode, wrap 
it in a DefaultTreeModel and pass it to a LinkTree.. Everything is fine, except 
that clicking on nodes doesn't expand them.
I think this is because AbstractTree.isNodeVisible() walks up the treenodes 
from parent to parent until it hits the topmost one, but it ignores that my 
TreeModel root could be different from the real root.. I figure I could alter 
the treeState by hand and expand all the nodes that lead to the subroot, but I 
think it's not a very clean solution.. Since isNodeVisible() is final I can't 
override it, but maybe it would be a patch worth including in Wicket itself?
Thanks for your time!


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



Re: AjaxIndicator and mouse hourglass

2007-11-15 Thread Federico Fanton
On Thu, 15 Nov 2007 15:59:18 +0100
Federico Fanton [EMAIL PROTECTED] wrote:

 I was wondering, is there a way to use the mouse hourglass to indicate AJAX 
 activity instead of showing/hiding a component?

Ehr, maybe Wicket.Ajax.registerPreCallHandler?


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



AjaxIndicator and mouse hourglass

2007-11-15 Thread Federico Fanton
Hi everyone!
I was wondering, is there a way to use the mouse hourglass to indicate AJAX 
activity instead of showing/hiding a component?
I know that you can use
document.style.cursor='wait'
but AbstractDefaultAjaxBehavior calls wicketShow() and wicketHide() directly 
(at least on 1.3b3), so I can't customise them..
Any idea?
Many thanks for your attention!


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



Re: AjaxIndicator and mouse hourglass

2007-11-15 Thread Federico Fanton
On Thu, 15 Nov 2007 16:18:50 +0100
Federico Fanton [EMAIL PROTECTED] wrote:

  I was wondering, is there a way to use the mouse hourglass to indicate AJAX 
  activity instead of showing/hiding a component?
 
 Ehr, maybe Wicket.Ajax.registerPreCallHandler?

Ok, I had to mess a bit with Javascript, but it works.. Thanks anyway :)


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



Re: Doubleclicking on a refreshable Ajax button

2007-11-14 Thread Federico Fanton
On Tue, 13 Nov 2007 11:36:30 -0800
Eelco Hillenius [EMAIL PROTECTED] wrote:

 We're actually seeing similar stack traces occasionally. I wonder if
 there is something more generic we can do about this.

Keeping away from Javascript would be great :) Maybe simply adding a way to 
suppress the exception in such cases..? ^^; Could this lead to Very Bad Things?
Thanks for your help!


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



Re: Doubleclicking on a refreshable Ajax button

2007-11-14 Thread Federico Fanton
On Wed, 14 Nov 2007 07:22:52 -0800 (PST)
jweekend [EMAIL PROTECTED] wrote:

 Can you try using something like setThrottleDelay(Duration.milliseconds(500))
 to help eliminate the accidental, quick-fire second click?

I completely overlooked that X-) I'll try it, many thanks :)


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



Re: Doubleclicking on a refreshable Ajax button

2007-11-14 Thread Federico Fanton
On Wed, 14 Nov 2007 17:30:18 +0100
Federico Fanton [EMAIL PROTECTED] wrote:

  Can you try using something like 
  setThrottleDelay(Duration.milliseconds(500))
  to help eliminate the accidental, quick-fire second click?
 
 I completely overlooked that X-) I'll try it, many thanks :)

Mmh.. Using throttleDelay works like wait X millisecs THEN fire event, not 
fire event THEN wait, right? Since I'm working on a generic component and I 
don't know how much time the Ajax request will take, I can't use this 
approach.. :/ (I'm also trying to prevent 
second-clicks-while-Ajax-does-its-thing)
Thanks anyway :)


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



Doubleclicking on a refreshable Ajax button

2007-11-13 Thread Federico Fanton
Hi everyone!
I'm having a problem with an ajax button and I'd like to ask for help X-)

I have a DataTable with a Button, a text field and a label on every row. My 
objective is to be able to insert data into the text field, then click on the 
button and have an ajax call which 1) renders the label according to the input 
and 2) hides the button.
Everything is fine as long as I press the button a single time, but if (by 
accident) I doubleclick, I get an exception like:

WicketMessage: component 
frmDettaglio:dettaglio:tabella:rows:1:cells:1:cell:button not found on page 
it.ibc.moduli.movimenti.DettaglioMovimenti[id = 4], listener interface = 
[RequestListenerInterface name=IBehaviorListener, method=public abstract void 
org.apache.wicket.behavior.IBehaviorListener.onRequest()]

Root cause:

org.apache.wicket.WicketRuntimeException: component 
frmDettaglio:dettaglio:tabella:rows:1:cells:1:cell:button not found on page 
it.ibc.moduli.movimenti.DettaglioMovimenti[id = 4], listener interface = 
[RequestListenerInterface name=IBehaviorListener, method=public abstract void 
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:394)
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:440)
at 
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1091)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1177)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:500)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:261)
at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:126)


I think this is because there are two ajax calls, and since the first one 
alters the DOM (or maybe the serverside state - the button needs to be hidden) 
the second one can't find the new button anymore.. Is there a way to suppress 
one of the two calls?

Many thanks for your attention!


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



ModalWindow windowClosedCallback and WicketTester

2007-10-31 Thread Federico Fanton
Hi everyone!
I have a ModalWindow with a close button in it, the button's onclick calls 
modalWindow.close() via AJAX. My problem is that when I call the onclick via
wicketTester.executeAjaxEvent(button, onclick)
the modalWindow's windowClosedCallback doesn't fire.. Am I missing something? 
Or am I supposed to call it from the testcase?

Many thanks for your time!


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



Re: Confirmation message after form submit

2007-10-29 Thread Federico Fanton
On Thu, 25 Oct 2007 11:33:57 +0100
Dipu Seminlal [EMAIL PROTECTED] wrote:

 yes  a modal window,

I see, I'll go with this solution.. Many thanks to everyone who answered :)


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



Confirmation message after form submit

2007-10-25 Thread Federico Fanton
Hi everyone!
I have a form with a submit button, and I need to implement a sequence like 
this:
- user presses the button
- form submit
- server-side validation of submitted data
- popup with confirmation message (like javascript confirm() )
- if user presses yes, call Java method X
- if user presses no, call Java method Y

Is this possible?
Many thanks for your time!


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



Re: Confirmation message after form submit

2007-10-25 Thread Federico Fanton
On Thu, 25 Oct 2007 10:40:20 +0100
Dipu Seminlal [EMAIL PROTECTED] wrote:

 I think you can make use of a modal window to do this

You mean, a modal window instead of the javascript confirm() ?


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



Re: File download and page refresh

2007-10-19 Thread Federico Fanton
On Thu, 18 Oct 2007 10:04:17 -0700
Igor Vaynberg [EMAIL PROTECTED] wrote:

 you can redirect to a page that has a meta refresh pointing to a file...

I'll try that, thanks! :)


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



File download and page refresh

2007-10-18 Thread Federico Fanton
Hi everyone!
Is it possible to build a form button which triggers a download *and* a page 
refresh?
Many thanks for your time!


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



Re: Page expired upon file download + model update

2007-10-17 Thread Federico Fanton
On Thu, 11 Oct 2007 17:00:46 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 The button has setDefaultFormProcessing(false), and overrides onSubmit so 
 that the form model object is sent to the persistence layer and printed 
 immediately afterwards. The persistence layer *may* alter the object, so I 
 have to reload it. My problem is that this reloading causes a page expired 
 when I press the button for a second time.

Ouch! Looks like it was simply a serialization issue.. ^^; Is there a way to 
trigger blocking Serialization exceptions instead of simply logging them?
Many thanks :)


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



Re: Page expired upon file download + model update

2007-10-15 Thread Federico Fanton
On Mon, 15 Oct 2007 09:37:50 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

  See here 
  http://cwiki.apache.org/WICKET/best-practices-and-gotchas.html#BestPracticesandGotchas-Startingdownloadafterformsubmission(Wicket1.1)

Sorry, I forgot to say I'm using 1.3-beta3


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



Page expired upon file download + model update

2007-10-11 Thread Federico Fanton
Hi everyone!
I have a form with some fields and a submit button which says Save and print.
The button has setDefaultFormProcessing(false), and overrides onSubmit so that 
the form model object is sent to the persistence layer and printed immediately 
afterwards. The persistence layer *may* alter the object, so I have to reload 
it. My problem is that this reloading causes a page expired when I press the 
button for a second time.

My onSubmit:

if(getForm().process()){
   MyBean data=getForm().getModelObject();

   data=Persistence.save(data);

   // Create PDF and send it to the browser
   IResourceStream s = new ByteArrayResource(application/pdf, 
buildPDF(data)).getResourceStream();
   RequestCycle.get().setRequestTarget( new ResourceStreamRequestTarget(s) );

   getForm().setModelObject(data);
}

I think the page expires because sending the PDF to the browser blocks the 
request cycle, so the browser never renders the new version of the page.. Is 
there a way to do this? Am I doing Something Wrong? ^__^;
Many thanks for your time!


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



Re: Onclick and ondblclick on same element

2007-10-01 Thread Federico Fanton
On Fri, 28 Sep 2007 16:43:05 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 My problem is that when I double click on the row three events are fired: two 
 onclick and one ondblclick.. Is this normal? Is there a way to isolate the 
 last event and ignore the first two?

I googled some more, and found that usually the workaround is to set a timeout 
for the onclick function, so that if ondblclick gets fired before the timeout, 
it cancels the onclick and goes on about its business.. Is there a Wicket 
behavior that works this way, perhaps? ^__^; I could extend 
AbstractAjaxTimerBehavior maybe..

Many thanks for your time!


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



Re: Onclick and ondblclick on same element

2007-10-01 Thread Federico Fanton
On Mon, 1 Oct 2007 02:10:13 -0700 (PDT)
swaroop belur [EMAIL PROTECTED] wrote:

 b1.setThrottleDelay(Duration.valueOf(1000)); // Make sure dbl click happens 
 before onclick

So the delay takes place *before* the first event, not after? I see.. Many 
thanks! :)


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



Onclick and ondblclick on same element

2007-09-28 Thread Federico Fanton
Hi everyone!
I fear this isn't strictly Wicket-related, but I'm having a little problem with 
a table row having two associated events: onclick and ondblclick.
Onclick should highlight the row, while Ondblclick should jump to another page 
passing along information about the selected row..
My problem is that when I double click on the row three events are fired: two 
onclick and one ondblclick.. Is this normal? Is there a way to isolate the last 
event and ignore the first two? (I'm using Firefox 2 btw)

Many thanks for your attention!


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



Re: Dojo floating panel

2007-09-20 Thread Federico Fanton
On Wed, 19 Sep 2007 20:00:46 +0200
Gerolf Seitz [EMAIL PROTECTED] wrote:

 hope it works this time ;)

It works very well :) Many thanks for your time and patience!


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



PropertyResolverConverter and non-String values

2007-09-19 Thread Federico Fanton
Hi everyone!
I have a form which needs to select a Class from a list, so I added a 
DropDownChoice loaded with a list of beans like:

public class ClassDescriptionBean{
   private String description;
   private Class type;

   [getters and setters omissis]
}

so that the form shows nice descriptions..

The form has a CompoundPropertyModel with a back bean like

public class BackBean{
   Class type;

   [getters and setters omissis]
}

But when I try to submit the form I have the following exception:

org.apache.wicket.util.convert.ConversionException: Can't convert value: [EMAIL 
PROTECTED] to class: class java.lang.Class for setting it on [EMAIL PROTECTED]

Obviously PropertyResolverConverter doesn't know how to map a 
ClassDescriptionBean to the corresponding Class, but how am I supposed to do 
it? I already have a custom ConverterLocator in place, but it looks like it 
gets called only when the source (or the destination) class of the conversion 
is a String..
If I change BackBean.type to a ClassDescriptionBean everything works, but I'd 
like to add the conversion.. Am I missing something?

Many thanks for your attention!


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



Re: PropertyResolverConverter and non-String values

2007-09-19 Thread Federico Fanton
On Wed, 19 Sep 2007 12:11:10 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 Obviously PropertyResolverConverter doesn't know how to map a 
 ClassDescriptionBean to the corresponding Class, but how am I supposed to do 
 it? I already have a custom ConverterLocator in place, but it looks like it 
 gets called only when the source (or the destination) class of the conversion 
 is a String..


Should I override AbstractSingleSelectChoice.convertValue() ? ^^;


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



Re: Dojo floating panel

2007-09-18 Thread Federico Fanton
On Mon, 17 Sep 2007 12:32:40 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

  you can probably add an InlineFrame which loads the webpage to the
  DojoFloatingPane.
 
 Mmh.. What about communicating between the two pages (containing page and 
 panel) in such a situation? For example, could I pass user input from the 
 panel back to the page? Via the Session maybe?

The session works, but now I have another little problem.. X-)
I need to add a button to the iframe-d page which should close the 
DojoFloatingPane.. I tried with something like

button.add(new AjaxEventBehavior(onclick){
@Override
protected void onEvent(AjaxRequestTarget target) {
target.prependJavascript(window.close(););
}
});

but nothing happens, even though in Wicket ajax debug I can see that the 
window.close is returned..
Am I going the wrong way?
Many thanks in advance!


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



Re: Dojo floating panel

2007-09-18 Thread Federico Fanton
On Tue, 18 Sep 2007 15:09:40 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 I see, but since the closing button is *inside* an iframe, I don't have any 
 means to get myDojoFloatingPane (which is in the containing page).. Am I 
 wrong? ^^;

As a side note, maybe things would be simpler using a ModalWindow instead of 
Dojo? I didn't notice ModalWindow before.. :/


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



Dojo floating panel

2007-09-17 Thread Federico Fanton
Hi everyone!
I need a floating panel such as the one provided by wicket-dojo's 
DojoFloatingPanel, but I was wondering, is there a way to handle the panel 
content as if it was a normal WebPage? I mean, can I build a normal page and 
insert it into a panel when needed? Could it be possible?
Many thanks for your advice!


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



Re: setEnabled() and complex components

2007-08-24 Thread Federico Fanton
On Fri, 24 Aug 2007 12:24:46 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

  I was wondering, is there a way to cleanly enable/disable complex 
  components such as DateFields and Palettes? I see that 
  Component.setEnabled() is final so it cannot be overridden to handle 
  special cases.. Should I always call visitChildren() on the component and 
  setEnabled() on every subcomponent?
 
 Just noticed that isEnabled isn't final.. Should I ovveride it and call 
 setEnabled on the subcomponents there?

Did that with DateFields and it works, while Palettes subcomponents handle 
getPalette().isEnabled() on their own.. Problem solved X-) Thanks for the 
attention all the same!


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



Re: No get method defined for expression recorder when using Palette and CompoundPropertyModel

2007-08-23 Thread Federico Fanton
On Fri, 6 Jul 2007 08:48:56 -0700
Igor Vaynberg [EMAIL PROTECTED] wrote:

  Thanks for the tip but I absolutly need a compoundPropertyModel.
 
 https://issues.apache.org/jira/browse/WICKET-723

I had the same issue, thanks! Now I'm using beta3..
Another question though: I see that Recorder.initIds() assumes that 
getPalette().getModelCollection() is never null.. Is this by design? Should I 
check my backing bean for null collections before passing it to the 
CompoundPropertyModel?
(Or maybe I could override 
CompoundPropertyModel.AttachedCompoundPropertyModel.getObject() so that it 
creates the empty collection when needed.. X-) )

Many thanks in advance!


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



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]



Double clicking on a table row

2007-08-20 Thread Federico Fanton
Hi everyone!
I'm looking for a little help.. I need to add an ondblclick functionality to 
a DataTable, so that doubleclicking on a row would jump to another page 
(passing information about the clicked row)..
I subclassed DataTable so that I could override newRowItem to let it return a 
modified Item, but I'd like to avoid hardcoding Javascript, so I'd like to ask, 
what is the Wicket way to do this?
Many thanks in advance!


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



Reacting to DateField change

2007-08-09 Thread Federico Fanton
Hi everyone!
I'd like to add an AJAX behavior to a DateField, so that when the value of the 
textfield changes an event gets fired.. I went with something like

field.get(date).add(new Mybehavior(onchange))

to attach the event to the textfield, but (comprehensibly) it doesn't get fired 
when I change the date via the calendar.. Any hint? ^^;

Many thanks for your attention


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



Re: Reacting to DateField change

2007-08-09 Thread Federico Fanton
On Thu, 9 Aug 2007 14:10:58 +0100
Dipu Seminlal [EMAIL PROTECTED] wrote:

 Did you add onchange in the markup as well, you need to add it in the markup
 as well
 input wicket:id=yourDate id=yourDate type=text name=yourDate
 onchange=blah  /

I'm sorry, do you mean that Wicket replaces the blah on the fly? I thought 
that behaviors don't need modification to the markup.. Or maybe it's needed 
just for DateFields?
I'll try with your suggestion though, many thanks :)


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



Re: Reacting to DateField change

2007-08-09 Thread Federico Fanton
On Thu, 9 Aug 2007 15:34:03 +0100
Dipu Seminlal [EMAIL PROTECTED] wrote:

 oh yes you need to set the outputMakupId to true, here you go
 
 TextField dateField = new TextField(dateField);

D'oh! I'm sorry, I fear I didn't explain myself properly :( The DateField I'm 
using is the date picker widget used by Wicket 1.3.. It's a FormComponentPanel 
made of a textfield and an icon which - when clicked - pops up a calendar.. So, 
I attached my behavior to the textfield and it works when I change the 
textfield directly, but I don't know how to intercept when _the calendar_ 
changes the textfield..


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



Re: Reacting to DateField change

2007-08-09 Thread Federico Fanton
On Thu, 9 Aug 2007 16:43:45 +0100
Dipu Seminlal [EMAIL PROTECTED] wrote:

 i checked and i agree with Igor :)

Ok, thanks anyway :) So.. Markup modification isn't needed, but if I'm not 
mistaken attaching the behavior directly to the DateField doesn't yield what 
I'm looking for..?


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



Re: Showing an alert

2007-08-07 Thread Federico Fanton
On Thu, 2 Aug 2007 18:25:28 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

  I'm sorry, I'm looking for a way to show an alert dialog when a condition 
  is met.. For example, the user fills in a search form, submits it and if 
  there's no data matching the query, a no data found! should pop up.. I'd 
  like to use something like the alert JavaScript function, but I'm a bit 
  confused about where to put it.. ^^;

 class alert extends abstractbehavior {
  boolean istemporary() { return false; }
  void renderhead(iheaderresponse r) {
 renderonloadjavascript(alert('error!');); }
 }
 
 form searchform=new form(...) {
   onerror() { add(new alert(); }
 }

I tried as you suggested, but I'm facing a little problem.. If I'm not 
mistaken, onError is called on form validation, so I added my check for no 
data in a FormValidator.. My problem is that this check needs the form 
CompoundPropertyModel to be up to date with the form contents, but form 
validation is called *before* the model gets updated.. Am I going the wrong 
way? :/
Many thanks for your time!


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



Re: Showing an alert

2007-08-07 Thread Federico Fanton
On Tue, 7 Aug 2007 10:57:03 +0200
Federico Fanton [EMAIL PROTECTED] wrote:

 I tried as you suggested, but I'm facing a little problem..
 If I'm not mistaken, onError is called on form validation,
 so I added my check for no data in a FormValidator.. My
 problem is that this check needs the form CompoundPropertyModel
 to be up to date with the form contents, but form validation is
 called *before* the model gets updated.. Am I going the wrong way? :/

I solved by overriding my button's onSubmit with something like

Form f=getForm();
f.process();
// snipped check for data size
if(showAlert){
   f.error(no data!);
   f.onError();
}

How does it look like? ^^;

Many thanks again for your help!


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



Re: DateField with a Calendar

2007-08-06 Thread Federico Fanton
On Fri, 3 Aug 2007 09:22:01 -0700
Igor Vaynberg [EMAIL PROTECTED] wrote:

 you cant use the compound property model then, you have to write your own
 model that will do the conversion

I ended up with a custom implementation of the AttachedCompoundPropertyModel.. 
Many thanks to all who answered :)


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



DateField with a Calendar

2007-08-03 Thread Federico Fanton
Hi everyone!
I just migrated to 1.3.0-beta2 from 1.2.6, and I'm trying to replace 
DatePicker's with DateField's, but I'm having a problem because the backbean 
of the CompoundPropertyModel of the containing form uses a Calendar field, not 
a Date one, so I'm receiving a conversion exception..
I have a custom Converter in place that would handle the conversion, but it 
doesn't get called, because PropertyResolverConverter calls it only when 
there's a String involved in the conversion, while the DateField would need a 
Date to Calendar conversion..
I thought of subclassing DateField and handling the conversion overriding 
setDate, but the date field inside DateField is private.. Any hint on what I 
could try?
Many thanks for your time!


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