custom icons on LinkTree nodes?

2007-10-03 Thread wfaler

Hi,
I'm using a LinkTree to display a tree-structure with links in a sidebar.
What do I have to do to get it to display custom icons (on a per node-basis)
in the tree?

Help would be very much appreciated.

/ Wille
-- 
View this message in context: 
http://www.nabble.com/custom-icons-on-LinkTree-nodes--tf4560283.html#a13014231
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: custom icons on LinkTree nodes?

2007-10-03 Thread swaroop belur


If you are referring to open/close images
Try this in ur LinkTree class impl:

protected Component newNodeComponent(String id, IModel model)
{
return new LinkIconPanel(id, model, LinkTree.this)
{
private static final long serialVersionUID = 1L;

protected void onNodeLinkClicked(TreeNode node, 
BaseTree tree,
AjaxRequestTarget target)
{
super.onNodeLinkClicked(node, tree, target);
LinkTree.this.onNodeLinkClicked(node, tree, 
target);
}

@Override
protected ResourceReference 
getResourceFolderOpen(TreeNode node) {
// return ur own resource ref impl for ur 
custom open image
// On per node basis, just use the above
node ref to do ur stuff 
}

   protected ResourceReference
getResourceFolderClosed(TreeNode node)
   {
// return ur own resource ref impl for ur 
custom close image
   }
protected ResourceReference
getResourceItemLeaf(TreeNode node)
{
// return ur own resource ref impl for ur 
custom leaf image
}
};
}


-swaroop


wfaler wrote:
 
 Hi,
 I'm using a LinkTree to display a tree-structure with links in a sidebar.
 What do I have to do to get it to display custom icons (on a per
 node-basis) in the tree?
 
 Help would be very much appreciated.
 
 / Wille
 

-- 
View this message in context: 
http://www.nabble.com/custom-icons-on-LinkTree-nodes--tf4560283.html#a13014455
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Session size is constantly increasing on setResponsePage(getPage())

2007-10-03 Thread Johan Compagner
are you talking about 1.2 or 1.3?

in 1.2 a session could grow a little bit because we have there max 7 pages
that all also can contain some version info.

But as you said when you do setResponsePage(Page.class) everything drops to
normal
that means that you have to use 1.3 because then the newly created page
replaces the old one in the session memory.

But if you set in the link click the same page that the link is on
(setResponsePage(getPage()).  You see a grow?

That seems a bit strange. need to check that out then.

johan


On 10/2/07, Martin2 [EMAIL PROTECTED] wrote:


 Hi there,

 we're developing a rather straight forward application with wicket and I
 am
 wondering if it is ok to call setResponsePage(getPage()) inside the
 onClick() method of a Link? Because the session size is constantly
 increasing, here's my example:

 Application class:

 public class TestApplication extends WebApplication {
public TestApplication() {
super();
}
@Override
public Class getHomePage() {
return TestPage.class;
}
@Override
protected void init() {
super.init();
mountBookmarkablePage(/home, getHomePage());
}
 }

 Page class:

 public class TestPage extends WebPage {
public TestPage() {
super();
setVersioned(false);
add(new TestLink(testLink));
}
@Override
protected void onBeforeRender() {
super.onBeforeRender();
System.err.println(getSession().getSizeInBytes());
}
 }

 Link class:

 public class TestLink extends Link {
public TestLink(String id) {
super(id);
}
@Override
public void onClick() {
setResponsePage(getPage());
}
 }

 Everytime the Link is clicked the session size increases a bit (it may be
 tiny in this test application, it's nevertheless increasing constantly).
 Whenever (this clue comes from testing our real application) a new page is
 constructed (be it via setResponsePage(Page.class) or via url) the session
 size falls back to normal. When an older instance (via back button or
 link)
 is used, the session is as big as before.

 I also noticed that when using TabbedPanel (from wicket-extensions) each
 tab
 change (out of the box) increases the session size much more.

 All our models are LoadableDetachableModels, so our model objects are all
 transient and should never be stored in the session. Of course we use here
 and there a new PropertyModel() and other wrapper models, but only in
 constructors.

 Any suggestion what we could do about it? In the real application the
 increment is about 2-3Kb per click, which will become a problem since the
 application is click-intensive and collaborative (many session at the same
 time).

 Thanks in advance,
 Martin


 --
 View this message in context:
 http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: wicket datetime / YUI calendar

2007-10-03 Thread Nino Saturnino Martinez Vazquez Wael

GREAT!! :)

Thanks. Did you also get the patch for the standalone (always shown) 
calendar commited?


regards Nino

Gerolf Seitz wrote:

On 10/1/07, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]
wrote:
  

Multipage calendar
http://developer.yahoo.com/yui/examples/calendar/calgrp.html
Calendar dates marked with bold
http://developer.yahoo.com/yui/examples/calendar/render.html




Nino,

have a look at WICKET-1030 and WICKET-1031.
both features are in trunk.

Regards,
  Gerolf

  


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



Re: wicket datetime / YUI calendar

2007-10-03 Thread Gerolf Seitz
On 10/3/07, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]
wrote:

 GREAT!! :)

 Thanks. Did you also get the patch for the standalone (always shown)
 calendar commited?


which patch?
do you mean the DatePicker#renderOnLoad and #hideOnSelect thingy? that
should be in.

  gerolf


regards Nino

 Gerolf Seitz wrote:
  On 10/1/07, Nino Saturnino Martinez Vazquez Wael 
 [EMAIL PROTECTED]
  wrote:
 
  Multipage calendar
  http://developer.yahoo.com/yui/examples/calendar/calgrp.html
  Calendar dates marked with bold
  http://developer.yahoo.com/yui/examples/calendar/render.html
 
 
 
  Nino,
 
  have a look at WICKET-1030 and WICKET-1031.
  both features are in trunk.
 
  Regards,
Gerolf
 
 

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




Re: wicket datetime / YUI calendar

2007-10-03 Thread Nino Saturnino Martinez Vazquez Wael

Yup thats the one:)..

Gerolf Seitz wrote:

On 10/3/07, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]
wrote:
  

GREAT!! :)

Thanks. Did you also get the patch for the standalone (always shown)
calendar commited?




which patch?
do you mean the DatePicker#renderOnLoad and #hideOnSelect thingy? that
should be in.

  gerolf


regards Nino
  

Gerolf Seitz wrote:


On 10/1/07, Nino Saturnino Martinez Vazquez Wael 
  

[EMAIL PROTECTED]


wrote:

  

Multipage calendar
http://developer.yahoo.com/yui/examples/calendar/calgrp.html
Calendar dates marked with bold
http://developer.yahoo.com/yui/examples/calendar/render.html




Nino,

have a look at WICKET-1030 and WICKET-1031.
both features are in trunk.

Regards,
  Gerolf


  

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





  


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



Re: Session size is constantly increasing on setResponsePage(getPage())

2007-10-03 Thread Johan Compagner
ok found it, We are leaking auto add html header containers.

Looking to fix it.


On 10/3/07, Johan Compagner [EMAIL PROTECTED] wrote:

 are you talking about 1.2 or 1.3?

 in 1.2 a session could grow a little bit because we have there max 7 pages
 that all also can contain some version info.

 But as you said when you do setResponsePage(Page.class) everything drops
 to normal
 that means that you have to use 1.3 because then the newly created page
 replaces the old one in the session memory.

 But if you set in the link click the same page that the link is on
 (setResponsePage(getPage()).  You see a grow?

 That seems a bit strange. need to check that out then.

 johan


  On 10/2/07, Martin2 [EMAIL PROTECTED] wrote:
 
 
  Hi there,
 
  we're developing a rather straight forward application with wicket and I
  am
  wondering if it is ok to call setResponsePage(getPage()) inside the
  onClick() method of a Link? Because the session size is constantly
  increasing, here's my example:
 
  Application class:
 
  public class TestApplication extends WebApplication {
 public TestApplication() {
 super();
 }
 @Override
 public Class getHomePage() {
 return TestPage.class;
 }
 @Override
 protected void init() {
 super.init();
 mountBookmarkablePage(/home, getHomePage());
 }
  }
 
  Page class:
 
  public class TestPage extends WebPage {
 public TestPage() {
 super();
 setVersioned(false);
 add(new TestLink(testLink));
 }
 @Override
 protected void onBeforeRender() {
 super.onBeforeRender();
 System.err.println(getSession().getSizeInBytes());
 }
  }
 
  Link class:
 
  public class TestLink extends Link {
 public TestLink(String id) {
 super(id);
 }
 @Override
 public void onClick() {
 setResponsePage(getPage());
 }
  }
 
  Everytime the Link is clicked the session size increases a bit (it may
  be
  tiny in this test application, it's nevertheless increasing constantly).
 
  Whenever (this clue comes from testing our real application) a new page
  is
  constructed (be it via setResponsePage(Page.class) or via url) the
  session
  size falls back to normal. When an older instance (via back button or
  link)
  is used, the session is as big as before.
 
  I also noticed that when using TabbedPanel (from wicket-extensions) each
  tab
  change (out of the box) increases the session size much more.
 
  All our models are LoadableDetachableModels, so our model objects are
  all
  transient and should never be stored in the session. Of course we use
  here
  and there a new PropertyModel() and other wrapper models, but only in
  constructors.
 
  Any suggestion what we could do about it? In the real application the
  increment is about 2-3Kb per click, which will become a problem since
  the
  application is click-intensive and collaborative (many session at the
  same
  time).
 
  Thanks in advance,
  Martin
 
 
  --
  View this message in context: 
  http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
 
  Sent from the Wicket - User mailing list archive at 
  Nabble.comhttp://nabble.com/
  .
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Re: Google Maps API

2007-10-03 Thread Martin Funk

hmm..

how do you deploy?

To get a first glimpse, a:

mvn jetty:run

should get the jetty server running and the examples should be visible at:
http://localhost:8080/wicket-contrib-gmap2-examples/

If you want to start it from within Eclipse using the Start class a:

mvn eclipse:clean eclipse:eclipse

cleanly rebuilding eclipses project and classpath files might help.
Also a eclipse classpath variable has to be set up, but eclipse warning 
will guide you to that.


Basically the exception says that that the classes providing the logging 
implementation can't be found,

Log4J, in this case.

Could it be that you are trying to get it started in a geronimo server?
I'm not quite familiar with setting those up, but the Log4J jar has to 
be present on the runtime classpath, WEB-INF/lib if you go by the 
standards, but maybe your container has configuration files for that.


Martin

Ballist1c schrieb:

Ive downloaded and compiled the Gmap2 and examples, however, the examples
don't seem to deploy... there seems to be some low level issue. I have the
latest wicket snapshot so I am assuming that there may be compatibility
issues.

Also the Gmap (original) the SVN provided no long works :(

The problem unfortuantely still exists and even though Gmap2 does not work
deploy, now that i have the code, i can begin to write my own Gmap
implementation.

Its gonna take a while to work through the code, im going to start with a
straight forward method to embed the most simple googlemap in a webpage with
using default Wicket components. Any tips?


SEVERE: error stopping 
org.apache.commons.logging.LogConfigurationException:

org.apache.commons.logging.LogConfigurationException:
java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.Log4JLogger (Caused by
java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.Log4JLogger) (Caused by
org.apache.commons.logging.LogConfigurationException:
java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.Log4JLogger (Caused by
java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.Log4JLogger))
at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370)
at
org.apache.catalina.core.ContainerBase.getLogger(ContainerBase.java:380)
at
org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:3623)
at
org.apache.catalina.core.StandardContext.stop(StandardContext.java:4336)
at
org.apache.catalina.core.StandardContext.preDeregister(StandardContext.java:5068)
at
org.apache.commons.modeler.BaseModelMBean.preDeregister(BaseModelMBean.java:1410)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.preDeregisterInvoke(DefaultMBeanServerInterceptor.java:1048)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:421)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:403)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:506)
at
org.apache.commons.modeler.Registry.unregisterComponent(Registry.java:643)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3960)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493)
at
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1204)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at
org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1377)
at
org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:814)
at
org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:343)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at

