Re: Alternative method to initialise page

2008-04-27 Thread Igor Vaynberg
On Sat, Apr 26, 2008 at 10:55 PM, John Patterson [EMAIL PROTECTED] wrote:
  1 - Checking against adding components more than once

to be fair this one doesnt apply. wicket throws a pretty descriptive
exception if you forget to call super.onbeforerender(), also its
javadoc mentions that overrides must call super. too bad there isnt an
annotation yet that checks this at compile time.

-igor



  2 - requirement to call super.onBeforeRender()

  and so would be significantly better - especially if this is a common
  pattern.

  John
  --
  View this message in context: 
 http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16918361.html


 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Is it kosher to have wicket-event.js and wicket-ajax.js contributed on every ajax update?

2008-04-27 Thread Matthew Young
The AjaxPagingNavigator is header-contributing wicket-event.js and
wicket-ajax.js everytime a link is clicked.  There must be something in
these js to make this ok?


Re: Is it kosher to have wicket-event.js and wicket-ajax.js contributed on every ajax update?

2008-04-27 Thread Igor Vaynberg
wicket will filter out the duplicates on the client side

-igor

On Sat, Apr 26, 2008 at 11:20 PM, Matthew Young [EMAIL PROTECTED] wrote:
 The AjaxPagingNavigator is header-contributing wicket-event.js and
  wicket-ajax.js everytime a link is clicked.  There must be something in
  these js to make this ok?


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



Re: Is it kosher to have wicket-event.js and wicket-ajax.js contributed on every ajax update?

2008-04-27 Thread Matthew Young
filter out the duplicates on the client side

  How do you do that?  Would it be possible to make stuff like scriptaculous
effects to work like that?  Scriptaculous doesn't work if it's ajax
contributed more than once.

On Sat, Apr 26, 2008 at 11:25 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 wicket will filter out the duplicates on the client side

 -igor

 On Sat, Apr 26, 2008 at 11:20 PM, Matthew Young [EMAIL PROTECTED] wrote:
  The AjaxPagingNavigator is header-contributing wicket-event.js and
   wicket-ajax.js everytime a link is clicked.  There must be something
 in
   these js to make this ok?
 

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




Re: Gzipping of pages (HTML output, not only resources)

2008-04-27 Thread Artur W.


Stefan Simik wrote:
 
 /Maybenbsp;itnbsp;cannbsp;worknbsp;fornbsp;yournbsp;applicationsnbsp;withoutnbsp;anynbsp;problemsnbsp;too.
 

Thanks for you response.

This filter works most of the time for me. The only problem is when I want
to upload a file.
I use UploadWebRequest and UploadProgressBar. AFAIK FileUpload closes the
stream and because of it the filter throws exception.


Artur


-- 
View this message in context: 
http://www.nabble.com/Gzipping-of-pages-%28HTML-output%2C-not-only-resources%29-tp16849900p16921105.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Problem with german error messages in feedback panel

2008-04-27 Thread greeklinux

Hello,

I have problems with german umlauts in a feedback panel.
I define the error messages in a property file.
It displays as follows:
Bitte geben Sie eine gültige E-Mail ein

In my HTML:
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
?xml version=1.0 encoding=UTF-8?

meta http-equiv=Content-type content=text/html; charset=utf-8 /
...

My editor is configured to use UTF-8 as encoding.
I tried to initialize the Wicket Application with
getRequestCycleSettings().setResponseRequestEncoding(UTF-8);
but the error is still there.

Has someone the same problem?
-- 
View this message in context: 
http://www.nabble.com/Problem-with-german-error-messages-in-feedback-panel-tp16921955p16921955.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Problem with german error messages in feedback panel

2008-04-27 Thread Timm Helbig
Yes I had the same one. After switching my favourite IDE (Netbeans) to UTF-8 
Encoding everything was fine. 

So, either you use Unicode Characters in your String literals, which is plain 
ugly, or use an editor which is capable of using UTF-8 Encodings.

Am Sonntag, 27. April 2008 11:35:16 schrieb greeklinux:
 Hello,

 I have problems with german umlauts in a feedback panel.
 I define the error messages in a property file.
 It displays as follows:
 Bitte geben Sie eine gültige E-Mail ein

 In my HTML:
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 ?xml version=1.0 encoding=UTF-8?
 
 meta http-equiv=Content-type content=text/html; charset=utf-8 /
 ...

 My editor is configured to use UTF-8 as encoding.
 I tried to initialize the Wicket Application with
 getRequestCycleSettings().setResponseRequestEncoding(UTF-8);
 but the error is still there.

 Has someone the same problem?



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



