Re: [Wicket-user] Forms locale(europe) and numbers does not

2007-05-30 Thread Nino Saturnino Martinez Vazquez Wael
This has nothing todo with it, already changed that part (I do know the 
code snipplet does not reflect this). Its because google always keep 
their formats in us locale not matter what the browser tells. So this 
gives a horrible conversion effect. making the numbers explode on EU 
locale. So inorder to work on european locale, the google related 
variables/markup parts must be converted via US locale.


Regards Nino

Ryan Gravener wrote:
 Hey Nino, remember that I changed longtitude to longitude.  So try 
 doing new HiddenField(longitudeCenter, new 
 PropertyModel(gMap.getCenter(),longitude)) .

   try changing

 On 29/05/07, *Nino Saturnino Martinez Vazquez Wael* 
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:

 Hi I have a form

 form wicket:id=Form
input type=hidden wicket:id=longtitudeNE name=longtitudeNE
 id=longtitudeNE
 /form


 java part:

 gMapUpdatingForm.add(new HiddenField(longtitudeCenter, new
 PropertyModel(
 gMap.getCenter(), longtitude)));


 If I am in US locale numbers are interpreted okay, however if in
 european locale they dont. Thats because the value are in US locale so
 how do I tell that these two fields should be interpereted as US.
 I have
 tried overiding the getlocale, but it does not seem to work?

 Should I create my own IConverter?

 regards Nino


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 mailto:Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user




 -- 
 Ryan Gravener
 fbb55c59d619f3cd68ac4f70ebeca372
 

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 

 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
   

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] wicket-contrib-gmap GMarkerComponent proposal

2007-05-30 Thread Nino Saturnino Martinez Vazquez Wael
Sorry did firstly see this now. I think you already changed it...

Iulian Costan wrote:
 alright, i think i need to escape the tooltip and everything should be 
 fine.
  
 /iulian

  
 On 5/26/07, *Ryan Gravener* [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 Since the tool tip may contain possessive nouns, this causes a
 javascript syntax error, so i propose changing
 gmarker.getToolTip() to gmarker.getToolTip().replace(\',\\')

 in methods: createMarkerDefaultIcon, createMarkerCustomIcon

 http://www.papernapkin.org/pastebin/view/150

 -- 
 Ryan Gravener
 fbb55c59d619f3cd68ac4f70ebeca372

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 mailto:Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 https://lists.sourceforge.net/lists/listinfo/wicket-user


 

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 

 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
   

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Forms locale(europe) and numbers does not

2007-05-30 Thread Nino Saturnino Martinez Vazquez Wael
Resend, as something bad happend to the original mail...
 This has nothing todo with it, already changed that part (I do know 
 the code snipplet does not reflect this). Its because google always 
 keep their formats in us locale not matter what the browser tells. So 
 this gives a horrible conversion effect. making the numbers explode on 
 EU locale. So inorder to work on european locale, the google related 
 variables/markup parts must be converted via US locale.


 Regards Nino

 Ryan Gravener wrote:
 Hey Nino, remember that I changed longtitude to longitude.  So try 
 doing new HiddenField(longitudeCenter, new 
 PropertyModel(gMap.getCenter(),longitude)) .

   try changing

 On 29/05/07, *Nino Saturnino Martinez Vazquez Wael* 
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:

 Hi I have a form

 form wicket:id=Form
input type=hidden wicket:id=longtitudeNE name=longtitudeNE
 id=longtitudeNE
 /form


 java part:

 gMapUpdatingForm.add(new HiddenField(longtitudeCenter, new
 PropertyModel(
 gMap.getCenter(), longtitude)));


 If I am in US locale numbers are interpreted okay, however if in
 european locale they dont. Thats because the value are in US 
 locale so
 how do I tell that these two fields should be interpereted as US.
 I have
 tried overiding the getlocale, but it does not seem to work?

 Should I create my own IConverter?

 regards Nino


 
 - 

 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 mailto:Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user




 -- 
 Ryan Gravener
 fbb55c59d619f3cd68ac4f70ebeca372
 

 - 

 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 

 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
   


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Conditional output

2007-05-30 Thread Thies Edeling
All,

Say that I have an HTML table with data and the last row is a total with 
a colspan to align the value:
table
tr
td wicket:id=prjProject A/td
td wicket:id=col1stuff/td
td wicket:id=col2stuff/td
td wicket:id=col35/td
/tr
   
tr
td colspan=3nbsp;/td
td5/td
/tr
/table

When col2 is optional I'd do a col2.setVisible(false) on that label but 
the colspan in the total row needs to be adjusted as well. Should I 
create a colspan property in the Page class and do a td colspan=span 
wicket:id=colspan / or is there another preferred way? Wondering 
how much I've to 'unlearn' from my JSTL way of doing things :)

Thies
--
http://blog.ehour.nl/


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] RadioGroup vs RadioChoice

2007-05-30 Thread Nino Saturnino Martinez Vazquez Wael
Hi

The largest difference between the two is how much control you want over 
the components. the Radio(used with radiogroup) lets you place your 
radios exactly where you desire where as the radiochoice has a somewhat 
fixed formatting and just prints out radios.

regards Nino

howzat wrote:
 The answer to the last question is that the model value is used (naturally).
 I just needed to adjust my models' value class' .equals implementation and
 it now the default selection works well.
 But any input on the other 2 questions is still useful:

 What is the difference between RadioChoice and RadioGroup?
 Are there use-case where one is more appropriate than the other? 




 howzat wrote:
   
 What is the difference between RadioChoice and RadioGroup?
 Are there use-case where one is more appropriate than the other?
 If there are 3 choices in the RadioChoice or RadioGroup  (eg radio buttons
 for each of a, b  c on the form), what is the best way to set a
 default value (eg b as selected) when the page is first visited?

 

   

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Conditional output

2007-05-30 Thread Maurice Marrink
You should use an attribute modifier on the totals row. like this
totalsRow.add(new AttributeModifier(colspan,myModel));
If you know for a fact the number of columns is not going to change
after a page refresh you could use a new
SimpleAttributeModifier(colspan,length) else you should use a model
to dynamically compute the number of desired columns

Maurice

On 5/30/07, Thies Edeling [EMAIL PROTECTED] wrote:
 All,

 Say that I have an HTML table with data and the last row is a total with
 a colspan to align the value:
 table
 tr
 td wicket:id=prjProject A/td
 td wicket:id=col1stuff/td
 td wicket:id=col2stuff/td
 td wicket:id=col35/td
 /tr

 tr
 td colspan=3nbsp;/td
 td5/td
 /tr
 /table

 When col2 is optional I'd do a col2.setVisible(false) on that label but
 the colspan in the total row needs to be adjusted as well. Should I
 create a colspan property in the Page class and do a td colspan=span
 wicket:id=colspan / or is there another preferred way? Wondering
 how much I've to 'unlearn' from my JSTL way of doing things :)

 Thies
 --
 http://blog.ehour.nl/


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Map.Entry and serialization

2007-05-30 Thread Sven Schliesing
Changing the code to:
new ListView(list, new ArrayListMap.EntryIKey,
Integer(map.entrySet())) {
public void populateItem(ListItem listItem) {
  Map.EntryIKey, Integer entry = (Map.EntryIKey, Integer)
listItem.getModelObject();
  ...
}
};

doesn't fix the problem. Furthermore 
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html says that 
Maps are not serializable. Now I'm confused.

btw: I didn't make the variable final to use it in an inner class. It 
was just a leftover of cp.


Sven

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Autocomplete - selecting (higlighting)firstoptionby default.

2007-05-30 Thread Dipu
I have created a JIRA issue

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

Regards
Dipu


- Original Message - 
From: Eelco Hillenius [EMAIL PROTECTED]
To: wicket-user@lists.sourceforge.net
Sent: Tuesday, May 29, 2007 5:08 PM
Subject: Re: [Wicket-user] Autocomplete - selecting 
(higlighting)firstoptionby default.


 Thanks. But could you please attach it to a JIRA issue so that we can
 properly track it?

 Thanks,

 Eelco

 On 5/29/07, Dipu [EMAIL PROTECTED] wrote:


 here is the patch, for preselecting the first item in the auto complete
 list.


 Index:
 C:/wicket/wicket-svn/releases/wicket-1.2.6/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/autocomplete/AbstractAutoCompleteBehavior.java
 ===
 ---
 C:/wicket/wicket-svn/releases/wicket-1.2.6/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/autocomplete/AbstractAutoCompleteBehavior.java
 (revision 541579)
 +++
 C:/wicket/wicket-svn/releases/wicket-1.2.6/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/autocomplete/AbstractAutoCompleteBehavior.java
 (working copy)
 @@ -34,6 +34,7 @@
   private static final ResourceReference AUTOCOMPLETE_JS = new
 CompressedResourceReference(
 AutoCompleteBehavior.class, wicket-autocomplete.js);

 + protected boolean preselect = false;
   /**
*
*/
 @@ -66,7 +67,7 @@