Re: pass information through ajax without form

2007-10-03 Thread David Bernard

For a similar case, I override (in MyBehavior)
@Override
public final void respond(AjaxRequestTarget target) {
try {
Request req = RequestCycle.get().getRequest();
String param1 = req.getParameter(param1);
// to stuff
super.respond(target); //??
} catch (RuntimeException exc) {
throw exc;
} catch (Exception exc) {
throw new RuntimeException(wrap:  + exc.getMessage(), exc);
}
}

And you need to override (server or client side) the callbackUrl to add 
parameter.



ywtsang wrote:

How to pass information (stored in an attribute of a html tag, or javascript
variable) through ajax without involving form?

e.g. there is an ajax link and after I click this ajax link, an ajax event
is triggered and I want to get the states of other html elements/javascript
states in this ajax event

it is no problem to use form, but we have a restriction that no form is used
(may look weird to all here), so I would like to see if there is workaround
in wicket.


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



Re: pass information through ajax without form

2007-10-03 Thread ywtsang

i have traced the wicket source codes at the place that how it generates the
ajax js like
wcall=wicketAjaxGet('xxx') 
but i don't know exactly what this does, so how to add parameter to the
wicket ajax request?

i can add custom js to the wicket ajax javascript, but how can I pass the
some dynamic js state into that ajax request, e.g. i trigger the ajax
request by a link with AjaxEventBehavior on onclick event.

would you mind show me a simple example?




David Bernard-2 wrote:
 
 For a similar case, I override (in MyBehavior)
  @Override
  public final void respond(AjaxRequestTarget target) {
  try {
  Request req = RequestCycle.get().getRequest();
  String param1 = req.getParameter(param1);
  // to stuff
  super.respond(target); //??
  } catch (RuntimeException exc) {
  throw exc;
  } catch (Exception exc) {
  throw new RuntimeException(wrap:  + exc.getMessage(), exc);
  }
  }
 
 And you need to override (server or client side) the callbackUrl to add
 parameter.
 
 
 
 ywtsang wrote:
 How to pass information (stored in an attribute of a html tag, or
 javascript
 variable) through ajax without involving form?
 
 e.g. there is an ajax link and after I click this ajax link, an ajax
 event
 is triggered and I want to get the states of other html
 elements/javascript
 states in this ajax event
 
 it is no problem to use form, but we have a restriction that no form is
 used
 (may look weird to all here), so I would like to see if there is
 workaround
 in wicket.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/pass-information-through-ajax-without-form-tf4560660.html#a13016592
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: pass information through ajax without form

2007-10-03 Thread David Bernard