Re: intro and explanation about DataTable and DetachableModel

2008-04-27 Thread Eyal Golan
Thanks Igor and Doug,
I'll check things out when the boss agrees
bbrrr ...

On Fri, Apr 25, 2008 at 12:39 AM, Doug Donohoe [EMAIL PROTECTED] wrote:


 This may help.  I am moving my DD Poker site to wicket and implemented an
 IDataProvider around my database service as follows:

 private class HistoryData implements IDataProvider
{
private static final long serialVersionUID = 42L;

private PokerUser user;
private int count;

private HistoryData(PokerUser user)
{
this.user = user;
count =
 histService.getAllTournamentHistoriesForProfileCount(user.getId());
}

@SuppressWarnings({RawUseOfParameterizedType})
public Iterator iterator(int first, int pagesize)
{
return
 histService.getAllTournamentHistoriesForProfile(user.getId(), count,
 first,
 pagesize).iterator();
}

public int size()
{
return count;
}

public boolean isEmpty()
{
return count == 0;
}

public IModel model(Object object)
{
return new CompoundPropertyModel(new EntityModel(object));
}

public void detach()
{
}
}

 Where EntityModel is:

 public class EntityModel extends CompoundPropertyModel
 {
private static final long serialVersionUID = 42L;

/**
 * Constructor
 *
 * @param object The model object, which may or may not implement
 IModel
 */
public EntityModel(Object object)
{
super(new NonLoadableDetachableModel(object));
}
 }

 and NonLoadableDetachableModel is

 public class NonLoadableDetachableModel extends LoadableDetachableModel
 {
private static final long serialVersionUID = 42L;

public NonLoadableDetachableModel(Object model)
{
super(model);
}

@Override
protected Object load()
{
throw new UnsupportedOperationException(load should never be
 called);
}
 }

 I created this last class because my pages are read-only and the result
 set
 is always fetched through the service.  I didn't want to have my (JPA
 based)
 entities being serialized.

 The HistoryData class worked great with the base DataView class in Wicket.

 Note that I drew a lot of inspiration from:

 http://wicketstuff.org/wicket13/repeater/

 and digging around in the source.

 I don't know if this will help you or not - hopefully so!

 -Doug


 Eyal Golan wrote:
 
  Hi,
  Can anyone give me an explanation about paging with DetachableModel?
 
  My problem:
  We have records in the DB that can be a-lot.
  We also filter them sometimes.
 
  someone in the company created a non-standard paging.
  He doesn't use the Wicket's paging.
 
  The iterator method of the DataProvider he created returns only the
 number
  of elements that should be displayed in the current page.
  Eg. suppose we decided we show 20 records per page.
  The DataProvider keeps track on which page we're at.
  Then he calculates the indexes of records.
  It's done in getVisibleTickets() method.
  int fromIndex = (currentPage - 1) * (ticketsPerPage);
  int toIndex = ticketsPerPage;
 
  And then he asks the DB for the records in this range (with the filter).
  This is the size() method:
  public int size() {
  if ((visibleTickets == null) || (update)) {
  getVisibleTickets();
  }
  return visibleTickets.size();
  }
 
  OK, I hope i was clear enough.
  I know that it might be done using Wicket's library.
  Can anyone explain?
 
  Thanks
  --
  Eyal Golan
  [EMAIL PROTECTED]
 
  Visit: http://jvdrums.sourceforge.net/
 
 

 --
 View this message in context:
 http://www.nabble.com/intro-and-explanation-about-DataTable-and-DetachableModel-tp16852272p16853277.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/


Re: Alternative method to initialise page

2008-04-27 Thread Stefan Simik



John Patterson wrote:
 
 Hi,
 
 I am extending the PagingNavigatation and need to access some member
 variables to create my page links.  Because these links are created in
 PagingNavigatation's constructor me subclasses newPagingNavigationLink()
 method is called before my subclasses member variables are initialised.  I
 realised that this situation must occur quite often when extending any
 class that allows subclasses to provide or override any components.
 
 Does anyone have a nice workaround?
 
 It seems to me that creating the pages component tree in some kind of
 initialisation step would make classes easier to extend.  Or is there
 already a method that should be used to do this?
 
 Thanks,
 
 John
 

