Variable changes on server running, don't change on localhost

2013-01-10 Thread Paolo
Hi,
I am become crazy!

My wicket web application works fine on my laptop on localhost,
but don't work well on my home server.

I made all the web site stateless. I don't need user login. But one page is 
stasefull because
I use wicket Ajax Tab Panel. On this page I have youtube video, with some 
panels that give informations
about the selected video, taken from youtube API using java. The first panel 
give information like title, author, views, ecc.
The second panel give comments of that video, ecc.

My problem is that when user pass from first panel to second panel, the 
comments returned is related to another video!
When come back to first panel the information changes and it is relative to 
another video too!
It looks totally random! But I think that the information on the actual panel 
is related to video selected by another user connected to my web site.
I known that there are user connected to my server every second, just because I 
can see upload bandwith used by system information graphic, and I
know by Google Analytics that every day I have about 500 users connected.

Infact when I test the application on my laptop on localhost it works well, all 
things is ok, and I am the only user of course.

How can I do some check to understand well the problem?
How can I solve the problem?
In my application I don't manage the Session, because I don't need, and I know 
that wicket automatically create a Session, infact
on ajax page I can see jsession=x in the url.
How can I know more instant informations about how many users connected and 
what pages that users are wacthing now?

I use wicket 6.2.0, Tomcat 6.2.4, Eclipse EE,  Linux, Home server and ADSL 
(1Mbit Upload)

Some part of code:

package org.apache.wicket.examples.authentication3;

import 

public class V extends BasePage implements Serializable
{   private static final long serialVersionUID = 1L;
public static String v, page;
public static String 
titolo,autore,data,descrizione,descr,uploader,videoid;
public static String visualiz = ---, sottoscr = ---, durata=;
public static long secondi;
public static long count;
public static int pageINT;
public static int max_results;

public V()
{
this ( new PageParameters() );
}

public V(PageParameters inparams) {
v = inparams.get(v).toString();
System.out.println (v:+v);
...
add(new Menu(panel,null,inparams.get(in).toString()));  // INCLUDE DIV 
SUPERIORE DELLA BARRA DI RICERCA


List tabs = new ArrayList();
tabs.add(new AbstractTab(new Model(Info Video))
{
public Panel getPanel(String panelId)
{
return new TabPanel1(panelId);
}
});

tabs.add(new AbstractTab(new Model(Comments))
{
public Panel getPanel(String panelId)
{
return new TabPanel2(panelId);
}
});

tabs.add(new AbstractTab(new Model(Download video or mp3))
{
public Panel getPanel(String panelId)
{
return new TabPanel3(panelId);
}
});

add(new AjaxTabbedPanel(tabs, tabs));

 // tabsdx  TabPanel di destra: Video correlati e Video dell'autore

List tabsdx = new ArrayList();
tabsdx.add(new AbstractTab(new Model(Related Video))
{
public Panel getPanel(String panelId)
{
return new TabPaneldx1(panelId);
}
});

tabsdx.add(new AbstractTab(new Model(Same author Video))
{
public Panel getPanel(String panelId)
{
return new TabPaneldx2(panelId);
}
});
add(new AjaxTabbedPanel(tabsdx, tabsdx));

...

VideoEntry ve = null;
try
{
YouTubeService service = new 
YouTubeService(gdataSample-YouTube-2);
ve = service.getEntry(new 
URL(http://gdata.youtube.com/feeds/api/videos/+v), VideoEntry.class);
System.out.println(Service v= + v);
}
catch (MalformedURLException e) { e.printStackTrace(); }
catch (IOException e) { e.printStackTrace(); }
catch (ServiceException e) { e.printStackTrace(); } 

...
private static class TabPanel1 extends Panel  // Tab Info Video
{
public TabPanel1(String id)
{
super(id);
//...
System.out.println (tab1 v:+v);
System.out.println (tab1 videoid:+videoid);

add(new Label(VideoTitoloTab,titolo)); 
add(new Label(VideoDescrTab,descrizione)); 
add(new Label(VideoData,data));
add(new Label(VideoVisualizzazioni,visualiz)); 
add(new Label(VideoSottoscrizioni,sottoscr)); 

PageParameters outparamslink13 = new PageParameters(); outparamslink13.add(v, 
videoid); outparamslink13.add(in, video); // outparamsl1.add(page, 
(pageINT+1));
add(new  BookmarkablePageLink(link13, V.class, 
outparamslink13).setBody(Model.of(autore)));

...

private static class TabPanel2 extends Panel // 
COMMENTI
{
public TabPanel2(String id)
{
super(id);
/**
 * Prints the comments feed of a VideoEntry.

 */


Re: Variable changes on server running, don't change on localhost

2013-01-10 Thread Paolo
Alle giovedì 10 gennaio 2013, francois meillet ha scritto:
 Why do you make properties static, why TabPanel1 is static  ?
 
 François

Just cut and past from some examples or previews app.

I removed static and now it works ok!
Thank you so much!
Long life to you!

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



AjaxTabPanel stateless is possible?

2012-11-26 Thread Paolo
I would the url of my site without pageId ?2 or ?3 etc.
I know that to do this I need to make the page stateless, so I did it for all 
my pages.
But one page have 2 tabs, using AjaxTabbedPanel.
I tried to use simple TabbedPanel, but it is not usefull, because so I have 
that all the page is reloaded, and it is not good,
because I have a flashplayer video playing in the page, and when the user 
change tab, the video is restarted.
Does exist a solution?
I am ready to put in the url some information to make the page stateless or to 
store the selected tab.
Thank you.

Some part of the code:

List tabs = new ArrayList();
tabs.add(new AbstractTab(new Model(Info Video))
{
public Panel getPanel(String panelId)
{
return new TabPanel1(panelId);
}
});

tabs.add(new AbstractTab(new Model(Commenti))
{
public Panel getPanel(String panelId)
{
return new TabPanel2(panelId);
}
});

tabs.add(new AbstractTab(new Model(mp3))
{
public Panel getPanel(String panelId)
{
return new TabPanel3(panelId);
}
});

add(new AjaxTabbedPanel(tabs, tabs));

 // tabsdx  TabPanel di destra:

List tabsdx = new ArrayList();
tabsdx.add(new AbstractTab(new Model(Video Correlati))
{
public Panel getPanel(String panelId)
{
return new TabPaneldx1(panelId);
}
});

tabsdx.add(new AbstractTab(new Model(Video dello stesso autore))
{
public Panel getPanel(String panelId)
{
return new TabPaneldx2(panelId);
}
});
add(new AjaxTabbedPanel(tabsdx, tabsdx));

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to know the country of the user

2012-10-28 Thread Paolo
Alle domenica 28 ottobre 2012, Andrea Del Bene ha scritto:
 You should try Session.get().getLocale(). By default Session returns the 
 locale of the underlying HttpServletRequest.

getLocale return the languange set in the browser, and it is not the same thing 
of country.

You are right for example for me that I am italian, so my language (it) is the 
same of the country (it)

But for example if your country may be Brazil (br), but language is portuguese.

The same is for language espanol (es), that is speaking in many countries.




  How can I know the country of the user that is connected to my wicket page?
 
  I only suppose to check the IP address with:
 
  String ipAddress = ((ServletWebRequest) 
  RequestCycle.get().getRequest()).getContainerRequest().getRemoteHost();
 
  And than with command line whois check the country
 
  whois 109.113.243.xx |grep -E 'country|Country'
 
  or use a free database:
 
  http://dev.maxmind.com/geoip/geolite.
 
  If you know some wicket library, or better way, please tell me.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to know the country of the user

2012-10-28 Thread Paolo
Alle domenica 28 ottobre 2012, Wujek Srujek ha scritto:
 Locale has more information than just the language. For example: en_US
 is English in USA; en_UK is English in the UK, it_IT is Italian in Italy,
 but it_CH is Italian in Switzerland. Your example would differentiate
 between pt_PT (Portuguese in Portugal) and pt_BR (Portuguese in Brazil).
 Check out Locale.getCountry().
 This being said, it is still not the same as the physical location. Do you
 really need the country of residence for some statistics / whatever, or the
 language / regional settings for localization? In the former case, Locale
 won't help; in the latter, the physical location is probably not the right
 way to go, Locale is.
 For example, I'm Polish but live in Germany, and I would like your
 application display Polish strings (or English).

Thank you so much, for your reply.
I don't need the physical location, so  Locale.getCountry() is enought for me,
and so faster and easy than my idea.

Thank you so much!

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



How to know the country of the user

2012-10-27 Thread Paolo
How can I know the country of the user that is connected to my wicket page?

I only suppose to check the IP address with:

String ipAddress = ((ServletWebRequest) 
RequestCycle.get().getRequest()).getContainerRequest().getRemoteHost();

And than with command line whois check the country

whois 109.113.243.xx |grep -E 'country|Country'

or use a free database:

http://dev.maxmind.com/geoip/geolite.

If you know some wicket library, or better way, please tell me.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



I would url clear, without jsessionid and ?1

2012-10-25 Thread Paolo
Hi,
I know that it is an old discussion,
but I really want the url simply and clear, without ;jsessionid= and without ?1 
 ?2 etc.
I am starting to upgrade to wichet 6.2.0
actually I use this in MainApplication:

protected void init()
{
super.init();
SecurePackageResourceGuard guard = new SecurePackageResourceGuard();
guard.addPattern(+**.gif);
guard.addPattern(+*.*);
guard.addPattern(+*.gi*);
guard.addPattern(+test*.gif);
getResourceSettings().setPackageResourceGuard(guard);
//getDebugSettings().setDevelopmentUtilitiesEnabled(true);
// mountPage(home.html, HomePage.class);
// mountPage(/, HomePage.class);
mountPage(search, Search.class);
mountPage(products, Products.class);

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: I would url clear, without jsessionid and ?1

2012-10-25 Thread Paolo
Alle giovedì 25 ottobre 2012, Martin Grigorov ha scritto:
 On Thu, Oct 25, 2012 at 4:57 PM, Paolo irresistible...@gmail.com wrote:
  Hi,
  I know that it is an old discussion,
  but I really want the url simply and clear, without ;jsessionid= and 
  without ?1  ?2 etc.
 
 1) make sure cookies are enabled - jsessionid is gone
Yes, the cookies are enabled.
Now I notice, that only the homepage have jsessionid, so I mounted it with:
mountPage(/, HomePage.class);
and jsessionid is disappeared.
But now an / is added at the end of url of homepage.
I don't like it, but I can live with it. I also see that if I wrote 
www.google.com the rendered page add an / at the and i.e.:
http://www.google.com/

 2) make sure your pages are stateless - ?2 is gone
How can I make all my pages stateless?

 
 Voila!
 
  I am starting to upgrade to wichet 6.2.0
  actually I use this in MainApplication:
 
  protected void init()
  {
  super.init();
  SecurePackageResourceGuard guard = new SecurePackageResourceGuard();
  guard.addPattern(+**.gif);
  guard.addPattern(+*.*);
  guard.addPattern(+*.gi*);
  guard.addPattern(+test*.gif);
  getResourceSettings().setPackageResourceGuard(guard);
  //getDebugSettings().setDevelopmentUtilitiesEnabled(true);
  // mountPage(home.html, HomePage.class);
  // mountPage(/, HomePage.class);
  mountPage(search, Search.class);
  mountPage(products, Products.class);
 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket and Menu support

2012-04-08 Thread Paolo
Alle domenica 08 aprile 2012, Daniel Neugebauer ha scritto:
 Depending on how your menus are supposed to be defined, you could
 statically put them into your markup or dynamically create them by using
 a ListView or similar.
 

 If you want to avoid HTML/CSS as far as possible, other frameworks may
 fit better. For example, you can avoid HTML/CSS almost completely with
 Vaadin or GWT if you don't need any custom layout (if you do, it can be
 a lot of work to style it). And then there are a lot of frameworks that
 are easier to style but require you to write some HTML/CSS yourself.
 
 If you want to stay with Wicket, you should get more comfortable with
 HTML and CSS (which will take a lot of exercise to get it right) or
 leave writing templates up to a web designer, which (due to a good
 separation of templates and code) is far easier in Wicket than with
 other frameworks. In most cases, you can simply take a design, add
 Wicket XML tags/attributes to it and start using that template from your
 code.

I suggest jquery menu, they are very simple to use. You could find a lot of 
those on google search.
I used with satisfaction jquery.treeview.js with 3 level menu and wicket:link 
statically
http://docs.jquery.com/Plugins/Treeview

P.S.
Jquery now, with wicket 6, is internally supported by wicket core.



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: What real life scenario calls for page ID?

2012-03-27 Thread Paolo
Alle martedì 27 marzo 2012, Martin Grigorov ha scritto:
 On Tue, Mar 27, 2012 at 12:51 AM, Paolo irresistible...@gmail.com wrote:
  Alle giovedì 22 marzo 2012, Pointbreak ha scritto:
  On Thu, Mar 22, 2012, at 11:42, Igor Vaynberg wrote:
 
   
No that is not what happens with NoVersionMount:
   
 
  
   i didnt say it was an ajax twistie
 
  Not being an ajax twistie link still doesn't add the ?1 to the url.
  NoVersionMount will only add the id to callback urls.
 
 
  I am newbie, and all discussion is very hard to understand.
  I got the code of NoVersionMount and It works fine for me until..
  ...I migrated to Wicket 6!
  I change imports:
  org.apache.wicket.request.mapper.**  
  org.apache.wicket.core.request.mapper.** (OSGi friendly)
 
  But I got this error on NoVersionMount:
 
  GRAVE: Exception starting filter MainApplication
  java.lang.IncompatibleClassChangeError: Expecting non-static method 
  org.apache.wicket.core.request.mapper.MountedMapper.getOptionalPlaceholder(Ljava/lang/String;)Ljava/lang/String;
 
 Make sure that all wicket jars are version 6.0.0-beta1 and clean and
 recompile your application against them.
 
I did it correctly. I clean it and recompile, but nothing changed. I got always 
the same error.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: What real life scenario calls for page ID?

2012-03-26 Thread Paolo
Alle giovedì 22 marzo 2012, Pointbreak ha scritto:
 On Thu, Mar 22, 2012, at 11:42, Igor Vaynberg wrote:

  
   No that is not what happens with NoVersionMount:
  

  
  i didnt say it was an ajax twistie
 
 Not being an ajax twistie link still doesn't add the ?1 to the url.
 NoVersionMount will only add the id to callback urls.
 

I am newbie, and all discussion is very hard to understand.
I got the code of NoVersionMount and It works fine for me until..
...I migrated to Wicket 6!
I change imports:
org.apache.wicket.request.mapper.**  
org.apache.wicket.core.request.mapper.** (OSGi friendly)

But I got this error on NoVersionMount:

GRAVE: Exception starting filter MainApplication
java.lang.IncompatibleClassChangeError: Expecting non-static method 
org.apache.wicket.core.request.mapper.MountedMapper.getOptionalPlaceholder(Ljava/lang/String;)Ljava/lang/String;
at 
org.apache.wicket.core.request.mapper.MountedMapper.isFixedSegment(MountedMapper.java:228)
at 
org.apache.wicket.core.request.mapper.MountedMapper.getPathSegments(MountedMapper.java:207)
at 
org.apache.wicket.core.request.mapper.MountedMapper.init(MountedMapper.java:196)
at 
org.apache.wicket.core.request.mapper.MountedMapper.init(MountedMapper.java:175)
at 
org.apache.wicket.examples.authentication3.NoVersionMount.init(MainApplication.java:90)
at 
org.apache.wicket.examples.authentication3.MainApplication.init(MainApplication.java:77)
at org.apache.wicket.Application.initApplication(Application.java:801)
at 
org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:344)
at 
org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:284)
at 
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at 
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at 
org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:115)
at 
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4488)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
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.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
27-mar-2012 0.30.55 org.apache.catalina.core.StandardContext start
GRAVE: Error filterStart
27-mar-2012 0.30.55 org.apache.catalina.core.StandardContext start
GRAVE: Context [/watch] startup failed due to previous errors
27-mar-2012 0.30.55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesJdbc
GRAVE: A web application registered the JBDC driver [com.mysql.jdbc.Driver] but 
failed to unregister it when the web application was stopped. To prevent a 
memory leak, the JDBC Driver has been forcibly unregistered.


And this is my import list in MainApplication.java:

package org.apache.wicket.examples.authentication3;

import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.Page;
import 
org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession;
import org.apache.wicket.authroles.authentication.AuthenticatedWebApplication;
import org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler;
import org.apache.wicket.core.request.mapper.MountedMapper;
import org.apache.wicket.markup.html.SecurePackageResourceGuard;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.Application;
import org.apache.wicket.Page;
import org.apache.wicket.request.IRequestHandler;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.Response;
import org.apache.wicket.request.Url;
import org.apache.wicket.Session;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.core.request.*;
import org.apache.wicket.request.component.IRequestablePage;
import org.apache.wicket.request.mapper.info.PageComponentInfo;
import org.apache.wicket.request.mapper.parameter.PageParametersEncoder;
//import 

Could not find child with id: cart:prezzo in the wicket:enclosure

2012-03-26 Thread Paolo
I am become crazy with wicket:enclosure to prevent an runtime error in case the 
ListView is empty.

this is part of my html code:

 
   table border=1
wicket:enclosure child=cart:prezzo
  tr wicket:id=cart
 tda href=# wicket:id=OggettoLink target=_blank img 
wicket:id=OggettoIcon width=180 src=# title=Apri in nuova finestra 
alt=Immagine/ /a/td 

 td a wicket:id=titolo href=#Link/a/td
 td wicket:id=prezzoprezzo/td
 td nbsp;/td
  /tr
/wicket:enclosure
   /table

--
I use Wicket 6 beta. If you need more code, I can post it.
I try to change the child to:
cart
prezzo
OggettoLink
OggettoIcon
titolo

but I got always the same runtime error:


Unexpected RuntimeException 
Last cause: Could not find child with id: cart:prezzo in the wicket:enclosure


Stacktrace 
Root cause:
org.apache.wicket.WicketRuntimeException: Could not find child with id: 
cart:prezzo in the wicket:enclosure
 at 
org.apache.wicket.markup.html.internal.Enclosure.checkChildComponent(Enclosure.java:270)
 at 
org.apache.wicket.markup.html.internal.Enclosure.getChildComponent(Enclosure.java:249)
 at 
org.apache.wicket.markup.html.internal.Enclosure.onInitialize(Enclosure.java:134)
 at org.apache.wicket.Component.fireInitialize(Component.java:1004)
 at 
org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:963)
 at 
org.apache.wicket.MarkupContainer.addedComponent(MarkupContainer.java:940)
 at org.apache.wicket.MarkupContainer.add(MarkupContainer.java:164)
 at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:293)
 at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1424)
 at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1599)
 at 
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1574)
 at 
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1528)
 at 