Response response = getComponent().getResponse();
final String id = getComponent().getMarkupId();
response.write(JavascriptUtils.SCRIPT_OPEN_TAG);
 -  response.write(new Wicket.AutoComplete(' + id + ',' +
 getCallbackUrl() + '););
 +  response.write(new Wicket.AutoComplete(' + id + ',' +
 getCallbackUrl() +',+ preselect + ););
response.write(JavascriptUtils.SCRIPT_CLOSE_TAG);
   }

 Index:
 C:/wicket/wicket-svn/releases/wicket-1.2.6/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteBehavior.java
 ===
 ---
 C:/wicket/wicket-svn/releases/wicket-1.2.6/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteBehavior.java
 (revision 541579)
 +++
 C:/wicket/wicket-svn/releases/wicket-1.2.6/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteBehavior.java
 (working copy)
 @@ -49,6 +49,19 @@
*/
   public AutoCompleteBehavior(IAutoCompleteRenderer
 renderer)
   {
 +  this(renderer, false);
 + }
 +
 +
 + /**
 +  * Constructor
 +  *
 +  * @param renderer
 +  *renderer that will be used to generate output
 +  * @param preselect
 +  */
 + public AutoCompleteBehavior(IAutoCompleteRenderer
 renderer, boolean preselect)
 + {
if (renderer == null)
{
 throw new IllegalArgumentException(renderer cannot be
 null);
 @@ -54,6 +67,7 @@
 throw new IllegalArgumentException(renderer cannot be
 null);
}
this.renderer = renderer;
 +  this.preselect = preselect;
   }


 Index:
 C:/wicket/wicket-svn/releases/wicket-1.2.6/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteTextField.java
 ===
 ---
 C:/wicket/wicket-svn/releases/wicket-1.2.6/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteTextField.java
 (revision 541579)
 +++
 C:/wicket/wicket-svn/releases/wicket-1.2.6/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteTextField.java
 (working copy)
 @@ -43,7 +43,7 @@
*/
   public AutoCompleteTextField(String id, Class type)
   {
 -  this(id, (IModel)null, type);
 +  this(id, (IModel)null, type,false);
   }

   /**
 @@ -50,10 +50,11 @@
* @param id
* @param model
* @param type
 +  * @param preselect
*/
 - public AutoCompleteTextField(String id, IModel model, Class type)
 + public AutoCompleteTextField(String id, IModel model, Class 
 type,boolean
 preselect)
   {
 -  this(id, model, type,
 StringAutoCompleteRenderer.INSTANCE);
 +  this(id, model, type,
 StringAutoCompleteRenderer.INSTANCE,preselect);

   }

 @@ -60,10 +61,21 @@
   /**
* @param id
* @param object
 +  * @param preselect
 +  */
 + public AutoCompleteTextField(String id, IModel object,boolean 
 preselect)
 + {
 +  this(id, object, (Class)null,preselect);
 + }
 +
 +
 + /**
 +  * @param id
 +  * @param object
*/
   public AutoCompleteTextField(String id, IModel object)
   {
 -  this(id, object, (Class)null);
 +  this(id, object, (Class)null,false);
   }

   /**
 @@ -68,10 +80,20 @@

   /**
* @param id
 +  * @param preselect
 +  */
 + public AutoCompleteTextField(String id,boolean preselect)
 + {
 +  this(id, (IModel)null,preselect);
 +
 + }
 +
 + /**
 +  * @param id
*/
   public AutoCompleteTextField(String id)
   {
 -  this(id, (IModel)null);
 +  this(id, (IModel)null,false);

   }

 @@ -91,7 +113,7 @@
*/
   public 

Re: [Wicket-user] Map.Entry and serialization

2007-05-30 Thread Matthieu Casanova

2007/5/30, Sven Schliesing [EMAIL PROTECTED]:


Changing the code to:
new ListView(list, new ArrayListMap.EntryIKey,
Integer(map.entrySet())) {
public void populateItem(ListItem listItem) {
  Map.EntryIKey, Integer entry = (Map.EntryIKey, Integer)
listItem.getModelObject();
  ...
}
};

doesn't fix the problem. Furthermore
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html says that
Maps are not serializable. Now I'm confused.

btw: I didn't make the variable final to use it in an inner class. It
was just a leftover of cp.



I don't know exactly how to fix the problem, but that's right,
Map.Entryaren't serializable.
The Map are serializable if the content is serializable. But when you
serializes a map, only keys and values are serialized, not the entries (that
are rebuilt when unserializing the map). So maybe you should create ( or use
if there is one) a Model that uses your map directly.

Matthieu
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Map.Entry and serialization

2007-05-30 Thread Johan Compagner

ahh ok change this
new ListView(list, new ArrayListMap.EntryIKey,Integer(map.entrySet()))
{

thats wrong you can't keep Map.Entry objects in a arraylist.
why not keep the map yourself?

new ListView(list, new Model(map) {

johan


On 5/30/07, Sven Schliesing [EMAIL PROTECTED] wrote:


Changing the code to:
new ListView(list, new ArrayListMap.EntryIKey,
Integer(map.entrySet())) {
public void populateItem(ListItem listItem) {
  Map.EntryIKey, Integer entry = (Map.EntryIKey, Integer)
listItem.getModelObject();
  ...
}
};

doesn't fix the problem. Furthermore
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html says that
Maps are not serializable. Now I'm confused.

btw: I didn't make the variable final to use it in an inner class. It
was just a leftover of cp.


Sven

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] 1.2.x trunk stack overflow

2007-05-30 Thread Johan Compagner

that seems to be a problem yes
what i did was change the Settigngs one:

contextPath =
((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest().getContextPath();

so that i directly call the context path of the http servlet request.

i think that should work fine, or does some have WebRequest.getContextPath()
overwritten so that they supply there something else??

johan


On 5/30/07, Ingram Chen [EMAIL PROTECTED] wrote:


All,

   I build 1.2.x trunk today to try some fixed bugs (which found in 1.2.6)
. After I deploy I got stack overflow:

java.lang.StackOverflowError
at java.lang.ThreadLocal.get(ThreadLocal.java:125)
at wicket.RequestCycle.get(RequestCycle.java:211)
at wicket.settings.Settings.getContextPath(Settings.java:451)
at wicket.protocol.http.servlet.ServletWebRequest.getContextPath(
ServletWebRequest.java :69)
at wicket.settings.Settings.getContextPath(Settings.java:453)
at wicket.protocol.http.servlet.ServletWebRequest.getContextPath(
ServletWebRequest.java:69)
at wicket.settings.Settings.getContextPath (Settings.java:453)


I notice ServletWebRequest.getContextPath implmentaton changed:

in 1.2.6:
public String getContextPath()
{
return httpServletRequest.getContextPath();
}

in 1.2.x trunk
public String getContextPath()
{
String contextPath = Application.get
().getApplicationSettings().getContextPath();
return contextPath != null ? contextPath :
httpServletRequest.getContextPath ();
}

so the problem is caused by additional 
Application.get().getApplicationSettings().getContextPath();


I know wicket has a bamboo to build trunk continuously, but I can't find
it to check trunk's health.

--
Ingram Chen
��便��啦: http://dinbendon.net
blog: http://www.javaworld.com.tw/roller/page/ingramchen
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Map.Entry and serialization

2007-05-30 Thread Sven Schliesing
I tried that already. But I ran into the following problem:
Caused by: java.lang.ClassCastException: java.util.HashMap cannot be 
cast to java.util.List
at 
org.apache.wicket.markup.html.list.ListView.getList(ListView.java:174)
at 
org.apache.wicket.markup.html.list.ListView.getViewSize(ListView.java:227)
at 
org.apache.wicket.markup.html.list.ListView.onBeforeRender(ListView.java:538)
at org.apache.wicket.Component.beforeRender(Component.java:3037)
at 
org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1433)
... 28 more

The method-body:
public final List getList()
{
final List list = (List)getModelObject();
if (list == null)
{
return Collections.EMPTY_LIST;
}
return list;
}

So there is a need to use a List. I can't override getList() cause it's 
final.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Map.Entry and serialization

2007-05-30 Thread Johan Compagner

Model model = new Model(map)
{
 getObject()
 {
 return new List(map.entries())
 }
}

ListView lv = new ListView(x,model);
johan


On 5/30/07, Sven Schliesing [EMAIL PROTECTED] wrote:


I tried that already. But I ran into the following problem:
Caused by: java.lang.ClassCastException: java.util.HashMap cannot be
cast to java.util.List
at org.apache.wicket.markup.html.list.ListView.getList(
ListView.java:174)
at
org.apache.wicket.markup.html.list.ListView.getViewSize(ListView.java:227)
at
org.apache.wicket.markup.html.list.ListView.onBeforeRender(ListView.java
:538)
at org.apache.wicket.Component.beforeRender(Component.java:3037)
at
org.apache.wicket.MarkupContainer.onBeforeRenderChildren(
MarkupContainer.java:1433)
... 28 more

The method-body:
public final List getList()
{
final List list = (List)getModelObject();
if (list == null)
{
return Collections.EMPTY_LIST;
}
return list;
}

So there is a need to use a List. I can't override getList() cause it's
final.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Chicken-and-egg w/ Data Provider

2007-05-30 Thread Johan Compagner

this only works if you have a seperate method:

private List getOrders()
{
 if (orders == null)
 {
 orders = DAO.getOrders()
 }
}

iterator()
{
  return getOrders().sublist(x,y).iterator()
}


size()
{
 return getOrders().size();
}

detach()
{
 orders = null;
}

johan

On 5/29/07, V. Jenks [EMAIL PROTECTED] wrote:



I'm trying to use a provider class for a DataView so I can do
paging/sorting,
etc.  It looks like this:


public class OrderProvider implements IDataProvider
{
private transient ListOrder orders;

public OrderProvider()
{
}

public Iterator iterator(int first, int count)
{
this.orders =
WicketHelper.ListOrdergetDetachedModelObject(
OrderProxy.getAll(first, first + count));

return this.orders.iterator();
}

public IModel model(Object model)
{
return WicketHelper.getDetachedModel(model);
}

public int size()
{
return this.orders.size();
}
}


I thought this would work but it looks like size() is called first, since
I
get a NPE:


Caused by: java.lang.NullPointerException
at com.myapp.provider.OrderProvider.size(OrderProvider.java:36)


It works if size() makes a call to the database to get a count of
records...but I'm trying to use a global field to prevent that data call.

Any suggestions?
--
View this message in context:
http://www.nabble.com/Chicken-and-egg-w--Data-Provider-tf3834369.html#a10855464
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Skin effect in wicket

2007-05-30 Thread Javed

I tried with customresourceloading from wicket-examples its working but the
problem is with markup cache.

I am having to different markups for the same page(java file) so when I
start my server and hit that page it with criteria that selects markup
dynamically it displays that page with that markup but when I hit it one
more time (without restarting server) with different criteria which should
change the markup but it is showing first(old or previous) markup. 
After doing google, I came across this markup cache thing. but didnt get any
solution.

Could you please suggest on this problem?


Eelco Hillenius wrote:
 
 Thanks for reply.

 One more thing, Can I have this setting of markup for particular module
 (Page) and not for whole application?
 
 Yep, see PageWithCustomLoading from that example. Also note that the
 application scoped setting is a strategy, so with a bit of thinking
 you can bend it every way you want it.
 
 Eelco
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/Skin-effect-in-wicket-tf3833465.html#a10871813
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Map.Entry and serialization

2007-05-30 Thread Sven Schliesing
Ah, perfect :)

Thank you so much for your help!

Johan Compagner wrote:
 Model model = new Model(map)
 {
   getObject()
   {
   return new List(map.entries())
   }
 }
 
 ListView lv = new ListView(x,model);
 johan


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Bug in 1.3? HeaderContributor.forCss(String)

2007-05-30 Thread Al Maw
Relative URLs are good - they make the page work properly behind proxy
servers. Why do you want an absolute one? Do your resources live in a
different context or something?

If you're trying to serve resources relative to your context root, just
add it with:
add(HeaderContributor.forCss(resources/styles/global.css));

And that should work just fine (generating a relative URL).

Arguably we should strip off the first / if you put in an absolute 
path, so this is more transparent to the end user. I'm not convinced 
that enough people want to serve their resources from a different 
context path that we should provide absolute URLs - they're obviously 
open to people using them then wondering why it's broke behind a mod_proxy.

Regards,

Al

-- 
Alastair Maw
Wicket-biased blog at http://herebebeasties.com


Jeremy Thomerson wrote:
 I consider this a bug, and was wondering if you do as well...  If so, I 
 will open a JIRA and attach a patch for it.  Just let me know.
 
 In my 1.2.6 app, I have the following line:
 add(HeaderContributor.forCss(/resources/styles/global.css));
 
 which generates this in the markup (correctly):
 link rel =stylesheet type=text/css href=/resources/css/global.css 
  /link
 
 
 In 1.3, it generates this in the markup (incorrectly):
 link rel =stylesheet type=text/css 
 href=../../..//resources/styles/global.css /link
 
 This is because of the change to have everything with relative URLs, I 
 am assuming.  But, I don't want a relative URL, I want an absolute one.  
 I'm thinking that the following change would be appropriate:
 
 HeaderContributor.java (26)
 if (location.startsWith(http://;) || location.startsWith(https://;))
 
 changed to:
 
 if (location.startsWith(http://;) || location.startsWith(https://;) || 
 location.startsWith(/))
 
 
 Thoughts?
 Jeremy Thomerson
 !DSPAM:465ca773246071804284693!

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] [BUG]script tag evaluation in IE

2007-05-30 Thread Alex Objelean

Probably it is well known bug for most of you, but I think it worth to
mention again about it and its workaround. 

The bug appears when the ajax response contains a script which normally
should be evaluated (and it does in gecko browsers) but the script is not
evaluated in IE (any version, including IE7) I found two workarounds for
this issue:

1) Wrap the script into the form tag. But it has a drawback, you must be
careful to not have embedded forms. Not very convenient solution..

2) Wrap the script into the  tag, like this:


  script
//your script
  /script


The style=display:none is important because embed object itself should not
be visible, it is just a container which simply makes the script tag
evaluation work in IE...And this is the best choice to make it work in
XBrowser fashion.

Alex.


-- 
View this message in context: 
http://www.nabble.com/-BUG-%3Cscript%3E-tag-evaluation-in-IE-tf3839952.html#a10872337
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Implementing a PopupPanel

2007-05-30 Thread John Krasnay
One way to solve the abstract method from the constructor problem (or
more precisely, the non-final method from the constructor problem) is
to use a Model, e.g...

public class PopupPanel extends Panel {
public abstract String getTitle();
public PopupPanel(String id) {
add(new Label(foo, new AbstractReadOnlyModel() {
public Object getObject(Component component) {
return getTitle();
}
}
}
}

The model's getObject is only called some time after the object has
been constructed.

jk


On Tue, May 29, 2007 at 07:36:59AM -0400, Ravindra Wankar wrote:
 
 This looks more like a design question but I think there must be a 
 better, Wicket way.
 
 I wrote a PopupPanel that allows you to have a div popup in a page by 
 clicking a link. The contents of the div can be static/loaded via Ajax. 
 The popup part with Ajax is working. The link that activates the popup 
 can either have an image or text label. So I have...
 
   PopupPanel
   | abstract getTitle() and getContent()
   | constructor calls getTitle() and 
 getContents()
   | 
 --
 ||
LabelLinkedPopupPanelImageLinkedPopupPanel
implements getTitle()  implements getTitle()
 
 
 To use it, new LabelLinkedPopupPanel(...) and override the getContent() 
 method. I can't get the title to work because of abstract method from 
 the constructor problem. My options then are
 
 1. Have a setTitle() and setContent() method that is called by the 
 subclasses but failing to call them won't be caught till runtime.
 2. Have PopupPanel constructor take in components for title and content. 
 The sub classes then just act as wrappers.
 3. Replace the subclasses with PopupPanelFactory with 2 methods 
 newLabelLinkedPopup() and newImageLinkedPopup.
 
 I don't think a border suits this requirement but I'm not sure. Is there 
 a better way?
 
 Thanks
 Ravi
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [Nuub] Best practise: Navigation Component

2007-05-30 Thread John Krasnay
One idea would be to create a class that represents the logical idea of
a link, e.g

public class NavEntry {
private String title;
private Class pageClass;
private PageParameters parameters;
...
}

Pass a list of these to the constructor of your panel, which then
renders these into actual links and labels.

If this is too restrictive, e.g. if you want different kinds of links,
not just BookmarkablePageLinks, you can defer creation of the link to
the NavEntry object:

public class NavEntry {
...
public abstract WebMarkupContainer createLink(String id);
}

public class BookmarkablePageNavEntry extends NavEntry {
private Class pageClass;
private PageParameters parameters;
public WebMarkupContainer createLink(String id) {
return new BookmarkablePageLink(pageClass, parameters);
}
}

A similar technique is used in the tabs package in wicket-extensions.

jk

On Tue, May 29, 2007 at 07:55:48PM +0200, Johannes Schneider wrote:
 Hi,
 
 I am new to Wicket and I really like the things I have seen so far. But 
 I also have a few questions.
 At the moment I create a small page. Therefore I have created a 
 NavigationComponent (extends Panel) with its own markup file and some 
 other resources (css, images).
 
 Can anybody describe me the best way to add Links (most of them are 
 BookmarkableLinks) and the corresponding Labels to this component?
 At the moment I create a List of Links. Each of those links has a Label 
 added. Those links are then provided to a DataView and given to the 
 NavigationComponent.
 I don't like this because I have to create the components manually 
 (Links and Labels) with the correct ids. What approach would a wicket 
 expert take?
 
 Later I might reuse the NavigationComponent within another application. 
 But therefore I would like to modify/replace the CSS and replace some 
 images. What is the Wicket way to achive this?
 
 
 Thanks in advance,
 
 
 Johannes Schneider
 -- 
 Johannes Schneider
 Im Lindenwasen 15
 72810 Gomaringen
 
 Fon +49 7072 9229972
 Fax +49 7072 50
 Mobil +49 178 1364488
 
 [EMAIL PROTECTED]
 http://www.johannes-schneider.info



 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Implementing a PopupPanel

2007-05-30 Thread Ravindra Wankar





Thanks John. I was suspecting no one to reply to a long mail.

Unfortunately, in my case the getTitle() returns a component not the
label text. The component returned by the child can either be a "label"
or an "image" component. The derived class gets the label text in its
constructor which it uses to construct the label but the parent calls
getTitle() too soon.

As there are 2 components within the parent (title and contents) that
the child needs to fill, I could not use markup inheritance.

Thanks,
Ravi.

John Krasnay wrote:

  One way to solve the "abstract method from the constructor" problem (or
more precisely, the "non-final method from the constructor" problem) is
to use a Model, e.g...

public class PopupPanel extends Panel {
public abstract String getTitle();
public PopupPanel(String id) {
add(new Label("foo", new AbstractReadOnlyModel() {
public Object getObject(Component component) {
return getTitle();
}
}
}
}

The model's getObject is only called some time after the object has
been constructed.

jk


On Tue, May 29, 2007 at 07:36:59AM -0400, Ravindra Wankar wrote:
  
  
This looks more like a design question but I think there must be a 
better, Wicket way.

I wrote a PopupPanel that allows you to have a "div" popup in a page by 
clicking a link. The contents of the div can be static/loaded via Ajax. 
The popup part with Ajax is working. The link that activates the popup 
can either have an image or text label. So I have...

  PopupPanel
  | abstract getTitle() and getContent()
  | constructor calls getTitle() and getContents()
  | 
--
||
   LabelLinkedPopupPanelImageLinkedPopupPanel
   implements getTitle()  implements getTitle()


To use it, new LabelLinkedPopupPanel(...) and override the getContent() 
method. I can't get the title to work because of "abstract method from 
the constructor" problem. My options then are

1. Have a setTitle() and setContent() method that is called by the 
subclasses but failing to call them won't be caught till runtime.
2. Have PopupPanel constructor take in components for title and content. 
The sub classes then just act as wrappers.
3. Replace the subclasses with PopupPanelFactory with 2 methods 
newLabelLinkedPopup() and newImageLinkedPopup.

I don't think a border suits this requirement but I'm not sure. Is there 
a better way?

Thanks
Ravi

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

  
  
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

  





-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] 1.2.x trunk stack overflow

2007-05-30 Thread Johan Compagner

no i thnk AlMaw wants to take a look at it.

johan


On 5/30/07, Ingram Chen [EMAIL PROTECTED] wrote:


In 1.2.x trunk, Settings still use old implemation:

public String getContextPath()
{
// Set the default context path if the context path is not already
// set (previous time or by the developer itself)
// This all to do missing api in the servlet spec.. You can't get
a
// context path from the servlet context, which is just stupid.
if (contextPath == null  RequestCycle.get ().getRequest()
instanceof WebRequest)
{
contextPath =
((WebRequest)RequestCycle.get().getRequest()).getContextPath();
}
return contextPath;
}


http://svn.apache.org/repos/asf/incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/settings/Settings.java

not yet commit ?

On 5/30/07, Johan Compagner [EMAIL PROTECTED] wrote:

 that seems to be a problem yes
 what i did was change the Settigngs one:

 contextPath =
 
((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest().getContextPath();

 so that i directly call the context path of the http servlet request.

 i think that should work fine, or does some have
 WebRequest.getContextPath() overwritten so that they supply there
 something else??

 johan


 On 5/30/07, Ingram Chen [EMAIL PROTECTED] wrote:

   All,
 
 I build 1.2.x trunk today to try some fixed bugs (which found in
  1.2.6)
  . After I deploy I got stack overflow:
 
  java.lang.StackOverflowError
  at java.lang.ThreadLocal.get(ThreadLocal.java:125)
  at wicket.RequestCycle.get(RequestCycle.java:211)
  at wicket.settings.Settings.getContextPath(Settings.java:451)
  at wicket.protocol.http.servlet.ServletWebRequest.getContextPath(
  ServletWebRequest.java :69)
  at wicket.settings.Settings.getContextPath(Settings.java:453)
  at wicket.protocol.http.servlet.ServletWebRequest.getContextPath(
  ServletWebRequest.java:69)
  at wicket.settings.Settings.getContextPath (Settings.java:453)
 
 
  I notice ServletWebRequest.getContextPath implmentaton changed:
 
  in 1.2.6:
  public String getContextPath()
  {
  return httpServletRequest.getContextPath();
  }
 
  in 1.2.x trunk
  public String getContextPath()
  {
  String contextPath = Application.get
  ().getApplicationSettings().getContextPath();
  return contextPath != null ? contextPath :
  httpServletRequest.getContextPath ();
  }
 
  so the problem is caused by additional 
Application.get().getApplicationSettings().getContextPath();
 
 
  I know wicket has a bamboo to build trunk continuously, but I can't
  find it to check trunk's health.
 
  --
  Ingram Chen
  ��便��啦: http://dinbendon.net
  blog: http://www.javaworld.com.tw/roller/page/ingramchen
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user




--
Ingram Chen
��便��啦: http://dinbendon.net
blog: http://www.javaworld.com.tw/roller/page/ingramchen

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Stable URLs (Was: Bookmarkable pages and transparent login)

2007-05-30 Thread Thomas Singer
OK, I've tried to create an unversioned page to keep the URL stable using 
following page code:

 public class DownloadFile extends TemplatePage {
 
   // Constants 
 ==
 
   private static final String FILE_PARAMETER = file;
 
   // Static 
 =
 
   public static BookmarkablePageLink createLinkToPage(String id, String 
 file) {
   final BookmarkablePageLink pageLink = new 
 BookmarkablePageLink(id, DownloadFile.class);
   pageLink.setParameter(FILE_PARAMETER, file);
   return pageLink;
   }
 
   // Setup 
 ==
 
   public DownloadFile(PageParameters parameters) {
   final String file = parameters.getString(FILE_PARAMETER);
   if (file == null) {
   throw new 
 RestartResponseAtInterceptPageException(Download.class);
   }
 
   if (!getOurSession().isLicenseAgreed()) {
   addContent(createLicenseFragment(contentPanel, 
 parameters));
   throw new RestartResponseAtInterceptPageException(this);
   }
 
   addContent(createDownloadFragment(contentPanel, file));
   }
 
   // Utils 
 ==
 
   private Fragment createDownloadFragment(String id, String file) {
   final Fragment fragment = new Fragment(id, downloadFragment);
   fragment.add(new Label(file, file));
   return fragment;
   }
 
   private Fragment createLicenseFragment(String id, final PageParameters 
 parameters) {
   final Fragment fragment = new Fragment(id, licenseFragment);
   fragment.add(new PageLink(accept, new IPageLink() {
   public Page getPage() {
   getOurSession().setLicenseAgreed(true);
   return new DownloadFile(parameters);
   }
 
   public Class getPageIdentity() {
   return DownloadFile.class;
   }
   }));
   return fragment;
   }
 
   public boolean isVersioned() {
   return false;
   }
 }

Every page is mounted with QueryStringUrlCodingStrategy. On the Download 
page a link to this DownloadFile page is created using the above 
createLinkToPage() static method call which creates a link to 
http://localhost:8080/smartcvs/download-file.html?file=win32jre;
Curiously, when I click on it, the browser displays 
http://localhost:8080/?wicket:interface=:2::; as URL. The accept-link 
occurs pointing to 
http://localhost:8080/?wicket:interface=:2:border:contentPanel:accept::ILinkListener;.
 
When I click it, the browser displays 
http://localhost:8080/?wicket:interface=:3::; as URL. Clicking the 
back-button shows the http://localhost:8080/?wicket:interface=:2::; page 
with the accept-link, no matter whether I try it with Opera or FireFox.

Tom


Eelco Hillenius wrote:
 Regarding the back-button: it would be the best if the intermediate license
 agreement page would not occur when pressing the back-button, but instead
 the previous page (if any). Is something like that possible?
 
 What you need to achieve is that the URL stays stable. One way to
 achieve this is to use panel replacement. E.g. when you click the
 download page, you replace the main panel on your page with a panel
 that displays the license agreement. If you turn off versioning for
 that page, the URL will stay stable and thus if you push the back
 button later, your browser will return to the first version of the
 page. I think this should work for most browsers (maybe only not with
 Opera). There are alternative ways to do this, including throwing
 RestartResponseExceptions, using custom page factories and custom url
 coding strategies. Or you can trick the browser using JavaScript, of
 which I don't know too many details.
 
 Eelco


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Chicken-and-egg w/ Data Provider

2007-05-30 Thread kroekle

The size() method was one of my biggest stumbling blocks when I started using
DataProvders, but for slightly different reasons (i.e. just having a size
method makes it less maintainable, perform worse, less scalable and gives
less accurate results).  But when I tried to work around the size method, I
found it was very deeply embedded in the inner workings of DataTable.  I
also think DataTable is too nice of a component to not use.  So I came up
with a solution that doesn't require the DataProvider to have a size()
method, but leaves it in DataTable.  I've submitted this to JIRA
(https://issues.apache.org/jira/browse/WICKET-579), but since it requires
changing core classes, I wouldn't suggest anybody implement it before it is
an accepted patch.  (but maybe some support from others will help it get
accepted).

Kurt


James McLaughlin-3 wrote:
 
 The purpose of size() is to give the DataView an idea of how many
 pages there will be, so this really won't work. You should fetch size
 in a separate query as the number of orders total over all pages, and
 cache that.
 
 best,
 jim
 
 On 5/29/07, V. Jenks [EMAIL PROTECTED] wrote:

 I'm trying to use a provider class for a DataView so I can do
 paging/sorting,
 etc.  It looks like this:

 
 public class OrderProvider implements IDataProvider
 {
 private transient ListOrder orders;

 public OrderProvider()
 {
 }

 public Iterator iterator(int first, int count)
 {
 this.orders =
 WicketHelper.ListOrdergetDetachedModelObject(
 OrderProxy.getAll(first, first + count));

 return this.orders.iterator();
 }

 public IModel model(Object model)
 {
 return WicketHelper.getDetachedModel(model);
 }

 public int size()
 {
 return this.orders.size();
 }
 }
 

 I thought this would work but it looks like size() is called first, since
 I
 get a NPE:

 
 Caused by: java.lang.NullPointerException
 at com.myapp.provider.OrderProvider.size(OrderProvider.java:36)
 

 It works if size() makes a call to the database to get a count of
 records...but I'm trying to use a global field to prevent that data call.

 Any suggestions?
 --
 View this message in context:
 http://www.nabble.com/Chicken-and-egg-w--Data-Provider-tf3834369.html#a10855464
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/Chicken-and-egg-w--Data-Provider-tf3834369.html#a10875427
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Skin effect in wicket

2007-05-30 Thread Eelco Hillenius
Look at PageWithCustomLoading. It implements IMarkupCacheKeyProvider
and has method:

/**
 * Prevent the markup from ever be cached. This is optionally - 
components
 * that don't implement [EMAIL PROTECTED] IMarkupCacheKeyProvider} will 
just have their
 * markup cached - but is useful when markup varies. If you don't need 
such
 * dynamic loading, it is advisible to not implement
 * [EMAIL PROTECTED] IMarkupCacheKeyProvider}.
 *
 * @see 
org.apache.wicket.markup.IMarkupCacheKeyProvider#getCacheKey(org.apache.wicket.MarkupContainer,
 *  java.lang.Class)
 */
public CharSequence getCacheKey(MarkupContainer container, Class
containerClass)
{
return null;
}

Eelco

On 5/30/07, Javed [EMAIL PROTECTED] wrote:

 I tried with customresourceloading from wicket-examples its working but the
 problem is with markup cache.

 I am having to different markups for the same page(java file) so when I
 start my server and hit that page it with criteria that selects markup
 dynamically it displays that page with that markup but when I hit it one
 more time (without restarting server) with different criteria which should
 change the markup but it is showing first(old or previous) markup.
 After doing google, I came across this markup cache thing. but didnt get any
 solution.

 Could you please suggest on this problem?


 Eelco Hillenius wrote:
 
  Thanks for reply.
 
  One more thing, Can I have this setting of markup for particular module
  (Page) and not for whole application?
 
  Yep, see PageWithCustomLoading from that example. Also note that the
  application scoped setting is a strategy, so with a bit of thinking
  you can bend it every way you want it.
 
  Eelco
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

 --
 View this message in context: 
 http://www.nabble.com/Skin-effect-in-wicket-tf3833465.html#a10871813
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Implementing a PopupPanel

2007-05-30 Thread John Krasnay
Ah, I see.

If your popup functionality is pure client-side Javascript, couldn't you
just turn it into a Behavior that you attach to a Label, Image, or
whatever, that sets the onclick attribute of whatever you attached it
to?

jk

On Wed, May 30, 2007 at 10:13:40AM -0400, Ravindra Wankar wrote:
Thanks John. I was suspecting no one to reply to a long mail.
 
Unfortunately, in my case the getTitle() returns a component not the label
text. The component returned by the child can either be a label or an
image component. The derived class gets the label text in its
constructor which it uses to construct the label but the parent calls
getTitle() too soon.
 
As there are 2 components within the parent (title and contents) that the
child needs to fill, I could not use markup inheritance.
 
Thanks,
Ravi.
 
John Krasnay wrote:
 
  One way to solve the abstract method from the constructor problem (or
  more precisely, the non-final method from the constructor problem) is
  to use a Model, e.g...
 
  public class PopupPanel extends Panel {
  public abstract String getTitle();
  public PopupPanel(String id) {
  add(new Label(foo, new AbstractReadOnlyModel() {
  public Object getObject(Component component) {
  return getTitle();
  }
  }
  }
  }
 
  The model's getObject is only called some time after the object has
  been constructed.
 
  jk
 
 
  On Tue, May 29, 2007 at 07:36:59AM -0400, Ravindra Wankar wrote:
   
 
  This looks more like a design question but I think there must be a
  better, Wicket way.
 
  I wrote a PopupPanel that allows you to have a div popup in a page by
  clicking a link. The contents of the div can be static/loaded via Ajax.
  The popup part with Ajax is working. The link that activates the popup
  can either have an image or text label. So I have...
 
PopupPanel
| abstract getTitle() and getContent()
| constructor calls getTitle() and 
 getContents()
|
  --
  ||
 LabelLinkedPopupPanelImageLinkedPopupPanel
 implements getTitle()  implements getTitle()
 
 
  To use it, new LabelLinkedPopupPanel(...) and override the getContent()
  method. I can't get the title to work because of abstract method from
  the constructor problem. My options then are
 
  1. Have a setTitle() and setContent() method that is called by the
  subclasses but failing to call them won't be caught till runtime.
  2. Have PopupPanel constructor take in components for title and content.
  The sub classes then just act as wrappers.
  3. Replace the subclasses with PopupPanelFactory with 2 methods
  newLabelLinkedPopup() and newImageLinkedPopup.
 
  I don't think a border suits this requirement but I'm not sure. Is there
  a better way?
 
  Thanks
  Ravi
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
   

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Skin effect in wicket

2007-05-30 Thread Javed

I am using wicket 1.2.6 API. I couldnt find this
org.apache.wicket.markup.IMarkupCacheKeyProvider interface. Could you
please tell me which jar or wicket has this interface.

Thanks in advance.


Eelco Hillenius wrote:
 
 Look at PageWithCustomLoading. It implements IMarkupCacheKeyProvider
 and has method:
 
   /**
* Prevent the markup from ever be cached. This is optionally -
 components
* that don't implement [EMAIL PROTECTED] IMarkupCacheKeyProvider} will 
 just have
 their
* markup cached - but is useful when markup varies. If you don't need
 such
* dynamic loading, it is advisible to not implement
* [EMAIL PROTECTED] IMarkupCacheKeyProvider}.
*
* @see
 org.apache.wicket.markup.IMarkupCacheKeyProvider#getCacheKey(org.apache.wicket.MarkupContainer,
*  java.lang.Class)
*/
   public CharSequence getCacheKey(MarkupContainer container, Class
 containerClass)
   {
   return null;
   }
 
 Eelco
 
 On 5/30/07, Javed [EMAIL PROTECTED] wrote:

 I tried with customresourceloading from wicket-examples its working but
 the
 problem is with markup cache.

 I am having to different markups for the same page(java file) so when I
 start my server and hit that page it with criteria that selects markup
 dynamically it displays that page with that markup but when I hit it one
 more time (without restarting server) with different criteria which
 should
 change the markup but it is showing first(old or previous) markup.
 After doing google, I came across this markup cache thing. but didnt get
 any
 solution.

 Could you please suggest on this problem?


 Eelco Hillenius wrote:
 
  Thanks for reply.
 
  One more thing, Can I have this setting of markup for particular
 module
  (Page) and not for whole application?
 
  Yep, see PageWithCustomLoading from that example. Also note that the
  application scoped setting is a strategy, so with a bit of thinking
  you can bend it every way you want it.
 
  Eelco
 
 
 -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

 --
 View this message in context:
 http://www.nabble.com/Skin-effect-in-wicket-tf3833465.html#a10871813
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/Skin-effect-in-wicket-tf3833465.html#a10876450
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] How To Test with getApplication method

2007-05-30 Thread tma tma

Hi

I am not native English speaker.
sorry for poor English.

I use wicket 1.2.6 .
I have question to use WicketTester.

i want to make Global object ,create instance in WebApplication Class and
create method to access the instance.
In WebPage class ,access the instance like this

SingleClass class = ((FooApplication)getApplication()).getSingleClass();

'FooApplication' extends WebApplication and 'SingleClass' is Global object's
class.

To test the above WebPage class, make the class 'FooApplicationTester' that
extends WicketTester and
Copy  Paste the FooApplication's method .

when run the test code, ClassCastException happens.
I declared interface IFooApplication and implement at FooApplication and
FooApplicationTester.
I changed the WebPage class like this

SingleClass class = ((IFooApplication)getApplication()).getSingleClass();

This way, I can run without exception.
But I don't want to create interface.
Is there other way to solve ?

best regards
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Wiki reference page on custom converter is outdated

2007-05-30 Thread Anto Paul

Hi all,
   The reference about using custom converter in apache wiki is outdated(
http://cwiki.apache.org/confluence/display/WICKET/Using+custom+converters#Usingcustomconverters-Provideacustomconverterfactory).
I could'nt find the method getConverterFactory() in Application class. Can
somebody update the wiki with details for 1.2 series.

Regards,
Anto
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Have to click 2 times to get my search results

2007-05-30 Thread Francisco Diaz Trepat - gmail

Johan many thanks for answering I think so.

Here is the structure of the code:

1) A panel that contains a Form (fields name and lastName) and a Table
(PageableListView).

2) A small SearchPage like this:

  public DossierSearch() {
 super();
 add(new ch.logismata.wicket.panels.ajax.DossierSearchPanel
(ajaxDossierSearchPanel));
  }


f(t)


On 5/29/07, Johan Compagner  [EMAIL PROTECTED] wrote:


Are you sure that you don't set another page to render in the ajax button
submit code??

Because if you a pure ajax call and you don't set anohter response page
then the url in your browser shouldn't change

johan


On 5/29/07, Francisco Diaz Trepat - gmail  [EMAIL PROTECTED]
wrote:

 Hi all,

 I have the following behavior:

 On one side of a Page I have a list of links (acting as a menu :P) that
 is created by building links by obtaining the page class
 NameOfThePage.class.

 That gives me the url:

 
http://localhost:8084/WicketDemo?wicket:bookmarkablePage=:ch.logismata.wicket.pages.DossierSearch


 Then I click on my AJAX Submit button to get a search result, but
 instead of that, the page is refreshed, now with this url:

 http://localhost:8084/WicketDemo?wicket:interface=:8:1 :

 Then I click the AJAX SubmitButton and everything works fine.

 This happens most times, but I don't know how yet, sometimes it works on
 the first step.

 Best regards,
 f(t)


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Best Practices for accessing/repainting sibling/cousin components?

2007-05-30 Thread dukejansen

I have some state which backs two panels, Panel A and Panel B, that may be
included as part of other panels. Ultimately they are both on the same page,
and their backing state is shared via the model class that backs both of
them. Panel A has an Ajax event handler which modifies the backing model
state, after which I want to force Panel A and Panel B to repaint.

I've dealt with this in a few different ways so far, and they all bother me:

1. Walk up the containership tree and back down again until I find the panel
with a known ID or which implements a specific marker interface, finding it
that way. (Or do a full DFS of the tree to be thorough.)

2. Assume how my Panel is included and how the other Panel are included, and
explicitly walk up and back down the containership tree. This is fragile
because if I decide to rework panel containership, the method could fail.

Is there some better way of doing this that I'm missing? A best practice for
reaching out to siblings and cousins?

Or something more fundamental to trigger refreshes of all componets backed
by that model? Seems like a common use case. A component updates some state
as part of ajax event, then wants to use ajax to repaint any other
components backed by that state.

Interested to hear how others have solved this problem.

-Jason
-- 
View this message in context: 
http://www.nabble.com/Best-Practices-for-accessing-repainting-sibling-cousin-components--tf3841514.html#a10877622
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Skin effect in wicket

2007-05-30 Thread Eelco Hillenius
 I am using wicket 1.2.6 API. I couldnt find this
 org.apache.wicket.markup.IMarkupCacheKeyProvider interface. Could you
 please tell me which jar or wicket has this interface.

It's a new feature of Wicket 1.3. Unfortunately, we can't support this in 1.2.

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] FW: wicket scriptaculous drag and drop

2007-05-30 Thread Apaar Trivedi


-Original Message-
From: Ryan Sonnek [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 30, 2007 12:45 PM
To: Apaar Trivedi
Subject: Re: wicket scriptaculous drag and drop

Thanks for the feedback.  This question might be applicable to the
wicket user mailing list.  My suggestion is to use the
SortableListView for users that can drag/drop and a normal ListView
for users that can not sort.

something like:
if (canSort) {
  add(new SortableListView());
} else {
  add(new ListView());
}

I think this should be possible.

On 5/30/07, Apaar Trivedi [EMAIL PROTECTED] wrote:




 Hi Ryan,



 We are using the wicket scriptaculous drag and drop contribution for
an app
 we are building.  I am wondering if there is anyway to disable to drag
and
 drop nature of the listview.  For instance, if we have several types
of
 users, and some users can re order the list, but others cannot, we
would
 like to disable the sorting feature for those who can't use it.



 Any help on how to do this?  The constraints options do not seem to
prohibit
 the movement, and it seems to be only able to move vertically be
default.
 Fyi, I am using the contrib. from the wicket 1.3 trunk.  Thank you for
any
 help!





 Apaar Trivedi

 Consultant

 O: (512) 469-9300 x 128

 M: (512) 363-9290

 Blue Fish Development Group

 http://www.bluefishgroup.com



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Wicket Acegi - small implementation

2007-05-30 Thread Jan Kriesten

huhu!

i just gave acegi with your wicket-role-model a try and came up with this quick
implementation (2 java  1 xml-file):

http://wicket.silberlicht.de/misc/acegi-wicket.tar.gz (2k size)

you need the acegi-framework from

http://www.acegisecurity.org/

and the spring.jar (acegi needs this for it's configuration - nothing else!).

if all libs/classes are in place, you can change the role-example to use
AcegiWebApplication and AcegiWebSession. make sure, that you have your Roles
configured in the acegi.xml! :-)

i think it's not 100% bulletproof but it's already usable. and you can
authenticate to what you like. :-)

if it's good enough and interesting for others, your welcome to add this to
the wiki.

best regards, --- jan.

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Chicken-and-egg w/ Data Provider

2007-05-30 Thread V. Jenks

I prefer not to do it that way because it requires a potentially large list
of records to be pulled up initially whereas now, I'm only pulling the
records on the current page, making it much faster.  I pass the x  y right
through to the data access layer.


Johan Compagner wrote:
 
 this only works if you have a seperate method:
 
 private List getOrders()
 {
   if (orders == null)
   {
   orders = DAO.getOrders()
   }
 }
 
 iterator()
 {
return getOrders().sublist(x,y).iterator()
 }
 
 
 size()
 {
   return getOrders().size();
 }
 
 detach()
 {
   orders = null;
 }
 
 johan
 
 On 5/29/07, V. Jenks [EMAIL PROTECTED] wrote:


 I'm trying to use a provider class for a DataView so I can do
 paging/sorting,
 etc.  It looks like this:

 
 public class OrderProvider implements IDataProvider
 {
 private transient ListOrder orders;

 public OrderProvider()
 {
 }

 public Iterator iterator(int first, int count)
 {
 this.orders =
 WicketHelper.ListOrdergetDetachedModelObject(
 OrderProxy.getAll(first, first + count));

 return this.orders.iterator();
 }

 public IModel model(Object model)
 {
 return WicketHelper.getDetachedModel(model);
 }

 public int size()
 {
 return this.orders.size();
 }
 }
 

 I thought this would work but it looks like size() is called first, since
 I
 get a NPE:

 
 Caused by: java.lang.NullPointerException
 at com.myapp.provider.OrderProvider.size(OrderProvider.java:36)
 

 It works if size() makes a call to the database to get a count of
 records...but I'm trying to use a global field to prevent that data call.

 Any suggestions?
 --
 View this message in context:
 http://www.nabble.com/Chicken-and-egg-w--Data-Provider-tf3834369.html#a10855464
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/Chicken-and-egg-w--Data-Provider-tf3834369.html#a10879506
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [BUG]script tag evaluation in IE

2007-05-30 Thread Eelco Hillenius
 2) Wrap the script into the  tag, like this:


   script
 //your script
   /script

Is this something Wicket can/ should do by default?

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] DateTimeField surviving Ajax updates

2007-05-30 Thread Aaron Hiniker
I have a AjaxTabbedPanel that contains the Yahoo DateTimeField from 
extensions.  The calendar works fine on a page refresh, but when 
clicking to other tabs with Ajax loading each tab, the DateTimeFields 
quit working.  Has anyone else experienced this and found a workaround 
or fix?


Thanks

Aaron
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Adding more onclick script to ajax link?

2007-05-30 Thread Tremelune

I'm looking to add an additional script to the onclick of a (paging) ajax
link. I stumbled on this thread:

http://www.nabble.com/Appending-to-AJAX-Submit-Button-onclick-tf1695285.html#a4600751

I can't seem to find the additional code in 1.3. The thread is a year old,
perhaps the code was discarded. Is there a new and better way to add
additional onclick scripting somewhere else?
-- 
View this message in context: 
http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10883013
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] modalwindow open fails

2007-05-30 Thread Jonathan Locke

this may be my problem, but i'm having a bit of trouble with modal windows
that won't open and wondering if there are any known gotchas or words of
wisdom for what to look at...

-- 
View this message in context: 
http://www.nabble.com/modalwindow-open-fails-tf3843250.html#a10883547
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Best Practices for accessing/repainting sibling/cousin components?

2007-05-30 Thread Jonathan Locke


It shouldn't be hard to write the method you're talking about.  To find all
the components using the same model as a given component, just walk the
component hierarchy using visitChildren() and add any component which
returns true for sameInnermostModel(component).

There is a more general case of this problem though where one area of a web
page may need to be updated because some completely unrelated area changed. 
This I'm handling by hand right now, but I was asking a day or two ago if
there was a way to add a component to every ajax request (Eelco answered
that you can do this by implementing a request processor, I think).  It
seems to be pretty common in an AJAX request to want a global feedback
component to update.  Maybe we could have a poor-man's version of this where
if you override some boolean method, your component will get
auto-ajax-updated on every AJAX request. For many problems, this would be
convenient because it's easier to just update the thing every time than to
think about all the places it might need to be updated.


dukejansen wrote:
 
 I have some state which backs two panels, Panel A and Panel B, that may be
 included as part of other panels. Ultimately they are both on the same
 page, and their backing state is shared via the model class that backs
 both of them. Panel A has an Ajax event handler which modifies the backing
 model state, after which I want to force Panel A and Panel B to repaint.
 
 I've dealt with this in a few different ways so far, and they all bother
 me:
 
 1. Walk up the containership tree and back down again until I find the
 panel with a known ID or which implements a specific marker interface,
 finding it that way. (Or do a full DFS of the tree to be thorough.)
 
 2. Assume how my Panel is included and how the other Panel are included,
 and explicitly walk up and back down the containership tree. This is
 fragile because if I decide to rework panel containership, the method
 could fail.
 
 Is there some better way of doing this that I'm missing? A best practice
 for reaching out to siblings and cousins?
 
 Or something more fundamental to trigger refreshes of all componets backed
 by that model? Seems like a common use case. A component updates some
 state as part of ajax event, then wants to use ajax to repaint any other
 components backed by that state.
 
 Interested to hear how others have solved this problem.
 
 -Jason
 

-- 
View this message in context: 
http://www.nabble.com/Best-Practices-for-accessing-repainting-sibling-cousin-components--tf3841514.html#a10883859
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Best Practices for accessing/repainting sibling/cousin components?

2007-05-30 Thread Jonathan Locke


Maybe another way to auto-ajax-update a component would be to have it do
that whenever its model changes.  There are a lot of caveats with model
change notifications, but that seems to be a pretty clean idea if the rules
for model changes were respected.  Might make a good RFE for next Wicket
version.


Jonathan Locke wrote:
 
 
 It shouldn't be hard to write the method you're talking about.  To find
 all the components using the same model as a given component, just walk
 the component hierarchy using visitChildren() and add any component which
 returns true for sameInnermostModel(component).
 
 There is a more general case of this problem though where one area of a
 web page may need to be updated because some completely unrelated area
 changed.  This I'm handling by hand right now, but I was asking a day or
 two ago if there was a way to add a component to every ajax request (Eelco
 answered that you can do this by implementing a request processor, I
 think).  It seems to be pretty common in an AJAX request to want a global
 feedback component to update.  Maybe we could have a poor-man's version of
 this where if you override some boolean method, your component will get
 auto-ajax-updated on every AJAX request. For many problems, this would be
 convenient because it's easier to just update the thing every time than to
 think about all the places it might need to be updated.
 
 
 dukejansen wrote:
 
 I have some state which backs two panels, Panel A and Panel B, that may
 be included as part of other panels. Ultimately they are both on the same
 page, and their backing state is shared via the model class that backs
 both of them. Panel A has an Ajax event handler which modifies the
 backing model state, after which I want to force Panel A and Panel B to
 repaint.
 
 I've dealt with this in a few different ways so far, and they all bother
 me:
 
 1. Walk up the containership tree and back down again until I find the
 panel with a known ID or which implements a specific marker interface,
 finding it that way. (Or do a full DFS of the tree to be thorough.)
 
 2. Assume how my Panel is included and how the other Panel are included,
 and explicitly walk up and back down the containership tree. This is
 fragile because if I decide to rework panel containership, the method
 could fail.
 
 Is there some better way of doing this that I'm missing? A best practice
 for reaching out to siblings and cousins?
 
 Or something more fundamental to trigger refreshes of all componets
 backed by that model? Seems like a common use case. A component updates
 some state as part of ajax event, then wants to use ajax to repaint any
 other components backed by that state.
 
 Interested to hear how others have solved this problem.
 
 -Jason
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Best-Practices-for-accessing-repainting-sibling-cousin-components--tf3841514.html#a10883894
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] modalwindow open fails

2007-05-30 Thread Jonathan Locke


BTW, I know that the AJAX request to open the window is occurring because I
get this 

[15:31:00] INFO  - RequestLogger  -
time=11,event=Interface[target:SendToFriendModalWindow$1(xyz:sendToFriendLink),
page: web.pages.index.IndexPage(6), interface:
IBehaviorListener.onRequest],[EMAIL PROTECTED]
markupIdToComponent [{sendToFriendModalWindow6=[MarkupContainer [Component
id = sendToFriendModalWindow, page = web.pages.index.IndexPage, path =
0:sendToFriendModalWindow.SendToFriendModalWindow, isVisible = true,
isVersioned = false]]}], prependJavascript [[]], appendJavascript [[var
element = document.getElementById(content41);
var settings = new Object();
settings.minWidth=200;
settings.minHeight=200;
settings.className=w_blue;
settings.width=600;
settings.height=400;
settings.resizable=true;
settings.element = element;
settings.mask=semi-transparent;
settings.onCloseButton = function() { var
wcall=wicketAjaxGet('?wicket:interface=:0:sendToFriendModalWindow::IBehaviorListener:0:',
function() { }.bind(this), function() { }.bind(this));return !wcall;};
Wicket.Window.create(settings).show();
]],sessionid=30s4083ks3dhs,sessionsize=96668,sessionstart=Wed May 30
15:13:04 PDT
2007,requests=46,totaltime=1848,activerequests=2,maxmem=532M,total=532M,used=29M



Jonathan Locke wrote:
 
 this may be my problem, but i'm having a bit of trouble with modal windows
 that won't open and wondering if there are any known gotchas or words of
 wisdom for what to look at...
 
 

-- 
View this message in context: 
http://www.nabble.com/modalwindow-open-fails-tf3843250.html#a10883996
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Is it possible to remove something from a page?

2007-05-30 Thread Lowell Kirsh
I making a web page which contains some markup that I'd like to remove
(sometimes). I imagine it would look like:

...
span wicket:id=removeMeHello bW/borld/span
...

Is it possible to remove this markup?

Thanks
Lowell

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Best Practices for accessing/repainting sibling/cousin components?

2007-05-30 Thread James McLaughlin
+1. It can be tedious sometimes  figuring out  how to update
components that are on the other side of the tree from the onClick.

best,
jim

On 5/30/07, Jonathan Locke [EMAIL PROTECTED] wrote:


 Maybe another way to auto-ajax-update a component would be to have it do
 that whenever its model changes.  There are a lot of caveats with model
 change notifications, but that seems to be a pretty clean idea if the rules
 for model changes were respected.  Might make a good RFE for next Wicket
 version.


 Jonathan Locke wrote:
 
 
  It shouldn't be hard to write the method you're talking about.  To find
  all the components using the same model as a given component, just walk
  the component hierarchy using visitChildren() and add any component which
  returns true for sameInnermostModel(component).
 
  There is a more general case of this problem though where one area of a
  web page may need to be updated because some completely unrelated area
  changed.  This I'm handling by hand right now, but I was asking a day or
  two ago if there was a way to add a component to every ajax request (Eelco
  answered that you can do this by implementing a request processor, I
  think).  It seems to be pretty common in an AJAX request to want a global
  feedback component to update.  Maybe we could have a poor-man's version of
  this where if you override some boolean method, your component will get
  auto-ajax-updated on every AJAX request. For many problems, this would be
  convenient because it's easier to just update the thing every time than to
  think about all the places it might need to be updated.
 
 
  dukejansen wrote:
 
  I have some state which backs two panels, Panel A and Panel B, that may
  be included as part of other panels. Ultimately they are both on the same
  page, and their backing state is shared via the model class that backs
  both of them. Panel A has an Ajax event handler which modifies the
  backing model state, after which I want to force Panel A and Panel B to
  repaint.
 
  I've dealt with this in a few different ways so far, and they all bother
  me:
 
  1. Walk up the containership tree and back down again until I find the
  panel with a known ID or which implements a specific marker interface,
  finding it that way. (Or do a full DFS of the tree to be thorough.)
 
  2. Assume how my Panel is included and how the other Panel are included,
  and explicitly walk up and back down the containership tree. This is
  fragile because if I decide to rework panel containership, the method
  could fail.
 
  Is there some better way of doing this that I'm missing? A best practice
  for reaching out to siblings and cousins?
 
  Or something more fundamental to trigger refreshes of all componets
  backed by that model? Seems like a common use case. A component updates
  some state as part of ajax event, then wants to use ajax to repaint any
  other components backed by that state.
 
  Interested to hear how others have solved this problem.
 
  -Jason
 
 
 

 --
 View this message in context: 
 http://www.nabble.com/Best-Practices-for-accessing-repainting-sibling-cousin-components--tf3841514.html#a10883894
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Is it possible to remove something from a page?

2007-05-30 Thread Timo Rantalaiho
On Wed, 30 May 2007, Lowell Kirsh wrote:
 I making a web page which contains some markup that I'd like to remove
 (sometimes). I imagine it would look like:
 
 ...
 span wicket:id=removeMeHello bW/borld/span
 ...
 
 Is it possible to remove this markup?

new WebMarkupContainer(removeMe) {
protected void onBeforeRender() {
super.onBeforeRender();
setVisible(sometimesFalse());
}
}

- Timo
 
-- 
Timo Rantalaiho
Reaktor Innovations OyURL: http://www.ri.fi/ 

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] How to position the panel tab

2007-05-30 Thread Lec

I need some guidance. By default, normally we will see either a panel tab or
multiple tab appear on the far left of the screen. How do we position them (
the panel tabs ) in such a way that they will appear on the far right rather
than the left?
-- 
View this message in context: 
http://www.nabble.com/How-to-position-the-panel-tab-tf3844330.html#a10886908
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Is it possible to remove something from a page?

2007-05-30 Thread Eelco Hillenius
 new WebMarkupContainer(removeMe) {
 protected void onBeforeRender() {
 super.onBeforeRender();
 setVisible(sometimesFalse());
 }
 }

That, or alternatively,

new WebMarkupContainer(removeMe) {
  public boolean isVisible() {
return sometimesFalse();
  }
}

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] modalwindow open fails

2007-05-30 Thread Jonathan Locke


ugh.  looks like this was another session issue (different thing though).

one thing that was helpful in tracking this down was turning on the AJAX
debugging window.


Jonathan Locke wrote:
 
 this may be my problem, but i'm having a bit of trouble with modal windows
 that won't open and wondering if there are any known gotchas or words of
 wisdom for what to look at...
 
 

-- 
View this message in context: 
http://www.nabble.com/modalwindow-open-fails-tf3843250.html#a10887379
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [BUG]script tag evaluation in IE

2007-05-30 Thread Alex Objelean

Not necessarily, only if you (core developers) consider that it worth the
effort..
I just thought that this workaround could be useful for anyone who have
struggled with the same problem... 

Alex


Eelco Hillenius wrote:
 
 2) Wrap the script into the  tag, like this:


   script
 //your script
   /script
 
 Is this something Wicket can/ should do by default?
 
 Eelco
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/-BUG-%3Cscript%3E-tag-evaluation-in-IE-tf3839952.html#a10887903
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user