I had similar problems, when I worked with DefaultDataTable and needed to
have custom PagingNavigation.
For example, DefaultDataTable has no factory methods for creating custom
PagingNavigation
so I had to copy-paste it and change some minor parts of the class. But it
was very easy and I take
the default implementations as an example how to work with them.

SS

-- 
View this message in context: 
http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16922848.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Alternative method to initialise page

2008-04-27 Thread John Krasnay
On Sat, Apr 26, 2008 at 01:58:28PM -0700, John Patterson wrote:
 
 Note to self: don't post messages when half cut. But I have to break that
 rule just one more time
 

Heh, no problem. Been there once or twice myself...

jk

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



Re: what is the preferred way to include a javascript library to a wicket project?

2008-04-27 Thread Uwe Schäfer

Vitaly Tsaplin schrieb:

  -- personally i like to be able to simply include the datepicker and not
  -- have to worry or research what javascript library it uses.
  

i´ve talked this over with some guys personally, and maybe this was 
discussed before, but consider this:


what if components could express contributions by a dependency 
descriptor (maybe new Dependency(KnownLibs.XY, 1, 2) for xy 1.2) and 
provide wicket with a javascript integration project, where some 
versions of XY and others will be packaged? the page could resolve this 
dependency and actually contribute the header.


- first thing that comes to mind, is that if lib XY has init code, that 
really should run once, and once only, the page has a chance of 
including it only once, if two components request for it.
- second, assuming that later version are always compatible with earlier 
[yes, i know :) ], the page could decide to resolve to a later version 
if two components use two different versions of the same lib


up to here, the cost of mainting these third party libs is as high, as 
packaging them with a version descriptor. i really think, that would be 
doable.


- third (now really dreaming) if some version shift is known to break 
compatibility, the page could ask an handler to resolve this situation 
or (if unhandled) throw an exception.


this makes it possible to a) be aware of using two components that 
depend on different version of teh same lib and b) to get the PAGE in 
charge of handling this situation and decide, what to do, as the page is 
the one thing, the application coder has control over (whereas the 
components are not). this would of course mean, that the libs desriptor 
needs to declare that compatibility break and (and here comes the tricky 
part), those people adding it to the KnownLibs-project have to know 
about it.


what do you think?

cu uwe








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



Re: what is the preferred way to include a javascript library to a wicket project?

2008-04-27 Thread Vitaly Tsaplin
 -- create a jira issue for the datepicker please

   For the datepicker only? Shouldn't it be done on the component
level and be a part of solid wicket API...?
   In fact I do not use the datapicker at all what I said was related
to the problem that I faced writing my own components.

   Hi Uwe,
   Why it should be so complicated... Isn't it better and simpler to
be able to just add dependencies by hands overriding the defaults.
It's the only practice in the javascript world. Look at YUI or
whatever... every component has the inctructions... which libs to
include...which css files... and how to use it.
   Personally I think that java and javascript should be kept as
completely independent worlds with a clear conceptual separation since
wicket do not even pretend to do such a thing like GWT or Volta do
(java - javascript translation). And so an interoperational aspect in
wicket are very limited. The client side shouldn't be jailed by the
server side anyhow. A javascript developer should always have a change
to tweak the tricky nature of javascript.

On Sun, Apr 27, 2008 at 11:21 AM, Uwe Schäfer [EMAIL PROTECTED] wrote:
 Vitaly Tsaplin schrieb:


   -- personally i like to be able to simply include the datepicker and
 not
   -- have to worry or research what javascript library it uses.
 
 
  i´ve talked this over with some guys personally, and maybe this was
 discussed before, but consider this:

  what if components could express contributions by a dependency descriptor
 (maybe new Dependency(KnownLibs.XY, 1, 2) for xy 1.2) and provide wicket
 with a javascript integration project, where some versions of XY and others
 will be packaged? the page could resolve this dependency and actually
 contribute the header.

  - first thing that comes to mind, is that if lib XY has init code, that
 really should run once, and once only, the page has a chance of including it
 only once, if two components request for it.
  - second, assuming that later version are always compatible with earlier
 [yes, i know :) ], the page could decide to resolve to a later version if
 two components use two different versions of the same lib

  up to here, the cost of mainting these third party libs is as high, as
 packaging them with a version descriptor. i really think, that would be
 doable.

  - third (now really dreaming) if some version shift is known to break
 compatibility, the page could ask an handler to resolve this situation or
 (if unhandled) throw an exception.

  this makes it possible to a) be aware of using two components that depend
 on different version of teh same lib and b) to get the PAGE in charge of
 handling this situation and decide, what to do, as the page is the one
 thing, the application coder has control over (whereas the components are
 not). this would of course mean, that the libs desriptor needs to declare
 that compatibility break and (and here comes the tricky part), those people
 adding it to the KnownLibs-project have to know about it.

  what do you think?

  cu uwe










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