org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:71)
 at org.apache.wicket.Component.internalRenderComponent(Component.java:2584)
 at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1537)
 at org.apache.wicket.Component.internalRender(Component.java:2414)
 at org.apache.wicket.Component.render(Component.java:2342)
 at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1435)
 at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1599)
 at 
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1574)
 at 
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1528)
 at 
org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:71)
 at org.apache.wicket.Component.internalRenderComponent(Component.java:2584)
 at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1537)
 at org.apache.wicket.Component.internalRender(Component.java:2414)
 at org.apache.wicket.Component.render(Component.java:2342)
 at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1435)
 at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1599)
 at org.apache.wicket.Page.onRender(Page.java:929)
 at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:138)
 at org.apache.wicket.Component.internalRender(Component.java:2414)
 at org.apache.wicket.Component.render(Component.java:2342)
 at org.apache.wicket.Page.renderPage(Page.java:1060)
 at 
org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
 at 
org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:219)
 at 
org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:139)
 at 
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:717)
 at 
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63)
 at 
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
 at 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253)
 at 
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:160)
 at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:216)
 at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at 

Re: Homepage runs 2 times if I mount it as /

2012-03-25 Thread Paolo
Alle venerdì 23 marzo 2012, Jeff Schneller ha scritto:
 I may be wrong but you don't need to mount the homepage which is why it is 
 being executed twice. 

Yes, ok, you are right.
But the problem was start because I use the NoVersionMount to mount homepage 
because I don't like that the url of page have this add:

/;jsessionid=6730E8A6F6FED95C9AC24E7A37F3A35A?0

So, can you suggest a good solution?

--
@Override
protected void init()
{
super.init();
// mountPage(/, HomePage.class);
mount(new NoVersionMount(/, HomePage.class));
mount(new NoVersionMount(watch, V.class))  
}
}

/**
 * Provides a mount strategy that drops the version number from
 * stateful page urls.
 */
class NoVersionMount extends MountedMapper {
public NoVersionMount(String path, Class? extends IRequestablePage 
pageClass) {
super(path, pageClass, new PageParametersEncoder());
}

@Override protected void encodePageComponentInfo(Url url, PageComponentInfo 
info)
{
// do nothing so that component info does not get
// rendered in url
}

@Override public Url mapHandler(IRequestHandler
requestHandler)
{
if (requestHandler instanceof ListenerInterfaceRequestHandler) {
return null;
} else {
return super.mapHandler(requestHandler);
}
}
}

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



BookmarkablePageLink with Label is supported by Wicket?

2012-03-25 Thread Paolo
I read on this web site:

http://ondra.zizka.cz/stranky/programovani/java/web/wicket/wicket-link-with-label.texy

-
Wicket does not have exactly a „link with label“ component out of the box.
Remember Wicket tries to hide the HTTP from you (and is quite good at it).
It has a Link, which can react to onClick(), and can contain anything (a simple 
span or a whole div with everything inside).

But some people, me included, would like to have a simple link with text, to 
get:

a href=...Text/a

-
So my question:
Is it right?
Wicket really does not have link with label component out of the box?
And in wicket 1.5 or 1.6?

Is the normal solution to use onClick() override Label component?
Like this code?

add(new Label(linktext, Click the +text) {
@Override
public void onClick() {
PageParameters outparams = new PageParameters(); 
outparams.add(param, parameter);
setResponsePage(Index.class, outparams);
}  

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Homepage runs 2 times if I mount it as /

2012-03-23 Thread Paolo
I made bookmarkable the HomePage:

But it is executed two times!!!
Infact it make me crazy!
I put an System.out.printf to check it in the console log.
Because the page in the browser look like to load only one time,
but in the console I can read 2 times printf line!

If I mount it as something different by / homepage runs only one time.

This is the main of my app called watch:
---
public class MainApplication extends WebApplication
{
@Override
public Class getHomePage()
{
return HomePage.class;
}

@Override
protected void init()
{
super.init();
mountPage(/, HomePage.class);
mountPage(print.html, Print.class);
mount(new NoVersionMount(watch, V.class));
}
}
-
If I replace it with mountPage(home, HomePage.class); it works normally.

Url string after first start:

http://localhost:8080/watch/?0

Url string after reload page:

http://localhost:8080/watch/?2

--

If I mount page as

mountPage(, HomePage.class);

I got this error:
java.lang.IllegalArgumentException: Argument 'mountPath' may not be null or 
empty.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: What real life scenario calls for page ID?

2012-03-18 Thread Paolo
Alle lunedì 19 marzo 2012, Chris Colman ha scritto:
 I've been thinking about the new 1.5 page ID/versioning feature (which
 we disabled as soon as we discovered it) and wondering if there is
 actually a real world scenario for stateful pages that actually requires
 this functionality.
 
 I understand the purpose is so that the browser's 'Back' function can
 work properly (and maybe efficiently) but, in all the scenarios we
 have at least, proper would be to re-render and not pull the page from
 the cache.
 
 For example, an online store with the current shopping cart displayed in
 the right hand column:
 
 Browser is showing page for product A, no products in shopping cart
 shown in right column.
 
 User goes to page for product B, adds product B to shopping cart.
 
 Hit's back button.
 
 Now wouldn't the 'page versioning/id' feature now show the cached page
 for product A with a shopping cart that is still empty even though the
 user just added product B? Or would it realize that the shopping cart
 panel's model has changed and update it to reflect the newly added item?
 
 In this scenario showing an empty shopping cart is a very definite
 incorrect behavior that will freak out the user who believes that they
 have added a product B (which they have) but it is not shown in the
 shopping cart.
 
 1.4 functionality (without page ID) worked fine. We never had a single
 complaint about back button not displaying the correct result.
 
 I'm half doubting whether page ID is a useful feature but half wondering
 if it is a useful feature for which I just haven't discovered useful
 scenarios where it is of benefit and so I should find these scenarios
 and change my design to use it.
 
 Thoughts?
I support you!
I implemented class NoVersionMount thanks to pointbreak in my MainApplication.
And It will be my template for future app.
But to do it, I needed to understood the problem, check on google, read a lot 
of pages,
without found a solution, so post the question here, and after 3 post, got a 
right reply for me.
Why an wicket user have to do all this
Why not, wicket use the NoVersionMount as default Mount? Like in wicket 1.4.
And implement an VersionMount as an alternative for developer?

 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



I don't want url page count parameter: localhost:8080/context/?0

2012-03-17 Thread Paolo
Hi,
I read this old post to solve the my same problem:

---
I'm using Wicket 1.5.3, an application with a number of tabbed panels.

My application's url is, lets say http://localhost:9080/context/

When I enter this URL, the browse immediately changes this to
http://localhost:9080/context/?0

I don't want that!!

When I enter userdata and switch some tabs, nothing happens, but when I hit
F5 the URL changes to
http://localhost:9080/context/?9 or another number, depending on my
activity.
I don't want that!!

I read this suggested link:
http://stackoverflow.com/questions/8081143/components-not-reloading-on-url-change-in-wicket-1-5-2
http://stackoverflow.com/questions/8135755/wicket-1-5-new-urls/8139152#8139152


BUT I DON'T UNDERSTAND TO SOLVE THE SIMPLE PROBLEM!

I tried to change from

String id = inparams.get(id).toString();

   TO

RequestCycle requestCycle = RequestCycle.get();
Request request = requestCycle.getRequest();
IRequestParameters irp = request.getRequestParameters();
String id = irp.getParameterValue(id).toString();

BUT NOTHING CHANGED!

Please Help me, in this stupid wicket issue.

Thank you



Re: WICKET JAVASCRIPT

2012-03-07 Thread Paolo
Alle mercoledì 07 marzo 2012, mukesh kumar ha scritto:
 Thanks for it. But i am still confused. So, can you write some line of code
 for alert message of JS file. 
 
 Thanks !
You could use visural
http://wicket.visural.net/examples/dialog

If you learn to use it, you will use also other tools faster.
I like Fancybox to show images.

 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/WICKET-JAVASCRIPT-tp4450551p4453708.html
 Sent from the Users forum mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket authentication: how to store user?

2012-03-03 Thread Paolo
Alle sabato 03 marzo 2012, Martin Grigorov ha scritto:
 Hi,
 
 Save the logged in user id in the Session.
 
 MySession.java:
 
 private long userId;
 
 public User getUser() {
   return userService.getUserById(userId);
 }
 
 
 AnyPage.java:
 user = MySession.get().getUser();
 
Thank you, for support and explanation code, very useful because I am a newbie.
Just one another answer: Is it secure?
Can someone alter session data and change user data, so an hacher could log 
with own account but operate with other accounts?
Do I need some random code like this hdfds6yh6yhgtruifh4hf4frh9ruehfe to 
store temporanealy in session and database and associate it to a specific user?

  I added registration and user/password sign-in and checking with database, 
  instead of simple wicket as user and password.
  All works ok, but now I need in AdminPage to known which user is logged in.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket authentication: how to store user?

2012-03-02 Thread Paolo
I use this code as base:

http://wicketstuff.org/wicket14/authentication/

I added registration and user/password sign-in and checking with database, 
instead of simple wicket as user and password.
All works ok, but now I need in AdminPage to known which user is logged in.

How can I implement it?
Is there some Wicket implementation?
Do I need to store user in Session or with cookies or in PageParameters? Is it 
secure?

Thank you.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Google bot see my site with errors!!

2012-02-02 Thread Paolo
Alle mercoledì 01 febbraio 2012, Martin Grigorov ha scritto:
 I guess lingue is null here, i.e. there is no Accept-Language header.
  NPEs are easy to debug ;-)

Thank you very much,
I solved it by putting a
if (lingua==null) { lingua = 0; }

before the line with NPE:
if (lingua.indexOf(en-tt)-1) getSession().setLocale(

I don't know if this solution is nice to code, but it work's, and this
is enought for me! :-)

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Google bot see my site with errors!!

2012-01-31 Thread Paolo
Alle martedì 31 gennaio 2012, Josh Kamau ha scritto:
 Does your homepage constructor have any arguments?

this is the first part of HomePage.java, with some omissis

package org.wicket.example;
import ..