Currently I have no simple example :-(
In my case (wicketstuff-jquery),  I've got a link that call a javascript 
function generated (with a template on server side).
In this function :
var wcall = wicketAjaxGet('${callbackUrl}' + 
DnDSortableBehavior.asQueryString(), function(){}, function(){});

And the method DnDSortableBehavior.asQueryString() is in charge of formated 
collected state, params,...
var DnDSortableBehavior = {
  ...
  asQueryString : function() {
return 'itemId=' + this.itemId + 'srcContainerId=' + this.srcContainerId + 
'srcPosition=' + this.srcPosition + 'destContainerId='+ this.destContainerId + 
'destPosition=' + this.destPosition;
  }
};

In my case I use jquery to retrieve states, values.

If I've got time this evening, I'll try to create a sample.
Which type of information do you want to send back to server ?

ywtsang wrote:

i have traced the wicket source codes at the place that how it generates the
ajax js like
wcall=wicketAjaxGet('xxx') 
but i don't know exactly what this does, so how to add parameter to the

wicket ajax request?

i can add custom js to the wicket ajax javascript, but how can I pass the
some dynamic js state into that ajax request, e.g. i trigger the ajax
request by a link with AjaxEventBehavior on onclick event.

would you mind show me a simple example?




David Bernard-2 wrote:

For a similar case, I override (in MyBehavior)
 @Override
 public final void respond(AjaxRequestTarget target) {
 try {
 Request req = RequestCycle.get().getRequest();
 String param1 = req.getParameter(param1);
 // to stuff
 super.respond(target); //??
 } catch (RuntimeException exc) {
 throw exc;
 } catch (Exception exc) {
 throw new RuntimeException(wrap:  + exc.getMessage(), exc);
 }
 }

And you need to override (server or client side) the callbackUrl to add
parameter.



ywtsang wrote:

How to pass information (stored in an attribute of a html tag, or
javascript
variable) through ajax without involving form?

e.g. there is an ajax link and after I click this ajax link, an ajax
event
is triggered and I want to get the states of other html
elements/javascript
states in this ajax event

it is no problem to use form, but we have a restriction that no form is
used
(may look weird to all here), so I would like to see if there is
workaround
in wicket.

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







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



Wicket Ajax Debug window - font color

2007-10-03 Thread Daniel Stoch
Hi,

The Wicket Ajax Debug (WAD) window has a background color set to white
but the font color is not set (in wicket-ajax-debug.js) - it uses the
base page defaults. So when I have in css for my page setting like
this: body {color: #FF;} the text in WAD is not visible.

Maybe you should add somewhere in wicket-ajax-debug.js setting like
this: color: black;

PS. I'm using Wicket 1.3.0-beta3.

Best regards,
Daniel

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



Re: pass information through ajax without form

2007-10-03 Thread ywtsang

my case is:

there is a javascript variable (let say var STATE;) that will be updated
througout the client side javascript event

there is a link (for example) that I want to use to pass the STATE through
ajax to server.

in your codes, does client side javascript method
DnDSortableBehavior.asQueryString() generate the query string and append
to the wicketAjaxGet? and you parse the parameters in the server side?

I think you have already given me good hints and I will continue work on
that, thanks very much


David Bernard-2 wrote:
 
 Currently I have no simple example :-(
 In my case (wicketstuff-jquery),  I've got a link that call a javascript
 function generated (with a template on server side).
 In this function :
 var wcall = wicketAjaxGet('${callbackUrl}' +
 DnDSortableBehavior.asQueryString(), function(){}, function(){});
 
 And the method DnDSortableBehavior.asQueryString() is in charge of
 formated collected state, params,...
 var DnDSortableBehavior = {
...
asQueryString : function() {
  return 'itemId=' + this.itemId + 'srcContainerId=' +
 this.srcContainerId + 'srcPosition=' + this.srcPosition +
 'destContainerId='+ this.destContainerId + 'destPosition=' +
 this.destPosition;
}
 };
 
 In my case I use jquery to retrieve states, values.
 
 If I've got time this evening, I'll try to create a sample.
 Which type of information do you want to send back to server ?
 
 ywtsang wrote:
 i have traced the wicket source codes at the place that how it generates
 the
 ajax js like
 wcall=wicketAjaxGet('xxx') 
 but i don't know exactly what this does, so how to add parameter to the
 wicket ajax request?
 
 i can add custom js to the wicket ajax javascript, but how can I pass the
 some dynamic js state into that ajax request, e.g. i trigger the ajax
 request by a link with AjaxEventBehavior on onclick event.
 
 would you mind show me a simple example?
 
 
 
 
 David Bernard-2 wrote:
 For a similar case, I override (in MyBehavior)
  @Override
  public final void respond(AjaxRequestTarget target) {
  try {
  Request req = RequestCycle.get().getRequest();
  String param1 = req.getParameter(param1);
  // to stuff
  super.respond(target); //??
  } catch (RuntimeException exc) {
  throw exc;
  } catch (Exception exc) {
  throw new RuntimeException(wrap:  + exc.getMessage(),
 exc);
  }
  }

 And you need to override (server or client side) the callbackUrl to add
 parameter.



 ywtsang wrote:
 How to pass information (stored in an attribute of a html tag, or
 javascript
 variable) through ajax without involving form?

 e.g. there is an ajax link and after I click this ajax link, an ajax
 event
 is triggered and I want to get the states of other html
 elements/javascript
 states in this ajax event

 it is no problem to use form, but we have a restriction that no form is
 used
 (may look weird to all here), so I would like to see if there is
 workaround
 in wicket.
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



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

-- 
View this message in context: 
http://www.nabble.com/pass-information-through-ajax-without-form-tf4560660.html#a13017389
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: pass information through ajax without form

2007-10-03 Thread David Bernard



ywtsang wrote:

my case is:

there is a javascript variable (let say var STATE;) that will be updated
througout the client side javascript event

there is a link (for example) that I want to use to pass the STATE through
ajax to server.

in your codes, does client side javascript method
DnDSortableBehavior.asQueryString() generate the query string and append
to the wicketAjaxGet?


YES
I think you could use the code sent by swaroop
@Override
public CharSequence getCallbackUrl() {
return super.getCallbackUrl()+STATE=' + 
STATE;
}

protected CharSequence getCallbackScript(boolean 
recordPageVersion,
boolean onlyTargetActivePage){
return getCallbackScript(wicketAjaxGet('
+ getCallbackUrl(), null, null);
}

and you parse the parameters in the server side?


YES with the code sent ealier.



I think you have already given me good hints and I will continue work on
that, thanks very much


David Bernard-2 wrote:

Currently I have no simple example :-(
In my case (wicketstuff-jquery),  I've got a link that call a javascript
function generated (with a template on server side).
In this function :
var wcall = wicketAjaxGet('${callbackUrl}' +
DnDSortableBehavior.asQueryString(), function(){}, function(){});

And the method DnDSortableBehavior.asQueryString() is in charge of
formated collected state, params,...
var DnDSortableBehavior = {
   ...
   asQueryString : function() {
 return 'itemId=' + this.itemId + 'srcContainerId=' +
this.srcContainerId + 'srcPosition=' + this.srcPosition +
'destContainerId='+ this.destContainerId + 'destPosition=' +
this.destPosition;
   }
};

In my case I use jquery to retrieve states, values.

If I've got time this evening, I'll try to create a sample.
Which type of information do you want to send back to server ?

ywtsang wrote:

i have traced the wicket source codes at the place that how it generates
the
ajax js like
wcall=wicketAjaxGet('xxx') 
but i don't know exactly what this does, so how to add parameter to the

wicket ajax request?

i can add custom js to the wicket ajax javascript, but how can I pass the
some dynamic js state into that ajax request, e.g. i trigger the ajax
request by a link with AjaxEventBehavior on onclick event.

would you mind show me a simple example?




David Bernard-2 wrote:

For a similar case, I override (in MyBehavior)
 @Override
 public final void respond(AjaxRequestTarget target) {
 try {
 Request req = RequestCycle.get().getRequest();
 String param1 = req.getParameter(param1);
 // to stuff
 super.respond(target); //??
 } catch (RuntimeException exc) {
 throw exc;
 } catch (Exception exc) {
 throw new RuntimeException(wrap:  + exc.getMessage(),
exc);
 }
 }

And you need to override (server or client side) the callbackUrl to add
parameter.



ywtsang wrote:

How to pass information (stored in an attribute of a html tag, or
javascript
variable) through ajax without involving form?

e.g. there is an ajax link and after I click this ajax link, an ajax
event
is triggered and I want to get the states of other html
elements/javascript
states in this ajax event

it is no problem to use form, but we have a restriction that no form is
used
(may look weird to all here), so I would like to see if there is
workaround
in wicket.

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




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







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



Re: Session size is constantly increasing on setResponsePage(getPage())

2007-10-03 Thread Martin2

Hi,

thanks for the quick response. Should I open a JIRA issue for this or is it
to minor to justify the overhead? 

bw,
Martin





Johan Compagner wrote:
 
 ok found it, We are leaking auto add html header containers.
 
 Looking to fix it.
 
 
 On 10/3/07, Johan Compagner [EMAIL PROTECTED] wrote:

 are you talking about 1.2 or 1.3?

 in 1.2 a session could grow a little bit because we have there max 7
 pages
 that all also can contain some version info.

 But as you said when you do setResponsePage(Page.class) everything drops
 to normal
 that means that you have to use 1.3 because then the newly created page
 replaces the old one in the session memory.

 But if you set in the link click the same page that the link is on
 (setResponsePage(getPage()).  You see a grow?

 That seems a bit strange. need to check that out then.

 johan


  On 10/2/07, Martin2 [EMAIL PROTECTED] wrote:
 
 
  Hi there,
 
  we're developing a rather straight forward application with wicket and
 I
  am
  wondering if it is ok to call setResponsePage(getPage()) inside the
  onClick() method of a Link? Because the session size is constantly
  increasing, here's my example:
 
  Application class:
 
  public class TestApplication extends WebApplication {
 public TestApplication() {
 super();
 }
 @Override
 public Class getHomePage() {
 return TestPage.class;
 }
 @Override
 protected void init() {
 super.init();
 mountBookmarkablePage(/home, getHomePage());
 }
  }
 
  Page class:
 
  public class TestPage extends WebPage {
 public TestPage() {
 super();
 setVersioned(false);
 add(new TestLink(testLink));
 }
 @Override
 protected void onBeforeRender() {
 super.onBeforeRender();
 System.err.println(getSession().getSizeInBytes());
 }
  }
 
  Link class:
 
  public class TestLink extends Link {
 public TestLink(String id) {
 super(id);
 }
 @Override
 public void onClick() {
 setResponsePage(getPage());
 }
  }
 
  Everytime the Link is clicked the session size increases a bit (it may
  be
  tiny in this test application, it's nevertheless increasing
 constantly).
 
  Whenever (this clue comes from testing our real application) a new page
  is
  constructed (be it via setResponsePage(Page.class) or via url) the
  session
  size falls back to normal. When an older instance (via back button or
  link)
  is used, the session is as big as before.
 
  I also noticed that when using TabbedPanel (from wicket-extensions)
 each
  tab
  change (out of the box) increases the session size much more.
 
  All our models are LoadableDetachableModels, so our model objects are
  all
  transient and should never be stored in the session. Of course we use
  here
  and there a new PropertyModel() and other wrapper models, but only in
  constructors.
 
  Any suggestion what we could do about it? In the real application the
  increment is about 2-3Kb per click, which will become a problem since
  the
  application is click-intensive and collaborative (many session at the
  same
  time).
 
  Thanks in advance,
  Martin
 
 
  --
  View this message in context:
 http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
 
  Sent from the Wicket - User mailing list archive at
 Nabble.comhttp://nabble.com/
  .
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 
 

-- 
View this message in context: 
http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13018499
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Adding a Link for a Whole ListItem

2007-10-03 Thread Christopher Gardner
With a ListView is there a way to actually create a Link component
that encompasses the whole ListItem, such that when you click anywhere
on a row the onClick event is fired?  I know you can do this with Ajax
support, but I'm curious if you can do this using the traditional way,
i.e., with a full page refresh.  I don't want to add a click here
button to my row.

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



Re: Session size is constantly increasing on setResponsePage(getPage())

2007-10-03 Thread Gerolf Seitz
i think johan already fixed it in trunk.

gerolf

On 10/3/07, Martin2 [EMAIL PROTECTED] wrote:


 Hi,

 thanks for the quick response. Should I open a JIRA issue for this or is
 it
 to minor to justify the overhead?

 bw,
 Martin





 Johan Compagner wrote:
 
  ok found it, We are leaking auto add html header containers.
 
  Looking to fix it.
 
 
  On 10/3/07, Johan Compagner [EMAIL PROTECTED] wrote:
 
  are you talking about 1.2 or 1.3?
 
  in 1.2 a session could grow a little bit because we have there max 7
  pages
  that all also can contain some version info.
 
  But as you said when you do setResponsePage(Page.class) everything
 drops
  to normal
  that means that you have to use 1.3 because then the newly created page
  replaces the old one in the session memory.
 
  But if you set in the link click the same page that the link is on
  (setResponsePage(getPage()).  You see a grow?
 
  That seems a bit strange. need to check that out then.
 
  johan
 
 
   On 10/2/07, Martin2 [EMAIL PROTECTED] wrote:
  
  
   Hi there,
  
   we're developing a rather straight forward application with wicket
 and
  I
   am
   wondering if it is ok to call setResponsePage(getPage()) inside the
   onClick() method of a Link? Because the session size is constantly
   increasing, here's my example:
  
   Application class:
  
   public class TestApplication extends WebApplication {
  public TestApplication() {
  super();
  }
  @Override
  public Class getHomePage() {
  return TestPage.class;
  }
  @Override
  protected void init() {
  super.init();
  mountBookmarkablePage(/home, getHomePage());
  }
   }
  
   Page class:
  
   public class TestPage extends WebPage {
  public TestPage() {
  super();
  setVersioned(false);
  add(new TestLink(testLink));
  }
  @Override
  protected void onBeforeRender() {
  super.onBeforeRender();
  System.err.println(getSession().getSizeInBytes());
  }
   }
  
   Link class:
  
   public class TestLink extends Link {
  public TestLink(String id) {
  super(id);
  }
  @Override
  public void onClick() {
  setResponsePage(getPage());
  }
   }
  
   Everytime the Link is clicked the session size increases a bit (it
 may
   be
   tiny in this test application, it's nevertheless increasing
  constantly).
  
   Whenever (this clue comes from testing our real application) a new
 page
   is
   constructed (be it via setResponsePage(Page.class) or via url) the
   session
   size falls back to normal. When an older instance (via back button or
   link)
   is used, the session is as big as before.
  
   I also noticed that when using TabbedPanel (from wicket-extensions)
  each
   tab
   change (out of the box) increases the session size much more.
  
   All our models are LoadableDetachableModels, so our model objects are
   all
   transient and should never be stored in the session. Of course we use
   here
   and there a new PropertyModel() and other wrapper models, but only in
   constructors.
  
   Any suggestion what we could do about it? In the real application the
   increment is about 2-3Kb per click, which will become a problem since
   the
   application is click-intensive and collaborative (many session at the
   same
   time).
  
   Thanks in advance,
   Martin
  
  
   --
   View this message in context:
 
 http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
  
   Sent from the Wicket - User mailing list archive at
  Nabble.comhttp://nabble.com/
   .
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13018499
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




How to match File Pattern?

2007-10-03 Thread Edi

Hello Guys,

I have different file patterns like 

*.xls (all the xls files) 
n*.xls (xls file starts with n) - all the xls files starts with n


How can we do this pattern matching in wicket?
Please let me know.

Thanking you.
Regards,
Edi
-- 
View this message in context: 
http://www.nabble.com/How-to-match-File-Pattern--tf4561817.html#a13018908
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Adding a Link for a Whole ListItem

2007-10-03 Thread Maurice Marrink
Yes you can, The trick is to extend ListItem and have it implement
ILinkListener you can then add the onclick behavior through an
attributemodifier or override oncomponenttag. To prevent having to
make a subclass per page you should make the onLinkClicked method in
your listitem redirect to a method in your listview.

I could show you our code but it is cluttered with non relevant code,
and the above really says it all.

Maurice

On 10/3/07, Christopher Gardner [EMAIL PROTECTED] wrote:
 With a ListView is there a way to actually create a Link component
 that encompasses the whole ListItem, such that when you click anywhere
 on a row the onClick event is fired?  I know you can do this with Ajax
 support, but I'm curious if you can do this using the traditional way,
 i.e., with a full page refresh.  I don't want to add a click here
 button to my row.

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



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



Re: Session size is constantly increasing on setResponsePage(getPage())

2007-10-03 Thread Johan Compagner
jip, but open and close a jira if you want to have this in the change list..

On 10/3/07, Gerolf Seitz [EMAIL PROTECTED] wrote:

 i think johan already fixed it in trunk.

 gerolf

 On 10/3/07, Martin2 [EMAIL PROTECTED] wrote:
 
 
  Hi,
 
  thanks for the quick response. Should I open a JIRA issue for this or is
  it
  to minor to justify the overhead?
 
  bw,
  Martin
 
 
 
 
 
  Johan Compagner wrote:
  
   ok found it, We are leaking auto add html header containers.
  
   Looking to fix it.
  
  
   On 10/3/07, Johan Compagner [EMAIL PROTECTED] wrote:
  
   are you talking about 1.2 or 1.3?
  
   in 1.2 a session could grow a little bit because we have there max 7
   pages
   that all also can contain some version info.
  
   But as you said when you do setResponsePage(Page.class) everything
  drops
   to normal
   that means that you have to use 1.3 because then the newly created
 page
   replaces the old one in the session memory.
  
   But if you set in the link click the same page that the link is on
   (setResponsePage(getPage()).  You see a grow?
  
   That seems a bit strange. need to check that out then.
  
   johan
  
  
On 10/2/07, Martin2 [EMAIL PROTECTED] wrote:
   
   
Hi there,
   
we're developing a rather straight forward application with wicket
  and
   I
am
wondering if it is ok to call setResponsePage(getPage()) inside the
onClick() method of a Link? Because the session size is constantly
increasing, here's my example:
   
Application class:
   
public class TestApplication extends WebApplication {
   public TestApplication() {
   super();
   }
   @Override
   public Class getHomePage() {
   return TestPage.class;
   }
   @Override
   protected void init() {
   super.init();
   mountBookmarkablePage(/home, getHomePage());
   }
}
   
Page class:
   
public class TestPage extends WebPage {
   public TestPage() {
   super();
   setVersioned(false);
   add(new TestLink(testLink));
   }
   @Override
   protected void onBeforeRender() {
   super.onBeforeRender();
   System.err.println(getSession().getSizeInBytes());
   }
}
   
Link class:
   
public class TestLink extends Link {
   public TestLink(String id) {
   super(id);
   }
   @Override
   public void onClick() {
   setResponsePage(getPage());
   }
}
   
Everytime the Link is clicked the session size increases a bit (it
  may
be
tiny in this test application, it's nevertheless increasing
   constantly).
   
Whenever (this clue comes from testing our real application) a new
  page
is
constructed (be it via setResponsePage(Page.class) or via url) the
session
size falls back to normal. When an older instance (via back button
 or
link)
is used, the session is as big as before.
   
I also noticed that when using TabbedPanel (from wicket-extensions)
   each
tab
change (out of the box) increases the session size much more.
   
All our models are LoadableDetachableModels, so our model objects
 are
all
transient and should never be stored in the session. Of course we
 use
here
and there a new PropertyModel() and other wrapper models, but only
 in
constructors.
   
Any suggestion what we could do about it? In the real application
 the
increment is about 2-3Kb per click, which will become a problem
 since
the
application is click-intensive and collaborative (many session at
 the
same
time).
   
Thanks in advance,
Martin
   
   
--
View this message in context:
  
 
 http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
   
Sent from the Wicket - User mailing list archive at
   Nabble.comhttp://nabble.com/
.
   
   
   
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13018499
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



CompoundPropertyModel stops working when form validation fails.

2007-10-03 Thread Fabio Fioretti
Hi all,

thanks for your time and for keeping up this precious users' list.

I have a page with a page-global currentRecommendation variable. The
instance of this variable is updated by selecting one of the entries
of a ListChoice; basically, the ListChoice deals with a list of
recommendations instances and sets currentRecommendation to the
one selected by the user.

When a recommendation is selected, its data are loaded and displayed
in a recommendationForm (contained in the same page) defined like
this:

recommendationForm = new Form(recommendationForm);

The form contains a custom recommendationPanel which is linked to the
currentRecommendation instance by a CompoundPropertyModel built on
an AbstractReadOnlyModel, just like this:

IModel recommendationModel = new AbstractReadOnlyModel() {
@Override
public Object getObject(Component component) {
return currentRecommendation;
}
};

recommendationPanel = new CustomPanel(recommendationPanel, new
CompoundPropertyModel(recommendationModel));

The problem is that when the form is submitted and validation *fails*,
the CompoundPropertyModel of the recommendationPanel seems to
disconnect from the currentRecommendation instance, because clicking
on a different entry of the ListChoice mentioned above still refreshes
the form but doesn't update the data contained in it anymore.
In other words, the underlying currentRecommendation instance keeps
changing correctly on ListChoice selection change (and the
AbstractReadOnlyModel correctly picks up the selected instance), but
the form (i.e. the panel contained in it) keeps displaying the
instance that failed validation and doesn't show the newly selected
recommendation instance anymore.
The whole thing happens only when form validation fails.

What am I missing?


Thanks a lot for your help,

Fabio Fioretti - WindoM

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



Re: Session size is constantly increasing on setResponsePage(getPage())

2007-10-03 Thread Martin2

I'm using trunk right now and the issue is resolved, the session size does
not increase anymore when setting the response page. Since this was a
critical one on our issue tracking, thanks for the quick fix.

I opened jira  https://issues.apache.org/jira/browse/WICKET-1036 WICKET-1036 
and I'll close it then.

bw,
Martin


Johan Compagner wrote:
 
 jip, but open and close a jira if you want to have this in the change
 list..
 
 On 10/3/07, Gerolf Seitz [EMAIL PROTECTED] wrote:

 i think johan already fixed it in trunk.

 gerolf

 On 10/3/07, Martin2 [EMAIL PROTECTED] wrote:
 
 
  Hi,
 
  thanks for the quick response. Should I open a JIRA issue for this or
 is
  it
  to minor to justify the overhead?
 
  bw,
  Martin
 
 
 
 
 
  Johan Compagner wrote:
  
   ok found it, We are leaking auto add html header containers.
  
   Looking to fix it.
  
  
   On 10/3/07, Johan Compagner [EMAIL PROTECTED] wrote:
  
   are you talking about 1.2 or 1.3?
  
   in 1.2 a session could grow a little bit because we have there max 7
   pages
   that all also can contain some version info.
  
   But as you said when you do setResponsePage(Page.class) everything
  drops
   to normal
   that means that you have to use 1.3 because then the newly created
 page
   replaces the old one in the session memory.
  
   But if you set in the link click the same page that the link is on
   (setResponsePage(getPage()).  You see a grow?
  
   That seems a bit strange. need to check that out then.
  
   johan
  
  
On 10/2/07, Martin2 [EMAIL PROTECTED] wrote:
   
   
Hi there,
   
we're developing a rather straight forward application with wicket
  and
   I
am
wondering if it is ok to call setResponsePage(getPage()) inside
 the
onClick() method of a Link? Because the session size is constantly
increasing, here's my example:
   
Application class:
   
public class TestApplication extends WebApplication {
   public TestApplication() {
   super();
   }
   @Override
   public Class getHomePage() {
   return TestPage.class;
   }
   @Override
   protected void init() {
   super.init();
   mountBookmarkablePage(/home, getHomePage());
   }
}
   
Page class:
   
public class TestPage extends WebPage {
   public TestPage() {
   super();
   setVersioned(false);
   add(new TestLink(testLink));
   }
   @Override
   protected void onBeforeRender() {
   super.onBeforeRender();
   System.err.println(getSession().getSizeInBytes());
   }
}
   
Link class:
   
public class TestLink extends Link {
   public TestLink(String id) {
   super(id);
   }
   @Override
   public void onClick() {
   setResponsePage(getPage());
   }
}
   
Everytime the Link is clicked the session size increases a bit (it
  may
be
tiny in this test application, it's nevertheless increasing
   constantly).
   
Whenever (this clue comes from testing our real application) a new
  page
is
constructed (be it via setResponsePage(Page.class) or via url) the
session
size falls back to normal. When an older instance (via back button
 or
link)
is used, the session is as big as before.
   
I also noticed that when using TabbedPanel (from
 wicket-extensions)
   each
tab
change (out of the box) increases the session size much more.
   
All our models are LoadableDetachableModels, so our model objects
 are
all
transient and should never be stored in the session. Of course we
 use
here
and there a new PropertyModel() and other wrapper models, but only
 in
constructors.
   
Any suggestion what we could do about it? In the real application
 the
increment is about 2-3Kb per click, which will become a problem
 since
the
application is click-intensive and collaborative (many session at
 the
same
time).
   
Thanks in advance,
Martin
   
   
--
View this message in context:
  
 
 http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
   
Sent from the Wicket - User mailing list archive at
   Nabble.comhttp://nabble.com/
.
   
   
   
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13018499
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, 

Re: Graceful handling of ajax after session expiration

2007-10-03 Thread leok

Thanks for the response! I'm not sure if this solves my problem though, or if
I understand this correctly. Even if I use HybridUrlCodingStrategy to mount
the page, I will still get redirected to a Session Expired page if I try
to use any ajax-enabled component. 

A second problem emerges when I get redirected to the Session Expired page,
hit the back button, and attempt to invoke the ajax-enabled component again.
This time Wicket thinks I'm sending the ajax request to the Session Expired
page and redirects me to a plain old error page with a stack trace. 

It'd be nice to be able to register Wicket ajax components in some state
that persists beyond a single user's session. 


Martijn Dashorst wrote:
 
 1.3 has a new URL encoding strategy that would make this somehow
 possible: iirc it is the hybrid url coding strategy, and is for
 instance used at http://thoof.com
 
 The url becomes bookmarkable, and has the page nr and version number
 encoded in the url, but wicket will use the bookmarkable part when
 there is not session.
 
 Martijn
 
 On 10/3/07, leok [EMAIL PROTECTED] wrote:

 Hi there - I'm trying to add some graceful handling of ajax behavior
 during
 session expiration in my Wicket webapp. Is there a way to not redirect to
 the session expired page and invoke some other handler, using either a
 wicket component and/or javascript function, after the session has
 expired?

 Ideally, Ajax calls would continue to function after session expiration.
 I've scanned the list regarding this issue, and I think it makes sense
 for
 certain types of ajax requests, e.g. ajax requests that resemble
 stateless
 form interaction. Is there a way to hack this sort of behavior with
 Wicket?

 Thanks,
 leo
 --
 View this message in context:
 http://www.nabble.com/Graceful-handling-of-ajax-after-session-expiration-tf4559480.html#a13011817
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 
 -- 
 Buy Wicket in Action: http://manning.com/dashorst
 Apache Wicket 1.3.0-beta3 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Graceful-handling-of-ajax-after-session-expiration-tf4559480.html#a13021459
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket Ajax Debug window - font color

2007-10-03 Thread Daniel Stoch
Done: https://issues.apache.org/jira/browse/WICKET-1037

Daniel

On 10/3/07, Matej Knopp [EMAIL PROTECTED] wrote:
 Sure, please add a issue to JIRA.

 thanks.
 -Matej

 On 10/3/07, Daniel Stoch [EMAIL PROTECTED] wrote:
  Hi,
 
  The Wicket Ajax Debug (WAD) window has a background color set to white
  but the font color is not set (in wicket-ajax-debug.js) - it uses the
  base page defaults. So when I have in css for my page setting like
  this: body {color: #FF;} the text in WAD is not visible.
 
  Maybe you should add somewhere in wicket-ajax-debug.js setting like
  this: color: black;
 
  PS. I'm using Wicket 1.3.0-beta3.
 
  Best regards,
  Daniel
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



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



Re: CompoundPropertyModel stops working when form validation fails.

2007-10-03 Thread Martin-2

Hi,

if I understand correctly, the page variable and the panel model should
always point to the same thing. I suggest you give your page a model with
currentRecommendation as model object. Then construct your panel with the
same model instance as the page (or wrap it with an IChainingModel) and get
rid of the page wide variable. The form's onSubmit() would be like:

selectedValue = obtainSelectedValue();
getPage().getModel().setObject(selectedValue);
setResponsePage(getPage());

so setting the page's model object to the choice the user selected, and only
setting it if validation succeeds. This is what we do in a similar case, we
got one listChoice that controls the whole page and so a lot of components.

hope that helps,
Martin


Fabio Fioretti wrote:
 
 Hi all,
 
 thanks for your time and for keeping up this precious users' list.
 
 I have a page with a page-global currentRecommendation variable. The
 instance of this variable is updated by selecting one of the entries
 of a ListChoice; basically, the ListChoice deals with a list of
 recommendations instances and sets currentRecommendation to the
 one selected by the user.
 
 When a recommendation is selected, its data are loaded and displayed
 in a recommendationForm (contained in the same page) defined like
 this:
 
 recommendationForm = new Form(recommendationForm);
 
 The form contains a custom recommendationPanel which is linked to the
 currentRecommendation instance by a CompoundPropertyModel built on
 an AbstractReadOnlyModel, just like this:
 
 IModel recommendationModel = new AbstractReadOnlyModel() {
 @Override
 public Object getObject(Component component) {
 return currentRecommendation;
 }
 };
 
 recommendationPanel = new CustomPanel(recommendationPanel, new
 CompoundPropertyModel(recommendationModel));
 
 The problem is that when the form is submitted and validation *fails*,
 the CompoundPropertyModel of the recommendationPanel seems to
 disconnect from the currentRecommendation instance, because clicking
 on a different entry of the ListChoice mentioned above still refreshes
 the form but doesn't update the data contained in it anymore.
 In other words, the underlying currentRecommendation instance keeps
 changing correctly on ListChoice selection change (and the
 AbstractReadOnlyModel correctly picks up the selected instance), but
 the form (i.e. the panel contained in it) keeps displaying the
 instance that failed validation and doesn't show the newly selected
 recommendation instance anymore.
 The whole thing happens only when form validation fails.
 
 What am I missing?
 
 
 Thanks a lot for your help,
 
 Fabio Fioretti - WindoM
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/CompoundPropertyModel-stops-working-when-form-validation-fails.-tf4562483.html#a13021884
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Getting started with Hibernate and Wicket

2007-10-03 Thread Neil B. Cohen
I'm trying to learn both Hibernate and Wicket at the same time, and I 
could use a couple of pointers...


I have managed to take the Wicket 'signin' example and added a tiny 
Hibernate database which I can access to extract a 'User' object to 
validate the user's name and password. That works fine...


But now I would like to be able to pull a list of objects (Users) out of 
the database and display them in a table on a new page (with columns 
like 'userName, 'emailAddr', 'Role' etc. etc.) I think I can get the 
list of data from the database using Hibernate (although I'm not sure 
the best way to manage a table if it has thousands of rows, which mine 
will eventually have...) But I'm not sure how to set up the Wicket page 
to display that data. Can someone point me at some simple table examples 
that would do that??


thanks very much,

nbc


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



Re: CompoundPropertyModel stops working when form validation fails.

2007-10-03 Thread Fabio Fioretti
On 10/3/07, Martin-2 [EMAIL PROTECTED] wrote:

 Hi,

Hi, thanks for the quick reply.

 if I understand correctly, the page variable and the panel model should
 always point to the same thing.

Right.

 I suggest you give your page a model with
 currentRecommendation as model object. Then construct your panel with the
 same model instance as the page (or wrap it with an IChainingModel) and get
 rid of the page wide variable.

I can't do that because my page is rather complex and it deals with at
least two different kinds of objects. That's why I choose to have the
currentRecommendation page variable instead, and a panel inside the
related form that deals with the variable through the
CompoundPropertyModel.

 The form's onSubmit() would be like:

 selectedValue = obtainSelectedValue();
 getPage().getModel().setObject(selectedValue);
 setResponsePage(getPage());

 so setting the page's model object to the choice the user selected, and only
 setting it if validation succeeds.

I don't think this could solve my problem because:
1) I don't want the whole page to be refreshed or reloaded but only
the panel that deals with currentRecommendation;
2) more important, I don't want the panel to be refreshed only if
validation succeeds; I want it to always reflect user's selection from
the ListChoice, i.e. the currentRecommendation which is the model
object of the panel.

The problem here is that, when form validation fails, the panel (which
is contained in the form) stops responding to user's selections on the
ListChoice as if its model loses the pointer to currentRecommendation.

I hope I've been clear enough, 'cause it's not so easy to explain...


Thanks a lot for your help!

Fabio Fioretti - WindoM

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



CheckBox is misbehaving...

2007-10-03 Thread V. Jenks

NOTE: I'm stuck at Wicket 1.2.4 and cannot upgrade yet.

I've got a very simple form with an input class that looks like this:


public class PaymentInfoInput implements Serializable
{
private Boolean optedForNewsletter;

.

public Boolean isOptedForNewsletter()
{
return this.optedForNewsletter;
}

public void setOptedForNewsletter(Boolean optedForNewsletter)
{
this.optedForNewsletter = optedForNewsletter;
}
}


When the page loads I load a boolean value into my CheckBox from an entity,
like so:


//model for checkbox value
IModel checkedModel = new 
Model(customer.isOptedForNewsletter());

//newsletter opt-in checkbox
form.add(new CheckBox(optedForNewsletter, checkedModel));


...I've walked through this portion in the debugger, it loads the correct
value.

Now, when I submit the form, regardless of whether or not the CheckBox is
checked, the value is null:


//create form   
final Form form = new Form(paymentInfoForm, new
CompoundPropertyModel(new PaymentInfoInput()));

...

//submit button
form.add(new Button(completeOrderButton)
{
public void onSubmit()
{
try
{
//get form input
PaymentInfoInput input = 
(PaymentInfoInput)form.getModelObject();
Boolean opted =
input.isOptedForNewsletter(); //WHY IS THIS NULL?
}
catch (Exception exp)
{
LogProxy.saveEntry(exp);
}
}
});

...in the HTML:

input type=checkbox wicket:id=optedForNewsletter value=true /


...what's up with that?  I must be missing something painfully simple.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/CheckBox-is-misbehaving...-tf4563018.html#a13022997
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: CompoundPropertyModel stops working when form validation fails.

2007-10-03 Thread Martin-2

Ok, now I undestand better. So if the model of your page is complex, just put
the complex data in a custom model object and then use page.setModel(new
Model(complexObject)). Just move the get/set of your variable into the model
object.

In the form on submit then do

getPage().getModel().getObject().setCurrentRecommendation(selectedValue).

And the panel would be 

new CustomPanel(customPanel, new PropertyModel(getPage().getModel(),
currentRecommendation);

As for refreshing, just replace 

setResponsePage(getPage())

with 

ajaxRequestTarget.addComponent(customPanel);

or whatever you'd like to be updated.

The thing is: it's always better to rely on wicket for state handling and
variable updating. So if two components refer to the same thing, make sure
your model object is the same for both (or a property of the model object).
This keeps your data where it belongs (to the model of MVC) and frees you
from the hassle to deal with update events.

As a last resort, you could put the currentRecommendation to the session,
the brutal php approach ;)

Another thought... The form works until the first time validation failes.
Check if subsequents submits go through onSubmit(). 

bw,
Martin


Fabio Fioretti wrote:
 
 On 10/3/07, Martin-2 [EMAIL PROTECTED] wrote:

 Hi,
 
 Hi, thanks for the quick reply.
 
 if I understand correctly, the page variable and the panel model should
 always point to the same thing.
 
 Right.
 
 I suggest you give your page a model with
 currentRecommendation as model object. Then construct your panel with the
 same model instance as the page (or wrap it with an IChainingModel) and
 get
 rid of the page wide variable.
 
 I can't do that because my page is rather complex and it deals with at
 least two different kinds of objects. That's why I choose to have the
 currentRecommendation page variable instead, and a panel inside the
 related form that deals with the variable through the
 CompoundPropertyModel.
 
 The form's onSubmit() would be like:

 selectedValue = obtainSelectedValue();
 getPage().getModel().setObject(selectedValue);
 setResponsePage(getPage());

 so setting the page's model object to the choice the user selected, and
 only
 setting it if validation succeeds.
 
 I don't think this could solve my problem because:
 1) I don't want the whole page to be refreshed or reloaded but only
 the panel that deals with currentRecommendation;
 2) more important, I don't want the panel to be refreshed only if
 validation succeeds; I want it to always reflect user's selection from
 the ListChoice, i.e. the currentRecommendation which is the model
 object of the panel.
 
 The problem here is that, when form validation fails, the panel (which
 is contained in the form) stops responding to user's selections on the
 ListChoice as if its model loses the pointer to currentRecommendation.
 
 I hope I've been clear enough, 'cause it's not so easy to explain...
 
 
 Thanks a lot for your help!
 
 Fabio Fioretti - WindoM
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/CompoundPropertyModel-stops-working-when-form-validation-fails.-tf4562483.html#a13023833
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Getting started with Hibernate and Wicket

2007-10-03 Thread Landry Soules

You will find good examples here :

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

and

http://cwiki.apache.org/WICKET/reading-from-a-database.html


Neil B. Cohen a écrit :
I'm trying to learn both Hibernate and Wicket at the same time, and I 
could use a couple of pointers...


I have managed to take the Wicket 'signin' example and added a tiny 
Hibernate database which I can access to extract a 'User' object to 
validate the user's name and password. That works fine...


But now I would like to be able to pull a list of objects (Users) out 
of the database and display them in a table on a new page (with 
columns like 'userName, 'emailAddr', 'Role' etc. etc.) I think I can 
get the list of data from the database using Hibernate (although I'm 
not sure the best way to manage a table if it has thousands of rows, 
which mine will eventually have...) But I'm not sure how to set up the 
Wicket page to display that data. Can someone point me at some simple 
table examples that would do that??


thanks very much,

nbc


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





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



Re: CompoundPropertyModel stops working when form validation fails.

2007-10-03 Thread anita nichols
How do I use datagrid on wicket?
I tried the datagrid sample on wicket 1.2 is sooo confusing.

Any sugestion where to look


Re: Getting started with Hibernate and Wicket

2007-10-03 Thread Alexandre Bairos
http://databinder.net does a good job.

On 10/3/07, Neil B. Cohen [EMAIL PROTECTED] wrote:

 I'm trying to learn both Hibernate and Wicket at the same time, and I
 could use a couple of pointers...

 I have managed to take the Wicket 'signin' example and added a tiny
 Hibernate database which I can access to extract a 'User' object to
 validate the user's name and password. That works fine...

 But now I would like to be able to pull a list of objects (Users) out of
 the database and display them in a table on a new page (with columns
 like 'userName, 'emailAddr', 'Role' etc. etc.) I think I can get the
 list of data from the database using Hibernate (although I'm not sure
 the best way to manage a table if it has thousands of rows, which mine
 will eventually have...) But I'm not sure how to set up the Wicket page
 to display that data. Can someone point me at some simple table examples
 that would do that??

 thanks very much,

 nbc


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




Re: CheckBox is misbehaving...

2007-10-03 Thread V. Jenks

I apologize if this is a dumb question but can anyone offer any advice?  A
work-around would be fine, if necessary.  I'm unable to figure this thing
out.  It's the last issue before I can put my app into production today.

Thanks!


V. Jenks wrote:
 
 NOTE: I'm stuck at Wicket 1.2.4 and cannot upgrade yet.
 
 I've got a very simple form with an input class that looks like this:
 
 
 public class PaymentInfoInput implements Serializable
 {
   private Boolean optedForNewsletter;
 
 .
 
   public Boolean isOptedForNewsletter()
   {
   return this.optedForNewsletter;
   }
   
   public void setOptedForNewsletter(Boolean optedForNewsletter)
   {
   this.optedForNewsletter = optedForNewsletter;
   }
 }
 
 
 When the page loads I load a boolean value into my CheckBox from an
 entity, like so:
 
 
   //model for checkbox value
   IModel checkedModel = new 
 Model(customer.isOptedForNewsletter());
   
   //newsletter opt-in checkbox
   form.add(new CheckBox(optedForNewsletter, checkedModel));
 
 
 ...I've walked through this portion in the debugger, it loads the correct
 value.
 
 Now, when I submit the form, regardless of whether or not the CheckBox is
 checked, the value is null:
 
 
   //create form   
   final Form form = new Form(paymentInfoForm, new
 CompoundPropertyModel(new PaymentInfoInput()));
 
 ...
 
   //submit button
   form.add(new Button(completeOrderButton)
   {
   public void onSubmit()
   {
   try
   {
   //get form input
   PaymentInfoInput input = 
 (PaymentInfoInput)form.getModelObject();
 Boolean opted =
 input.isOptedForNewsletter(); //WHY IS THIS NULL?
   }
   catch (Exception exp)
   {
   LogProxy.saveEntry(exp);
   }
   }
   });
 
 ...in the HTML:
 
 input type=checkbox wicket:id=optedForNewsletter value=true /
 
 
 ...what's up with that?  I must be missing something painfully simple.
 
 Thanks!
 

-- 
View this message in context: 
http://www.nabble.com/CheckBox-is-misbehaving...-tf4563018.html#a13025097
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: CheckBox is misbehaving...

2007-10-03 Thread Igor Vaynberg
you are not tying your checkbox's model to the form's model object so it
saves into its own model..

as you can see here:
IModel checkedModel = new Model(customer.isOptedForNewsletter());
form.add(new CheckBox(optedForNewsletter, checkedModel));
you are giving it its own model...

so in your onsubmit you have to call checkbox.getmodelobject() to retrieve
the value, or give it a model that is properly tied to the form's model
object via a propertymodel or something else

-igor


On 10/3/07, V. Jenks [EMAIL PROTECTED] wrote:


 NOTE: I'm stuck at Wicket 1.2.4 and cannot upgrade yet.

 I've got a very simple form with an input class that looks like this:

 
 public class PaymentInfoInput implements Serializable
 {
 private Boolean optedForNewsletter;

 .

 public Boolean isOptedForNewsletter()
 {
 return this.optedForNewsletter;
 }

 public void setOptedForNewsletter(Boolean optedForNewsletter)
 {
 this.optedForNewsletter = optedForNewsletter;
 }
 }
 

 When the page loads I load a boolean value into my CheckBox from an
 entity,
 like so:

 
 //model for checkbox value
 IModel checkedModel = new Model(
 customer.isOptedForNewsletter());

 //newsletter opt-in checkbox
 form.add(new CheckBox(optedForNewsletter,
 checkedModel));
 

 ...I've walked through this portion in the debugger, it loads the correct
 value.

 Now, when I submit the form, regardless of whether or not the CheckBox is
 checked, the value is null:

 
 //create form
 final Form form = new Form(paymentInfoForm, new
 CompoundPropertyModel(new PaymentInfoInput()));

 ...

 //submit button
 form.add(new Button(completeOrderButton)
 {
 public void onSubmit()
 {
 try
 {
 //get form input
 PaymentInfoInput input =
 (PaymentInfoInput)form.getModelObject();
 Boolean opted =
 input.isOptedForNewsletter(); //WHY IS THIS NULL?
 }
 catch (Exception exp)
 {
 LogProxy.saveEntry(exp);
 }
 }
 });

 ...in the HTML:

 input type=checkbox wicket:id=optedForNewsletter value=true /
 

 ...what's up with that?  I must be missing something painfully simple.

 Thanks!
 --
 View this message in context:
 http://www.nabble.com/CheckBox-is-misbehaving...-tf4563018.html#a13022997
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: Adding a Link for a Whole ListItem

2007-10-03 Thread Christopher Gardner
Thank you.  I got this to work.  Now I'm wondering how the
ILinkListener gets registered to pick up the event.  Does anything
that happens to implement that interface automatically get registered?

On 10/3/07, Martijn Dashorst [EMAIL PROTECTED] wrote:
 Yes, but odds are you already had to do that, to override populateItem().

 Martijn

 On 10/3/07, Christopher Gardner [EMAIL PROTECTED] wrote:
  Do you also have to subclass ListView (overriding newItem()) to create
  an object of the ListItem subclass?
 
  On 10/3/07, Maurice Marrink [EMAIL PROTECTED] wrote:
   Yes you can, The trick is to extend ListItem and have it implement
   ILinkListener you can then add the onclick behavior through an
   attributemodifier or override oncomponenttag. To prevent having to
   make a subclass per page you should make the onLinkClicked method in
   your listitem redirect to a method in your listview.
  
   I could show you our code but it is cluttered with non relevant code,
   and the above really says it all.
  
   Maurice
  
   On 10/3/07, Christopher Gardner [EMAIL PROTECTED] wrote:
With a ListView is there a way to actually create a Link component
that encompasses the whole ListItem, such that when you click anywhere
on a row the onClick event is fired?  I know you can do this with Ajax
support, but I'm curious if you can do this using the traditional way,
i.e., with a full page refresh.  I don't want to add a click here
button to my row.
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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

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



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



Dumb question about page transfer

2007-10-03 Thread Neil B. Cohen
Ok - I'm feeling kind of stupid at the moment, but I'm missing something 
basic here...


I have a Wicket web page displayed with a button on it. When I click the 
button, the onSubmit routine fires
and my java code logs a message so I know it is working. But from there, 
I want to transfer to another
page, and I don't see how to specify that. I'm sure I'm looking at the 
forest and missing the tree, but I'd appreciate it if someone would aim 
me in the right direction...


thanks,

nbc


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



Re: Dumb question about page transfer

2007-10-03 Thread Igor Vaynberg
onsubmit() {
 setresponsepage(MyPage.class);
 or
  setresponsepage(new MyPage(...));
}

-igor


On 10/3/07, Neil B. Cohen [EMAIL PROTECTED] wrote:

 Ok - I'm feeling kind of stupid at the moment, but I'm missing something
 basic here...

 I have a Wicket web page displayed with a button on it. When I click the
 button, the onSubmit routine fires
 and my java code logs a message so I know it is working. But from there,
 I want to transfer to another
 page, and I don't see how to specify that. I'm sure I'm looking at the
 forest and missing the tree, but I'd appreciate it if someone would aim
 me in the right direction...

 thanks,

 nbc


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




Re: Dumb question about page transfer

2007-10-03 Thread Nick Heudecker
You're looking for the setResponsePage(...) methods.

On 10/3/07, Neil B. Cohen [EMAIL PROTECTED] wrote:

 Ok - I'm feeling kind of stupid at the moment, but I'm missing something
 basic here...

 I have a Wicket web page displayed with a button on it. When I click the
 button, the onSubmit routine fires
 and my java code logs a message so I know it is working. But from there,
 I want to transfer to another
 page, and I don't see how to specify that. I'm sure I'm looking at the
 forest and missing the tree, but I'd appreciate it if someone would aim
 me in the right direction...

 thanks,

 nbc


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




-- 
Nick Heudecker
Professional Wicket Training  Consulting
http://www.systemmobile.com

Eventful - Intelligent Event Management
http://www.eventfulhq.com


Re: Dumb question about page transfer

2007-10-03 Thread Neil B. Cohen

Igor Vaynberg wrote:

onsubmit() {
 setresponsepage(MyPage.class);
 or
  setresponsepage(new MyPage(...));
}

-igor
  


Thanks for the quick response...

Much obliged,

nbc


On 10/3/07, Neil B. Cohen [EMAIL PROTECTED] wrote:
  

Ok - I'm feeling kind of stupid at the moment, but I'm missing something
basic here...

I have a Wicket web page displayed with a button on it. When I click the
button, the onSubmit routine fires
and my java code logs a message so I know it is working. But from there,
I want to transfer to another
page, and I don't see how to specify that. I'm sure I'm looking at the
forest and missing the tree, but I'd appreciate it if someone would aim
me in the right direction...

thanks,

nbc


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





  



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



Re: CheckBox is misbehaving...

2007-10-03 Thread V. Jenks

Ah ha, that makes sense...I understand now.  I reorganized the code so I
could pre-load the input class first and it works.

Thanks much!


igor.vaynberg wrote:
 
 you are not tying your checkbox's model to the form's model object so it
 saves into its own model..
 
 as you can see here:
 IModel checkedModel = new Model(customer.isOptedForNewsletter());
 form.add(new CheckBox(optedForNewsletter, checkedModel));
 you are giving it its own model...
 
 so in your onsubmit you have to call checkbox.getmodelobject() to retrieve
 the value, or give it a model that is properly tied to the form's model
 object via a propertymodel or something else
 
 -igor
 
 
 On 10/3/07, V. Jenks [EMAIL PROTECTED] wrote:


 NOTE: I'm stuck at Wicket 1.2.4 and cannot upgrade yet.

 I've got a very simple form with an input class that looks like this:

 
 public class PaymentInfoInput implements Serializable
 {
 private Boolean optedForNewsletter;

 .

 public Boolean isOptedForNewsletter()
 {
 return this.optedForNewsletter;
 }

 public void setOptedForNewsletter(Boolean optedForNewsletter)
 {
 this.optedForNewsletter = optedForNewsletter;
 }
 }
 

 When the page loads I load a boolean value into my CheckBox from an
 entity,
 like so:

 
 //model for checkbox value
 IModel checkedModel = new Model(
 customer.isOptedForNewsletter());

 //newsletter opt-in checkbox
 form.add(new CheckBox(optedForNewsletter,
 checkedModel));
 

 ...I've walked through this portion in the debugger, it loads the correct
 value.

 Now, when I submit the form, regardless of whether or not the CheckBox is
 checked, the value is null:

 
 //create form
 final Form form = new Form(paymentInfoForm, new
 CompoundPropertyModel(new PaymentInfoInput()));

 ...

 //submit button
 form.add(new Button(completeOrderButton)
 {
 public void onSubmit()
 {
 try
 {
 //get form input
 PaymentInfoInput input =
 (PaymentInfoInput)form.getModelObject();
 Boolean opted =
 input.isOptedForNewsletter(); //WHY IS THIS NULL?
 }
 catch (Exception exp)
 {
 LogProxy.saveEntry(exp);
 }
 }
 });

 ...in the HTML:

 input type=checkbox wicket:id=optedForNewsletter value=true /
 

 ...what's up with that?  I must be missing something painfully simple.

 Thanks!
 --
 View this message in context:
 http://www.nabble.com/CheckBox-is-misbehaving...-tf4563018.html#a13022997
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/CheckBox-is-misbehaving...-tf4563018.html#a13025669
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Article about Wicket on javamagazin.de

2007-10-03 Thread Gerolf Seitz
for all those who are capable of reading german, here is an article about
wicket on javamagazin.de

http://javamagazin.de/itr/online_artikel/psecom,id,933,nodeid,11.html

i'll add a link to it in the wiki

gerolf


Re: Article about Wicket on javamagazin.de

2007-10-03 Thread Gerolf Seitz
it's also on the frontpage of the magazine.
see
http://javamagazin.de/itr/ausgaben/pspic/bildgross/66/big4700f14df0a73.gif
the second smaller heading right below the jruby heading

oh, and the authors of the article will have a talk at the conference
w-jax07 in germany.

gerolf

On 10/3/07, Gerolf Seitz [EMAIL PROTECTED] wrote:

 for all those who are capable of reading german, here is an article about
 wicket on javamagazin.de

 http://javamagazin.de/itr/online_artikel/psecom,id,933,nodeid,11.html

 i'll add a link to it in the wiki

 gerolf



webpage instance scope?

2007-10-03 Thread dukehoops

Hi,

I'm evaluating Wicket as a potential replacement for JSF and have a question
(tried searching, read wiki):

What is the lifespan of a WebPage / Panel subclass instance? In JSF,
page-backing beans can be request/session/app scoped. I read that Wicket is
an unmanaged framework. Does that mean the objects are request-scoped? 

If so, how how does one implement a session-persistent header (as Panel) +
request-scoped body scenario?

If this is documented in reference, please kindly point me to the specific
section - I could not find anything relevant

thanks
-nikita
-- 
View this message in context: 
http://www.nabble.com/webpage-instance-scope--tf4564224.html#a13027317
Sent from the Wicket - User mailing list archive at Nabble.com.


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



is wicket well-suited for integrating JS widgets?

2007-10-03 Thread dukehoops

I'm a complete newbie to wicket (coming from JSF, Swing world) and am in
process of building small examples as part of framework eval. 

I'm looking for a framework that'd make it easy to integrate arbitrary JS ui
components. Let's say Y!UI  or Script.aculo.us develops a new
super-accordion (or autocomplete 2.0) widget?

Is Wicket designed in a way that'd make integrating this widget relatively
easy? Or is this not considered an important use case?

If it is an important use could, could someone please elaborate why Wicket
has own implementation of an Autocomplete widget (rather than integrating an
existing one)?

thanks
-nikita
-- 
View this message in context: 
http://www.nabble.com/is-wicket-well-suited-for-integrating-JS-widgets--tf4564309.html#a13027622
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Getting started with Hibernate and Wicket

2007-10-03 Thread Tauren Mills
Wicketstuff Phonebook is a good starting place for
wicket/spring/hibernate integration:
http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook



On 10/3/07, Alexandre Bairos [EMAIL PROTECTED] wrote:
 http://databinder.net does a good job.

 On 10/3/07, Neil B. Cohen [EMAIL PROTECTED] wrote:
 
  I'm trying to learn both Hibernate and Wicket at the same time, and I
  could use a couple of pointers...
 
  I have managed to take the Wicket 'signin' example and added a tiny
  Hibernate database which I can access to extract a 'User' object to
  validate the user's name and password. That works fine...
 
  But now I would like to be able to pull a list of objects (Users) out of
  the database and display them in a table on a new page (with columns
  like 'userName, 'emailAddr', 'Role' etc. etc.) I think I can get the
  list of data from the database using Hibernate (although I'm not sure
  the best way to manage a table if it has thousands of rows, which mine
  will eventually have...) But I'm not sure how to set up the Wicket page
  to display that data. Can someone point me at some simple table examples
  that would do that??
 
  thanks very much,
 
  nbc
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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



Re: webpage instance scope?

2007-10-03 Thread Johan Compagner
pages are stored in the session (if they are statefull, that means they have
callbacks)

A stateless page could maybe been seen as a request scope object.

there is no such thing as a combination of those 2.

johan



On 10/3/07, dukehoops [EMAIL PROTECTED] wrote:


 Hi,

 I'm evaluating Wicket as a potential replacement for JSF and have a
 question
 (tried searching, read wiki):

 What is the lifespan of a WebPage / Panel subclass instance? In JSF,
 page-backing beans can be request/session/app scoped. I read that Wicket
 is
 an unmanaged framework. Does that mean the objects are request-scoped?

 If so, how how does one implement a session-persistent header (as Panel) +
 request-scoped body scenario?

 If this is documented in reference, please kindly point me to the specific
 section - I could not find anything relevant

 thanks
 -nikita
 --
 View this message in context:
 http://www.nabble.com/webpage-instance-scope--tf4564224.html#a13027317
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: is wicket well-suited for integrating JS widgets?

2007-10-03 Thread David Bernard

Hi,

It's lot of easier to integrate JS lib with wicket, than with JSF.
I currently work on JQuery's widget. About integration with YUI or Scriptaclus, 
take a look at wicketstuff.org (svn and wiki), there is already some project 
about it.

Regards.

dukehoops wrote:

I'm a complete newbie to wicket (coming from JSF, Swing world) and am in
process of building small examples as part of framework eval. 


I'm looking for a framework that'd make it easy to integrate arbitrary JS ui
components. Let's say Y!UI  or Script.aculo.us develops a new
super-accordion (or autocomplete 2.0) widget?

Is Wicket designed in a way that'd make integrating this widget relatively
easy? Or is this not considered an important use case?

If it is an important use could, could someone please elaborate why Wicket
has own implementation of an Autocomplete widget (rather than integrating an
existing one)?

thanks
-nikita


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



Missing resource parameters for an Image using a ResourceReference

2007-10-03 Thread Doug Leeper

I am using a ResourceReference to access a SharedResource for an Image.  I am
also passing parameters via a ValueMap to obtain the correct image. 
However, when I look at my URL, the parameters are missing.

I traced it to Image.onComponentTag()

code
final ResourceReference resourceReference = 
getImageResourceReference();
if (resourceReference != null)
{

localizedImageResource.setResourceReference(resourceReference);
}
/code

which calls localizedImageResource.setResourceReference( resourceReference,
null ) and therefore clears the parameters.

So either I am doing this all wrong or this is a bug.  Can someone point the
way for me?

Thanks

- Doug

BTW...in Image constructor, I am doing the following:

code
public HoleImage( String id, Long golfCourseId, int holeNo ) {
super( id );

ResourceReference ref = new 
ResourceReference(MyOwnGolfApplication.class,
holeOverviewImage);

ValueMap map = new ValueMap();

map.add( golfCourseId, golfCourseId.toString() );
map.add( holeNumber, String.valueOf( holeNo ));

setImageResourceReference( ref, map );
}
/code




-- 
View this message in context: 
http://www.nabble.com/Missing-resource-parameters-for-an-Image-using-a-ResourceReference-tf4564719.html#a13029039
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: webpage instance scope?

2007-10-03 Thread dukehoops

Sorry, I am still a bit unclear:

1.say I go to an app at localhost/MyApp/app
2.App's home page is HomePage.class; its' constructor executes
3.I do browser reload, HomePage's contructor is executed again (so I'm
getting a new object and not one costructed in #2)

How can I get Wicket to reuse object from #2 in step 3?

thanks
-nikita



Johan Compagner wrote:
 
 pages are stored in the session (if they are statefull, that means they
 have
 callbacks)
 
 A stateless page could maybe been seen as a request scope object.
 
 there is no such thing as a combination of those 2.
 
 johan
 
 
 
 On 10/3/07, dukehoops [EMAIL PROTECTED] wrote:


 Hi,

 I'm evaluating Wicket as a potential replacement for JSF and have a
 question
 (tried searching, read wiki):

 What is the lifespan of a WebPage / Panel subclass instance? In JSF,
 page-backing beans can be request/session/app scoped. I read that Wicket
 is
 an unmanaged framework. Does that mean the objects are request-scoped?

 If so, how how does one implement a session-persistent header (as Panel)
 +
 request-scoped body scenario?

 If this is documented in reference, please kindly point me to the
 specific
 section - I could not find anything relevant

 thanks
 -nikita
 --
 View this message in context:
 http://www.nabble.com/webpage-instance-scope--tf4564224.html#a13027317
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/webpage-instance-scope--tf4564224.html#a13029062
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Missing resource parameters for an Image using a ResourceReference

2007-10-03 Thread Doug Leeper

BTW...if I change LocaledImageResource.setResourceReference(
ResourceReference ref ) to the following:


public final void setResourceReference(final ResourceReference
resourceReference)
{
setResourceReference(resourceReference, resourceParameters);
}

Everything works as expected.

Another possible solution would be to expose the parameters in
LocalizedResourceReference (get/set)Parameters.  Then the change could be
limited to Image.onComponentTag()

final ResourceReference resourceReference = 
getImageResourceReference();
if (resourceReference != null)
{

localizedImageResource.setResourceReference(resourceReference,
localizedImageResource.getParameters());
}

BTW...I filed a bug report for this issue 
https://issues.apache.org/jira/browse/WICKET-1039 WICKET-1039 
-- 
View this message in context: 
http://www.nabble.com/Missing-resource-parameters-for-an-Image-using-a-ResourceReference-tf4564719.html#a13029367
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Custom label for number and currency formatting?

2007-10-03 Thread Tauren Mills
Does such a thing exist?  I thought it did, but can't find it now.

Basically, I want a Label that allows me to format floats/doubles as
currency.  I don't need i18n built in (for different currencies,
etc.), just take double x=8.3 and output $8.30.

Any pointers are appreciated!  Thanks.

Tauren

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



Re: Article about Wicket on javamagazin.de

2007-10-03 Thread Eelco Hillenius
Very nice.

Eelco

On 10/3/07, Gerolf Seitz [EMAIL PROTECTED] wrote:
 it's also on the frontpage of the magazine.
 see
 http://javamagazin.de/itr/ausgaben/pspic/bildgross/66/big4700f14df0a73.gif
 the second smaller heading right below the jruby heading

 oh, and the authors of the article will have a talk at the conference
 w-jax07 in germany.

 gerolf

 On 10/3/07, Gerolf Seitz [EMAIL PROTECTED] wrote:
 
  for all those who are capable of reading german, here is an article about
  wicket on javamagazin.de
 
  http://javamagazin.de/itr/online_artikel/psecom,id,933,nodeid,11.html
 
  i'll add a link to it in the wiki
 
  gerolf
 


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



Re: is wicket well-suited for integrating JS widgets?

2007-10-03 Thread Igor Vaynberg
see wiclet-stuff svn repo, there are projects that integrate wicket with
yui, scriptaculous, animator.js, gmap, mootools, openlayers, tinymce, dojo.
if all those projects do it then its not so bad... :)

https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/

-igor




On 10/3/07, dukehoops [EMAIL PROTECTED] wrote:


 I'm a complete newbie to wicket (coming from JSF, Swing world) and am in
 process of building small examples as part of framework eval.

 I'm looking for a framework that'd make it easy to integrate arbitrary JS
 ui
 components. Let's say Y!UI  or Script.aculo.us develops a new
 super-accordion (or autocomplete 2.0) widget?

 Is Wicket designed in a way that'd make integrating this widget relatively

 easy? Or is this not considered an important use case?

 If it is an important use could, could someone please elaborate why Wicket
 has own implementation of an Autocomplete widget (rather than integrating
 an
 existing one)?

 thanks
 -nikita
 --
 View this message in context: 
 http://www.nabble.com/is-wicket-well-suited-for-integrating-JS-widgets--tf4564309.html#a13027622

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


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




Re: Google Maps API

2007-10-03 Thread Ballist1c

Ah that might explain it... ive attempted to deploy it in the current
Netbeans IDE im using with the crappy tomcat integrated server (v5.5 or
osmething i think) 

My main project is destined to run on a base tomcat server at the moment,
and as a team we are not considering adding any other containers or
extensions to tomcat just yet... :(

so whatever googlemap implementation i use.. or googmap implementation i
create, will need to run on tomcat. :S... 


martinf wrote:
 
 hmm..
 
 how do you deploy?
 
 To get a first glimpse, a:
 
 mvn jetty:run
 
 should get the jetty server running and the examples should be visible at:
 http://localhost:8080/wicket-contrib-gmap2-examples/
 
 If you want to start it from within Eclipse using the Start class a:
 
 mvn eclipse:clean eclipse:eclipse
 
 cleanly rebuilding eclipses project and classpath files might help.
 Also a eclipse classpath variable has to be set up, but eclipse warning 
 will guide you to that.
 
 Basically the exception says that that the classes providing the logging 
 implementation can't be found,
 Log4J, in this case.
 
 Could it be that you are trying to get it started in a geronimo server?
 I'm not quite familiar with setting those up, but the Log4J jar has to 
 be present on the runtime classpath, WEB-INF/lib if you go by the 
 standards, but maybe your container has configuration files for that.
 
 Martin
 
 Ballist1c schrieb:
 Ive downloaded and compiled the Gmap2 and examples, however, the examples
 don't seem to deploy... there seems to be some low level issue. I have
 the
 latest wicket snapshot so I am assuming that there may be compatibility
 issues.

 Also the Gmap (original) the SVN provided no long works :(

 The problem unfortuantely still exists and even though Gmap2 does not
 work
 deploy, now that i have the code, i can begin to write my own Gmap
 implementation.

 Its gonna take a while to work through the code, im going to start with a
 straight forward method to embed the most simple googlemap in a webpage
 with
 using default Wicket components. Any tips?


 SEVERE: error stopping 
 org.apache.commons.logging.LogConfigurationException:
 org.apache.commons.logging.LogConfigurationException:
 java.lang.ClassNotFoundException:
 org.apache.commons.logging.impl.Log4JLogger (Caused by
 java.lang.ClassNotFoundException:
 org.apache.commons.logging.impl.Log4JLogger) (Caused by
 org.apache.commons.logging.LogConfigurationException:
 java.lang.ClassNotFoundException:
 org.apache.commons.logging.impl.Log4JLogger (Caused by
 java.lang.ClassNotFoundException:
 org.apache.commons.logging.impl.Log4JLogger))
 at
 org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
 at
 org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
 at
 org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370)
 at
 org.apache.catalina.core.ContainerBase.getLogger(ContainerBase.java:380)
 at
 org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:3623)
 at
 org.apache.catalina.core.StandardContext.stop(StandardContext.java:4336)
 at
 org.apache.catalina.core.StandardContext.preDeregister(StandardContext.java:5068)
 at
 org.apache.commons.modeler.BaseModelMBean.preDeregister(BaseModelMBean.java:1410)
 at
 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.preDeregisterInvoke(DefaultMBeanServerInterceptor.java:1048)
 at
 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:421)
 at
 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:403)
 at
 com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:506)
 at
 org.apache.commons.modeler.Registry.unregisterComponent(Registry.java:643)
 at
 org.apache.catalina.core.StandardContext.start(StandardContext.java:3960)
 at
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
 at
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
 at
 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
 at
 org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
 at
 org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493)
 at
 org.apache.catalina.startup.HostConfig.check(HostConfig.java:1204)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at
 org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
 at
 

Re: webpage instance scope?

2007-10-03 Thread Eelco Hillenius
 1.say I go to an app at localhost/MyApp/app
 2.App's home page is HomePage.class; its' constructor executes
 3.I do browser reload, HomePage's contructor is executed again (so I'm
 getting a new object and not one costructed in #2)

Your home page is a bookmarkable page (and are thus not session
relative), and bookmarkable pages are constructed for every request.
Older instances will by default be pushed to second level cache. If
pages are stateless, they are discarded right away and will not be
part of the session store's history (we don't need that because the as
state doesn't matter for these pages, we can construct them from
scratch on every request, even for the back button).

 How can I get Wicket to reuse object from #2 in step 3?

You typically don't unless you have a very specific reason for it. But
if you want, you can implement a custom page factory for instance.
Though that's probably pre-mature optimization. If you navigate
between pages, you can reuse instances by passing references to those
pages. A typical use for that is when you have a list and a detail
screen and from that detail screen you want to navigate 'back'. Again,
if the only reason you want to do such things is efficiency, you're
probably prematurely optimizing.

Eelco

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



Re: webpage instance scope?

2007-10-03 Thread Eelco Hillenius
Scoping depends. RequestCycles and stateless pages are per request,
Sessions are per session, Application is per Wicket filter.

How pages are scoped basically depends on the session store you use,
and whether they are reachable by the back button. By default, the
current page is stored in the session, so that call backs (form
submits, non-bookmarkable links, etc) can immediately be handled on
the instance. New pages push older ones to 'second level cache', which
is typically a file in a temp dir or a data store shared in a cluster
(if you want to support fail over for the back button). As long as
pages are in that second level store, they are reachable.

Instead of using the Servlet API's scopes, it is probably more useful
to think about reach-ability of your pages/ components, just like you
would do with normal server-side/ desktop Java programming. Pages are
reachable as long as the session stores can find them (and that is
only really relevant for back button support), and components are
reachable as long as you keep passing them on/ can be reached from the
current page.

Does that make sense?

Eelco

On 10/3/07, dukehoops [EMAIL PROTECTED] wrote:

 Hi,

 I'm evaluating Wicket as a potential replacement for JSF and have a question
 (tried searching, read wiki):

 What is the lifespan of a WebPage / Panel subclass instance? In JSF,
 page-backing beans can be request/session/app scoped. I read that Wicket is
 an unmanaged framework. Does that mean the objects are request-scoped?

 If so, how how does one implement a session-persistent header (as Panel) +
 request-scoped body scenario?

 If this is documented in reference, please kindly point me to the specific
 section - I could not find anything relevant

 thanks
 -nikita
 --
 View this message in context: 
 http://www.nabble.com/webpage-instance-scope--tf4564224.html#a13027317
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Adding a Link for a Whole ListItem

2007-10-03 Thread swaroop belur


Look up how requesttargets work in wicket. In particular
look up ListenerInterfaceRequestTarget for this use case.
It just knows how to call ur component(link for example)
in ur page object. Call will land in onLinkClicked.

-swaroop






Christopher Gardner-2 wrote:
 
 Thank you.  I got this to work.  Now I'm wondering how the
 ILinkListener gets registered to pick up the event.  Does anything
 that happens to implement that interface automatically get registered?
 
 On 10/3/07, Martijn Dashorst [EMAIL PROTECTED] wrote:
 Yes, but odds are you already had to do that, to override populateItem().

 Martijn

 On 10/3/07, Christopher Gardner [EMAIL PROTECTED] wrote:
  Do you also have to subclass ListView (overriding newItem()) to create
  an object of the ListItem subclass?
 
  On 10/3/07, Maurice Marrink [EMAIL PROTECTED] wrote:
   Yes you can, The trick is to extend ListItem and have it implement
   ILinkListener you can then add the onclick behavior through an
   attributemodifier or override oncomponenttag. To prevent having to
   make a subclass per page you should make the onLinkClicked method in
   your listitem redirect to a method in your listview.
  
   I could show you our code but it is cluttered with non relevant code,
   and the above really says it all.
  
   Maurice
  
   On 10/3/07, Christopher Gardner [EMAIL PROTECTED] wrote:
With a ListView is there a way to actually create a Link component
that encompasses the whole ListItem, such that when you click
 anywhere
on a row the onClick event is fired?  I know you can do this with
 Ajax
support, but I'm curious if you can do this using the traditional
 way,
i.e., with a full page refresh.  I don't want to add a click here
button to my row.
   
   
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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

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


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

-- 
View this message in context: 
http://www.nabble.com/Adding-a-Link-for-a-Whole-ListItem-tf4561727.html#a13032210
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Custom label for number and currency formatting?

2007-10-03 Thread swaroop belur


Do this

double x= 8.3;

Label dbl = new Label(dbllbl,+x){

@Override
protected void onComponentTagBody(final MarkupStream 
markupStream, final
ComponentTag openTag)
{
Object val = 
getConverter().convert(getModelObjectAsString(),
Double.class);
final NumberFormat nf = 
NumberFormat.getCurrencyInstance();
String newval = nf.format(val);
replaceComponentTagBody(markupStream, openTag, 
newval);
}

};

If you want to vary the locale on some cond, just use the method
 getCurrencyInstance(Locale inLocale) in NumberFormat class

-swaroop


tauren wrote:
 
 Does such a thing exist?  I thought it did, but can't find it now.
 
 Basically, I want a Label that allows me to format floats/doubles as
 currency.  I don't need i18n built in (for different currencies,
 etc.), just take double x=8.3 and output $8.30.
 
 Any pointers are appreciated!  Thanks.
 
 Tauren
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Custom-label-for-number-and-currency-formatting--tf4564849.html#a13032472
Sent from the Wicket - User mailing list archive at Nabble.com.


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