Re: Problem with german error messages in feedback panel

2008-04-27 Thread greeklinux

Hello,

I am using IDEA as IDE. I configured it to use UTF-8.
Did I forget something? 
In the property file it is not possible to write  uuml instead of ü,
because
the  will be escaped to  amp.




Timm Helbig wrote:
 
 Yes I had the same one. After switching my favourite IDE (Netbeans) to
 UTF-8 
 Encoding everything was fine. 
 
 So, either you use Unicode Characters in your String literals, which is
 plain 
 ugly, or use an editor which is capable of using UTF-8 Encodings.
 
 Am Sonntag, 27. April 2008 11:35:16 schrieb greeklinux:
 Hello,

 I have problems with german umlauts in a feedback panel.
 I define the error messages in a property file.
 It displays as follows:
 Bitte geben Sie eine gültige E-Mail ein

 In my HTML:
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 ?xml version=1.0 encoding=UTF-8?
 
 meta http-equiv=Content-type content=text/html; charset=utf-8 /
 ...

 My editor is configured to use UTF-8 as encoding.
 I tried to initialize the Wicket Application with
 getRequestCycleSettings().setResponseRequestEncoding(UTF-8);
 but the error is still there.

 Has someone the same problem?
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-german-error-messages-in-feedback-panel-tp16921955p16925025.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: RedirectPage - gets stuck in an endless loop

2008-04-27 Thread Jonathan Locke


can you go to this login url in a browser at all or does that cause the loop
too?

(maybe urls that should be going to the other application are being handled
by wicket?)


mfs wrote:
 
 Eventually its throws StackOverFlow exception...
 
 Jonathan Locke wrote:
 
 
 some kind of exception being thrown maybe?
 
 try debugging it.  it's an interesting and educational trip through
 wicket internals anyway.
 
 if you still can't figure it and you think it's not your problem, boil it
 down to a quickstart example and attach the example to a JIRA bug and
 someone will take a look at it.
 
   jon
 
 
 mfs wrote:
 
 Guys,
 
 I am using RedirectPage class to redirect to an external url, and
 strangely it just gets stuck in an endless loop..any idea as to what the
 problem could be ?
 
 i.e. 
 new RedirectPage(Host.getHttpsUrl() + /login)
 
 Thanks in advance..
 
 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/RedirectPage---gets-stuck-in-an-endless-loop-tp16908835p16925090.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: what is the preferred way to include a javascript library to a wicket project?

2008-04-27 Thread Uwe Schäfer

Vitaly Tsaplin schrieb:

hi Vitaly

   Why it should be so complicated... Isn't it better and simpler to
be able to just add dependencies by hands overriding the defaults.
  
what is the aspect, that sounds complicated to you? implementation is 
near to trivial and about ease of use: in most cases it would not be 
used by the application coder at all. (just work)
i mean, this simple algorithm would work under the covers and - if the 
components would be kind enough to use it - it´ll resolve most of the 
time automatically. if not, there would be one and only responsible 
place for handling this situation.


the thing is, i don´t care whatever sillywilli lib is used by any 
component. what i want is the javascript aspect encapsulated in the 
components. i really dont want to extend those components just in order 
to be able to resolve javascript dependencies (that are not even 
declared in a standardized way) manually. maybe it is just me hating 
javascript.


i anticipate, there can be certain (rare) cases where this would be 
necessary. thats what the handler/resolver would be for. i think, this 
would make a nice 90/10 rule.

any other comments?

cu uwe


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



Re: Integer only NumberValidator?

2008-04-27 Thread Al Maw
You can find the default messages (and keys, obviously) in the
org.apache.wicket.Application.properties file.

Regards,

Al