public class HomePage extends WebPage // implements java.io.Serializable 
{
private static final long serialVersionUID = 1L;
public Model modelWww; //private
public int i;
public String ,cp;
public String vcode; 

public HomePage()
{
this ( new PageParameters() );  
}

public HomePage(PageParameters inparams) // PageParameters params)
{
 final HttpServletRequest httpServletRequest = 
((WebRequest)getRequest()).getHttpServletRequest();
 final String lingua = 
httpServletRequest.getHeader(Accept-Language);
 if (lingua..
String v; // = params.getString(v);  // prende il parametro v 
(codice del video) dall'URL
String invideo = inparams.getString(v);

if (invideo==null) {// NESSUN VIDEO URL INSERITO
modelWww = new Model(eg: 
http://www.youtube.com/watch?v=uSD4vsh1zDA;);
}
else {  
..

The MainApplication.java complete source code:
==
package org.wicket.example;

import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.request.target.coding.QueryStringUrlCodingStrategy;
import org.wicket.example.HomePage;
import org.wicket.example.QuoteResult;
 
public class MainApplication extends WebApplication
{
@Override
protected void init()
{
mount(new QueryStringUrlCodingStrategy(watch, QuoteResult.class));


}
@Override
public Class getHomePage()
{
return HomePage.class;  
}

}

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Google bot see my site with errors!!

2012-01-31 Thread Paolo
Alle martedì 31 gennaio 2012, Martin Grigorov ha scritto:
 What exactly is the code at: org.wicket.example.QuoteResult. init
 (QuoteResult.java: 55) ?

package org.wicket.example;

import java.util.Locale;

import javax.servlet.http.HttpServletRequest;

import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.Component;
import org.apache.wicket.behavior.AbstractBehavior;
import org.apache.wicket.markup.html.IHeaderResponse;
import org.apache.wicket.markup.html.internal.HeaderResponse;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.behavior.SimpleAttributeModifier;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.markup.html.link.*;
import org.apache.wicket.model.Model;
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.protocol.http.WebRequest;
import org.apache.wicket.protocol.http.WebResponse;
import org.apache.wicket.request.target.coding.QueryStringUrlCodingStrategy;
import org.apache.wicket.request.target.component.BookmarkablePageRequestTarget;
import org.apache.wicket.request.target.basic.RedirectRequestTarget;

import javax.servlet.http.HttpServletRequest;

public class QuoteResult extends WebPage // implements java.io.Serializable 
{
private static final long serialVersionUID = 1L;
public Model modelWww;
public int i;
public String ,cp,formato;
public String vcode; 
public String urlcache,burlcache;

public QuoteResult()
{
this ( new PageParameters() );

}
//

public QuoteResult(PageParameters inparams) // PageParameters params)
{
final HttpServletRequest httpServletRequest = 
((WebRequest)getRequest()).getHttpServletRequest();
final String lingua = 
httpServletRequest.getHeader(Accept-Language);
if (lingua.indexOf(en-tt)-1) getSession().setLocale(new 
Locale (en-tt)); // *** THIS IS LINE 55



 NPEs are easy to debug ;-)
What is NPEs?
I use Eclipse IDE. I don't know to debug, can you suggest a simple guide to 
debug Wichet?
The app work well, on my laptop, where I code it, I tested it in localhost with 
different language browsers.
It also work well on server. It is very strange!

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to get client ip with wicket 1.5

2011-11-21 Thread Paolo
Alle lunedì 21 novembre 2011, François Meillet ha scritto:
 ((ServletWebRequest) 
 RequestCycle.get().getRequest()).getContainerRequest().getRemoteHost()
 
 François
 
getHeader(X-Forwarded-For) return null string!!
I use getRemoteHost() and it works! Thanks to all!!

P.S.
I test it only on localhost (ip 127.0.0.1)

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



How to get client ip with wicket 1.5

2011-11-20 Thread Paolo
I need to known the ip address of the user connected to my tomcat server.
In previous post, I read about...

getWebRequestCycle().getWebRequest().getHttpServletRequest().getRemoteAddr();

But I also find some documentation with google that in Wicket 1.5 I should use 
WebClientInfo:

getRemoteAddr
protected String getRemoteAddr(RequestCycle requestCycle)
When using ProxyPass, requestCycle().getHttpServletRequest(). getRemoteAddr() 
returns the IP of the machine forwarding the request. In order to maintain the 
clients ip address, the server places it in the X-Forwarded-For Header.
Parameters:
requestCycle - the request cycle
Returns:
remoteAddr IP address of the client, using the X-Forwarded-For header and 
defaulting to: getHttpServletRequest().getRemoteAddr(



But I am a beginner in wicket 1.5 and java, so I need some example code to get 
ip address, if it is possible.
Thank you in advance




Re: How to get client ip with wicket 1.5

2011-11-20 Thread Paolo
Alle domenica 20 novembre 2011, vineet semwal ha scritto:
   HttpServletRequest request = servletWebRequest.getContainerRequest();
 String ipAddress = request.getHeader(X-Forwarded-For);
 

Thank you for your very fast reply.
I implemented your code:

HttpServletRequest request = ServletWebRequest.getContainerRequest();
String ipAddress = request.getHeader(X-Forwarded-For);

but I got this error on the first line:
Cannot make a static reference to the non-static method getContainerRequest() 
from the type ServletWebRequest

Can you help me?
Thak you so much.

 On Sun, Nov 20, 2011 at 4:41 PM, Paolo irresistible...@gmail.com wrote:
  I need to known the ip address of the user connected to my tomcat server.
  In previous post, I read about...
 
  getWebRequestCycle().getWebRequest().getHttpServletRequest().getRemoteAddr();
 
  But I also find some documentation with google that in Wicket 1.5 I should 
  use WebClientInfo:
 
  getRemoteAddr
  protected String getRemoteAddr(RequestCycle requestCycle)
  When using ProxyPass, requestCycle().getHttpServletRequest(). 
  getRemoteAddr() returns the IP of the machine forwarding the request. In 
  order to maintain the clients ip address, the server places it in the 
  X-Forwarded-For Header.
  Parameters:
  requestCycle - the request cycle
  Returns:
  remoteAddr IP address of the client, using the X-Forwarded-For header and 
  defaulting to: getHttpServletRequest().getRemoteAddr(

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



What is the Best login implementation?

2011-06-18 Thread Paolo
Hi,
I found on google some solution for login with wicket:

http://wicket.apache.org/learn/projects/authroles.html
Wicket Shiro - integration between Apache Shiro and Wicket  (I can't find the 
web site)
Wicket Security - JAAS inspired, principal based security framework (I can't 
find the web site)

What is the the best and the simplest to implement? I need security too :-)
Are there some other library/example code?

thank you

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Repetitive TextField Form into ListView?

2011-04-11 Thread Paolo
Hi,
It is my first experience with Wicket.
I try to do a e-commerce site, based on cheese shop from Wicket in Action Book.
I have problem to implement shopping cart to set the quantity of each item that 
the user choose.
As you can see in this screenshot, I put a TextField for quantity in a ListView 
of all items that the user put in the shopping cart.
At beginning all quantity value are set to 1.
The problem is that it works correctly only if I have only one item. If I have 
two or more items, I can set correctly only the last quantity.
Foe example, If I try to set quantity of the first item, the value that will be 
assigned to it will be the value of the last item.
Thank you for help!

http://sacredspirit.altervista.org/images/screenshot.jpg

QuantFUORI=1
QuantFUORI=1
QuantSTR=1
QuantFORM=2
Quantity Value changed
QuantFUORI=1
QuantFUORI=2
QuantSTR=1
QuantFORM=2
Quantity Value changed
QuantFUORI=2
QuantFUORI=2

This is the complete source code of Checkout.java

package org.wicket.example.pages;

import au.com.bytecode.opencsv.CSVReader;
import au.com.bytecode.opencsv.CSVWriter;

import java.io.IOException;
import java.io.Serializable;
import java.text.NumberFormat;

import java.io.Serializable;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Properties;

import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.ExternalLink;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.list.PageableListView;
import org.apache.wicket.markup.html.navigation.paging.PagingNavigator;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.ResourceReference;
import org.apache.wicket.behavior.SimpleAttributeModifier;
import org.apache.wicket.behavior.AbstractBehavior;
import org.apache.wicket.extensions.yui.calendar.DateField;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.RequiredTextField;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.RefreshingView;
import org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy;
import org.apache.wicket.markup.repeater.util.ModelIteratorAdapter;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.IModel;


import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.Radio;
import org.apache.wicket.markup.html.form.RadioChoice;
import org.apache.wicket.markup.html.form.RadioGroup;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.link.ExternalLink;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.ResourceReference;
import org.apache.wicket.behavior.SimpleAttributeModifier;
import org.apache.wicket.behavior.AbstractBehavior;
import org.apache.wicket.extensions.yui.calendar.DateField;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.RequiredTextField;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.RefreshingView;
import org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy;
import org.apache.wicket.markup.repeater.util.ModelIteratorAdapter;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.validation.validator.EmailAddressValidator;

import org.wicket.example.Address;
import org.wicket.example.Pagamento;
import org.wicket.example.Cart;
import org.wicket.example.C;
import org.wicket.example.pages.CheesrPage;
import org.wicket.example.MainApplication;

public class Checkout extends CheesrPage {
private Cart cart;


public 

How to know what RadioGroup was selected?

2011-04-06 Thread Paolo
I implemented this example in my application

https://cwiki.apache.org/WICKET/using-radiogroups.html

But, how I can know what radio button of radiogroup the user selected?

This is a part of the html code:

   span wicket:id=group
input wicket:id=1 type=radio/
input wicket:id=2 type=radio/
input wicket:id=3 type=radio/
input wicket:id=4 type=radio/
  /span

This is a part of the java code:


final Pagamento bean=new Pagamento();
RadioGroup myInt = new RadioGroup(group, new PropertyModel(bean, 
myInt));
myInt.add(new Radio(1, new Model(1)));
myInt.add(new Radio(2, new Model(2)));
myInt.add(new Radio(3, new Model(3)));
myInt.add(new Radio(4, new Model(4)));
form.add(myInt);

...

   form.add(new Button(order) {
  @Override
  public void onSubmit() {
  
  final String pagamentoSTR = bean.toString();

System.out.println (Tipo pagamento:+pagamentoSTR);
...

This is the java code for the class Pagamento:
--
package org.wicket.example;

import java.io.Serializable;

public class Pagamento implements Serializable {
private Integer myInt;
public void setMyInt(Integer myInt) {
this.myInt=myInt;
}
public Integer getMyInt() {
return myInt;
}
  
}

I have no errors, but in the console i got:
Tipo pagamento:org.wicket.example.Pagamento@5bee9e20

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to know what RadioGroup was selected?

2011-04-06 Thread Paolo
Alle giovedì 07 aprile 2011, James Carman ha scritto:
 What is the value of myInt?  That should tell you which one was selected.
 
 On Wed, Apr 6, 2011 at 10:15 PM, Paolo irresistible...@gmail.com wrote:
  I implemented this example in my application
 
  https://cwiki.apache.org/WICKET/using-radiogroups.html
 
  But, how I can know what radio button of radiogroup the user selected?
 
Great!! You was very fast to reply! And I solved my problem with:

System.out.println (Tipo pagamento:+bean.getMyInt());

Thank you very much!!!

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



How to do document.write(Hello Word); in Wicket?

2011-02-20 Thread Paolo
How can I write something into the HTML page, from Java code.
A similar fast metod like in javascript to write in HTML:

document.write(Hello word);

It is userfull for conditional messagge like:

If (sum==5) { document.write(It is right!) }

or it may be userfull for an simple email antispam system, like in javascript:

document.write(irresi+stiblecam+@+gma+il.com);

Thank you.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



How discover the caller page (referer)?

2011-02-20 Thread Paolo
How can I discover the caller page (referer) of my wicket application or 
specific page?

http://en.wikipedia.org/wiki/HTTP_referrer

Thank you.
Paolo

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



How to read cookie from different domain?

2011-02-16 Thread Paolo
Hi, I need to read a cookie from a different domain (it is not mine).
I known the name ok cookie.

When I create (write) a cookie, it is possible to set the name of domain:
cookie.setDomain(.example.com);

But It does'nt work for foreign domain just because security reasons, infact I 
can not modify or create cookie for othen site, not own.

But I think it is possible to READ cookie from other site. Just the user set in 
own browser settings allow third party cookies.
How can do it in wicket?

I only know this instruction to read cookie, and in this I can not choose the 
domain to use:
Cookie[] cookies = ((WebRequest)getRequestCycle().getRequest()).getCookies();

This is my test application:

=
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
xmlns:wicket=http://wicket.apache.org/; xml:lang=en lang=en
head
titleWicket cookie test/title
/head
body
a wicket:id=create_cookieCreate Cookie/a
br /br /br /
 a wicket:id=read_cookieRead Cookie/a
/body
/html

==

package org.wicket.example;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.protocol.http.WebResponse;
import org.apache.wicket.protocol.http.WebRequest;

import javax.servlet.http.Cookie;


public class TestPage extends WebPage {
  /**
   * Constructor
   */
  public TestPage() {
  }

  @Override
  protected void onInitialize() {
  super.onInitialize();

  add(new LinkTestPage(create_cookie) {

private static final long serialVersionUID = 6762033052623200948L;

@Override
public void onClick() {
((WebResponse) getResponse()).addCookie(createCookie());
setResponsePage(TestPage.class);
}
});
  add(new LinkTestPage(read_cookie) {

private static final long serialVersionUID = 
6762033052623200948L;

@Override
public void onClick() {
Cookie[] cookies = 
((WebRequest)getRequestCycle().getRequest()).getCookies();
System.out.println(cookies[0].getName());
setResponsePage(TestPage.class);
}
});
  }
  
  /**
   * Creates test cookie
   * @return cookie
   */
  public Cookie createCookie() {
Cookie cookie = new Cookie(wicketTest, 1);
//  cookie.setDomain(.example.com);
cookie.setMaxAge(6000);
return cookie;
  }

}

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to read cookie from different domain?

2011-02-16 Thread Paolo
Alle mercoledì 16 febbraio 2011, Randy S. ha scritto:
 It is not possible to read a cookie from a different domain. That would be a
 terrible security problem.
 
 The browser will not send cookies that do not match your domain so no amount
 of code tricks on the server handling this request will get you the cookie.
 
 The third party cookies settings in browsers controls whether it is
 possible to set cookies in requests for images and other assets for a page
 that come from a domain that is different than the page's domain.

If I put the other page in a Iframe into my page, and I use Javascript or other 
client side technology, is it possible?

Thank you.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



how to set cookie domain?

2011-02-01 Thread Paolo
Hi,
I want add a cookie, and I saw on this site, how to do this.

https://cwiki.apache.org/WICKET/dealing-with-cookies.html

 ((WebResponse)RequestCycle.get().getResponse()).addCookie(new 
Cookie(cookieName, cookieValue));

but I need to specify also the domanin.

I need something like this PHP code, but for Wicket:

ini_set('session.cookie_domain', '.otherdomain.com');

thank you!

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



How to set cookie domain?

2011-02-01 Thread Paolo
Hi,
I want add a cookie, and I saw on this site, how to do this.

https://cwiki.apache.org/WICKET/dealing-with-cookies.html

 ((WebResponse)RequestCycle.get().getResponse()).addCookie(new 
Cookie(cookieName, cookieValue));

but I need to specify also the domanin.

I need something like this PHP code, but for Wicket:

ini_set('session.cookie_domain', '.otherdomain.com');

thank you!

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



What is the best slideshow?

2010-09-11 Thread Paolo
I found this:

http://lazydev.ildella.net/wicket-slides-080-released-with-smoothgallery

Is it the best solution to show a sequence of image?

I don't like to use flash. And this use javascript, so it may be OK.

thank you.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Forums tools ready-to-use?

2010-07-26 Thread Paolo
very good.
I could use comments panel to let users to let messages on my web site.
Does it need Spring integration?
Where is stored comments info: texts,emails,authors?
I need a database suppport?

I saw also a interesting ReCaptcha plugin.
But now I am interesting in ReCaptcha Mailhide (
http://www.google.com/recaptcha/mailhide/) wicket support.
I saw that Recaptha plugin doesn't supportt Mailhide function.
I need Mailhide, to hide email address of who write a comment on my web site
to spammers.


2010/7/26 Vytautas Racelis turi...@gmail.com

 Thanks Josh;)
  Forum support is in feature plans, but it is not currently implemented.


Thank you!




 --
 Regards,
 Vytautas Racelis
 ---
 phone:+370-600-34389
 www.xaloon.org
 www.leenle.com
 www.allcarindex.com


 On 07/26/2010 04:46 PM, Josh Kamau wrote:

 Please check www.xaloon.org. This project contains some nice ready to use
 components for wicket including:


- blog;
- comments panel;
- sports component;
- plugin administration console;
- registration and activation panel;

 Regards.
 Josh


 On Sun, Jul 25, 2010 at 7:30 PM, Paoloirresistible...@gmail.com  wrote:

  I need a tool for a Forum in my web site.
 I don't want use the classic php based tools, like phpForum, bbCode ecc.

 But I would use WICKET!
 Do you suggest me some wicket examples o ready-to-use forum tool?

 Or if it doesn't exist, please suggest some guestbook or similar way to
 posting message in a webpage.

 thank you.
 Paolo



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Forums tools ready-to-use?

2010-07-25 Thread Paolo
I need a tool for a Forum in my web site.
I don't want use the classic php based tools, like phpForum, bbCode ecc.

But I would use WICKET!
Do you suggest me some wicket examples o ready-to-use forum tool?

Or if it doesn't exist, please suggest some guestbook or similar way to
posting message in a webpage.

thank you.
Paolo


Re: Wicket in Italy

2009-09-24 Thread Paolo Di Tommaso
Roma (~)


On Thu, Sep 24, 2009 at 8:46 AM, francesco dicarlo
evilsephir...@gmail.comwrote:

 Hi, i've just worked on a project with wicket for a software house in Bari.

 But now i'm in Rome.

 Hope to see you in an event XD

 2009/9/24 Luca Provenzani eufor...@gmail.com




Re: Ajax indicator turning off

2009-07-26 Thread Paolo Di Tommaso
Yep, intercept the ajax call and inc/dec a counter

-- paolo


On Sat, Jul 25, 2009 at 10:03 AM, John Patterson jdpatter...@gmail.comwrote:

 Hi, I notice that when I have two ajax requests overlapping the indicator
 is turned off when the first one completes.

 Start AJAX request A - turns on the indicator
 Start AJAX request B
 Return AJAX request A - turns off the indicator
 Return AJAX request B

 Would a possible solution be to replace the call to wicketShow(id) with
 something like wicketIncrementShow(id) which increments a counter against
 the id and wicketDecrementHide(id) would only hide the component when the
 count got to 0?

 John.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: ExtJS

2009-07-24 Thread Paolo Di Tommaso
John,

Despite the sources has been commented the javadoc isn't available.

The best and quickest way to deep into Wicket-Ext is to have a look to the
component integration gallery sample application.

We are using that code in a production application and it works pretty
nicely, but Wicket-ext does cover all the huge ExtJS components library.

Grid are supported as GroupingGrid as well, but unfortunately not the
editable grids.


Regards, Paolo


On Fri, Jul 24, 2009 at 1:36 AM, John Armstrong siber...@siberian.orgwrote:

 Hi all,
  Does anyone have access to the javadocs for the ext-js
 implementation at http://code.google.com/p/wicket-ext/ ? When I
 attempt to download them with maven I get an empty archive that says
 'not-available'.

  On that note, does anyone (Paolo?) know if the Grid supports inplace
 cell editing via the form components as ext-js does?

  Seems like a cool project but I am not sure how mature it is and my
 UX guy is getting pushy..

 John-

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: dzone refcard

2009-07-06 Thread Paolo Di Tommaso
It would be nice

-- paolo

On Mon, Jul 6, 2009 at 6:07 PM, Luther Baker lutherba...@gmail.com wrote:

 Is anyone aware of a wicket
 refcardhttp://refcardz.dzone.com/refcardz/core-java-concurrency
 initiative?
 Thoughts?

 -Luther



Re: Wicket-like JavaScript Components

2009-06-17 Thread Paolo Di Tommaso
Say your boss to engage more java developers ;)

-- p

On Tue, Jun 16, 2009 at 9:23 PM, Dane Laverty danelave...@gmail.com wrote:

 I'm currently the only Java programmer on staff, and I'm already
 maintaining
 two Wicket applications, so my boss is concerned that if I start a third
 project in Java that no one else will be able to maintain it. It's a
 reasonable concern, but kind of too bad nonetheless. I'm using JQuery as my
 main JS resource for the application. All of the business logic is managed
 through Ajax calls.

 On Tue, Jun 16, 2009 at 12:05 PM, Jeremy Thomerson 
 jer...@wickettraining.com wrote:

  Yeah - but I would guess that it wouldn't fit where I'm limited to
  using only JavaScript
 
  Out of curiosity - what do you mean where I'm limited to using only
  JavaScript?  I mean, can you use HTML?  What does this app do -
  obviously not much if it's only JS.  What does it tie in with to do
  business logic, etc?  Were these requirements written by a PHB?
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
 
  On Tue, Jun 16, 2009 at 11:56 AM, Nicolas
  Melendeznmelen...@getsense.com.ar wrote:
   GWT is a good framework.You can code in java and then it is translated
 to
   javascript.
   NM
  
   On Tue, Jun 16, 2009 at 4:05 PM, nino martinez wael 
   nino.martinez.w...@gmail.com wrote:
  
   You can also have a look at wicketstuff and see what integrations
   already exists :)
  
   2009/6/15 Dane Laverty danelave...@gmail.com:
I'm working on a small project where I'm limited to using only
   JavaScript. I
love the Wicket programming model, especially reusable components.
 Is
   anyone
aware of a JavaScript framework or JavaScript techniques that would
  allow
   me
to approximate Wicket components?
   
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 



Re: Wicket-like JavaScript Components

2009-06-16 Thread Paolo Di Tommaso
Extjs is a good choice, we have integrated it successfully with Wicket.

Check it out at http://code.google.com/p/wicket-ext/

Paolo


On Mon, Jun 15, 2009 at 6:31 PM, Dane Laverty danelave...@gmail.com wrote:

 I'm working on a small project where I'm limited to using only JavaScript.
 I
 love the Wicket programming model, especially reusable components. Is
 anyone
 aware of a JavaScript framework or JavaScript techniques that would allow
 me
 to approximate Wicket components?



Re: Wicket in Php

2009-05-20 Thread Paolo Di Tommaso
In other words .. impossible

-- paolo

On Wed, May 20, 2009 at 6:24 PM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 That's for you to decide.  Typically it involves some kind of jump
 page between the two applications that once you are signed in, it
 sends the user to a page in the other app with a key (perhaps a UUID,
 etc) that correlates to that user in the DB so that the other app can
 automatically sign the user in.

 The problem of course will be keeping session data in sync between the
 two since they can't share the same object.  This typically means
 persisting much of the session state to a database or memcache layer.

 --
 Jeremy Thomerson
 http://www.wickettraining.com




 On Wed, May 20, 2009 at 11:20 AM, Ajayi Yinka
 iamstyaj...@googlemail.com wrote:
  Thanks
 
 
  May I get the description on how to do the integration. I may not mind
 the
  integration, provided it can handle my session for me (As in if a user
 log
  in through a wicket page, we can use this same log in instance to manage
 the
  wicket page).
 
 
  regards,
  yinka
 
  On Wed, May 20, 2009 at 4:45 PM, Jeremy Thomerson 
 jer...@wickettraining.com
  wrote:
 
  Wicket is written in Java.  You would need to build an application in
  Java, running in a servlet container.  Perhaps you could do an
  integration and have some pages running in PHP and some in Java, but
  you are looking at a complex project.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
 
  On Wed, May 20, 2009 at 10:39 AM, Ajayi Yinka
  iamstyaj...@googlemail.com wrote:
   Hi,
  
   Can anyone give me an insight on how I can integrate wicket into php
   project.
  
   I already have an application that is written in php.
  
   I will like to upgrade the application with some new features in which
 I
   prefer to use  wicket.
  
   I am afraid if this is possible?
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Cometd Servlet mapping for wickestuff-push example

2009-04-19 Thread Paolo Marrone

Hi all,
first of all, I'm sorry for a wicketstuff question posted on this list, 
but I cannot find a mailing list for wicketstuff, so I hope someone can 
help me.


I'm a happy user of wicket (great framework!), and because I need also 
the server-side push feature, I gave a look to the wicketstuff-dojo-1.1 
project, that includes an implementation of server-push based on 
Dojo-cometd.


I'm able to run the example within the embedded jetty server, without 
modifications, but because I need to use Glassfish (it is the servlet 
container we use in production), I tried to run the wicketstuff-push 
examples on a Glassfish v3 server, but without success.

The problem, in my opinion, depends on the content of web.xml.
This is the original web.xml (it works on jetty, but not on Glassfish):

web-app id=WebApp_ID
   display-namewicketstuff-push-examples/display-name
   welcome-file-list
   welcome-fileindex.html/welcome-file
   welcome-fileindex.htm/welcome-file
   welcome-fileindex.jsp/welcome-file
   welcome-filedefault.html/welcome-file
   welcome-filedefault.htm/welcome-file
   welcome-filedefault.jsp/welcome-file
   /welcome-file-list
/web-app


I added the following lines to web.xml in order to make the application 
compatible with wicket:


   ...
   filter
   filter-namePushExamples/filter-name
   filter-class
   org.apache.wicket.protocol.http.WicketFilter
   /filter-class
   init-param
   param-nameapplicationClassName/param-name
   param-value
   org.wicketstuff.push.examples.application.ExampleApplication
   /param-value
   /init-param
   /filter
   filter-mapping
   filter-namePushExamples/filter-name
   url-pattern/*/url-pattern
   /filter-mapping
   ...

with the above new web.xml the webapp apparently seems to work in 
Glassfish (I can reach the home page, that contains just a list of links 
to launch all the wicketstuff-push examples), but when I try to launch 
some Cometd based example, I get the following error:


WicketMessage: Can't instantiate page using constructor public 
org.wicketstuff.push.examples.pages.WicketCometdChat(org.apache.wicket.PageParameters) 
and argument


Root cause:

javax.servlet.ServletException: Error searching for cometd Servlet
at 
org.wicketstuff.push.cometd.CometdAbstractBehavior.getCometdServletPath(CometdAbstractBehavior.java:232)
at 
org.wicketstuff.push.cometd.CometdAbstractBehavior.clinit(CometdAbstractBehavior.java:28)
at 
org.wicketstuff.push.cometd.CometdService.addChannelListener(CometdService.java:74)
at 
org.wicketstuff.push.examples.pages.WicketAbstractChat.init(WicketAbstractChat.java:49)
at 
org.wicketstuff.push.examples.pages.WicketCometdChat.init(WicketCometdChat.java:13)

at java.lang.reflect.Constructor.newInstance(Constructor.java:513)


It seems that the cometd servlet mapping cannot be found.
My questions are:

- Why the original web.xml can work in jetty? Where does it get the 
wicket filter definition, and the cometd servlet mapping?


- Someone tried the wicketstuff-push example on a different servlet 
container? If yes, which is the right web.xml file to use?


Please help me.
Thank you
Paolo Marrone





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket, FOP, Markup Inheritance and Markup Type

2008-12-16 Thread Paolo Di Tommaso
Adrian, is not a strange question, I've implemented it and works very well.

And in some use cases is a perfect choice.

In my implementation I use  a FopPage that declares page#getmarkuptype() {
return fop}

The nice thing is that all panel added in that page will look for an
associated markup will a suffix .fop (instead of .html).

This means that you can have a panel implementing a common business logic
with two skins, one html and one fop.

When used in html page it will use the HTML panel and when added in the FOP
page will produce the FOP markup.


Paolo







On Mon, Dec 15, 2008 at 11:14 PM, Adrian Wiesmann awiesm...@somap.orgwrote:

 Hello everybody

 A quick question out of curiosity. Has anybody played around or tried to
 generate XSL-FO from within your Wicket project?

 What I mean is this:

 - Add an XML file to every HTML file.
 - Tell Wicket to use the XML instead of the HTML file for the markup.
 - Have Wicket do the markup inheritance magic and rendering of a FO file
 (instead of plain HTML).
 - Use the resulting FO to render PDF with Apache FOP.
 - Present the PDF file instead the HTML to the client.

 Anyone did so? Anyone played with Wicket and did so in a Swing application
 (instead the web environment)?

 I know, these questions may sound strange, but I am currently thinking
 about the possibilities of Wicket's markup inheritance and if it is
 possible (and makes sense) to use Wicket as a reports generator. Not what
 it is intended to do, but just pretend everything makes sense. :)

 Thanks for your comments.

 Cheers,
 Adrian

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Wicket session back button support

2008-12-12 Thread Paolo Di Tommaso
Good, in this way it works.

I'm apply the onBeforeRender trick to propagate the previous state in the
session.


Thank guys, long live to Wicket

Paolo

On Thu, Dec 11, 2008 at 6:27 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 or instead of pages use panels as content. that way you use the same
 menu instance across multiple pages and the menu can keep its own
 state.

 -igor

 On Thu, Dec 11, 2008 at 2:37 AM, Paolo Di Tommaso
 paolo.ditomm...@gmail.com wrote:
  Nice question. Consider the following use case:
 
  You have the main application menu bar. The user chooses an item from it.
 
  What happens is that all the following pages will be related to that
 choice,
  for example the second level menu in the page (that is contextual to the
  above choice) and I would avoid to specify it as a parameter every time I
  create a new page .
 
  Possible solution, store those variables in the page also and initialize
  them taking the values from the session.
 
  When the user clicks on the back button re-sync the session variables -
 if
  changed - overriding the onBeforeRender() method.
 
  Other solution could be to create a custom UrlEncodingStrategy to
 propagate
  the session vars on URL ...
 
 
  What do you think ?
 
  -- Paolo
 
 
  On Thu, Dec 11, 2008 at 12:29 AM, Matej Knopp matej.kn...@gmail.com
 wrote:
 
  No. You have to track the changes yourself. Or use Page as the scope.
  What's the reason to put values in session anyway?
 
  -Matej
 
  On Wed, Dec 10, 2008 at 11:18 PM, Paolo Di Tommaso
  paolo.ditomm...@gmail.com wrote:
   Dear community,
  
   I'm facing with a really ugly problem. In my web app I need to store
 some
   variables in the Wicket session.
  
   But this cause some nasty side-effects when users click on the browser
  back
   button.
  
   The page displays the previous content correctly but some components,
  which
   model is based on session values, do not.
  
   Is there any best practice for Wicket session to support the browser
 back
   button (so that coming back the session is restored to the previous
  state)?
  
   Thank you,
  
   Paolo
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: [OT] wicket users around the world

2008-12-12 Thread Paolo Di Tommaso
Paolo Di Tommaso, Roma - IT

On Fri, Dec 12, 2008 at 3:40 PM, Steve Flasby st...@flasby.org wrote:

 Brit (actually a Yorkshireman) working in Zürich, Switzerland.



Re: Wicket session back button support

2008-12-11 Thread Paolo Di Tommaso
Nice question. Consider the following use case:

You have the main application menu bar. The user chooses an item from it.

What happens is that all the following pages will be related to that choice,
for example the second level menu in the page (that is contextual to the
above choice) and I would avoid to specify it as a parameter every time I
create a new page .

Possible solution, store those variables in the page also and initialize
them taking the values from the session.

When the user clicks on the back button re-sync the session variables - if
changed - overriding the onBeforeRender() method.

Other solution could be to create a custom UrlEncodingStrategy to propagate
the session vars on URL ...


What do you think ?

-- Paolo


On Thu, Dec 11, 2008 at 12:29 AM, Matej Knopp [EMAIL PROTECTED] wrote:

 No. You have to track the changes yourself. Or use Page as the scope.
 What's the reason to put values in session anyway?

 -Matej

 On Wed, Dec 10, 2008 at 11:18 PM, Paolo Di Tommaso
 [EMAIL PROTECTED] wrote:
  Dear community,
 
  I'm facing with a really ugly problem. In my web app I need to store some
  variables in the Wicket session.
 
  But this cause some nasty side-effects when users click on the browser
 back
  button.
 
  The page displays the previous content correctly but some components,
 which
  model is based on session values, do not.
 
  Is there any best practice for Wicket session to support the browser back
  button (so that coming back the session is restored to the previous
 state)?
 
  Thank you,
 
  Paolo
 

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




Wicket session back button support

2008-12-10 Thread Paolo Di Tommaso
Dear community,

I'm facing with a really ugly problem. In my web app I need to store some
variables in the Wicket session.

But this cause some nasty side-effects when users click on the browser back
button.

The page displays the previous content correctly but some components, which
model is based on session values, do not.

Is there any best practice for Wicket session to support the browser back
button (so that coming back the session is restored to the previous state)?

Thank you,

Paolo


Re: Wicket and Ext JS integration

2008-10-23 Thread Paolo Di Tommaso
I could be interested to share experience about that, but now I'm really in
early stage so I think it would be too early to share the code.


Anyway the main idea is to use the Wicket behaviour feature to attach an
Ext component to the associated Wicket component.

This is the easiest part. More complex integration like Data Store could be
always done using a Wicket ajax behavior.

But I' haven't yet tryed to integrate more complex stuff like editable
grids, groups and so on . .


Paolo




On Thu, Oct 23, 2008 at 1:41 PM, Richard Allen [EMAIL PROTECTED]wrote:

 The licensing is a pain. We started using ExtJS when it was LGPL, then they
 switched to GPL. By then we were already invested, so we bought a
 commercial
 license -- kind of feel like we got suckered into that one. If I had a
 chance to do it again I would just use YUI. We use ExtJS on top of YUI.
 However, ExtJS is a good product, even though they made a poor licensing
 decision.

 The licensing problem is just a fact that we have to deal with now, so I'm
 trying to find out what the easiest path is for integrating ExtJS 2.2 with
 Wicket. If someone else has already done the effort or started the effort,
 then that would help. The amount of work involved in integrating ExtJS 2.2
 with Wicket is part of our new web framework evaluation criteria.

 Thanks,
 Richard Allen

 On Wed, Oct 22, 2008 at 2:05 PM, Nino Saturnino Martinez Vazquez Wael 
 [EMAIL PROTECTED] wrote:

  I thought there were a licensing issue! Could'nt just remember if it were
  the guy doing the wicket contrib or ext js..
 
  Martijn Dashorst wrote:
 
  The GPL licensing of ExtJS is really a brain damage inflicting mess.
  Personally I would stay very far away from JS libraries that are GPL
  licensed (it is not clear how the viral aspect infects your server
  side code, possibly requiring you to ship your server side code to
  your users—you *are* distributing the GPL licensed code, which is
  linked to your product)
 
  Martijn
 
 
 
 
  --
  -Wicket for love
 
  Nino Martinez Wael
  Java Specialist @ Jayway DK
  http://www.jayway.dk
  +45 2936 7684
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Re: Wicket and Ext JS integration

2008-10-23 Thread Paolo Di Tommaso
Yes, I'm working for a no-profit organization and it could be an interesting
option to release it as an OSS.

Do you have any suggestion where the project could be hosted?  Google code?
and any idea about the licence?


Thank you, Paolo


On Thu, Oct 23, 2008 at 2:19 PM, Richard Allen [EMAIL PROTECTED]wrote:

 Paolo,

 Is this an open source effort? What version of ExtJS are you using?

 If we were to choose to go with Wicket, we would be willing to contribute.

 Thanks,
 Richard Allen

 On Wed, Oct 22, 2008 at 10:20 AM, Paolo Di Tommaso 
 [EMAIL PROTECTED] wrote:

  I'm working on a wicket-ext integration project.
 
  Until now I've done just really simple stuff, like simple TextField,
  DateField, TimeField, ComboBox, AutoComplete field and basic (static)
 grid
  elements.
 
  Though my implementation is trivial I would say that is really promising
  and
  I've not found any evident obstacle to a more complete integration.
 
 
  Paolo
 
  On Wed, Oct 22, 2008 at 1:53 PM, Richard Allen 
 [EMAIL PROTECTED]
  wrote:
 
   We currently use Ext JS 2.2 (http://extjs.com) with Struts 1.x, and we
  are
   considering migrating to Wicket. I have seen on the mail archive that
  some
   people have integrated Wicket and Ext JS with mixed success. In
  particular,
   I found the wicket-tools-extjs project,
   http://www.wickettools.org/index.php/extjs-integrationm, which is
  version
   0.1.0, published in February 2008.
  
   Is the wicket-tools-extjs project in active development or was that
  project
   abandoned? Is there any other significant work undergoing to integrate
   Wicket and Ext JS?
  
   Thanks,
   Richard Allen
  
 



Re: Wicket and Ext JS integration

2008-10-22 Thread Paolo Di Tommaso
I'm working on a wicket-ext integration project.

Until now I've done just really simple stuff, like simple TextField,
DateField, TimeField, ComboBox, AutoComplete field and basic (static) grid
elements.

Though my implementation is trivial I would say that is really promising and
I've not found any evident obstacle to a more complete integration.


Paolo

On Wed, Oct 22, 2008 at 1:53 PM, Richard Allen [EMAIL PROTECTED]wrote:

 We currently use Ext JS 2.2 (http://extjs.com) with Struts 1.x, and we are
 considering migrating to Wicket. I have seen on the mail archive that some
 people have integrated Wicket and Ext JS with mixed success. In particular,
 I found the wicket-tools-extjs project,
 http://www.wickettools.org/index.php/extjs-integrationm, which is version
 0.1.0, published in February 2008.

 Is the wicket-tools-extjs project in active development or was that project
 abandoned? Is there any other significant work undergoing to integrate
 Wicket and Ext JS?

 Thanks,
 Richard Allen



Seamless Wicket

2008-10-01 Thread Paolo Di Tommaso
A really interesting post showing how integrate Wicket in the lastest JBoss
Seam.

http://in.relation.to/Bloggers/SeamlessWicket

Enjoy, Paolo


Re: Wicket/Seam on Tomcat 6?

2008-09-30 Thread Paolo Di Tommaso
I've successfully run it on Tomcat 5.5 ..

-- Paolo

On Tue, Sep 30, 2008 at 1:49 PM, Martijn Lindhout
[EMAIL PROTECTED]wrote:

 Hi all,

 Has anyone a running setup of Wicket/Seam on Tomcat. No EJB's, just JPA.

 I get a string ClassNotFoundException on a class that is present in
 WEB-INF/classes

 --
 Martijn Lindhout
 JointEffort IT Services
 http://www.jointeffort.nl
 [EMAIL PROTECTED]
 +31 (0)6 18 47 25 29

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




Best to strategy to have a Wicket page returns a binary content by default

2008-09-23 Thread Paolo Di Tommaso
Guys,

I'm using Wicket to create pdf content using Apache FOP. The idea is to have
a FopPage that extends the root wicket Page component and declares fo as
marketType. The FopPage parses FOP markup instead HTML markup.

I'm able to manage the fop to pdf binary conversion using a custom
PdfRequestTarget, but it requires to specify it explicitly, invoking
RequestCycle.get().setRequestTarget(new PdfRequestTarget(this)); every time.


So the question: is there a way to make a custom RequestTarget the default
to certain pages? Or exists a better strategy to override the default render
strategy to return a content different from HTML ?


Thank you,

-- Paolo


Re: Best to strategy to have a Wicket page returns a binary content by default

2008-09-23 Thread Paolo Di Tommaso
Interesting .. so I could extend QueryStringUrlCodingStrategy overriding the
decode() method to return my PdfRequestTarget.

Cool! Thank you,

-- Paolo

On Tue, Sep 23, 2008 at 3:04 PM, Matej Knopp [EMAIL PROTECTED] wrote:

 You don't have to do this from the pages. You can create your own
 simple IRequestTargetUrlCodingStrategy that resolves to your request
 target and mount the strategy.

 -Matej

 On Tue, Sep 23, 2008 at 12:45 PM, Paolo Di Tommaso
 [EMAIL PROTECTED] wrote:
  Guys,
 
  I'm using Wicket to create pdf content using Apache FOP. The idea is to
 have
  a FopPage that extends the root wicket Page component and declares fo
 as
  marketType. The FopPage parses FOP markup instead HTML markup.
 
  I'm able to manage the fop to pdf binary conversion using a custom
  PdfRequestTarget, but it requires to specify it explicitly, invoking
  RequestCycle.get().setRequestTarget(new PdfRequestTarget(this)); every
 time.
 
 
  So the question: is there a way to make a custom RequestTarget the
 default
  to certain pages? Or exists a better strategy to override the default
 render
  strategy to return a content different from HTML ?
 
 
  Thank you,
 
  -- Paolo
 

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




Re: Re: Best to strategy to have a Wicket page returns a binary content by default

2008-09-23 Thread Paolo Di Tommaso
Because, I want to use Wicket to render PDF content in a trasparent way -
just extending a base page - as normally it is done for a WebPage.

-- Paolo

On Tue, Sep 23, 2008 at 6:08 PM, [EMAIL PROTECTED] wrote:

 Why don't you use the DownloadLink component?

 Just create a file in the java.tmp.dir and setDeleteAfterDownload (true);


 http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/link/DownloadLink.html

 Regards,
 Bruno

 On Sep 23, 2008 11:30am, Paolo Di Tommaso [EMAIL PROTECTED]
 wrote:

 Interesting .. so I could extend QueryStringUrlCodingStrategy overriding

 the


 decode() method to return my PdfRequestTarget.



 Cool! Thank you,



 -- Paolo





Apache FOP and Wicket

2008-09-11 Thread Paolo Di Tommaso
Dear all,

If I'm not wrong Wicket is able to manage any king of markup not just HTML.


So it would be possibile to use Wicket to generate an Apache FOP markup to
rendere a PDF file? Any suggestions?

Thank you,
-- Paolo


Re: Apache FOP and Wicket

2008-09-11 Thread Paolo Di Tommaso
Why not? I was remembering that Wicket can manage any markup, not just HTML
. .

Am I missing something ?

Paolo

On Thu, Sep 11, 2008 at 3:03 PM, Edvin Syse [EMAIL PROTECTED] wrote:

 I don't think Wicket is the right tool for that, try Freemarker instead.
 You can still serve up the file through Wicket though :)

 -- Edvin

 Paolo Di Tommaso skrev:

  Dear all,

 If I'm not wrong Wicket is able to manage any king of markup not just
 HTML.


 So it would be possibile to use Wicket to generate an Apache FOP markup to
 rendere a PDF file? Any suggestions?

 Thank you,
 -- Paolo




 --
 Med vennlig hilsen

 Edvin Syse
 Programutvikler

 www.sysedata.no / [EMAIL PROTECTED]
 Tlf: 333 49700  / Faks: 333 49701
 Adresse: Møllegaten 12, 3111 Tønsberg

 Syse Data AS -Profesjonelle IT-tjenester

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




Wicket integration in Seam 2.1

2008-08-05 Thread Paolo Di Tommaso
Guys,

A very interesting interview to Pete Muir about the upcoming JBoss Seam 2.1,
especially regarding Wicket integration as presentation layer.


[..] Firstly, we want to support Wicket, as a first class view layer. Well,
what does this actually mean, with some sort of technical details. Well,
what we want to be able to do is allow you, obviously, to be able to access
your Seam components for a Wicket club, using annotation controlled
injection, to be able to control conversations, with annotations from inside
your Wicket class, to be able to control your business process management
tasks and your business process management processes themselves. So
basically, all the orchestration stuff that you need to do with writing the
view side of your app. [..] 

http://java.dzone.com/articles/whats-new-seam-21-an-interview


Enjoy.

-- Paolo


Re: Issue with the FileUploadField

2008-07-16 Thread Paolo Di Tommaso
The trick is based on a hidden iframe, like the following:

iframe id=upload_target wicket:id=upload_target name=upload_target
style=width:0px;height:0px;border:0  /iframe
form wicket:id=form0 target=upload_target 
div id=upload-field-handler style=position: absolute; z-index: 100;
display: none
input id=upload_field wicket:id=upload_field type=file
class=DisplayText size=55 onchange=upload(this) /
/div
/form

And tell wicket to do not redirect on form upload when the submit is
terminated:

public void onSubmit() {
getRequestCycle().setRedirect(false);

getRequestCycle().setRequestTarget(EmptyRequestTarget.getInstance());
}

I'm attaching my code so you can check details.

Have fun

-- Paolo



On Wed, Jul 9, 2008 at 4:35 PM, Arun Wagle [EMAIL PROTECTED] wrote:

 Hello All,

 I have an issue with the file upload
 I have a Fileupload input filed on a tabbed panel.  The first time when I
 select a file and submit,  the following returns null
 FileUpload upload = fileUploadField.getFileUpload(); return null.
 But if I select the same file again and submit I get the value. Have anyone
 encountered this before ?

 If this can be of any help, the TabbedPanel link is a AJAXSubmit as I need
 to retain some of the form values on tab change .
 Also the above action occurs on the submit of another File Upload button
 on the form and not on the Tabbed link Submit

 Also is there a AJAX Fileupload component anyone know of or has written? .

 Thank you all in advance

 Regards,
 Arun Wagle

package org.fao.ocd.applications.coin.web.ui.widget;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.fao.ocd.applications.coin.web.wicket.AjaxUtils;

import org.apache.wicket.ajax.AjaxEventBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.IAjaxCallDecorator;
import org.apache.wicket.ajax.calldecorator.AjaxCallDecorator;
import org.apache.wicket.feedback.FeedbackMessage;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.upload.FileUpload;
import org.apache.wicket.markup.html.form.upload.FileUploadField;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.request.target.basic.EmptyRequestTarget;
import org.apache.wicket.util.lang.Bytes;

/**
 * A specialized Panel aimed at file uploading management.
 * 
 * pThe components to render the attachments list should look like this:br/
 * code 
 *	lt;div wicket:id=attachment_container gt;br/
 *		lt;table id=attach-tablegt;br/
 *			lt;tr wicket:id=attachments gt;br/
 *lt;td class=menuListItemgt;lt;img wicket:id=clip height=15 width=15 /gt; lt;/tdgt;br/
 *lt;td class=menuListItemgt;lt;a wicket:id=link gt;lt;span wicket:id=filename gt;filename (size)lt;/spangt;lt;/agt;lt;/tdgt;br/
 *lt;td class=menuListItemgt;lt;a wicket:id=delete gt;deletelt;/agt;lt;/tdgt;br/
 *			lt;/trgt;br/
 *  	lt;/tablegt;br/
 *	lt;/divgt;br/
 *	lt;div id=upload-field-position class=menuListItem style=height: 22px gt;br/
 *	lt;a id=attach-link href=javascript:void(0) onclick=showUploadField(); gt;Attach a filelt;/agt;br/lt;/divgt; br/
 *  /code
 *  /p
 *  p
 *  There are a few naming contraints you need to follow to make it work, due to the fact that some components' names are explicitly referenced in the Javascript code
 *  contained in UploadPanel.html:br/
 *  1) the last DIV in the code above must have id=upload-field-position;br/
 *  2) the anchor inside it must have id=attach-link and onclick=showUploadField();.
 *  /p
 *  
 * @author Fabio Fioretti
 *
 */
public class UploadPanel extends Panel{
	
	private static final Log log = LogFactory.getLog(UploadPanel.class);
	
	private UploadForm uploadForm;
	

	public UploadPanel(String id) {
		super(id);
		
		// the hidden frame
		createUploadTargetFrame(this);

		/*
		 * The uploading form
		 */
		add( uploadForm = new UploadForm(form0) );

	}
	
	public UploadPanel(String id, int sizeMB) {
		super(id);
		
		// the hidden frame
		createUploadTargetFrame(this);

		/*
		 * The uploading form
		 */
		add( uploadForm = new UploadForm(form0, sizeMB) );

	}
	
	private WebMarkupContainer createUploadTargetFrame(Panel container) {
		WebMarkupContainer frame = new WebMarkupContainer(upload_target);
		frame.add( new AjaxEventBehavior(onload) {
			
			protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() { 
	public CharSequence decorateScript( CharSequence script ) { 
		return  if(__cload++0) { +script+ } ;
	}
};
			}
			
			protected void onEvent(AjaxRequestTarget target) {
try { 
	if( uploadForm.error != null ) { 
		AjaxUtils.alert(target, String.valueOf(uploadForm.error.getMessage()) );
		// on error we will reload the form
		target.addComponent( uploadForm );
		// clear raising error
		uploadForm.error = null;
	}
	else { 
		// on hidden frame reload we will refresh

Re: [ANNOUNCE] Apache Wicket 1.3.4 is released!

2008-06-28 Thread Paolo Di Tommaso
Really a good news. Congratulations!

-- Paolo


On Fri, Jun 27, 2008 at 12:35 AM, Martijn Dashorst [EMAIL PROTECTED]
wrote:

 The Apache Wicket team is proud to announce the availability of the fourth
 maintenance release: Apache Wicket 1.3.4. A lot of bugs have been squashed
 and
 several improvements implemented. Two noteworthy bugs have been squashed:

  - cross session leakage due to a dangling thread local in exceptional
   circumstances
  - memory leak in localizer (WICKET-1667)

 It is therefore recommended you update to Wicket 1.3.4 at your earliest
 convenience.

 Eager people click here to download the distribution, others can read
 further:

 http://www.apache.org/dyn/closer.cgi/wicket/1.3.4

 We thank you for your patience and support.

 - The Wicket Team


 Apache Wicket

 Apache Wicket is a component oriented Java web application framework. With
 proper mark-up/logic separation, a POJO data model, and a refreshing lack
 of
 XML, Apache Wicket makes developing web-apps simple and enjoyable again.
 Swap
 the boilerplate, complex debugging and brittle code for powerful, reusable
 components written with plain Java and HTML.

 You can find out more about Apache Wicket on our website:

 http://wicket.apache.org


 This release

 This release is the fourth maintenance release for the Wicket 1.3 product.
 This release fixes several bugs and adds some minor improvements. You can
 find
 out about the changes at the bottom of this announcement.


 Migrating from 1.2

 If you are coming from Wicket 1.2, you really want to read our migration
 guide, found on the wiki:

 http://cwiki.apache.org/WICKET/migrate-13.html


 Downloading the release

 You can download the release from the official Apache mirror system, and
 you
 can find it through the following link:

 http://www.apache.org/dyn/closer.cgi/wicket/1.3.4/

 For the Maven and Ivy fans out there: update your pom's to the following,
 and
 everything will be downloaded automatically:

 dependency
   groupIdorg.apache.wicket/groupId
   artifactIdwicket/artifactId
   version1.3.4/version
 /dependency

 Substitute the artifact ID with the projects of your liking to get the
 other
 projects.

 Please note that we don't prescribe a Logging implementation for SLF4J. You
 need to specify yourself which one you prefer. Read more about SLF4J here:
 http://slf4j.org


 Validating the release

 The release has been signed by Martijn Dashorst, your release manager for
 today. The public key can be found in the KEYS file in the download area.
 Download the KEYS file only from the Apache website.

 http://www.apache.org/dist/wicket/1.3.4/KEYS

 Instructions on how to validate the release can be found here:

 http://www.apache.org/dev/release-signing.html#check-integrity


 Reporting bugs

 In case you do encounter a bug, we would appreciate a report in our JIRA:

 http://issues.apache.org/jira/browse/WICKET


 The distribution

 In the distribution you will find a README. The README contains
 instructions
 on how to build from source yourself. You also find a CHANEGELOG-1.3 which
 contains a list of all things that have been fixed, added and/or removed
 since
 Wicket 1.3.0.

 Release Notes - Wicket - Version 1.3.4

 ** Bug
* [WICKET-613] - Prototype scoped Spring beans
* [WICKET-1152] - MetaDataRoleAuthorizationStrategy.unauthorize()
 doesn't work
* [WICKET-1292] - WicketTester continueToOriginalDestination()
 uses application home page instead of original redictor
* [WICKET-1366] - ava.lang.IllegalStateException: No Page found
 for component when collapsing nodes in a LinkTree
* [WICKET-1418] - org.apache.wicket.MarkupContainer swallows
 AbortException
* [WICKET-1453] - WicketServlet does not set content type on fallback()
* [WICKET-1473] - BaseWicketTester.isComponentOnAjaxResponse()
 test is too strong
* [WICKET-1476] - Referencing Page may cause StackOverflowError
* [WICKET-1499] - AjaxEditableMultiLineLabel + race condition /
* [WICKET-1501] - MarkupCache.putIntoCache doesn't behave correctly!!
* [WICKET-1504] - AutoCompleteTextField - javascript error type
 mismatch in line 227 in IE
* [WICKET-1507] - MarkupCache style/variation/locale support broken
* [WICKET-1510] - FormDispatcherRequest creates invalid parameter map
* [WICKET-1521] - ClassCastException in MixedUrlCodingStrategy
* [WICKET-1527] - WicketTester can not deal with null values in
 page parameters
* [WICKET-1536] - Enclosure permanently hides direct children
 after it has been itself hidden once
* [WICKET-1537] - SelectOption generates non xhtml compliant markup
* [WICKET-1541] - PopupSettings' windowName fixes for IE
* [WICKET-1544] - Update Javadoc for AbstractValidator
* [WICKET-1547] - Add getterfor IPageable to PagingNavigation
* [WICKET-1548] - PagingNavigator calls factory methods from constructor
* [WICKET-1549] - Memory leak with PropertyResolver (in running test
 suites)
* [WICKET-1551

Re: using wicket to create dynamic chart

2008-05-15 Thread Paolo Di Tommaso
Pure JavaScript .. simple stunning!

http://people.iola.dk/olau/flot/examples/graph-types.html

// Paolo

On Thu, May 15, 2008 at 9:11 PM, Ryan Gravener [EMAIL PROTECTED]
wrote:

 These look pretty nice for free:

 http://teethgrinder.co.uk/open-flash-chart/

 On Thu, May 15, 2008 at 11:29 AM, Jonathan Locke [EMAIL PROTECTED]
 
 wrote:

 
 
  if you mean it changes in the browser after the page is finished loading,
  you are probably talking client-side technologies: JS, flash, applets,
  something like that.
 
 
  emee wrote:
  
   Hello ,
  
   I would like to use wicket to create a dynamic chart, I mean the values
  of
   my chart change in the time. I use googleChart to create my chart but
 it
   is a static chart and  all the example I have with wicket to create
  static
   chart any idea how I can create a dynamic chart by using wicket ?
  
   Thank you
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/using-wicket-to-create-dynamic-chart-tp17251826p17255946.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 Ryan Gravener
 http://twitter.com/ryangravener



Re: JmxPanel

2008-04-30 Thread Paolo Di Tommaso
YESS! You are right, now it works.

Thank you, Paolo



On Wed, Apr 30, 2008 at 11:15 AM, Benjamin Ernst [EMAIL PROTECTED]
wrote:

 Hi Paolo,

 I had just the same problem as you.

 The display:none has nothing to do with this. It just hides the root of
 the tree.

 The problem was that the domain is skipped, because it doesen´t have the
 same name as my Application.

 So I removed the the filter part from the createTreeModel()-Method in the
 JmxPanel.java like this:

 // process all available domains
for (int i = 0; i  domains.length; i++)
{
// skip unwanted domains
 *//if (!getDomainFilter().accept(domains[i]))
 //{
 //continue;
 //}*
// create domain tree node and add to root
JmxTreeNode domain = new JmxTreeNode(domains[i], null);
rootNode.add(domain);
..

 Now I can see all domains in my jmx-Panel

 I hope it helps.

 Benjamin





 On Wed, Apr 23, 2008 at 11:09 PM, Paolo Di Tommaso 
 [EMAIL PROTECTED] wrote:

  No. Just a plain html page without any custom css.
 
  What version of Wicket/Wicket-stuff-jmx-panel are you using ?
 
 
  Thanks,
 
  // Paolo
 
  On Wed, Apr 23, 2008 at 7:20 PM, Gerolf Seitz [EMAIL PROTECTED]
  wrote:
 
   nope, did the same thing you did.
   do you have any custom css that might cause this?
  
Gerolf
  
   On Wed, Apr 23, 2008 at 7:02 PM, Paolo Di Tommaso 
   [EMAIL PROTECTED]
   wrote:
  
Absolutely, JMX feature is enabled.
   
I'm adding a JmxPanel in my page using a simple:
   
add(new JmxPanel(jmx));
   
   
but nothing is displayed ..
   
You have it working? Have you used any trick?
   
// Paolo
   
   
On Wed, Apr 23, 2008 at 3:46 PM, Gerolf Seitz 
 [EMAIL PROTECTED]
wrote:
   
 Paolo,
 I'm not sure where the display:none comes from,
 but i'm pretty sure it's not from the JmxPanel.

 do you have jmx enabled at all?

 Gerolf

 On Thu, Apr 17, 2008 at 9:07 AM, Paolo Di Tommaso 
 [EMAIL PROTECTED]
 wrote:

  Guys,
 
  someone has soem experience with the nice JmxPanel describe
 here?
 
  http://chillenious.wordpress.com/2007/08/29/jmx-wicket-panel/
 
  Adding a JmxPanel instance to my page I always get the following
   EMPTY
  panel
  ..
 
 
  div class=jmxTreePanel
  table
  tr
   tddiv id=tree1 class=jmxTree
   div style=display:none id=tree1_0/div
   /div/td
 tddiv id=detailPanel2
  /div/td
  /tr
  /table
  /div
  div style=clear:both/div
 
 
  Any ideas ?
 
  Thanks.
 
  // Paolo
 

   
  
 



Re: JmxPanel

2008-04-30 Thread Paolo Di Tommaso
Cool, good to know.

Thanks, Paolo

On Wed, Apr 30, 2008 at 11:59 AM, Gerolf Seitz [EMAIL PROTECTED]
wrote:

 heh, didn't think of that ;)
 the correct way would be to override the methode getDomainFilter
 and return IDomainFilter.ALL (or something like that)

 Gerolf

 On Wed, Apr 30, 2008 at 11:49 AM, Paolo Di Tommaso 
 [EMAIL PROTECTED] wrote:

  YESS! You are right, now it works.
 
  Thank you, Paolo
 
 
 
  On Wed, Apr 30, 2008 at 11:15 AM, Benjamin Ernst 
 [EMAIL PROTECTED]
  
  wrote:
 
   Hi Paolo,
  
   I had just the same problem as you.
  
   The display:none has nothing to do with this. It just hides the root
  of
   the tree.
  
   The problem was that the domain is skipped, because it doesen´t have
 the
   same name as my Application.
  
   So I removed the the filter part from the createTreeModel()-Method in
  the
   JmxPanel.java like this:
  
   // process all available domains
  for (int i = 0; i  domains.length; i++)
  {
  // skip unwanted domains
   *//if (!getDomainFilter().accept(domains[i]))
   //{
   //continue;
   //}*
  // create domain tree node and add to root
  JmxTreeNode domain = new JmxTreeNode(domains[i], null);
  rootNode.add(domain);
  ..
  
   Now I can see all domains in my jmx-Panel
  
   I hope it helps.
  
   Benjamin
  
  
  
  
  
   On Wed, Apr 23, 2008 at 11:09 PM, Paolo Di Tommaso 
   [EMAIL PROTECTED] wrote:
  
No. Just a plain html page without any custom css.
   
What version of Wicket/Wicket-stuff-jmx-panel are you using ?
   
   
Thanks,
   
// Paolo
   
On Wed, Apr 23, 2008 at 7:20 PM, Gerolf Seitz 
 [EMAIL PROTECTED]
wrote:
   
 nope, did the same thing you did.
 do you have any custom css that might cause this?

  Gerolf

 On Wed, Apr 23, 2008 at 7:02 PM, Paolo Di Tommaso 
 [EMAIL PROTECTED]
 wrote:

  Absolutely, JMX feature is enabled.
 
  I'm adding a JmxPanel in my page using a simple:
 
  add(new JmxPanel(jmx));
 
 
  but nothing is displayed ..
 
  You have it working? Have you used any trick?
 
  // Paolo
 
 
  On Wed, Apr 23, 2008 at 3:46 PM, Gerolf Seitz 
   [EMAIL PROTECTED]
  wrote:
 
   Paolo,
   I'm not sure where the display:none comes from,
   but i'm pretty sure it's not from the JmxPanel.
  
   do you have jmx enabled at all?
  
   Gerolf
  
   On Thu, Apr 17, 2008 at 9:07 AM, Paolo Di Tommaso 
   [EMAIL PROTECTED]
   wrote:
  
Guys,
   
someone has soem experience with the nice JmxPanel describe
   here?
   
   
 http://chillenious.wordpress.com/2007/08/29/jmx-wicket-panel/
   
Adding a JmxPanel instance to my page I always get the
  following
 EMPTY
panel
..
   
   
div class=jmxTreePanel
table
tr
 tddiv id=tree1 class=jmxTree
 div style=display:none id=tree1_0/div
 /div/td
   tddiv id=detailPanel2
/div/td
/tr
/table
/div
div style=clear:both/div
   
   
Any ideas ?
   
Thanks.
   
// Paolo
   
  
 

   
  
 



WebRequestCycle and Open-session-in-view pattern

2008-04-28 Thread Paolo Di Tommaso
Dear Wicket Gurus,

I'm implementing the Open-session-in-view pattern overriding the
onBeginRequest and onEndRequest method of a custom WebRequestCycle.

Is there any way to avoid to open a new hibernate session for non-view
request, for example resources request (css, javascript, images, etc)
served through the wicket application?

Basically I'm looking for a method to identify requests for static resources
that does not requires n open hibernate session.


Thank you,

// Paolo


Re: JmxPanel

2008-04-23 Thread Paolo Di Tommaso
I tried this trick but the JmxPanel still does not work ..

Have someone used successfully the JmxPanel ?!

Thank you

// Paolo


On Thu, Apr 17, 2008 at 2:20 PM, gumnaam23 [EMAIL PROTECTED] wrote:


 Download the jmx panel source code and add an empty DIV element before the
 the JmxPanel.html

 here's patch,   (you need stuff between --START and -- END )

 svn diff src/main/java/org/wicketstuff/jmx/markup/html/JmxPanel.html

 -- START

 Index: src/main/java/org/wicketstuff/jmx/markup/html/JmxPanel.html
 ===
 --- src/main/java/org/wicketstuff/jmx/markup/html/JmxPanel.html (revision
 3817)
 +++ src/main/java/org/wicketstuff/jmx/markup/html/JmxPanel.html (working
 copy)
 @@ -15,6 +15,7 @@
limitations under the License.
  --
  wicket:panel
 +   div style=clear:both /div
div wicket:id=jmxBeanTable/div
 div style=clear:both/div
 /wicket:panel

 -- END

 Or you can ask the author of JMX panel to include this patch in the next
 release.





Re: JmxPanel

2008-04-23 Thread Paolo Di Tommaso
Absolutely, JMX feature is enabled.

I'm adding a JmxPanel in my page using a simple:

add(new JmxPanel(jmx));


but nothing is displayed ..

You have it working? Have you used any trick?

// Paolo


On Wed, Apr 23, 2008 at 3:46 PM, Gerolf Seitz [EMAIL PROTECTED]
wrote:

 Paolo,
 I'm not sure where the display:none comes from,
 but i'm pretty sure it's not from the JmxPanel.

 do you have jmx enabled at all?

 Gerolf

 On Thu, Apr 17, 2008 at 9:07 AM, Paolo Di Tommaso 
 [EMAIL PROTECTED]
 wrote:

  Guys,
 
  someone has soem experience with the nice JmxPanel describe here?
 
  http://chillenious.wordpress.com/2007/08/29/jmx-wicket-panel/
 
  Adding a JmxPanel instance to my page I always get the following EMPTY
  panel
  ..
 
 
  div class=jmxTreePanel
  table
  tr
   tddiv id=tree1 class=jmxTree
   div style=display:none id=tree1_0/div
   /div/td
 tddiv id=detailPanel2
  /div/td
  /tr
  /table
  /div
  div style=clear:both/div
 
 
  Any ideas ?
 
  Thanks.
 
  // Paolo
 



Re: JmxPanel

2008-04-23 Thread Paolo Di Tommaso
No. Just a plain html page without any custom css.

What version of Wicket/Wicket-stuff-jmx-panel are you using ?


Thanks,

// Paolo

On Wed, Apr 23, 2008 at 7:20 PM, Gerolf Seitz [EMAIL PROTECTED]
wrote:

 nope, did the same thing you did.
 do you have any custom css that might cause this?

  Gerolf

 On Wed, Apr 23, 2008 at 7:02 PM, Paolo Di Tommaso 
 [EMAIL PROTECTED]
 wrote:

  Absolutely, JMX feature is enabled.
 
  I'm adding a JmxPanel in my page using a simple:
 
  add(new JmxPanel(jmx));
 
 
  but nothing is displayed ..
 
  You have it working? Have you used any trick?
 
  // Paolo
 
 
  On Wed, Apr 23, 2008 at 3:46 PM, Gerolf Seitz [EMAIL PROTECTED]
  wrote:
 
   Paolo,
   I'm not sure where the display:none comes from,
   but i'm pretty sure it's not from the JmxPanel.
  
   do you have jmx enabled at all?
  
   Gerolf
  
   On Thu, Apr 17, 2008 at 9:07 AM, Paolo Di Tommaso 
   [EMAIL PROTECTED]
   wrote:
  
Guys,
   
someone has soem experience with the nice JmxPanel describe here?
   
http://chillenious.wordpress.com/2007/08/29/jmx-wicket-panel/
   
Adding a JmxPanel instance to my page I always get the following
 EMPTY
panel
..
   
   
div class=jmxTreePanel
table
tr
 tddiv id=tree1 class=jmxTree
 div style=display:none id=tree1_0/div
 /div/td
   tddiv id=detailPanel2
/div/td
/tr
/table
/div
div style=clear:both/div
   
   
Any ideas ?
   
Thanks.
   
// Paolo
   
  
 



Re: integrating extjs with wicket

2008-04-22 Thread Paolo Di Tommaso
Dear AT ... unfortunately I didn't had time to work out on this integration.


I will let you know in future.

// Paolo



On Mon, Apr 21, 2008 at 4:58 PM, Advanced Technology(R) [EMAIL PROTECTED]
wrote:

 Hi Paulo,
 Did you have sucess integrating Ext.form.FormPanel ???
 Can you upload  Wicket-Extjs integration Test App ?


 AT

 2008/1/9, Paolo Di Tommaso [EMAIL PROTECTED]:
 
  This is really an interesting topic!
 
  I've made some Wicket-Extjs integration tests and I haven't found any
  particular issues to make them work smoothly together.
 
  Extjs UI widgets can be created dynamically or can be attach to existing
  HTML elements using the element IDs.
 
  Following the latter approach is quite easy integrate Extjs with Wicket.
 
  The simplest way I've tried is using a behavior to 'attach' an Extjs
  widget
  to Wicket component.
 
  For example:
 
  public class ExtDateFieldBehavior extends ExtAbstractBehavior{
 
  @Override
  String getExtjsClassName() {
  return Ext.form.DateField;
  }
 
  }
 
  public abstract class ExtAbstractBehavior extends AbstractBehavior {
 
 
  /**
   * Used to add all common Extjs required JavaScript and CSS
 resources
   */
  @Override
  public void bind(Component component) {
  if( component == null ) throw new
  IllegalArgumentException(Argument
  cannot be null);
  component.setOutputMarkupId(true);
  component.add(HeaderContributor.forCss( Extjs.Css.EXT_ALL ));
  component.add(HeaderContributor.forJavaScript( Extjs.Js.EXT_BASE
  ));
  component.add(HeaderContributor.forJavaScript(
  Extjs.Js.EXT_ALL_DEBUG ));
  }
 
 
  abstract String getExtjsClassName();
 
  abstract String getOptions();
 
  @Override
  public void onRendered( Component component ) {
  /* create a copy of options */
  Config options = new Config( config );
  /* initialization */
  config(component,options);
  /* get the string version */
  String sConfig = Extjs.serialize(options);
 
  String extjs = new  + getExtjsClassName() + ( + getOptions()
 +
  );;
  //TODO log here
 
  Response r = component.getResponse();
  r.write( JavascriptUtils.SCRIPT_OPEN_TAG );
  r.write( extjs );
  r.write( JavascriptUtils.SCRIPT_CLOSE_TAG );
  }
  }
 
 
  That's all!
 
  Obviously this is just a simple test but it works and can be extended
  easily
  for other widgets.
 
 
  What I've found not trivial is to pass/define the Extjs widget
  property/configuration in a easy/elegant way.
 
  Would be interesting discuss this...
 
 
  -- Paolo
 
 
 
 
 
  On Jan 9, 2008 6:25 PM, Jeremy Fergason [EMAIL PROTECTED]
 wrote:
 
   wicket seems to provide some nice management classes like TextField,
  that
   do
   things like set the value for you, I don't see how to integrate this
  with
   a
   javascript solution like ExtJs which does not use an input
 type=text
   ...
   tag.  It could be something very simple and I am just missing it, if
 so
   please point me in the right direction.
  
   Thanks!
  
   On Jan 9, 2008 10:19 AM, Martijn Dashorst [EMAIL PROTECTED]
   wrote:
  
What is keeping you from building it?
   
Martijn
   
On Jan 9, 2008 6:15 PM, Reinout van Schouwen [EMAIL PROTECTED]
  wrote:

 Op woensdag 09-01-2008 om 09:07 uur [tijdzone -0700], schreef
 Jeremy
 Fergason:

  I'm just starting out with wicket and I would like to use a
client-side
  javascript library--ExtJs, to enhance the end user experience.

 +1

 At my company we use Ext2 and are very enthousiastic about it.
 I want to move us from Struts to Wicket but lack of support for
 Ext2
 would be a roadblock...

 --
 Reinout van Schouwen





  -
 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 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
   
   
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
 



 --
 AT(R)



Re: JmxPanel

2008-04-18 Thread Paolo Di Tommaso
Thanks, I will try it. Anyway strange that there's this still this issue ..


// Paolo

On Thu, Apr 17, 2008 at 2:20 PM, gumnaam23 [EMAIL PROTECTED] wrote:


 Download the jmx panel source code and add an empty DIV element before the
 the JmxPanel.html

 here's patch,   (you need stuff between --START and -- END )

 svn diff src/main/java/org/wicketstuff/jmx/markup/html/JmxPanel.html

 -- START

 Index: src/main/java/org/wicketstuff/jmx/markup/html/JmxPanel.html
 ===
 --- src/main/java/org/wicketstuff/jmx/markup/html/JmxPanel.html (revision
 3817)
 +++ src/main/java/org/wicketstuff/jmx/markup/html/JmxPanel.html (working
 copy)
 @@ -15,6 +15,7 @@
limitations under the License.
  --
  wicket:panel
 +   div style=clear:both /div
div wicket:id=jmxBeanTable/div
 div style=clear:both/div
 /wicket:panel

 -- END

 Or you can ask the author of JMX panel to include this patch in the next
 release.


 paolo di tommaso wrote:
 
  Guys,
 
  someone has soem experience with the nice JmxPanel describe here?
 
  http://chillenious.wordpress.com/2007/08/29/jmx-wicket-panel/
 
  Adding a JmxPanel instance to my page I always get the following EMPTY
  panel
  ..
 
 
  div class=jmxTreePanel
  table
  tr
   tddiv id=tree1 class=jmxTree
div style=display:none id=tree1_0/div
/div/td
  tddiv id=detailPanel2
  /div/td
  /tr
  /table
  /div
  div style=clear:both/div
 
 
  Any ideas ?
 
  Thanks.
 
  // Paolo
 
 

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


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




Re: AW: Wicket + CMS

2008-04-18 Thread Paolo Di Tommaso
Someones in this thread have ever seen Riot CMS ?!

*Riot is a web-based Open Source Content Management System written in Java.
It's quite different from other systems as it has been designed to match the
needs of custom applications, [..]*

http://www.riotfamily.org


I think would be relatively easy to add Wicket support to it.


// Paolo



On Fri, Apr 18, 2008 at 9:28 PM, Frank van Lankvelt 
[EMAIL PROTECTED] wrote:

 Hi Uwe,

   plug shameless=true
  
   The repository is a JCR (JackRabbit) repository extended with workflow
   and faceted navigation.  The CMS is composed as a set of plugins.
  These
   Wicket components can be configured and that can be dynamically
 swapped
   in and out of the application.  We use this for example for the
   templates.  Templates consist of a set of (template) plugins and a
   configuration in the repository.  The template configuration can be
   edited in the CMS itself!
  
   /plug
 
  will the actual delivery be done by a JSP frontend, or a Wicket
 frontend?
 
 at the moment, we're focussing on JSP.  A custom tag library is under
 development that accesses the repository and allows url mapping.

 It should certainly be possible to develop a frontend in Wicket; the
 models that we use to access the repository are easily reused.
 To embed plugins, e.g. those used by the CMS, does require some support
 from the environment.  The Wicket session needs to provide a valid JCR
 session, for example.

  And if JSP will be delivering, can we build CMS-agnostic wicket
  components that could wor as they would in a normal wicket app (wrapped
  by some plugin adapter of course)?
 
 yes, if you're components don't need to have any interaction with the
 CMS then this is certainly possible.

 When you do want to have an interaction, some additional constaints will
 (likely) be present due to the possible actions of other plugins.

 If you want to further discuss the Hippo CMS, then we should move the
 discussion to the hipporepos-dev mailing list.  You can subscribe and
 visit the archives at
 http://lists.hippo.nl/mailman/listinfo/hipporepos-dev
 The traffic mainly consists of JIRA updates and svn-logs, but it should
 be possible to filter these out if you want to.

 thanks for the interest!

 cheers, Frank


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




JmxPanel

2008-04-17 Thread Paolo Di Tommaso
Guys,

someone has soem experience with the nice JmxPanel describe here?

http://chillenious.wordpress.com/2007/08/29/jmx-wicket-panel/

Adding a JmxPanel instance to my page I always get the following EMPTY panel
..


div class=jmxTreePanel
table
tr
 tddiv id=tree1 class=jmxTree
  div style=display:none id=tree1_0/div
  /div/td
tddiv id=detailPanel2
/div/td
/tr
/table
/div
div style=clear:both/div


Any ideas ?

Thanks.

// Paolo


Check validator existence

2008-04-14 Thread Paolo Di Tommaso
Guys,

is there an API in wicket to know if a Validator instance has been added to
a form?

Something like Form#contains( IValidator ) or any workaround to know it?


Thanks,


// Paolo


Re: Check validator existence

2008-04-14 Thread Paolo Di Tommaso
I've done so .. thanks.

// Paolo

On Mon, Apr 14, 2008 at 9:17 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 just have a boolean that marks the fact that you have added the
 validator to the form...

 -igor





How page handle a request wiki page

2008-04-12 Thread Paolo Di Tommaso
I think the content of this page describing how page handle a request is
outdated by wicket 1.3.x

http://cwiki.apache.org/WICKET/lifecycle-of-a-wicket-application.html#LifecycleofaWicketApplication-HowPageHandlesaRequest

It is still making reference to onBeginRequest and onAfterRequest methods
that have been deprecated. Haven't they?


Thank Paolo


Re: onBeforeRender vs. prepareForRender

2008-04-12 Thread Paolo Di Tommaso
Here it is a good reference

http://cwiki.apache.org/WICKET/user-code-context.html


// Paolo

On Sat, Apr 12, 2008 at 7:29 PM, Stefan Simik [EMAIL PROTECTED]
wrote:


 One additional question,

 is it valid to change to component hierarchy in these methods ?

 I tried it, but it didnt work:



 SHORT EXAMPLE:
 -

 AjaxFallbackLink updateLink = new AjaxFallbackLink(updateLink) {

  @Override
  public void prepareForRender() {
super.prepareForRender();

// if some condition true - render additional attribute
if (isUpdateProcessRunning()) {
add(new
 StyleAttributeAppender(text-decoration: none;));
}
  }
 };


  and result was, that no STYLE attribute was rendered.

 But when I write:
updateLink.add(new StyleAttributeAppender(text-decoration: none;));
 then, the STYLE attribute is rendered.


 I cannot find out, what I am doing wrong here..

 Thanks a lot.
 --
 View this message in context:
 http://www.nabble.com/onBeforeRender-vs.-prepareForRender-tp16653398p16653658.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: Seam Wicket integration and conversation scope

2008-03-23 Thread Paolo Di Tommaso
Nice and interesting. This could be a valid alternative to simulate the Seam
conversation-scoped persistent context.

Although doing so the presentation layer is too tied to persistent session
handling aspect. I think this could be really useful in a simple scenario
with few pages, but in complex use causes (and integrating other frameworks
like jbpm that need to share the same hibernate session) it will drive in a
hell.


Thank you.

// Paolo

On Sun, Mar 23, 2008 at 2:25 AM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 conversation scope is slightly different, for long running hibernate
 sessions it is an equivalent of doing:

 class conversationpage extends webpage {
  private org.hibernate.Session session;

  public conversationpage(Session session) {
this.session=session;
  }

  protected Session getSession() {
if (!session.isconnected()) { session.reconnect(); }
return session;
  }

  protected void ondetach() { session.disconnect(); }
 }

 so in this case the conversation would be propogated so:

 setresponsepage(new edituserstep2page(getsession(), usermodel));

 -igor


 On Sat, Mar 22, 2008 at 6:13 PM, brian.diekelman [EMAIL PROTECTED]
 wrote:
 
   I have only read up on Seam a few times, so help me out where I'm
   incorrect...
 
   As far as I can tell Seam uses the conversation scope as a step between
   request scope and session scope to persist values across a couple of
   requests, for instance a user creation wizard, etc.
 
   I don't know what integration they've enabled or how it works, but
 passing
   an object between requests is simple and straight forward in wicket.
  Say
   that you want to pass a user object (or any other combination of
 objects)
   from one page to another when the user clicks a link:
 
   public class SimplePage extends WebPage
   {
public SimplePage(final User user)
{
  add(new Link(link)
  {
public void onClick()
{
  setResponsePage(new SomeOtherPage(user));
}
  }
}
   }
 
   You would pass it directly by reference.  Like I said, I don't know how
 Seam
   is integrating, but when you're using Wicket you don't really have a
 need
   for something like a conversation scope.  You can use whatever
 granularity
   you'd like to pass objects between pages, not necessarily bound to any
   particular scope.
 
   Please let me know if I'm just completely missing your point here.
 
   --
   View this message in context:
 http://www.nabble.com/Seam-Wicket-integration-and-conversation-scope-tp16228793p16230158.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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




Seam Wicket integration and conversation scope

2008-03-22 Thread Paolo Di Tommaso
I'm playing with the latest Seam release (2.1.0.A1) containing a really
interesting integration of Apache Wicket.

The current implementation appear to be really promising and I hope it will
improved in next release.

One of the most interesting feature already implemented is the conversation
scope that enables conversation-scoped persistent context.

I've noticed that the conversation between different wicket pages is
maintained only navigating by a form submit action BUT it doesn't when
moving between pages using other components i.e. Link, AjaxLink, Button,
AjaxBehavior .. and so on.

This makes it useless, in particular with Ajax interactions where it is
expected to have the maximum benefits (no more LazyInitializationException
.. ).

Is this a know issue? It is planned in next release to maintained the
conversation between Wicket pages navigating by Link and AjaxBehavior also?

Thank you,

// Paolo


Re: wicket-datetime

2008-03-06 Thread Paolo Di Tommaso
If you don't have licence matter you can download the old 1.2.x datepicker
available here

http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-datepicker

and refactor to make it use the Wicket 1.3.x core classes.


That's all .

/ Paolo


On Thu, Mar 6, 2008 at 11:23 AM, Charlie Dobbie [EMAIL PROTECTED] wrote:

 Hi all,

 This is causing me some issues as well.  I have a page which contains
 21 datepickers...  These add 59KB of JavaScript to the head and I now
 believe might be the cause of a ~three second browser pause I'm seeing
 when the entering the page.

 The 1.2.6 datepicker component kept its JavaScript in external
 libraries, so they were only loaded once, and made a call to
 Calendar.setup to do the work for each component.  Obviously, they're
 both different technologies behind the scenes, so the same approach
 might not work.  Anyone got any suggestions?

 Charlie.



 On Thu, Mar 6, 2008 at 9:42 AM, Ned Collyer [EMAIL PROTECTED] wrote:
 
   Hi Igor,
 
   The picker works fine - its the implementation I'm concerned about.
 
   If you have 2 instances, then all the javascript exists twice.  All the
   translations exist twice.
 
   The demo does not show 2 date pickers and you can clearly see the
 dependance
   on initdateTextField2 being pasted into the middle of the script
 area.
 
   eg, say you need to specify a date range - or multiple date ranges for
   something like a search input, or you have multiple panels with date
   pickers.
 
   Is this purely to satisfy the requirement of the example? -ie, not
 suitable
   for anything more than date of birth checking and 1 instance per
 page.
 
 
 
   igor.vaynberg wrote:
   
it seems to be working just fine here
   
http://wicketstuff.org/wicket13/dates/
   
   
-igor

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




Re: Bookmarkable page absolute url

2008-03-04 Thread Paolo Di Tommaso
Nice. thank you!

But the real problem is that the RequestCycle#urlFor( Class, PageParams ) is
returning a relating path like:

../?wicket:bookmarkablePage=the.class.Name

Well the javadoc for urlFor() states:

*Returns a bookmarkable URL that references a given page class using a given
set of page
parameters. Since the URL which is returned contains all information
necessary to instantiate
and render the page, it can be stored in a user's browser as a stable
bookmark.*

But a RELATIVE url (like the above) how can be considered a stable
bookmarkable url?

Am I missing something ?


Thanks.

/ Paolo


On Tue, Mar 4, 2008 at 12:47 PM, Daniel Frisk [EMAIL PROTECTED] wrote:

 I use RequestUtils to convert the path to an absolute path, seems to
 work like a charm :-)

 import org.apache.wicket.protocol.http.RequestUtils;

 RequestUtils.toAbsolutePath(relativePath);

 Regards
 // Daniel




Cross fields validation

2008-02-29 Thread Paolo Di Tommaso
Guys,

Which the best pattern using wicket to write validation rule that span over
more than one field?!

Take in consideration the following use case:

There is a form with two field Field-A and Field-B.

Field-A is mandatory and contains a date value. So this is trivial:
setRequired(true) + a DateValidator

Field-B validation depends on the date value entered in Field-A and is
mandatory only for certain date value entered in Field-A.

So basically how write a validator that depends on values entered in other
fields?


Thank you.

/ Paolo


Re: Cross fields validation

2008-02-29 Thread Paolo Di Tommaso
Thanks!

On Fri, Feb 29, 2008 at 10:55 AM, Kai Mütz [EMAIL PROTECTED] wrote:

 [EMAIL PROTECTED]  wrote:
  Guys,
 
  Which the best pattern using wicket to write validation rule that
  span over
  more than one field?!

 http://cwiki.apache.org/WICKET/validating-related-fields.html

 HTH, Kai


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




Wicket 1.3.x PageParameters

2008-02-25 Thread Paolo Di Tommaso
Guys,

I'm migrating to Wicket 1.3.x but my application is raising the following
exception

java.lang.IllegalArgumentException: PageParameters can only contain String
or String[]
at org.apache.wicket.request.target.coding.WebRequestEncoder.addValue(
WebRequestEncoder.java:71)
at
org.apache.wicket.request.target.coding.QueryStringUrlCodingStrategy.appendParameters
(QueryStringUrlCodingStrategy.java:139)
at
org.apache.wicket.request.target.coding.BookmarkablePageRequestTargetUrlCodingStrategy.encode
(BookmarkablePageRequestTargetUrlCodingStrategy.java:135)
at
org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.pathForTarget
(WebRequestCodingStrategy.java:459)
at org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.encode(
WebRequestCodingStrategy.java:236)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond
(BookmarkablePageRequestTarget.java:224)
at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(
AbstractRequestCycleProcessor.java:103)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java
:1172)

Is the PageParameters contract changed to contains only String as values?!
Any workaround to have to change all my PageParameters composition?

Thank you,

/ Paolo


Re: Wicket 1.3.x DatePicket drop-in replacement

2008-02-23 Thread Paolo Di Tommaso
Yes, I know that. But I would just to use the previous (and nice) JSCalendar
DatePicker.

I was expecting that the drop-in replacement was a .. drop-in replacement.
But it is still requiring the Wicket 1.2.x core classes (!), being so
migrating to 1.3.x and using the DatePicker drop-in replacement jar it would
require also to deploy also the wicket 1.2.x core classes .. this seems a
bit strange.

Am I missing something ?

Thanks,

- Paolo


On Fri, Feb 22, 2008 at 6:11 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 there is wicket-datetime that has a yui datepicker

 there is also wicket-stuff-calendar (or something that is
 wicket-*-calendar) that uses dhtml gooies datepicker

 -igor


 On Fri, Feb 22, 2008 at 5:15 AM, Paolo Di Tommaso
 [EMAIL PROTECTED] wrote:
  Guys,
 
   as stated in the migration 1.3 migration guide I'm trying to use the
 drop-in
   replacement for the old (JSCalendar based) DatePicker.
 
   http://cwiki.apache.org/WICKET/migrate-13.html#Migrate-1.3-DatePicker
 
   But the download jar named wicket-contrib-datepicker-1.2.jar still
 make
   references to 1.2.x wicket classes (wicket.xxx.Xxx classes) so I'm
 unable to
   use together the wicket 1.3 core classes.
 
 
   Is there a distribution of the previous DatePicker that works with
 Wicket
   1.3 ?
 
 
   Thank you,
 
 
   Paolo
 

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




Wicket 1.3.x DatePicket drop-in replacement

2008-02-22 Thread Paolo Di Tommaso
Guys,

as stated in the migration 1.3 migration guide I'm trying to use the drop-in
replacement for the old (JSCalendar based) DatePicker.

http://cwiki.apache.org/WICKET/migrate-13.html#Migrate-1.3-DatePicker

But the download jar named wicket-contrib-datepicker-1.2.jar still make
references to 1.2.x wicket classes (wicket.xxx.Xxx classes) so I'm unable to
use together the wicket 1.3 core classes.


Is there a distribution of the previous DatePicker that works with Wicket
1.3 ?


Thank you,


Paolo


Re: the flow of wicket

2008-01-12 Thread Paolo Di Tommaso
I disagree with this answer.

The fact that request handling stuff is not a public api, is A GOOD REASON
because it should be documented better, not viceversa.

And I really don't understand in which way this could prevent you to change
- eventually - in future wicket versions.

I not a newbie user and I'm really a Wicket enthusiastic user and pleased to
be involved in its great community, but I have to admit that some topics are
still obscure.

The request flow handling is one of the most important topic to know in a
web application framework, being so I think it would be very interesting to
have only a brief description, for example a sequence diagram showing the
components interaction starting from the WicketFilter (and/or the
WicketServlet) involved in a web request handling.

Hiding this stuff or, even worse, asking the users to debug the framework to
understand what it should important to know I don't think is a good approach
because it is precisely this that leads to wrong assumptions, that could
break in future.

Thank you,

- Paolo



On Jan 11, 2008 2:09 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:

 you guys want to know about internal implementation details. it has no
 publically exposed api, so why should you care? why should we document
 something that can change without affecting our users? does the jee
 spec detail how the request gets to the servlet? no, that is left up
 to the implementor of the servlet container.

 you want to know about it?  set a break point in
 wicketfilter.dofilter() and walk the code.

 -igor


 On Jan 10, 2008 5:06 PM, Dan Kaplan [EMAIL PROTECTED] wrote:
  seconded
 
 
  -Original Message-
  From: Beyonder Unknown [mailto:[EMAIL PROTECTED]
  Sent: Thursday, January 10, 2008 5:05 PM
  To: WICKET USER
  Subject: the flow of wicket
 
 
  Hi All,
 
  I am studying wicket from the WicketFilter to the WebApplication, but I
  don't understand the concept of RequestCycleProcessor and how does it
 get
  invoked.  I read the Wicket In Action and Pro Wicket but the
 explanation
  is not that detailed. Does anybody know of a primer with regards to how
  Wicket process really works? I want to know the flow, from startup of
 the
  servlet container, like what is being instantiated, and when  request is
  made.
 
  I can't seem to trace how RequestTarget being consumed by
  RequestCycleProcessor, from the page.
 
  Thank you very much!
 
  Best,
  Wen Tong
 
  --
  The only constant in life is change.
 
 
 
 
 
 
 
  
  Be a better friend, newshound, and
  know-it-all with Yahoo! Mobile.  Try it now.
  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
 
 
  -
  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: integrating extjs with wicket

2008-01-09 Thread Paolo Di Tommaso
This is really an interesting topic!

I've made some Wicket-Extjs integration tests and I haven't found any
particular issues to make them work smoothly together.

Extjs UI widgets can be created dynamically or can be attach to existing
HTML elements using the element IDs.

Following the latter approach is quite easy integrate Extjs with Wicket.

The simplest way I've tried is using a behavior to 'attach' an Extjs widget
to Wicket component.

For example:

public class ExtDateFieldBehavior extends ExtAbstractBehavior{

@Override
String getExtjsClassName() {
return Ext.form.DateField;
}

}

public abstract class ExtAbstractBehavior extends AbstractBehavior {


/**
 * Used to add all common Extjs required JavaScript and CSS resources
 */
@Override
public void bind(Component component) {
if( component == null ) throw new IllegalArgumentException(Argument
cannot be null);
component.setOutputMarkupId(true);
component.add(HeaderContributor.forCss( Extjs.Css.EXT_ALL ));
component.add(HeaderContributor.forJavaScript( Extjs.Js.EXT_BASE ));
component.add(HeaderContributor.forJavaScript(
Extjs.Js.EXT_ALL_DEBUG ));
}


abstract String getExtjsClassName();

abstract String getOptions();

@Override
public void onRendered( Component component ) {
/* create a copy of options */
Config options = new Config( config );
/* initialization */
config(component,options);
/* get the string version */
String sConfig = Extjs.serialize(options);

String extjs = new  + getExtjsClassName() + ( + getOptions() +
);;
//TODO log here

Response r = component.getResponse();
r.write( JavascriptUtils.SCRIPT_OPEN_TAG );
r.write( extjs );
r.write( JavascriptUtils.SCRIPT_CLOSE_TAG );
}
}


That's all!

Obviously this is just a simple test but it works and can be extended easily
for other widgets.


What I've found not trivial is to pass/define the Extjs widget
property/configuration in a easy/elegant way.

Would be interesting discuss this...

-- Paolo




On Jan 9, 2008 6:25 PM, Jeremy Fergason [EMAIL PROTECTED] wrote:

 wicket seems to provide some nice management classes like TextField, that
 do
 things like set the value for you, I don't see how to integrate this with
 a
 javascript solution like ExtJs which does not use an input type=text
 ...
 tag.  It could be something very simple and I am just missing it, if so
 please point me in the right direction.

 Thanks!

 On Jan 9, 2008 10:19 AM, Martijn Dashorst [EMAIL PROTECTED]
 wrote:

  What is keeping you from building it?
 
  Martijn
 
  On Jan 9, 2008 6:15 PM, Reinout van Schouwen [EMAIL PROTECTED] wrote:
  
   Op woensdag 09-01-2008 om 09:07 uur [tijdzone -0700], schreef Jeremy
   Fergason:
  
I'm just starting out with wicket and I would like to use a
  client-side
javascript library--ExtJs, to enhance the end user experience.
  
   +1
  
   At my company we use Ext2 and are very enthousiastic about it.
   I want to move us from Struts to Wicket but lack of support for Ext2
   would be a roadblock...
  
   --
   Reinout van Schouwen
  
  
  
  
   -
   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 is released
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Re: [Wicket 1.2.6] How to get Wizard's form from inside a WizardStep?

2008-01-07 Thread Paolo Di Tommaso
I would propose the following patch to AjaxFormSubmitBehavior.

Basically adding a form-less constructor so that when the form obejct is not
specified it will discovered using the findParent(Form.class) method.


Core developers what do you think about it ?

Paolo


abstract public class AjaxFormSubmitBehavior extends AjaxEventBehavior{

private Form form;


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

public LazyFormSubmitBehavior( Form form, String event ) {
super(event);
this.form = form;
}

protected Form getForm() {
if( form == null ) {
form = (Form) getComponent().findParent(Form.class);
/* form component cannot be null */
if( form == null ) {
throw new IllegalStateException(Unable to discover parent
form object. Try to override getForm() method with different deferred
strategy);
}
}

return form;
}

@Override
protected CharSequence getEventHandler()
{
final String formId = getForm().getMarkupId();
final CharSequence url = getCallbackUrl();


AppendingStringBuffer call = new
AppendingStringBuffer(wicketSubmitFormById(').append(formId).append(',
').append(url).append(', );

if (getComponent() instanceof Button)
{

call.append(').append(((FormComponent)getComponent()).getInputName()).append('
);
}
else
{
call.append(null);
}

return getCallbackScript(call, null, null) + ;;
}

@Override
protected void onEvent(AjaxRequestTarget target)
{
getForm().onFormSubmitted();
if (!getForm().hasError())
{
onSubmit(target);
}
else
{
onError(target);
}
}

protected abstract void onSubmit(AjaxRequestTarget target);

protected void onError(AjaxRequestTarget target)
{

}

}

On Jan 7, 2008 9:45 AM, Fabio Fioretti [EMAIL PROTECTED] wrote:

 Thanks everybody for the precious help, a custom lazy
 AjaxFormSubmitBehavior was the way to go.


 Fabio Fioretti - WindoM

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




Re: [Wicket 1.2.6] How to get Wizard's form from inside a WizardStep?

2008-01-07 Thread Paolo Di Tommaso
Emh .. not really because that source IS the patch ;)


On Jan 8, 2008 4:52 AM, Timo Rantalaiho [EMAIL PROTECTED] wrote:

 On Mon, 07 Jan 2008, Paolo Di Tommaso wrote:
  I would propose the following patch to AjaxFormSubmitBehavior.
 
  Basically adding a form-less constructor so that when the form obejct is
 not
  specified it will discovered using the findParent(Form.class) method.

 Could you get the same event by

  AjaxFormSubmitBehavior behavior =
  new AjaxFormSubmitBehavior(null, onchange) {
  @Override
  protected Form getForm() {
  return findParent(Form.class);
  }
  ...
  }

 as stated in the source code:

  /* form component cannot be null */
  if( form == null ) {
  throw new IllegalStateException(Unable to discover
 parent
  form object. Try to override getForm() method with different deferred
  strategy);

 Best wishes,
 Timo

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

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




Re: [Wicket 1.2.6] How to get Wizard's form from inside a WizardStep?

2008-01-05 Thread Paolo Di Tommaso
Let me guess .. you need the form to create a AjaxSubmitLink instance.

But the #findParent(Form.class) will return null until the component
hierarchy is constructed, being so you cannot invoke it at component
construction-time.

A possible workaround is to postpone the findParent(Form.class) method
invocation instantiating a the AjaxSubmitLink using a form proxy.

I've hacked this writing a custom AjaxFormSubmitBehavior that does not
require the form instance on its constructor but just discover it - invoking
#findParent(Form.class) method - when is required.

Me fate sempre lavora.. ;)

P


On Jan 4, 2008 12:43 PM, Fabio Fioretti [EMAIL PROTECTED] wrote:

 First of all, many compliments for the great Wicket 1.3 release: we're
 looking forward to port our application to the new cool version!

 How can I get the Wizard's form from inside a WizardStep? I need it to
 trigger an AjaxSubmitLink which should update a part of my model while
 remaining inside that step. What leaves me clueless is the fact that
 WizardStep instances are added to the WizardModel instead of the
 Wizard, so doing something like this from inside the WizardStep:

 Form form = (Form)WizardStep.this.findParent(Form.class);

 seems to return null; moreover, this makes me wonder how the same
 instruction inside WizardStep.AddFormValidatorAction.execute() can
 succeed.

 I'm sure I'm missing something really stupid. Please forgive me. :-)


 Thanks a lot,

 Fabio Fioretti - WindoM

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




Re: Ways of making components in a page optional?

2008-01-03 Thread Paolo Di Tommaso
Yes, I use this approach in conjunction to an ajax action to refresh/create
UI components in response  to user interaction.


Paolo

On Jan 3, 2008 7:43 AM, Timo Rantalaiho [EMAIL PROTECTED] wrote:

 On Wed, 02 Jan 2008, Paolo Di Tommaso wrote:
  An easy trick to avoid this is to use a Panel/Fragment instantiating
 just a
  WebMarkupContainer when you don't want to display/create the full
 component.

 Ah, you mean something like

  add(new WebmarkupContainer(myComplexComponent));

 at construction and then later on

  replace(new MyComplexComponent(myComplexComponent))

 ?

 That's an interesting idea, thanks!

 Best wishes,
 Timo

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

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




Re: Ways of making components in a page optional?

2008-01-02 Thread Paolo Di Tommaso
An easy trick to avoid this is to use a Panel/Fragment instantiating just a
WebMarkupContainer when you don't want to display/create the full component.


That's all

Paolo

On Jan 2, 2008 7:06 PM, Timo Rantalaiho [EMAIL PROTECTED] wrote:

 On Tue, 18 Dec 2007, wfaler wrote:
  Hmm, haven't tried that. That might work - sometimes you just don't
 check all
  the methods thoroughly enough.. :)

 Yep, as far as I know the Wicket Way (TM) of making
 components optional is controlling their visibility. This
 need becomes more obvious when you consider that (except
 repeaters) there is a 1:1 correspondence between HTML
 elements with wicket:id and Wicket components, and it
 wouldn't be nice to need to change the HTML files runtime :)

 One consequence is that all components of the page always
 get constructed even if they are not visible, so on one hand
 you don't want to do heavy work in the constructor of such
 component but on other hand you get more fail-fast with
 regard to component creation.

 Best wishes,
 Timo

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

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




Re: WicketTester failure (1.2.6)

2007-12-06 Thread Paolo Di Tommaso
Solved using

WicketTester#setStartPage( ITestPageSource ) instead of
WicketTester#setStartPage( Page )

Bye, Paolo

On Dec 5, 2007 4:18 PM, Paolo Di Tommaso [EMAIL PROTECTED] wrote:

 Guys,

 I'm getting a WicketRuntimeExceptionin this simple unit test:

 class SimpleTest {

 @Test
 public void createPage() {
 WicketTester tester = new WicketTester();

 PageParameters params = new PageParameters(office_code=FAAFG);
 Page page = new PremisesListPage(params);
 tester.startPage( page );
 tester.assertNoErrorMessage();
 }

 }


 I'm missing something to run test on page instances (instead of using
 WicketTester#startPage(Class) )

 Here it is the stack trace:

 wicket.WicketRuntimeException: Can not set the attribute. No RequestCycle
 available
 at wicket.Session.setAttribute(Session.java:933)
 at wicket.PageMap.put(PageMap.java :531)
 at wicket.Session.touch(Session.java:744)
 at wicket.util.tester.WicketTester.startPage(WicketTester.java:264)
 at
 org.fao.ocd.applications.coin.premises.ui.PremisesListPageTest.createListPage
 (PremisesListPageTest.java :52)
 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.junit.internal.runners.TestMethodRunner.executeMethodBody(
 TestMethodRunner.java:99)
 at org.junit.internal.runners.TestMethodRunner.runUnprotected (
 TestMethodRunner.java:81)
 at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(
 BeforeAndAfterRunner.java:34)
 at org.junit.internal.runners.TestMethodRunner.runMethod(
 TestMethodRunner.java:75)
 at org.junit.internal.runners.TestMethodRunner.run(
 TestMethodRunner.java:45)
 at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(
 TestClassMethodsRunner.java:66)
 at org.junit.internal.runners.TestClassMethodsRunner.run (
 TestClassMethodsRunner.java:35)
 at org.junit.internal.runners.TestClassRunner$1.runUnprotected(
 TestClassRunner.java:42)
 at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(
 BeforeAndAfterRunner.java :34)
 at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java
 :52)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
 JUnit4TestReference.java:38)
 at org.eclipse.jdt.internal.junit.runner.TestExecution.run (
 TestExecution.java:38)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
 RemoteTestRunner.java:460)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
 RemoteTestRunner.java:673)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
 RemoteTestRunner.java:386)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
 RemoteTestRunner.java:196



 Thank, Paolo



Re: Mystery problem w/ Wicket + Glassfish v2?

2007-11-08 Thread Paolo Di Tommaso
Has Wicket 1.2.7 been released? I'm unable to find on 1.2.x download page ..


Thanks, Paolo

On Nov 5, 2007 10:17 PM, Johan Compagner [EMAIL PROTECTED] wrote:

 please upgrade to at least the latest version of 1.2 (1.2.7) because if i
 look at getContentType of an innerclass of DynamicWebResource
 then that is now a abstract method. So there are changes in that area.

 johan



 On 11/5/07, V. Jenks [EMAIL PROTECTED] wrote:
 
 
  OOps!  Sorry, in the Glassfish log-viewer they separate the top line of
  the
  stack from the rest, for some reason.  Here it is:
 
  null java.lang.NullPointerException at
  wicket.markup.html.DynamicWebResource$1.getContentType(
  DynamicWebResource.java
 
 
 
  Johan Compagner wrote:
  
   you miss the most importand part of the error:  the top!
  
  
   On 11/5/07, V. Jenks [EMAIL PROTECTED] wrote:
  
  
   Occasionally, my application will just start doing this - throwing
  this
   error.  I am using Wicket 1.2.4 because my application is stuck at
  that
   version for the time being.  I do not have the time to make the
 changes
   to
   upgrade to the latest version, right now.
  
   Rebooting the app server (Glassfish v2) usually fixes it but when
 it
   does
   happen, it prevents orders from going through and frustrates
   customers.  Not
   a good thing...
  
   I have no idea what causes this and don't know the internals of
  Glassfish
   to
   even begin to try and troubleshoot.  All I know for sure is; this
 NEVER
   happened on JBoss 4.0.x with Wicket.  I figured it was safe to assume
   this
   had nothing to do with my code - nowhere in the stack does it point
 to
   anything in my application (or any application running on it, for
 that
   matter.)
  
   I realize this is vague so hopefully someone else is experiencing
 this
   and
   can help troubleshoot.
  
   Here's the error:
  
   ***
  
   156) at wicket.Resource.onResourceRequested(Resource.java:119) at
   wicket.request.target.resource.SharedResourceRequestTarget.respond(
   SharedResourceRequestTarget.java:192)
   at
   wicket.request.compound.DefaultResponseStrategy.respond(
   DefaultResponseStrategy.java:49)
   at
   wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond
 (
   AbstractCompoundRequestCycleProcessor.java:66)
   at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java
 :902)
   at
   wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:934) at
   wicket.RequestCycle.step(RequestCycle.java:1010) at
   wicket.RequestCycle.steps(RequestCycle.java:1084) at
   wicket.RequestCycle.request(RequestCycle.java:454) at
   wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219) at
   javax.servlet.http.HttpServlet.service(HttpServlet.java:718) at
   javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at
   org.apache.catalina.core.ApplicationFilterChain.servletService(
   ApplicationFilterChain.java:411)
   at
   org.apache.catalina.core.StandardWrapperValve.invoke(
   StandardWrapperValve.java:290)
   at
   org.apache.catalina.core.StandardContextValve.invokeInternal(
   StandardContextValve.java:271)
   at
   org.apache.catalina.core.StandardContextValve.invoke(
   StandardContextValve.java:202)
   at
   org.apache.catalina.core.StandardPipeline.doInvoke(
  StandardPipeline.java
   :632)
   at
   org.apache.catalina.core.StandardPipeline.doInvoke(
  StandardPipeline.java
   :577)
   at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at
   org.apache.catalina.core.StandardHostValve.invoke(
  StandardHostValve.java
   :206)
   at
   org.apache.catalina.core.StandardPipeline.doInvoke(
  StandardPipeline.java
   :632)
   at
   org.apache.catalina.core.StandardPipeline.doInvoke(
  StandardPipeline.java
   :577)
   at
   org.apache.catalina.core.StandardPipeline.invoke(
 StandardPipeline.java
   :571)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java
  :1080)
   at
   org.apache.catalina.core.StandardEngineValve.invoke(
   StandardEngineValve.java:150)
   at
   org.apache.catalina.core.StandardPipeline.doInvoke(
  StandardPipeline.java
   :632)
   at
   org.apache.catalina.core.StandardPipeline.doInvoke(
  StandardPipeline.java
   :577)
   at
   org.apache.catalina.core.StandardPipeline.invoke(
 StandardPipeline.java
   :571)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java
  :1080)
   at
   org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java
 :270)
   at
  
  
 
 com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter
   (DefaultProcessorTask.java:637)
   at
  
 com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess
  (
   DefaultProcessorTask.java:568)
   at
   com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process
 (
   DefaultProcessorTask.java:813)
   at
  
  
 
 com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask
   (DefaultReadTask.java

Wicket-jmx download (?)

2007-10-27 Thread Paolo Di Tommaso
Folks,

I'm looking for Wicket (1.2.x) JMX download but I'm unable to find in the
download page:

http://wicket.sourceforge.net/wicket-1.2/Download.html

Is there another location? How to get it?

Thanks,

Paolo


Re: Wicket-jmx download (?)

2007-10-27 Thread Paolo Di Tommaso
Great .. thank you people!

On 10/27/07, Martijn Dashorst [EMAIL PROTECTED] wrote:


 http://sourceforge.net/project/showfiles.php?group_id=119783package_id=138753release_id=503024

 On 10/27/07, Paolo Di Tommaso [EMAIL PROTECTED] wrote:
  Folks,
 
  I'm looking for Wicket (1.2.x) JMX download but I'm unable to find in
 the
  download page:
 
  http://wicket.sourceforge.net/wicket-1.2/Download.html
 
  Is there another location? How to get it?
 
  Thanks,
 
  Paolo
 


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

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




  1   2   >