On Fri, Apr 25, 2008 at 1:20 AM, Michael Mehrle [EMAIL PROTECTED]
wrote:

 Man, of course - I was so focused on NumberValidator that I completely
 forgot about the Integer.class setting which I already have!

 Q: what is the validator I need to refer to when defining my custom
 error message in my properties file?

 Michael

 -Original Message-
 From: Martijn Dashorst [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, April 23, 2008 11:46 PM
 To: users@wicket.apache.org
 Subject: Re: Integer only NumberValidator?

 new TextField(number, ..., Integer.class);

 Integer-ness is checked at conversion level before validation.

 Martijn

 On 4/24/08, Michael Mehrle [EMAIL PROTECTED] wrote:
  Javadoc keeps talking about a factory method to create an Integer
 based
   NumberValidator, but I don't see it. How do I create a
 NumberValidator
   that only permits Integer values?
 
 
 
   Thanks,
 
 
 
 
   Michael
 
 


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

 -
 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: what is the preferred way to include a javascript library to a wicket project?

2008-04-27 Thread Igor Vaynberg
On Sun, Apr 27, 2008 at 8:06 AM, Vitaly Tsaplin
[EMAIL PROTECTED] wrote:
  -- create a jira issue for the datepicker please

For the datepicker only? Shouldn't it be done on the component
  level and be a part of solid wicket API...?
In fact I do not use the datapicker at all what I said was related
  to the problem that I faced writing my own components.

yes, for datepicker only, afaik that is the only core component that
uses 3rd party javascript. there is no way for us to enforce this
behavior in any way, users are free to write whatever they want to the
header.

-igor



Hi Uwe,
Why it should be so complicated... Isn't it better and simpler to
  be able to just add dependencies by hands overriding the defaults.
  It's the only practice in the javascript world. Look at YUI or
  whatever... every component has the inctructions... which libs to
  include...which css files... and how to use it.
Personally I think that java and javascript should be kept as
  completely independent worlds with a clear conceptual separation since
  wicket do not even pretend to do such a thing like GWT or Volta do
  (java - javascript translation). And so an interoperational aspect in
  wicket are very limited. The client side shouldn't be jailed by the
  server side anyhow. A javascript developer should always have a change
  to tweak the tricky nature of javascript.



  On Sun, Apr 27, 2008 at 11:21 AM, Uwe Schäfer [EMAIL PROTECTED] wrote:
   Vitaly Tsaplin schrieb:
  
  
 -- personally i like to be able to simply include the datepicker and
   not
 -- have to worry or research what javascript library it uses.
   
   
i´ve talked this over with some guys personally, and maybe this was
   discussed before, but consider this:
  
what if components could express contributions by a dependency descriptor
   (maybe new Dependency(KnownLibs.XY, 1, 2) for xy 1.2) and provide wicket
   with a javascript integration project, where some versions of XY and others
   will be packaged? the page could resolve this dependency and actually
   contribute the header.
  
- first thing that comes to mind, is that if lib XY has init code, that
   really should run once, and once only, the page has a chance of including 
 it
   only once, if two components request for it.
- second, assuming that later version are always compatible with earlier
   [yes, i know :) ], the page could decide to resolve to a later version if
   two components use two different versions of the same lib
  
up to here, the cost of mainting these third party libs is as high, as
   packaging them with a version descriptor. i really think, that would be
   doable.
  
- third (now really dreaming) if some version shift is known to break
   compatibility, the page could ask an handler to resolve this situation or
   (if unhandled) throw an exception.
  
this makes it possible to a) be aware of using two components that depend
   on different version of teh same lib and b) to get the PAGE in charge of
   handling this situation and decide, what to do, as the page is the one
   thing, the application coder has control over (whereas the components are
   not). this would of course mean, that the libs desriptor needs to declare
   that compatibility break and (and here comes the tricky part), those people
   adding it to the KnownLibs-project have to know about it.
  
what do you think?
  
cu uwe
  
  
  
  
  
  
  
  
  
  
-
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: Is it kosher to have wicket-event.js and wicket-ajax.js contributed on every ajax update?

2008-04-27 Thread Matthew Young
Wicket filters the contributions on client side (according to the
URL)

Can explain what is (according to the URL)?  Does the filtering apply to any
js?

If wicket js is filtered on the client side, then I don't know what's going
on with this question:

http://www.nabble.com/Ajax-postcall-handler-does-not-get-called-every-time-td16659218.html#a16663054

Can you please elaborate on scriptaculous not working?

I run into this problem with the lightbox component in wicket-stuff.
Lightbox uses scriptaculous. My page also uses scriptaculous so I includes
the lib (implements IHeaderContributor and renderHead on the page).  On ajax
update, the lightbox component contributes scriptaculous.  Once that happen,
scriptaculous effects stops working.  I had to disable lightbox from
contributing scriptaculous.

Another problem is the lightbox.js needs to be part of the page because it
initializes itself on window load event.  Lightbox doesn't work if
lightbox.js is loaded via ajax because there is no window load event to hook
itself up.

On Sun, Apr 27, 2008 at 2:15 AM, Matej Knopp [EMAIL PROTECTED] wrote:

 Wicket filters the contributions on client side (according to the
 URL). Can you please elaborate on scriptaculous not working?

 -Matej

 On Sun, Apr 27, 2008 at 9:43 AM, Matthew Young [EMAIL PROTECTED] wrote:
  filter out the duplicates on the client side
 
How do you do that?  Would it be possible to make stuff like
 scriptaculous
   effects to work like that?  Scriptaculous doesn't work if it's ajax
   contributed more than once.
 
   On Sat, Apr 26, 2008 at 11:25 PM, Igor Vaynberg 
 [EMAIL PROTECTED]
   wrote:
 
 
 
wicket will filter out the duplicates on the client side
   
-igor
   
On Sat, Apr 26, 2008 at 11:20 PM, Matthew Young [EMAIL PROTECTED]
 wrote:
 The AjaxPagingNavigator is header-contributing wicket-event.js
 and
  wicket-ajax.js everytime a link is clicked.  There must be
 something
in
  these js to make this ok?

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



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

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




Re: Is it kosher to have wicket-event.js and wicket-ajax.js contributed on every ajax update?

2008-04-27 Thread Matej Knopp
On Sun, Apr 27, 2008 at 9:46 PM, Matthew Young [EMAIL PROTECTED] wrote:
 Wicket filters the contributions on client side (according to the
  URL)

  Can explain what is (according to the URL)?  Does the filtering apply to any
  js?

  If wicket js is filtered on the client side, then I don't know what's going
  on with this question:

  
 http://www.nabble.com/Ajax-postcall-handler-does-not-get-called-every-time-td16659218.html#a16663054
That would be a wicket bug, is there a jira entry for it?


  Can you please elaborate on scriptaculous not working?

  I run into this problem with the lightbox component in wicket-stuff.
  Lightbox uses scriptaculous. My page also uses scriptaculous so I includes
  the lib (implements IHeaderContributor and renderHead on the page).  On ajax
  update, the lightbox component contributes scriptaculous.  Once that happen,
  scriptaculous effects stops working.  I had to disable lightbox from
  contributing scriptaculous.

  Another problem is the lightbox.js needs to be part of the page because it
  initializes itself on window load event.  Lightbox doesn't work if
  lightbox.js is loaded via ajax because there is no window load event to hook
  itself up.
In that case lightbox needs to be fixed. Dynamically loaded javascript
is a common thing.

-Matej



  On Sun, Apr 27, 2008 at 2:15 AM, Matej Knopp [EMAIL PROTECTED] wrote:

   Wicket filters the contributions on client side (according to the
   URL). Can you please elaborate on scriptaculous not working?
  
   -Matej
  
   On Sun, Apr 27, 2008 at 9:43 AM, Matthew Young [EMAIL PROTECTED] wrote:
filter out the duplicates on the client side
   
  How do you do that?  Would it be possible to make stuff like
   scriptaculous
 effects to work like that?  Scriptaculous doesn't work if it's ajax
 contributed more than once.
   
 On Sat, Apr 26, 2008 at 11:25 PM, Igor Vaynberg 
   [EMAIL PROTECTED]
 wrote:
   
   
   
  wicket will filter out the duplicates on the client side
 
  -igor
 
  On Sat, Apr 26, 2008 at 11:20 PM, Matthew Young [EMAIL PROTECTED]
   wrote:
   The AjaxPagingNavigator is header-contributing wicket-event.js
   and
wicket-ajax.js everytime a link is clicked.  There must be
   something
  in
these js to make this ok?
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
   
  
  
  
   --
   Resizable and reorderable grid components.
   http://www.inmethod.com
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  




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

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



Re: DropDownChoice getting value into the model

2008-04-27 Thread Russell Webb

Perhaps I'm missing something big time about BoundCompoundPropertyModel. I
removed my loadable detachable model and still can't get it to work
specifically with a dropdown element.

The following works...
FormComponent networks = new DropDownChoice(network, new
PropertyModel(phone, network), networksList);
but the following doesn't
FormComponent networks = new DropDownChoice(network, new
BoundCompoundPropertyModel(phone), networksList);

I've tried stepping into the code but can't resolve the issue. Can anyone
confirm or explain this problem?




Russell Webb wrote:
 
 I am experiencing something similar. My LoadableDetachableModel is wrapped
 with a CompoundPropertyModel.
 
 Submitting a TexTField acquires the AttachedCompoundPropertyModel whose
 setObject() acquires the target object and persists changes. 

 CompoundPropertyModel$AttachedCompoundPropertyModel(AbstractPropertyModel).setObject(Object)
 line: 146 
 TextField(Component).setModelObject(Object) line: 2888
 TextField(FormComponent).updateModel() line: 1060 
 Form$19.validate(FormComponent) line: 1754
 
 Submitting the dropdown acquires the read only setObject()
 VxsNewUserWizard$3(AbstractReadOnlyModel).setObject(Object) line: 52  
 BoundCompoundPropertyModel(CompoundPropertyModel).setObject(Object)
 line: 72  
 DropDownChoice(Component).setModelObject(Object) line: 2888   
 DropDownChoice(FormComponent).updateModel() line: 1060
 Form$19.validate(FormComponent) line: 1754
 
 It seems the model is linked to the two components differently and that
 this causes different behaviour when using a CompoundPropertyModel (and
 perhaps others) like allowing the ReadOnlyModel.setObject to be bypassed. 
 
 Russ
 
 
 
 igor.vaynberg wrote:
 
 perhaps because your textfield is setting a property of the object
 loaded by the model, not the object itself.
 
 -igor
 
 
 On Fri, Mar 7, 2008 at 1:48 PM, rmattler [EMAIL PROTECTED] wrote:

  Thanks for the quick reply.  But you answer doesn't make sense to me. 
 Why do
  loadable models work for a text field but not a drop down?  If I have
 NY
  stored in the database, New York is loaded onto the form but when the
 form
  is submitted the selected value of the drop down is not saved into the
  model.  I'm trying to get the selected value stored into the Vendor
 object
  and a String not a SelectOption.

  public class Vendor implements java.io.Serializable {

 private String state;





  two problems

  1) loadable detachable models do not support the setobject() call,
  because they are...loadable. so you should use a different kind of
  model.

  2) yes, selectoption object will be put into your model, dropdown
  choice works like this:

  DropDownChoiceT(String id, IModelT model, IModelListT choices,
  IChoiceRenrererT renderer)

  -igor


  --
  View this message in context:
 http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15907046.html


 Sent from the Wicket - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p16927437.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: RedirectPage - gets stuck in an endless loop

2008-04-27 Thread mfs

I can...as otherwise in that case...this shouldnt work too..which is

RequestCycle.get().setRequestTarget(new RedirectRequestTarget(loginURL))



Jonathan Locke wrote:
 
 
 can you go to this login url in a browser at all or does that cause the
 loop too?
 
 (maybe urls that should be going to the other application are being
 handled by wicket?)
 
 
 mfs wrote:
 
 Eventually its throws StackOverFlow exception...
 
 Jonathan Locke wrote:
 
 
 some kind of exception being thrown maybe?
 
 try debugging it.  it's an interesting and educational trip through
 wicket internals anyway.
 
 if you still can't figure it and you think it's not your problem, boil
 it down to a quickstart example and attach the example to a JIRA bug and
 someone will take a look at it.
 
   jon
 
 
 mfs wrote:
 
 Guys,
 
 I am using RedirectPage class to redirect to an external url, and
 strangely it just gets stuck in an endless loop..any idea as to what
 the problem could be ?
 
 i.e. 
 new RedirectPage(Host.getHttpsUrl() + /login)
 
 Thanks in advance..
 
 
 
 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/RedirectPage---gets-stuck-in-an-endless-loop-tp16908835p16927460.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Is it kosher to have wicket-event.js and wicket-ajax.js contributed on every ajax update?

2008-04-27 Thread Matthew Young
That would be a wicket bug, is there a jira entry for it?

Just created one:

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

This one should not be called a bug. Open browser first, then start wicket
app, it's fine. But start wicket app first, then open browser, it's not.
What difference do it make? The fix and the explanation will be real
interesting.

In that case lightbox needs to be fixed

lightbox.js does this at the very end:

function initLightbox() { myLightbox = new Lightbox(); }
Event.observe(window, 'load', initLightbox, false);

So how to fix this? Change lightbox.js?


Interview: How Wicket Does Ajax

2008-04-27 Thread Martijn Dashorst
Some preaching to the choir: JavaLobby has printed an interview with
Eelco, Jonathan and Igor regarding Wicket's Ajax implementation. It is
quite an informative piece that doesn't hesitate to go a bit deeper
into the technology bits.

Read it here: http://java.dzone.com/news/interview-how-wicket-does-ajax

Martijn

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

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



a hidden field named x is filled by the form action url... a bug?

2008-04-27 Thread Vitaly Tsaplin
   Hi everyone,

  It seems that if you add a hidden field named x to your form the
field is going to be filled by the form action url :) It should be
easy to reproduce.

   Vitaly

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



What is the best way to create layouts in Wicket?

2008-04-27 Thread Azzeddine Daddah
Hi there,

I'm new to Wicket trying to build my first application :).
I've already token a look at Creating layouts using markup inheritance
tutorial from the Wicket website, but still have some questions:
Suppose that I've a base page which I want that some of my pages inherits
the layout from it. What I want to do is to have some protected methods like
f.e. appendComponen(final Component comp, String position) and
setTitle(String title). The position string In the first method indicates
the position where the component in the page should be appended.

   1. How can I implement this?
   2. Is it possible to define multiple wicket:child / in the base
   page?

Gr. Azzeddine


Change image source on every ajax request

2008-04-27 Thread mfs

Guys,

I have got a keep-alive.gif[?random=timestamp] in my LayoutPage (which every
page extends from).

I need a way to change the source of this keep-alive image (so as to update
the time stamp post-fixed with, so that the browser doesnt fetch it from the
cache).and make it a default behavior for all ajax response, and avoid
setting the image in AjaxRequestTarget for every ajax-event in every
component...

Please suggest.



-- 
View this message in context: 
http://www.nabble.com/Change-image-source-on-every-ajax-request-tp16930284p16930284.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



loadStringResource(Component component, String key) - correct method to check if the component IS a Page?

2008-04-27 Thread Ned Collyer

Hi,

I've written my own class that extends ComponentStringResourceLoader (i
might change it to extend some other class)

At any rate, when loadStringResource(Component component, String key) is
called, and the component is a panel I can call getModel and retrieve the
model.

When the component is a Page, it comes in as
MarkupInheritanceResolver$TransparentWebMarkupContainer - and getModel
returns null (even if the page has had the model set).

So... how do I determine is the component is a page? - what is the condition
I should check?
-- 
View this message in context: 
http://www.nabble.com/loadStringResource%28Component-component%2C-String-key%29---correct-method-to-check-if-the-component-IS-a-Page--tp16930303p16930303.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Change image source on every ajax request

2008-04-27 Thread Igor Vaynberg
see NonCachingImage

-igor


On Sun, Apr 27, 2008 at 7:03 PM, mfs [EMAIL PROTECTED] wrote:

  Guys,

  I have got a keep-alive.gif[?random=timestamp] in my LayoutPage (which every
  page extends from).

  I need a way to change the source of this keep-alive image (so as to update
  the time stamp post-fixed with, so that the browser doesnt fetch it from the
  cache).and make it a default behavior for all ajax response, and avoid
  setting the image in AjaxRequestTarget for every ajax-event in every
  component...

  Please suggest.



  --
  View this message in context: 
 http://www.nabble.com/Change-image-source-on-every-ajax-request-tp16930284p16930284.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Overridable Authorization

2008-04-27 Thread freak182

Hello,
I have a problem about authorization.I look at wicket-in-action source code
and implement authorization from there it work well. I use annotation to tag
Pages that is unauthorize. But i just go on circle.Here is my problem:

@OverridablePage
public class EditUserPage extends OverridableProtectedPage 

1. I want to redirect the RestartResponseAtInterceptPageException page to
overridable page not to the homepage?(considering the user is already login)
2. If redirected to overridable page, the supervsor will enter the username
and password to authorized the user to enter the EditUserPage
3. Then if validated it will redirect to the page where the suppose to
be..e.g. EditUserPage
4. Any code samples ??? :)

Thanks a lot...Cheers

-- 
View this message in context: 
http://www.nabble.com/Overridable-Authorization-tp16930329p16930329.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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