Re: Mount causes strange effects on my web application

2008-04-04 Thread SteamR

My project structure is as follows:

root
  -- WEB-INF
  -- classes
  -- libs
  -- css
 --css-files
  -- js
 --javascript files.
  -- images
 --image files.
  -- 
html files.


I have changed the default location of the resources, to reflect the
directory structure (by following the information on wiki:
(http://cwiki.apache.org/WICKET/control-where-html-files-are-loaded-from.html). 



igor.vaynberg wrote:
 
 where does your javascript live? context folder? package folder?
 
 -igor
 
 
 On Thu, Apr 3, 2008 at 2:22 AM, SteamR [EMAIL PROTECTED] wrote:

  OK, it seems that image paths are filtered with correct path, and thus
 leaves
  my javascript reference as is, since I add it myself. Is there somehow I
 can
  find out what path is correct, since I am adding javascript reference in
 my
  java code???




  SteamR wrote:
  
   I found out that it was a js sourcefile reference which were added in
 code
   (in a onRendered method), that when app was mounted, caused the
 lookups to
   be sent to the page instead... So that seems that relative paths are
 nogos
   when mounted???
  
   But strange is that images seems to work ok, they also use relative
   path...
  
  
   SteamR wrote:
  
   I have now searched the html files, and can't find any empty src
   attributes. And it only happens when I add the
  
   mount(/pwa, PackageName.forClass(CategoryPage.class));
  
   in my WebApplication class' init method.
  
   (I also have relocated the html files to the src/main/webapp
 folder, if
   that has something to do with it.)
  
   Well, I will try to strip down the code, to bare minimum and maybe
 post
   the full code here thereafter.
  
  
  
  
  
   SteamR wrote:
  
   Hi,  I hope someone could help me with this...
  
   I have 5 pages which are pretty standalone but stateful, and they
 have
   nothing to do with each other.
  
   Now I thought of having bookmarks for each of these pages, and added
 a
   mount point to /pwa.
  
   Now the problems started; my page's constructor was invoked three
 times
   before actual output occured (it has an empty constructor), and a
 form
   object loses its transient fields during a request-response cycle.
  
   The transient field getting lost, is something I can fix, but
 invoking
   the constructor three times and why wicket does so, is very
 strange...?
  
   Anyone know any answer to this...
  
   Btw, I am running wicket 1.3.1
  
  
  
  
  

  --
  View this message in context:
 http://www.nabble.com/Mount-causes-strange-effects-on-my-web-application-tp16395309p16467343.html


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


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


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

-- 
View this message in context: 
http://www.nabble.com/Mount-causes-strange-effects-on-my-web-application-tp16395309p16485866.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: Mount causes strange effects on my web application

2008-04-04 Thread Igor Vaynberg
see ContextImage and how it generates the necessary ../../ prefix, do
the same for your javascript inside iheadercontributor.

-igor


On Thu, Apr 3, 2008 at 11:22 PM, SteamR [EMAIL PROTECTED] wrote:

  My project structure is as follows:

  root
   -- WEB-INF
   -- classes
   -- libs
   -- css
  --css-files
   -- js
  --javascript files.
   -- images
  --image files.
   --
 html files.


  I have changed the default location of the resources, to reflect the
  directory structure (by following the information on wiki:
  
 (http://cwiki.apache.org/WICKET/control-where-html-files-are-loaded-from.html).





  igor.vaynberg wrote:
  
   where does your javascript live? context folder? package folder?
  
   -igor
  
  
   On Thu, Apr 3, 2008 at 2:22 AM, SteamR [EMAIL PROTECTED] wrote:
  
OK, it seems that image paths are filtered with correct path, and thus
   leaves
my javascript reference as is, since I add it myself. Is there somehow I
   can
find out what path is correct, since I am adding javascript reference in
   my
java code???
  
  
  
  
SteamR wrote:

 I found out that it was a js sourcefile reference which were added in
   code
 (in a onRendered method), that when app was mounted, caused the
   lookups to
 be sent to the page instead... So that seems that relative paths are
   nogos
 when mounted???

 But strange is that images seems to work ok, they also use relative
 path...


 SteamR wrote:

 I have now searched the html files, and can't find any empty src
 attributes. And it only happens when I add the

 mount(/pwa, PackageName.forClass(CategoryPage.class));

 in my WebApplication class' init method.

 (I also have relocated the html files to the src/main/webapp
   folder, if
 that has something to do with it.)

 Well, I will try to strip down the code, to bare minimum and maybe
   post
 the full code here thereafter.





 SteamR wrote:

 Hi,  I hope someone could help me with this...

 I have 5 pages which are pretty standalone but stateful, and they
   have
 nothing to do with each other.

 Now I thought of having bookmarks for each of these pages, and added
   a
 mount point to /pwa.

 Now the problems started; my page's constructor was invoked three
   times
 before actual output occured (it has an empty constructor), and a
   form
 object loses its transient fields during a request-response cycle.

 The transient field getting lost, is something I can fix, but
   invoking
 the constructor three times and why wicket does so, is very
   strange...?

 Anyone know any answer to this...

 Btw, I am running wicket 1.3.1





  
--
View this message in context:
   
 http://www.nabble.com/Mount-causes-strange-effects-on-my-web-application-tp16395309p16467343.html
  
  
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  

  --
  View this message in context: 
 http://www.nabble.com/Mount-causes-strange-effects-on-my-web-application-tp16395309p16485866.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]



Re: Changing Wickets default styles

2008-04-04 Thread Nino Saturnino Martinez Vazquez Wael

Strange, but that is the way with browsers:)

Steen Larsen wrote:

More or less. Rearranging the order of the styles, seems to have an
influence. No idea why but it looks ok now. Firebug only showed the first
style (background-image), but changing the order made more show up (not
all). Go figure. But thanks for the input all.

/Steen

2008/4/2, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]:
  

so you got this sorted out right?

Steen Larsen wrote:



I'm also developing mainly on firefox, and have tried clearing the cache
an
all, but no luck. My colleague tried it out with the same result and he
had
never downloaded the new stylesheet before.

The html is the standard feedback panel:

div wicket:id=feedbackwicket:panel
 ul wicket:id=feedbackul
   li wicket:id=messages class=feedbackPanelERROR
 span wicket:id=message class=feedbackPanelERRORFeltet
postnummer skal udfyldes./span
   /li
 /ul
/wicket:panel/div

and the css reference adds the following line to head, which should be
ok:

link rel=stylesheet type=text/css
href=resources/dk.yousee.order.css.Style/yousee.css media=screen
/

/Steen

2008/4/1, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]
  

:

  

Eeek TDC(yousee), which robs me of a montly fee for television!

This might not be the rigth forum to ask CSS questions and is sort of
offtopic. But usually when something works in IE and doesnt in firefox
it means that IE breaks standard compability, and due to some bug in
IE
works anyway. My prefered way of working are using firefox to develop,
checking in IE and then fix so it works in IE too..

Could you show the corresponding html?

regards Nino


Steen Larsen wrote:




Hi,

I have made a stylesheet to change the default look of the


  

FeedbackPanel,




and loaded it with response.renderCSSReference(new
ResourceReference(
Style.class,yousee.css), screen), where the class Style and the
css


  

is




in the same package. The css looks like this:

li.feedbackPanelERROR {
   background-image: none;
   color: red;
   padding-left: 0px;
   background-repeat: no-repeat;
   background-position: 0px;
   list-style-type: none;
}

li.feedbackPanelINFO {
   background-image: none;
   color: red;
   padding-left: 0px;
   background-repeat: no-repeat;
   background-position: 0px;
   list-style-type: none;
}

This works fine in IE7, but for some reason only works partly in


  

Firefox.




The green background-image is removed but the text is not red, and
is
indented as in the original. Looking at the styles with Firefoxs
WebDeveloper shows the correct styles. Anybody experienced this and


  

found a




solution ?.

/Steen




  

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







  

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





  


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



IE 6 7 Ajax Refresh Issue

2008-04-04 Thread Cristi Manole
Hello,

I have on a page 3 radio buttons in a group and for each radio a drop down:

xDropDown1 V
oDropDown2 V
oDropDown3 V

When the user selects a radio, the corresponding dropdown will be enabled
and the other two disabled.

In Firefox, this works as I need it to, but in IE, the dropdowns are not
enabled/disabled as needed (either not at all - in IE6 or oddly in IE7). The
funny thing is the functionality is there - i mean, although graphically
they are wrong, I can change the values only for the dropdown which is
enabled. And when I try to do that, all the dropdowns will be updated
correctly.

Any ideas what's wrong with IE and how i could update the dropdowns
correctly? I use just setEnabled(true/false) and target.addComponent(...).

Thanks,
Cristi Manole


Re: Writing to .properties files and make changes happen?

2008-04-04 Thread Azzeddine Daddah
Why don't you try to use the Apache Commons Configuration?
Take a look http://commons.apache.org/configuration

Azzeddine

On Fri, Apr 4, 2008 at 8:35 AM, unka_hahrry [EMAIL PROTECTED] wrote:


 I call this method from inside a WebPage:

 public static void setNewText(String path, String textId, String
 neuerText)
 throws IOException {

... getting old text as StringBuffer alt ...

//create new String from content of .properties file
String neu = alt.replace(start, ende,
 neuTextTeil).toString();

  File output = new File(path);
  BufferedWriter out = new BufferedWriter(new
 FileWriter(output));

try {
out.write(neu);
}
finally {
out.close();
}

}
 That's all. The .properties file will be changed correctly, but the new
 content will only take effect if I open the .properties file with an
 editor
 and save it, but the overwriting process won't be recognized.


 Johan Compagner wrote:
 
  thats very strange
  writing  a file in an editor or save it through java that shouldn't
 matter
  But are you constantly writing properties file from inside the webapp?
 
  johan
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Writing-to-.properties-files-and-make-changes-happen--tp16447118p16484561.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]




-- 
Azzeddine Daddah
www.hbiloo.com


Re: Writing to .properties files and make changes happen?

2008-04-04 Thread Johan Compagner
What  is the path you write it in? Where sits the property file?

On 4/4/08, unka_hahrry [EMAIL PROTECTED] wrote:

 I call this method from inside a WebPage:

 public static void setNewText(String path, String textId, String neuerText)
 throws IOException {
   
   ... getting old text as StringBuffer alt ...
   
   //create new String from content of .properties file
   String neu = alt.replace(start, ende, neuTextTeil).toString();

   File output = new File(path);
   BufferedWriter out = new BufferedWriter(new
 FileWriter(output));
   
   try {
   out.write(neu);
   }
   finally {
   out.close();
   }

   }
 That's all. The .properties file will be changed correctly, but the new
 content will only take effect if I open the .properties file with an editor
 and save it, but the overwriting process won't be recognized.


 Johan Compagner wrote:
 
  thats very strange
  writing  a file in an editor or save it through java that shouldn't matter
  But are you constantly writing properties file from inside the webapp?
 
  johan
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Writing-to-.properties-files-and-make-changes-happen--tp16447118p16484561.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]



Re: IE 6 7 Ajax Refresh Issue

2008-04-04 Thread Igor Vaynberg
make sure you dont have any span tags attached to wicket components
that have div tags inside.

also past the output of wicket ajax console

-igor


On Thu, Apr 3, 2008 at 11:52 PM, Cristi Manole [EMAIL PROTECTED] wrote:
 Hello,

  I have on a page 3 radio buttons in a group and for each radio a drop down:

  xDropDown1 V
  oDropDown2 V
  oDropDown3 V

  When the user selects a radio, the corresponding dropdown will be enabled
  and the other two disabled.

  In Firefox, this works as I need it to, but in IE, the dropdowns are not
  enabled/disabled as needed (either not at all - in IE6 or oddly in IE7). The
  funny thing is the functionality is there - i mean, although graphically
  they are wrong, I can change the values only for the dropdown which is
  enabled. And when I try to do that, all the dropdowns will be updated
  correctly.

  Any ideas what's wrong with IE and how i could update the dropdowns
  correctly? I use just setEnabled(true/false) and target.addComponent(...).

  Thanks,
  Cristi Manole


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



Re: Problems with wicketstuff-contrib-jasperreports

2008-04-04 Thread Maurice Marrink
Not sure what the status is of that project, but it not that hard to
do it yourself.
Something like this should get you started.

InputStream is = getClass().getResourceAsStream(template.jrxml);
JasperDesign design = JRXmlLoader.load(is);
//do something with template
JasperReport report = JasperCompileManager.compileReport(design);
JRCsvDataSource source = new JRCsvDataSource(someReader);
JasperPrint print = JasperFillManager.fillReport(report, parameters, source);
File file = File.createTempFile(list, .pdf);
JasperExportManager.exportReportToPdfFile(print, file.getPath());
IResourceStream stream = new SomeCustomPdfImpl(file)
getRequestCycle().setRequestTarget(new ResourceStreamRequestTarget(stream));
getRequestCycle().setRedirect(false);

Maurice

On Thu, Apr 3, 2008 at 11:10 PM, Peter Neubauer
[EMAIL PROTECTED] wrote:
 Hi all,
  I tried using a copy of the page at
  
 http://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicket-contrib-jasperreports/src/examples/java/wicket/contrib/jasperreports/examples/ReportLinksPage.java
  to get some Jasperreport out, but instead, I am getting
  ERROR - RequestCycle   -
  java.lang.NullPointerException
at java.util.HashMap.init(HashMap.java:217)
at 
 wicket.contrib.jasperreports.JRResource.getReportParameters(JRResource.java:256)
at 
 wicket.contrib.jasperreports.JRResource.newJasperPrint(JRResource.java:444)
at 
 wicket.contrib.jasperreports.JRResource.getResourceState(JRResource.java:376)
at 
 org.apache.wicket.markup.html.DynamicWebResource$1.checkLoadData(DynamicWebResource.java:265)


  It seems that in
  
 http://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicket-contrib-jasperreports/src/java/wicket/contrib/jasperreports/JRResource.java
  setReportParameters is never called anywhere in the project.

  Is this still worth to pursue or is there a better way to serve Jasper
  reports via some method in Wicket?

  Cheers

  --
  GTalk: neubauer.peter
  Skype peter.neubauer
  ICQ 18762544
  GTalk neubauer.peter
  Phone +46704 106975
  LinkedIn http://www.linkedin.com/in/neubauer

  http://www.neo4j.org - New Energy for Data - the Netbase.
  http://www.ops4j.org - New Energy for OSS Communities - Open
  Participation Software.
  http://www.qi4j.org - New Energy for Java - Domain Driven Development.

  -
  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: Throw AbortWithWebErrorCodeException in onBeforeRender

2008-04-04 Thread Michael Sparer

While creating a quickstart for the jira issue, I noticed that it only occurs
when using custom error pages as described on
http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html ... so
maybe jetty creates a new (internal) web request and the application gets
detached before the old request can be cleaned up properly. as far as i
could see the getApplication method is only needed for checking if the app
is in development mode and does some additional cleanup if it is ... anyway,
the issue can be found on https://issues.apache.org/jira/browse/WICKET-1478

regards, 
Michael

igor.vaynberg wrote:
 
 jira...
 
 -igor
 
 On Wed, Apr 2, 2008 at 2:41 AM, Michael Sparer [EMAIL PROTECTED]
 wrote:

  (Using wicket 1.3.2) I have a super class (WebPage) that throws a
  AbortWithWebErrorCodeException(404) depending on some properties of its
  subclasses. Therefore I can't check the subclasses' properties in the
 super
  class' constructor and throw the exception there.
  So I tried to throw it in the onBeforeRender method instead. The Error
 page
  for the 404 gets rendered and displayed without problems however an
  exception gets thrown (see below).

  So my question: where's the (right) place to throw the exception? I also
  tried RequestCycle.get().setRequestTarget(new
  WebErrorCodeResponseTarget(404)); with the same result.

  thanks in advance

  michael

  exception trace:
  ERROR - RequestCycle   - there was an error cleaning up
 target
  [EMAIL PROTECTED] pageClass=].
  org.apache.wicket.WicketRuntimeException: There is no application
 attached
  to current thread btpool0-2
 at org.apache.wicket.Application.get(Application.java:166)
 at
 org.apache.wicket.Component.getApplication(Component.java:1229)
 at
 org.apache.wicket.markup.html.WebPage.onDetach(WebPage.java:404)
 at org.apache.wicket.Component.detach(Component.java:1075)
 at
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.detach(BookmarkablePageRequestTarget.java:122)
 at org.apache.wicket.RequestCycle.detach(RequestCycle.java:1046)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1348)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
 at
 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
 at
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
 at
 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
 at
 
 org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
 at
 
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
 at
 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)

  -
  Michael Sparer
  http://talk-on-tech.blogspot.com
  --
  View this message in context:
 http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-tp16446341p16446341.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]
 
 
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-tp16446341p16487488.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]



DataPicker problem

2008-04-04 Thread lienok

Hello, 

I am following book Enjoying web development with wicket, using Wicket
1.3.2.
Everythink worked fine till I added form.add(quoteDate). 
Please check code and stack trace below and let me know any advice.
Thank you

public class GetQuoteSymbol extends WebPage {
private Model model;

private Model dateModel;

public GetQuoteSymbol() {
FeedbackPanel feedback = new FeedbackPanel(msgs);
add(feedback);
Form form = new Form(f) {
protected void onSubmit() {
String sym = (String) model.getObject();
Date date = (Date) dateModel.getObject();
int stockValue = (sym + 
date.toString()).hashCode() % 100;
QuoteResult quoteResult = new 
QuoteResult(stockValue);
setResponsePage(quoteResult);
}
};
model = new Model();
List symbols = new ArrayList();
symbols.add(MSFT);
symbols.add(IBM);
symbols.add(RHAT);
DropDownChoice symbol = new DropDownChoice(sym, model, 
symbols);
symbol.setRequired(true);
form.add(symbol);
dateModel = new Model();
TextField quoteDate = new TextField(quoteDate, dateModel, 
Date.class);
quoteDate.setRequired(true);
quoteDate.add(new DatePicker());

//HERE IS A PROBLEM
form.add(quoteDate);

add(form);
}
}

stack trace:
WicketMessage: Can't instantiate page using constructor public
com.myapp.stockquote.GetQuoteSymbol()

Root cause:

java.lang.ClassNotFoundException: org.joda.time.DateTime
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1363)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at
org.apache.wicket.extensions.yui.calendar.DatePicker.class$(DatePicker.java:86)
at
org.apache.wicket.extensions.yui.calendar.DatePicker.getDatePattern(DatePicker.java:438)
at
org.apache.wicket.extensions.yui.calendar.DatePicker.checkComponentProvidesDateFormat(DatePicker.java:296)
at
org.apache.wicket.extensions.yui.calendar.DatePicker.bind(DatePicker.java:129)
at org.apache.wicket.Component.add(Component.java:922)
at com.myapp.stockquote.GetQuoteSymbol.init(GetQuoteSymbol.java:57)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:149)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
at
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at

Re: DataPicker problem

2008-04-04 Thread Gerolf Seitz
you don't have joda-time in your classpath.
  Gerolf

On Fri, Apr 4, 2008 at 9:55 AM, lienok
[EMAIL PROTECTED][EMAIL PROTECTED]
wrote:


 Hello,

 I am following book Enjoying web development with wicket, using Wicket
 1.3.2.
 Everythink worked fine till I added form.add(quoteDate).
 Please check code and stack trace below and let me know any advice.
 Thank you

 public class GetQuoteSymbol extends WebPage {
private Model model;

private Model dateModel;

public GetQuoteSymbol() {
FeedbackPanel feedback = new FeedbackPanel(msgs);
add(feedback);
Form form = new Form(f) {
protected void onSubmit() {
String sym = (String) model.getObject();
Date date = (Date) dateModel.getObject();
int stockValue = (sym +
 date.toString()).hashCode() % 100;
QuoteResult quoteResult = new
 QuoteResult(stockValue);
setResponsePage(quoteResult);
}
};
model = new Model();
List symbols = new ArrayList();
symbols.add(MSFT);
symbols.add(IBM);
symbols.add(RHAT);
DropDownChoice symbol = new DropDownChoice(sym, model,
 symbols);
symbol.setRequired(true);
form.add(symbol);
dateModel = new Model();
TextField quoteDate = new TextField(quoteDate, dateModel,
 Date.class);
quoteDate.setRequired(true);
quoteDate.add(new DatePicker());

 //HERE IS A PROBLEM
form.add(quoteDate);

add(form);
}
 }

 stack trace:
 WicketMessage: Can't instantiate page using constructor public
 com.myapp.stockquote.GetQuoteSymbol()

 Root cause:

 java.lang.ClassNotFoundException: org.joda.time.DateTime
 at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1363)
 at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:169)
 at

 org.apache.wicket.extensions.yui.calendar.DatePicker.class$(DatePicker.java:86)
 at

 org.apache.wicket.extensions.yui.calendar.DatePicker.getDatePattern(DatePicker.java:438)
 at

 org.apache.wicket.extensions.yui.calendar.DatePicker.checkComponentProvidesDateFormat(DatePicker.java:296)
 at

 org.apache.wicket.extensions.yui.calendar.DatePicker.bind(DatePicker.java:129)
 at org.apache.wicket.Component.add(Component.java:922)
 at com.myapp.stockquote.GetQuoteSymbol.init(GetQuoteSymbol.java:57)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at

 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:149)
 at

 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
 at

 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262)
 at

 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
 at

 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210)
 at

 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
 at

 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
 at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
 at

 org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at

 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at

 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at

 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at

 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at

 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at

 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at

 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at

 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
 at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
 at

 

Re: Throw AbortWithWebErrorCodeException in onBeforeRender

2008-04-04 Thread Michael Sparer

Maybe I didn't explain it precise enough, the subclass ain't the right place
to do that cause my usecase is like:

class Super {
onBeforeRender() {
 if (!isValid()) {
 throw Abort...Exception(404);
 }
}

abstract boolean isValid();
}

class Sub extends Super{
boolean isValid() {
 return false;
}
}

to see it in action take a look at the quickstart attached to the jira
issue :)
https://issues.apache.org/jira/browse/WICKET-1478

regards,
Michael

lars vonk wrote:
 
 Why not implement this in the subclass itself? It sounds really specific
 for
 a certain class right? So I think the subclass itself is the correct
 place.
 
 On Wed, Apr 2, 2008 at 11:41 AM, Michael Sparer [EMAIL PROTECTED]
 wrote:
 

 (Using wicket 1.3.2) I have a super class (WebPage) that throws a
 AbortWithWebErrorCodeException(404) depending on some properties of its
 subclasses. Therefore I can't check the subclasses' properties in the
 super
 class' constructor and throw the exception there.
 So I tried to throw it in the onBeforeRender method instead. The Error
 page
 for the 404 gets rendered and displayed without problems however an
 exception gets thrown (see below).

 So my question: where's the (right) place to throw the exception? I also
 tried RequestCycle.get().setRequestTarget(new
 WebErrorCodeResponseTarget(404)); with the same result.

 thanks in advance

 michael

 exception trace:
 ERROR - RequestCycle   - there was an error cleaning up
 target
 [EMAIL PROTECTED] pageClass=].
 org.apache.wicket.WicketRuntimeException: There is no application
 attached
 to current thread btpool0-2
at org.apache.wicket.Application.get(Application.java:166)
at org.apache.wicket.Component.getApplication(Component.java:1229)
at
 org.apache.wicket.markup.html.WebPage.onDetach(WebPage.java:404)
at org.apache.wicket.Component.detach(Component.java:1075)
at

 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.detach(BookmarkablePageRequestTarget.java:122)
at org.apache.wicket.RequestCycle.detach(RequestCycle.java:1046)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1348)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
at

 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at

 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
at

 org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at

 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at

 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)

 -
 Michael Sparer
 http://talk-on-tech.blogspot.com
 --
 View this message in context:
 http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-tp16446341p16446341.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]


 
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-tp16446341p16487491.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: DataPicker problem

2008-04-04 Thread Igor Vaynberg
you werent kidding about 3 hours of sleep...

-igor


On Fri, Apr 4, 2008 at 12:57 AM, Gerolf Seitz [EMAIL PROTECTED] wrote:
 you don't have joda-time in your classpath.
   Gerolf

  On Fri, Apr 4, 2008 at 9:55 AM, lienok
  [EMAIL PROTECTED][EMAIL PROTECTED]
  wrote:



  
   Hello,
  
   I am following book Enjoying web development with wicket, using Wicket
   1.3.2.
   Everythink worked fine till I added form.add(quoteDate).
   Please check code and stack trace below and let me know any advice.
   Thank you
  
   public class GetQuoteSymbol extends WebPage {
  private Model model;
  
  private Model dateModel;
  
  public GetQuoteSymbol() {
  FeedbackPanel feedback = new FeedbackPanel(msgs);
  add(feedback);
  Form form = new Form(f) {
  protected void onSubmit() {
  String sym = (String) model.getObject();
  Date date = (Date) dateModel.getObject();
  int stockValue = (sym +
   date.toString()).hashCode() % 100;
  QuoteResult quoteResult = new
   QuoteResult(stockValue);
  setResponsePage(quoteResult);
  }
  };
  model = new Model();
  List symbols = new ArrayList();
  symbols.add(MSFT);
  symbols.add(IBM);
  symbols.add(RHAT);
  DropDownChoice symbol = new DropDownChoice(sym, model,
   symbols);
  symbol.setRequired(true);
  form.add(symbol);
  dateModel = new Model();
  TextField quoteDate = new TextField(quoteDate, dateModel,
   Date.class);
  quoteDate.setRequired(true);
  quoteDate.add(new DatePicker());
  
   //HERE IS A PROBLEM
  form.add(quoteDate);
  
  add(form);
  }
   }
  
   stack trace:
   WicketMessage: Can't instantiate page using constructor public
   com.myapp.stockquote.GetQuoteSymbol()
  
   Root cause:
  
   java.lang.ClassNotFoundException: org.joda.time.DateTime
   at
  
   
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1363)
   at
  
   
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:169)
   at
  
   
 org.apache.wicket.extensions.yui.calendar.DatePicker.class$(DatePicker.java:86)
   at
  
   
 org.apache.wicket.extensions.yui.calendar.DatePicker.getDatePattern(DatePicker.java:438)
   at
  
   
 org.apache.wicket.extensions.yui.calendar.DatePicker.checkComponentProvidesDateFormat(DatePicker.java:296)
   at
  
   
 org.apache.wicket.extensions.yui.calendar.DatePicker.bind(DatePicker.java:129)
   at org.apache.wicket.Component.add(Component.java:922)
   at com.myapp.stockquote.GetQuoteSymbol.init(GetQuoteSymbol.java:57)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at
  
   
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:149)
   at
  
   
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
   at
  
   
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262)
   at
  
   
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
   at
  
   
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210)
   at
  
   
 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
   at
  
   
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)
   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243)
   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
   at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
   at
   org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
   at
  
   org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at
  
   
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at
  
   
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at
  
   
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at
  
   
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   at
  
   
 

Get back value for a RatingPanel

2008-04-04 Thread Fabien D.

Hi

I have a problem to get back the value of a rating panel. It displays well.

This is the déclaration :

RatingPanel rating = new 
RatingPanel(str_rating,model_rating,5,true){
private double rating = 0;

protected String getActiveStarUrl(int iteration){
return WICKETSTAR1;
}

protected String getInactiveStarUrl(int iteration){
return WICKETSTAR0;
}

protected boolean onIsStarActive(int star)
{
return star  ((int)(rating + 0.5));
}
 
protected void onRated(int rating, AjaxRequestTarget target)
{
this.rating = rating;
}
};
rating.setRatingLabelVisible(false);
this.form_evaluation.add(rating);

And in the method on submit of my form : 
 protected void onSubmit() {
log.info(+model_rating.getObject());
setResponsePage(new 
ProjetPage(ajoutinftechnique));
}

But the value is null, so how i can get back the value of this special panel
?

Thank you in advance for your help.


-- 
View this message in context: 
http://www.nabble.com/Get-back-value-for-a-RatingPanel-tp16488179p16488179.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: DataPicker problem

2008-04-04 Thread TonyVegas

Did you include the JodaTime package into your project?


lienok wrote:
 
 Hello, 
 
 I am following book Enjoying web development with wicket, using Wicket
 1.3.2.
 Everythink worked fine till I added form.add(quoteDate). 
 Please check code and stack trace below and let me know any advice.
 Thank you
 
 public class GetQuoteSymbol extends WebPage {
   private Model model;
 
   private Model dateModel;
 
   public GetQuoteSymbol() {
   FeedbackPanel feedback = new FeedbackPanel(msgs);
   add(feedback);
   Form form = new Form(f) {
   protected void onSubmit() {
   String sym = (String) model.getObject();
   Date date = (Date) dateModel.getObject();
   int stockValue = (sym + 
 date.toString()).hashCode() % 100;
   QuoteResult quoteResult = new 
 QuoteResult(stockValue);
   setResponsePage(quoteResult);
   }
   };
   model = new Model();
   List symbols = new ArrayList();
   symbols.add(MSFT);
   symbols.add(IBM);
   symbols.add(RHAT);
   DropDownChoice symbol = new DropDownChoice(sym, model, 
 symbols);
   symbol.setRequired(true);
   form.add(symbol);
   dateModel = new Model();
   TextField quoteDate = new TextField(quoteDate, dateModel, 
 Date.class);
   quoteDate.setRequired(true);
   quoteDate.add(new DatePicker());
 
 //HERE IS A PROBLEM
   form.add(quoteDate);
 
   add(form);
   }
 }
 
 stack trace:
 WicketMessage: Can't instantiate page using constructor public
 com.myapp.stockquote.GetQuoteSymbol()
 
 Root cause:
 
 java.lang.ClassNotFoundException: org.joda.time.DateTime
 at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1363)
 at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:169)
 at
 org.apache.wicket.extensions.yui.calendar.DatePicker.class$(DatePicker.java:86)
 at
 org.apache.wicket.extensions.yui.calendar.DatePicker.getDatePattern(DatePicker.java:438)
 at
 org.apache.wicket.extensions.yui.calendar.DatePicker.checkComponentProvidesDateFormat(DatePicker.java:296)
 at
 org.apache.wicket.extensions.yui.calendar.DatePicker.bind(DatePicker.java:129)
 at org.apache.wicket.Component.add(Component.java:922)
 at com.myapp.stockquote.GetQuoteSymbol.init(GetQuoteSymbol.java:57)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:149)
 at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
 at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262)
 at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
 at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210)
 at
 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
 at
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
 at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
 at
 org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
 at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
 at
 org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at
 

Re: DataPicker problem

2008-04-04 Thread Thijs

http://joda-time.sourceforge.net/


lienok schreef:
I did not. 


I do not have that package. I do not use anything special. I supposed it
should be included in wicket jars.  I tryied to find JodaTime package
through google, bo no success. :(



TonyVegas wrote:
  

Did you include the JodaTime package into your project?


lienok wrote:

Hello, 


I am following book Enjoying web development with wicket, using Wicket
1.3.2.
Everythink worked fine till I added form.add(quoteDate). 
Please check code and stack trace below and let me know any advice.

Thank you

public class GetQuoteSymbol extends WebPage {
private Model model;

private Model dateModel;

public GetQuoteSymbol() {
FeedbackPanel feedback = new FeedbackPanel(msgs);
add(feedback);
Form form = new Form(f) {
protected void onSubmit() {
String sym = (String) model.getObject();
Date date = (Date) dateModel.getObject();
int stockValue = (sym + 
date.toString()).hashCode() % 100;
QuoteResult quoteResult = new 
QuoteResult(stockValue);
setResponsePage(quoteResult);
}
};
model = new Model();
List symbols = new ArrayList();
symbols.add(MSFT);
symbols.add(IBM);
symbols.add(RHAT);
DropDownChoice symbol = new DropDownChoice(sym, model, 
symbols);
symbol.setRequired(true);
form.add(symbol);
dateModel = new Model();
TextField quoteDate = new TextField(quoteDate, dateModel,
Date.class);
quoteDate.setRequired(true);
quoteDate.add(new DatePicker());

//HERE IS A PROBLEM
form.add(quoteDate);

add(form);
}
}

stack trace:
WicketMessage: Can't instantiate page using constructor public
com.myapp.stockquote.GetQuoteSymbol()

Root cause:

java.lang.ClassNotFoundException: org.joda.time.DateTime
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1363)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at
org.apache.wicket.extensions.yui.calendar.DatePicker.class$(DatePicker.java:86)
at
org.apache.wicket.extensions.yui.calendar.DatePicker.getDatePattern(DatePicker.java:438)
at
org.apache.wicket.extensions.yui.calendar.DatePicker.checkComponentProvidesDateFormat(DatePicker.java:296)
at
org.apache.wicket.extensions.yui.calendar.DatePicker.bind(DatePicker.java:129)
at org.apache.wicket.Component.add(Component.java:922)
at com.myapp.stockquote.GetQuoteSymbol.init(GetQuoteSymbol.java:57)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:149)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
at
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at

Re: DataPicker problem

2008-04-04 Thread Fabien D.

search joda-time... and this package is obligatory :)
-- 
View this message in context: 
http://www.nabble.com/DataPicker-problem-tp16487490p16490804.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: Customerize captcha image

2008-04-04 Thread wenm

Thank you very much! I just create my own captcha by extends
RenderedDynamicImageResource.

Vitaly Tsaplin wrote:
 
Create your own captcha :) The idea of the
 RenderedDynamicImageResource is brilliant. You just need to implement
 the render (Graphics2D gfx) method. Draw there whatever you want. It's
 even better. No one will be able to reuse the algorithm to teach a
 neuronet :)
 
 On Thu, Apr 3, 2008 at 2:32 PM, wenm [EMAIL PROTECTED] wrote:

  Does anybody have an idea how to change the background image and font
 size
  etc of wicket captcha image?


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


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


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

-- 
View this message in context: 
http://www.nabble.com/Customerize-captcha-image-tp16467447p16490314.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: Get back value for a RatingPanel

2008-04-04 Thread Maurice Marrink
Where do you set the value of the model?
It looks to me like you need to get rid of rating double in the panel
and use that as the model value.
Something like this:
protected boolean onIsStarActive(int star)
   {
   return star  ((int)(model_rating.getObject()+ 0.5));
   }

   protected void onRated(int rating, AjaxRequestTarget target)
   {
  model_rating.setObject(rating)
   }

Note i skipped all casts / type checks etc.
Try reading 
http://www.theserverside.com/tt/articles/content/IntroducingApacheWicket/article.html

Maurice

On Fri, Apr 4, 2008 at 10:21 AM, Fabien D. [EMAIL PROTECTED] wrote:

  Hi

  I have a problem to get back the value of a rating panel. It displays well.

  This is the déclaration :

 RatingPanel rating = new 
 RatingPanel(str_rating,model_rating,5,true){
 private double rating = 0;

 protected String getActiveStarUrl(int iteration){
 return WICKETSTAR1;
 }

 protected String getInactiveStarUrl(int iteration){
 return WICKETSTAR0;
 }

 protected boolean onIsStarActive(int star)
 {
 return star  ((int)(rating + 0.5));
 }

 protected void onRated(int rating, AjaxRequestTarget 
 target)
 {
 this.rating = rating;
 }
 };
 rating.setRatingLabelVisible(false);
 this.form_evaluation.add(rating);

  And in the method on submit of my form :
  protected void onSubmit() {
 log.info(+model_rating.getObject());
 setResponsePage(new 
 ProjetPage(ajoutinftechnique));
 }

  But the value is null, so how i can get back the value of this special panel
  ?

  Thank you in advance for your help.


  --
  View this message in context: 
 http://www.nabble.com/Get-back-value-for-a-RatingPanel-tp16488179p16488179.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]



Re: DataPicker problem

2008-04-04 Thread lienok

Hi,

thank you for the obvious advice =) It helped of course. 
I just do not understand what was the problem. I have run the same code few
weeks ago on my home computer without any problem and I did NOT add any
joda-time jar. 
confused .. :confused:


Fabien D. wrote:
 
 search joda-time... and this package is obligatory :)
 

-- 
View this message in context: 
http://www.nabble.com/DataPicker-problem-tp16487490p16491005.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: Writing to .properties files and make changes happen?

2008-04-04 Thread unka_hahrry

Damn... Yes, it was the false path... Obviously the .properties file must be
changed in the context of classes, not in the source...

Thank you very much!!!

Johan Compagner wrote:
 
 What  is the path you write it in? Where sits the property file?
 
 On 4/4/08, unka_hahrry [EMAIL PROTECTED] wrote:

 I call this method from inside a WebPage:

 public static void setNewText(String path, String textId, String
 neuerText)
 throws IOException {
  
  ... getting old text as StringBuffer alt ...
  
  //create new String from content of .properties file
  String neu = alt.replace(start, ende, neuTextTeil).toString();

   File output = new File(path);
   BufferedWriter out = new BufferedWriter(new
 FileWriter(output));
  
  try {
  out.write(neu);
  }
  finally {
  out.close();
  }

  }
 That's all. The .properties file will be changed correctly, but the new
 content will only take effect if I open the .properties file with an
 editor
 and save it, but the overwriting process won't be recognized.


 Johan Compagner wrote:
 
  thats very strange
  writing  a file in an editor or save it through java that shouldn't
 matter
  But are you constantly writing properties file from inside the webapp?
 
  johan
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Writing-to-.properties-files-and-make-changes-happen--tp16447118p16484561.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://www.nabble.com/Writing-to-.properties-files-and-make-changes-happen--tp16447118p16491007.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: wicket, spring and aop

2008-04-04 Thread Korbinian Bachl - privat

Hello,

im quite new to spring, but afaik you cant have spring manipulating 
wicket itself; however you could create a spring based proxy-class for 
those purposes and have it used by @SpringBean(name=name) where you 
put the logic in it;


maybe its possible to have a wicket-PageClass be also a managed by 
spring but im not sure if this works...


Is spring spewing out its lines at your current app startup? (if not: 
http://cwiki.apache.org/WICKET/spring.html helds details for this)


Best,

Korbinian

[EMAIL PROTECTED] schrieb:

Hi there,

I'm just trying to integrate wicket 1.3.2, spring 2.0 and aspect oriented 
programming (spring-aop). I've an aspect for instrumenting a dao provider that 
is defined as follow:

@Aspect()
public class DaoProviderInstrumentation {

@Around(execution(* *(..))  target(org.mypackage.dao.DaoProvider))

public Object executeFinder(ProceedingJoinPoint pjp) throws Throwable {
   // stuff not important for now
}

A dao provider is intended to be an interface similar to the following:

public interface Daos extends DaoProvider{

 public AnimalDAO getAnimalDao();
}

where AnimalDAO is another interface with methods to retrieve animals. The 
instrumentation should get executed when i'm trying to access to the getAnimalDao() and 
it should create a proxy of animalDAO that exposes finder methods to retrieve 
animals using some conventions defined by name of the methods.

The instrumentation isn't executed. I know wicket is not managed but i like the 
wicket framework and it would be great to use integrate it but i don't know if 
it is possible and what is the correct way of doing it.
I've tried to use the SpringWebApplication in the wicket-spring package  but i 
don't know how to use it to integrate the instrumentation.

I don't need to inject components using the @SpringBean annotation.

Thanks for your time,


-
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: Removing the jsessionid for SEO

2008-04-04 Thread Korbinian Bachl - privat

Hi Jeremy,
Hi Dan,

for a project long ago I had the trail of making a product-browser SEO 
friendly; I used a plain PagingNavigator at first, and then extended it 
to have it to use the IndexedUrlPageParameters; this allowed me to put 
anything into the path to have a nice URL;


the key here is to look at the URL and treat it as a unique resource 
line; so I did it sth like that:


mountName{(/anyparams)}*{/pageNumber}

this gave me the possiblity to have a browsing URL where I could put 
anything in while the rest still works; remember also that the URL for 
SEO may (!) change in future, so go for maximum flexible designs, up you 
see a resource, then any params to feed the spider (there may be 0 to 
over 10) and a hook at the end that has to be a number (where 0 is 
pretended in case nothing at the end is a number);


so I was able to finally let the spider see things like:

e.g:
product/brand_New/BestItemOfTheWorld
product/specialCategory/moreSpecial/moreInfo/2
product/spcialCategory/moreSpecail/brandName/moreDetails/1

etc.

now, you wonder if I feed the spider with this how do I know where to 
end?  the key was that the part between got merged internally and was 
specified by the application so we overcome the problem of:


a, recreating the view that should be the right one (here: we had a 
tree-like behaviour for our products where we could compare to the tree 
in database)


b, duplicate content (very bad! - never, ever have a spider find the 
same content (or very very similar!) under more than one URL !)


this strategy did very well; Today with wicket 1.3 I would go nearly the 
same but stick to the HybridURL scheme, and maybe try to be even more 
flexible with URL scheme by having the basic schemes and resources 
specified in persistence (URL-hook, initialState); Remember it is 
important to feed same resources under same URLs out, else the spider 
will think you might try to fake content for him;


The jsessionID is sth. I dont care about anymore - its 2008, spiders 
knows it and the usual visitor/ surfer has no clue how to different a 
URL from an emailadress; however many people have turned cookies + JS 
off because of security fears - in turn the JSessionID will concern only 
few people who know about some details but hamper many people that have 
no knowledge of the internet and its techniques all over - IMHO.


@Jeremy: your aproach also seems interesting to me, can you give more 
details about it?


Best,

Korbinian

Jeremy Thomerson schrieb:




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



RE: Default selection in radio group?

2008-04-04 Thread Hoover, William
see http://cwiki.apache.org/confluence/display/WICKET/Using+RadioGroups

-Original Message-
From: Michael Mehrle [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2008 8:49 PM
To: users@wicket.apache.org
Subject: Default selection in radio group?


I created a RadioGroup with three radios attached. For some reason the form is 
being drawn with the last radio pre-selected, which I don't want. How can I 
pre-select a default radio and also how can I set the group to nothing selected?

Thanks,

Michael



Re: Default selection in radio group?

2008-04-04 Thread Cristi Manole
Hi,

What I did is use the same model for the group and for the radio item I want
selected.
For example:

add(radioGroup = new RadioGroup(group, new Model(selectthis))); //the
radio who has the same model will be selected

radioGroup.add(someradio1Radio = new Radio(someradio1radio, new
Model(selectthis)));
radioGroup.add(someradio2Radio = new Radio(someradio2radio, new
Model()));
radioGroup.add(someradio3Radio = new Radio(someradio3radio, new
Model()));

I hope this helps,
Cristi Manole

On Fri, Apr 4, 2008 at 3:01 PM, Hoover, William [EMAIL PROTECTED] wrote:

 see http://cwiki.apache.org/confluence/display/WICKET/Using+RadioGroups

 -Original Message-
 From: Michael Mehrle [mailto:[EMAIL PROTECTED]
 Sent: Thursday, April 03, 2008 8:49 PM
 To: users@wicket.apache.org
 Subject: Default selection in radio group?


 I created a RadioGroup with three radios attached. For some reason the
 form is being drawn with the last radio pre-selected, which I don't want.
 How can I pre-select a default radio and also how can I set the group to
 nothing selected?

 Thanks,

 Michael




Re: ModalWindow and Ajax?

2008-04-04 Thread Nino Saturnino Martinez Vazquez Wael

:)

After instantiating your modal window.  You can do something like this:

   AjaxLink popupLink = new AjaxLink(manageWeightPop) {
   @Override
   public void onClick(AjaxRequestTarget target) {
*
target.appendJavascript(Wicket.Window.unloadConfirmation = false;);*

   modalWindow.setTitle(Weight Log.);
   modalWindow.setMinimalHeight(600);
   modalWindow.setContent(new ManageWeightPanel(modalWindow
   .getContentId(), modalWindow,
   new BaseEntityDetachableModel(getPerson(;
   modalWindow.show(target);
   }
   };

Which means that the modal window showing up will not give that 
confirmation thing.


Per Newgro wrote:

Hello Nino Saturnino Martinez Vazquez Wael:

could you please provide a small example on this issue / solution. I think 
about a similiar way of doin things and i don't want to ask the same question 
as you in a month again


:-)

Thanks
Per

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


  


--
-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: IE 6 7 Ajax Refresh Issue

2008-04-04 Thread Cristi Manole
Hi,

I've been searching around a bit and found the solution. I figured maybe
someone else will face the same issue. It's pretty darn simple anyway.

I used to do what I wanned like this:

someRadio.add(new AjaxEventBehavior(onchange){...}

This worked great in FF, but in IE7 it didn't... all i did is change
onchange with *onclick* and now it works in both.

I think that FF handles onchange for the *newly selected item* while IE7
does it for the *element which gets deselected*. I'm not 100% sure, anyways,
maybe somebody can say for certain.

Thanks Igor,
Cristi Manole


On Fri, Apr 4, 2008 at 10:01 AM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 make sure you dont have any span tags attached to wicket components
 that have div tags inside.

 also past the output of wicket ajax console

 -igor


 On Thu, Apr 3, 2008 at 11:52 PM, Cristi Manole [EMAIL PROTECTED]
 wrote:
  Hello,
 
   I have on a page 3 radio buttons in a group and for each radio a drop
 down:
 
   xDropDown1 V
   oDropDown2 V
   oDropDown3 V
 
   When the user selects a radio, the corresponding dropdown will be
 enabled
   and the other two disabled.
 
   In Firefox, this works as I need it to, but in IE, the dropdowns are
 not
   enabled/disabled as needed (either not at all - in IE6 or oddly in
 IE7). The
   funny thing is the functionality is there - i mean, although
 graphically
   they are wrong, I can change the values only for the dropdown which is
   enabled. And when I try to do that, all the dropdowns will be updated
   correctly.
 
   Any ideas what's wrong with IE and how i could update the dropdowns
   correctly? I use just setEnabled(true/false) and
 target.addComponent(...).
 
   Thanks,
   Cristi Manole
 

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




Multiple TextField in ListView

2008-04-04 Thread Mathias P.W Nilsson

Hi!

In my application a user should be able to connect keywords to a datasheet.

When clicking the link add keywords 10-20 textfields should appear and the
user can enter data to
the fields. 

#1
textField 
#2
textfield
..


How can I handle this like an array in wicket? I do not want to add 20
textfields by hand. 
-- 
View this message in context: 
http://www.nabble.com/Multiple-TextField-in-ListView-tp16492002p16492002.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]



ListView params from 1.2 to 1.3 - detached data

2008-04-04 Thread V. Jenks

I'm having some trouble finding out how to use detached data with a ListView,
as I would have in Wicket 1.2.

In 1.2 I would have used a detachable model:

IModel model = new LoadableDetachableModel()
{
protected Object load()
{
return data;
}
};  

...but ListView doesn't appear to accept IModel as a parameter anymore.  How
would I pass detached data into a ListView in 1.3?
-- 
View this message in context: 
http://www.nabble.com/ListView-params-from-1.2-to-1.3---detached-data-tp16492707p16492707.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: ListView params from 1.2 to 1.3 - detached data

2008-04-04 Thread Scott Swank
The 2nd constructor, below, takes an id  IModel.

http://wicketstuff.org/wicket13doc/org/apache/wicket/markup/html/list/ListView.html

ListView(java.lang.String id)
ListView(java.lang.String id, IModel model)
ListView(java.lang.String id, java.util.List list)

- Scott

On Fri, Apr 4, 2008 at 9:07 AM, V. Jenks [EMAIL PROTECTED] wrote:

  I'm having some trouble finding out how to use detached data with a ListView,
  as I would have in Wicket 1.2.

  In 1.2 I would have used a detachable model:

 IModel model = new LoadableDetachableModel()
 {
 protected Object load()
 {
 return data;
 }
 };

  ...but ListView doesn't appear to accept IModel as a parameter anymore.  How
  would I pass detached data into a ListView in 1.3?
  --
  View this message in context: 
 http://www.nabble.com/ListView-params-from-1.2-to-1.3---detached-data-tp16492707p16492707.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]



Sorting and ListView

2008-04-04 Thread mnwicket

I'm using a ListView to display contents of a List of a domain object. 
Pretty simply.  However, the domain has a name on it that is
internationalized, ie it will used a key value from a dot properties file. 
The issue is is that the List of object must be sorted based on the
internationalized value of the name.  Currently I'm using the localizer to
get the internationalized values and then sorting the List but the localizer
complains, something about not being attached to a page yet.  Does anyone
else have a better way of doing this?
-- 
View this message in context: 
http://www.nabble.com/Sorting-and-ListView-tp16493832p16493832.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: Sorting and ListView

2008-04-04 Thread Mathias P.W Nilsson

Couldn't you just use the Comparator? Add all items to a list, with the
translated name
implement Comparator and make the sort. Return the sorted list as a model.
-- 
View this message in context: 
http://www.nabble.com/Sorting-and-ListView-tp16493832p16494143.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: Sorting and ListView

2008-04-04 Thread mnwicket

This issue isn't about how to sort, this issue is at what point do you grab
the translated name.


Mathias P.W Nilsson wrote:
 
 Couldn't you just use the Comparator? Add all items to a list, with the
 translated name
 implement Comparator and make the sort. Return the sorted list as a model.
 

-- 
View this message in context: 
http://www.nabble.com/Sorting-and-ListView-tp16493832p16494145.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: Multiple TextField in ListView

2008-04-04 Thread Nino Saturnino Martinez Vazquez Wael

A listview with a listview or a repeater?

Mathias P.W Nilsson wrote:

Hi!

In my application a user should be able to connect keywords to a datasheet.

When clicking the link add keywords 10-20 textfields should appear and the
user can enter data to
the fields. 


#1
textField 
#2

textfield
..


How can I handle this like an array in wicket? I do not want to add 20
textfields by hand. 
  


--
-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: Removing the jsessionid for SEO

2008-04-04 Thread Dan Kaplan
That is helpful, but: This is an extension of the standard, so not all bots
may follow it.  I wonder if the major ones do...

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeremy Levy
 Sent: Thursday, April 03, 2008 6:16 PM
 To: users@wicket.apache.org
 Subject: Re: Removing the jsessionid for SEO
 
 We have a similar issue, and are trying the following out right now..
 
 http://www.google.com/support/webmasters/bin/answer.py?hl=enanswer=40367
 
 User-agent: *
 Disallow: /*?
 
 
 
 
 On Thu, Apr 3, 2008 at 9:09 PM, Dan Kaplan [EMAIL PROTECTED]
 wrote:
 
  Ok, at least I'm not missing anything.  I understand the benefits it's
  providing with its stateful framework.  Developing a site with Wicket is
  easier than with any other framework I've used.  But this statefulness,
  which makes websites so easy to develop, seems to be counter productive
 to
  SEO:
 
  GoogleBot will follow and index stateful links.  Worst case scenario,
  these
  actually become visible to google users and when they click the link it
  takes them to an invalid session page.  They think, This site is
  broken
  and move on to the next link of their search result.
 
  Another approach to solving this is to block all the stateful pages in
 my
  robots.txt file.  But how can I block these links in robots.txt since
 they
  change per session?  Is there any way to know what the url will resolve
 to
  when googlebot tries to visit my site so I can tell it to disallow:
  /?wicket:interface=:10:1::: and ?wicket:interface=:0:1::: and ...?
 
 
   -Original Message-
   From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
   Sent: Thursday, April 03, 2008 5:45 PM
   To: users@wicket.apache.org
   Subject: Re: Removing the jsessionid for SEO
  
   On Thu, Apr 3, 2008 at 5:31 PM, Dan Kaplan [EMAIL PROTECTED]
   wrote:
Ok I did a little preliminary research on this.  Right now
   PagingNavigator
 uses PagingNavigationLink's to represent its page.  This extends
  Link.
   I'm
 supposed to override PagingNavigator's newPagingNavigationLink()
  method
   to
 accomplish this (I think) but past that, this isn't very
   straightforward to
 me.
   
 Do I need to create my own BookmarkablePagingNavigationLink?  When
 I
   do...
 what next?  I really don't know enough about bookmarkablePageLinks
 to
   do
 this.  Right now, all the magic happens inside
 PagingNavigationLink.
   Won't
 I have to move all that logic into the WebPage that I'm passing
 into
 BookmarkablePagingNavigationLink?  This seems like a lot of work.
 Am
  I
 missing something critical?
  
   no, you are not missing anything. you see, when you go stateless, like
   what you want, then you have to recreate all the magic stuff that
   makes stateful links Just Work. Without state you are back to the
   servlet/mvc programming model: you have to encode the state that you
   want into the link, then on the trip back decode it, recreate
   something from it, and then apply that something onto the components.
   This is the crapwork that wicket does for you usually.
  
   -igor
  
  
   
   
  -Original Message-
  From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
   
   
 Sent: Thursday, April 03, 2008 3:40 PM
  To: users@wicket.apache.org
  Subject: Re: Removing the jsessionid for SEO
 
  you subclass the pagenavigator and make it use bookmarkable links
  also. it has factory methods for all the links it uses.
 
  -igor
 
 
  On Thu, Apr 3, 2008 at 3:36 PM, Dan Kaplan
 [EMAIL PROTECTED]
  
  wrote:
   I wasn't talking about the links that are on the list (I
 already
   make
  those
bookmarkable).  I'm talking about the links that the Navigator
  generates.
How do I make it so page 2 is bookmarkable?
  
  
-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
  
  
   Sent: Thursday, April 03, 2008 3:30 PM
To: users@wicket.apache.org
Subject: Re: Removing the jsessionid for SEO
  
instead of
  
item.add(new link(foo) { onclick() });
  
do
  
item.add(new bookmarkablepagelink(foo, page.class));
  
-igor
  
  
On Thu, Apr 3, 2008 at 3:28 PM, Dan Kaplan
   [EMAIL PROTECTED]
  wrote:
 How?  I asked how to do it before and nobody suggested this
 as
  a
  possibility.



  -Original Message-
  From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
  Sent: Thursday, April 03, 2008 3:26 PM
  To: users@wicket.apache.org
  Subject: Re: Removing the jsessionid for SEO

  dataview can work in a stateless mode, just use
 bookmarkable
   links
  inside
it

  -igor


  On Thu, Apr 3, 2008 at 3:22 PM, Dan Kaplan
   [EMAIL PROTECTED]

Re: DataPicker problem

2008-04-04 Thread Matthew Young
If you use Maven, just add the dependency:

dependency
groupIdorg.apache.wicket/groupId
artifactIdwicket-extensions/artifactId
version${wicket.version}/version
/dependency


dependency
groupIdorg.apache.wicket/groupId
artifactIdwicket-datetime/artifactId
version${wicket.version}/version
/dependency

wicket-extensions for the DatePicker
wicket-datetime will pull its dependency including Joda


On Fri, Apr 4, 2008 at 4:04 AM, lienok
[EMAIL PROTECTED][EMAIL PROTECTED]
wrote:


 Hi,

 thank you for the obvious advice =) It helped of course.
 I just do not understand what was the problem. I have run the same code
 few
 weeks ago on my home computer without any problem and I did NOT add any
 joda-time jar.
 confused .. :confused:


 Fabien D. wrote:
 
  search joda-time... and this package is obligatory :)
 

 --
 View this message in context:
 http://www.nabble.com/DataPicker-problem-tp16487490p16491005.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: [WUG] Copenhagen

2008-04-04 Thread Flemming Boller
I will also be there :-)


/Flemming

On Thu, Apr 3, 2008 at 3:26 PM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

 Thanks:)



 Frank Bille wrote:

  Good initiative. I'm glad you are taking lead on this. I think I can
  come and have signed up on the wiki page.
 
  Frank
 
 
  On Thu, Apr 3, 2008 at 10:54 AM, Nino Saturnino Martinez Vazquez Wael
  [EMAIL PROTECTED] wrote:
 
 
   So in order to have this meetin, i'd like to see how many we are (if
   below 5
   or something around there it's not gonna happen).
  
So please fill in if you will come here :
  
   http://cwiki.apache.org/confluence/display/WICKET/Community+meetups#Communitymeetups-Denmark
  
Or if youre really lazy, write me a email:)
  
  
  
Nino Saturnino Martinez Vazquez Wael wrote:
  
  
  
I suggest that we hold a meeting the 23. april at 16 hours. At
Jayway.
   
   
   
   
  
   http://www.google.com/calendar/embed?src=7mkimsnp84i09nh48u5ju59pqg%40group.calendar.google.comctz=Europe/Copenhagen
  
  
WDYT?
   
   
   
   
--
-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]
  
  
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 -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: Strange behaviour with autocomplete

2008-04-04 Thread Erik van Oosten
This may be related to the bug I reported in 
https://issues.apache.org/jira/browse/WICKET-1355. Maybe the attached 
fix works for you.


Regards,
   Erik.


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


David Leangen wrote:

Hi,

Using the standard wicket autocomplete widget, I just noticed that I am
getting some strange behaviour.

When I mouseover or scroll the list via the keyboard, the entire screen
jumps to the bottom. I never noticed before because there wasn't enough
content to cause the page to scroll and therefore for this bug to
manifest itself.


Has anybody else ever dealt with this problem?


Thanks!
David



  



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



Re: java.io.StreamCorruptedException: invalid type code: 29

2008-04-04 Thread Daniel Wu
I think I've found the solution for my StreamCorruptedException problem.
Inside the org.apache.wicket.Page, there is a constant LATEST_VERSION which
value is  -1. In my application, the versionNumber passed as parameter to
the method getVersion(final int versionNumber) inside Page is never -1, the
initial versionNumber of a page is always 0. When this versionNumber is
different from 0, the versionManager object inside Page is not null, so the
flow goes to the else block inside the getVersion() method.

If LATEST_VERSION is -1, the flow of my application is always going to the
if block below, never to else block, as my versionNumber is always = 0, so
depending on the versionNumber, no page will be recovered, which was leading
to the StreamCorruptedException, maybe because wicket was trying to
de-serialize the wrong version of my page.

if (versionNumber != LATEST_VERSION) {
  page = versionManager.getVersion(versionNumber);
}
else {
  page = versionManager.getVersion(getCurrentVersionNumber());
}

I've changed LATEST_VERSION value to 0, and now my application works
perfectly. Are these assumptions correct? Does anytime versionNumber assumes
the -1 value?

On Thu, Apr 3, 2008 at 8:43 PM, Daniel Wu [EMAIL PROTECTED] wrote:

 I debugged my application and it really doesn't have a
 ClassNotFoundException eaten by ObjectInputStream. I compared the flow of
 two screens of my application, one that works and another that doesn't:

 1) The line 298 of SecondLevelCacheSessionStore =
 getLastPage().getVersion(versionNumber) is returning the correct page,
 because inside the getVersion() method, the versionManager object is null.
 In this case, the screen that I'm testing works perfectly.

 2) For the screen that throws the StackOverFlow and
 StreamCorruptedException, for some reason the versionManager object is not
 null, and it returns a null page object.

 Another strange thing is that after the line 393 of Objects.java = return
 ois.readObject(); = while debugging it using Eclipse, after this method
 call the flow goes straight to the line 363 of AbstractPageStore.java,
 without entering the finally block. So, an infinite loop starts, causing the
 StackOverflow.

 During the tab switch of the screen that works, the line 393 of
 Objects.java is never reached, meaning that this screen was not serialized,
 right? This code is only reached during a tab switch of the screen that
 throws StackOverFlow exception.

 What defines if a page should be serialized/deserialized? Does anyone know
 what could be causing these problems?


 On Wed, Apr 2, 2008 at 7:28 PM, Daniel Stoch [EMAIL PROTECTED]
 wrote:

  Hi,
 
  It seems that this could be an OSGi related issue. We have the similar
  problem in our applications.
  You can look at the thread: Wicket + OSGI + Session (november 2007).
  Then Sebastiaan gave me a tip that this can be ClassNotFoundException:
 
  It's probably a ClassNotFoundException on deserialization which gets
  eaten by ObjectInputStream (there's a bug report at Sun for this). To be
  sure you can debug trapping on ClassNotFoundException (caught and uncaught)
  when this problem occurs.
 
  However, since it's in a page you can easily fix this one: either
  upgrade to trunk and implement your own IClassResolver and register it with
  the application, or write your own IObjectStreamFactory implementation and
  register it with the Objects class.
 
  In either case, have a look at the DefaultObjectStreamFactory to see how
  to write a hook to look up classes in an ObjectInputStream implementation
  (resolveClass method).
 
 
  Inside OSGI environment each bundle has its own class loader, so this
  could leeds to problem when you try to use in your app a class defined in
  another bundle.
  I've solved this problem by implementing my own IClassResolver. The
  default Wicket DefaultClassResolver is a final class, so we must make a copy
  of it and make a little change at the end of resolveClass method.
 
  The default implementation (DefaultClassResolver):
 
 synchronized (classes)
 {
 ClassLoader loader =
  Thread.currentThread().getContextClassLoader();
 if (loader == null)
 {
 loader =
  DefaultClassResolver.class.getClassLoader();
 }
 clazz = loader.loadClass(classname);
 }
 
  When there is a ClassLoader attached to the current thread as context
  class loader, then Wicket uses it. The problem is under OSGi, that the
  related class (with classname) can be located inside another bundle and can
  be loaded by another class loader, not this from current thread. So
  DefaultClassResolver fails to find this class. The solution is to try in
  such situation use the class loader which loads DefaultClassResolver class
  (= which loads all Wicket classes). In our CustomClassResolver this block
  was changed to something like this:
 
 synchronized (classes) {
 

Re: Multiple TextField in ListView

2008-04-04 Thread jeredm

Here is how I would do it:

HTML:
table
tr wicket:id=tableRow
td
. input wicket:id=textInput type=text /
/td
/tr
/table


Model Object:
// this is a simple object I am going to use for my model.
// It holds the value the user will enter in the textbox and
// a primary key value, so I know how to update my database 
// when I save.
private class RandomObject implements Serializable{
private static final long serialVersionUID = 1L;
private String textValue;
private int pkValue;

public String getTextValue() {
return textValue;
}

public void setTextValue(String textValue) {
this.textValue = textValue;
}

public int getPkValue() {
return pkValue;
}

public void setPkValue(int pkValue) {
this.pkValue = pkValue;
}

private RandomObject(String textValue, int pkValue){
this.textValue = textValue;
this.pkValue = pkValue;
}

}


Java for the page layout:
// Create objects however...here I make 3
// Store the list somewhere so you can loop through it and save each 
// key word on submit...I did not add the submit code here, but it is basic
enough
ArrayListRandomObject myArray = new ArrayListRandomObject();
myArray.add(new RandomObject(null, 1));
myArray.add(new RandomObject(null, 2));
myArray.add(new RandomObject(null, 3));

ListView theView = new ListView(tableRow, myArray){
private static final long serialVersionUID = 1L;

public void populateItem(final ListItem listItem){
final RandomObject item = 
(RandomObject)listItem.getModelObject();
listItem.add(new Label(numberLabel, new
Model(String.valueOf(listItem.getIndex() + 1;
// Could add validation here if needed.
listItem.add(new TextField(textInput, new PropertyModel(item,
textValue)));
}
};

add(theView);


Mathias P.W Nilsson wrote:
 
 Hi!
 
 In my application a user should be able to connect keywords to a
 datasheet.
 
 When clicking the link add keywords 10-20 textfields should appear and the
 user can enter data to
 the fields. 
 
 #1
 textField 
 #2
 textfield
 ..
 
 
 How can I handle this like an array in wicket? I do not want to add 20
 textfields by hand. 
 

-- 
View this message in context: 
http://www.nabble.com/Multiple-TextField-in-ListView-tp16492002p16496226.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: UploadProgress Bar and cancel button

2008-04-04 Thread sunraider

I doubt its a workerthread issue, it calls the submit form even though the
default form processing is set to false.



Nino.Martinez wrote:
 
 This is something not really wicket related, but more workerthread... 
 You need for it to run asynch in order for wicket to be able to process 
 it the way you want to, worker thread can solve this..
 
 regards Nino
 
 sunraider wrote:
 I have a page with upload form and added the upload progress bar, I have
 added the cancel button to it by setDefaultFormProcessing(false) but it
 does
 not behave the same. The content is getting saved and even on empty form
 the
 validation is being done. I removed the progress bar from the page and
 everything seems to be working fine. I am not sure if that the way it
 should
 be.


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

-- 
View this message in context: 
http://www.nabble.com/UploadProgress-Bar-and-cancel-button-tp16349844p16497717.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: Default selection in radio group?

2008-04-04 Thread Michael Mehrle
Yes, that actually worked for me - thanks!! 

Michael

-Original Message-
From: Cristi Manole [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 04, 2008 5:33 AM
To: users@wicket.apache.org
Subject: Re: Default selection in radio group?

Hi,

What I did is use the same model for the group and for the radio item I
want
selected.
For example:

add(radioGroup = new RadioGroup(group, new Model(selectthis)));
//the
radio who has the same model will be selected

radioGroup.add(someradio1Radio = new Radio(someradio1radio, new
Model(selectthis)));
radioGroup.add(someradio2Radio = new Radio(someradio2radio, new
Model()));
radioGroup.add(someradio3Radio = new Radio(someradio3radio, new
Model()));

I hope this helps,
Cristi Manole

On Fri, Apr 4, 2008 at 3:01 PM, Hoover, William [EMAIL PROTECTED]
wrote:

 see
http://cwiki.apache.org/confluence/display/WICKET/Using+RadioGroups

 -Original Message-
 From: Michael Mehrle [mailto:[EMAIL PROTECTED]
 Sent: Thursday, April 03, 2008 8:49 PM
 To: users@wicket.apache.org
 Subject: Default selection in radio group?


 I created a RadioGroup with three radios attached. For some reason the
 form is being drawn with the last radio pre-selected, which I don't
want.
 How can I pre-select a default radio and also how can I set the group
to
 nothing selected?

 Thanks,

 Michael



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



Re: java.io.StreamCorruptedException: invalid type code: 29

2008-04-04 Thread Matej Knopp
passing 0 instead of -1 is definitely not the solution. This can
result in wrong page version set to other page references. I wish you
could provide a quickstart that reproduces the problem. It looks like
a bug in wicket but so far I'm not able to reproduce this behavior.

-Matej

On Fri, Apr 4, 2008 at 9:01 PM, Daniel Wu [EMAIL PROTECTED] wrote:
 I think I've found the solution for my StreamCorruptedException problem.
  Inside the org.apache.wicket.Page, there is a constant LATEST_VERSION which
  value is  -1. In my application, the versionNumber passed as parameter to
  the method getVersion(final int versionNumber) inside Page is never -1, the
  initial versionNumber of a page is always 0. When this versionNumber is
  different from 0, the versionManager object inside Page is not null, so the
  flow goes to the else block inside the getVersion() method.

  If LATEST_VERSION is -1, the flow of my application is always going to the
  if block below, never to else block, as my versionNumber is always = 0, so
  depending on the versionNumber, no page will be recovered, which was leading
  to the StreamCorruptedException, maybe because wicket was trying to
  de-serialize the wrong version of my page.

  if (versionNumber != LATEST_VERSION) {
   page = versionManager.getVersion(versionNumber);
  }
  else {
   page = versionManager.getVersion(getCurrentVersionNumber());
  }

  I've changed LATEST_VERSION value to 0, and now my application works
  perfectly. Are these assumptions correct? Does anytime versionNumber assumes
  the -1 value?



  On Thu, Apr 3, 2008 at 8:43 PM, Daniel Wu [EMAIL PROTECTED] wrote:

   I debugged my application and it really doesn't have a
   ClassNotFoundException eaten by ObjectInputStream. I compared the flow of
   two screens of my application, one that works and another that doesn't:
  
   1) The line 298 of SecondLevelCacheSessionStore =
   getLastPage().getVersion(versionNumber) is returning the correct page,
   because inside the getVersion() method, the versionManager object is null.
   In this case, the screen that I'm testing works perfectly.
  
   2) For the screen that throws the StackOverFlow and
   StreamCorruptedException, for some reason the versionManager object is not
   null, and it returns a null page object.
  
   Another strange thing is that after the line 393 of Objects.java = return
   ois.readObject(); = while debugging it using Eclipse, after this method
   call the flow goes straight to the line 363 of AbstractPageStore.java,
   without entering the finally block. So, an infinite loop starts, causing 
 the
   StackOverflow.
  
   During the tab switch of the screen that works, the line 393 of
   Objects.java is never reached, meaning that this screen was not serialized,
   right? This code is only reached during a tab switch of the screen that
   throws StackOverFlow exception.
  
   What defines if a page should be serialized/deserialized? Does anyone know
   what could be causing these problems?
  
  
   On Wed, Apr 2, 2008 at 7:28 PM, Daniel Stoch [EMAIL PROTECTED]
   wrote:
  
Hi,
   
It seems that this could be an OSGi related issue. We have the similar
problem in our applications.
You can look at the thread: Wicket + OSGI + Session (november 2007).
Then Sebastiaan gave me a tip that this can be ClassNotFoundException:
   
It's probably a ClassNotFoundException on deserialization which gets
eaten by ObjectInputStream (there's a bug report at Sun for this). To be
sure you can debug trapping on ClassNotFoundException (caught and 
 uncaught)
when this problem occurs.
   
However, since it's in a page you can easily fix this one: either
upgrade to trunk and implement your own IClassResolver and register it 
 with
the application, or write your own IObjectStreamFactory implementation 
 and
register it with the Objects class.
   
In either case, have a look at the DefaultObjectStreamFactory to see how
to write a hook to look up classes in an ObjectInputStream implementation
(resolveClass method).
   
   
Inside OSGI environment each bundle has its own class loader, so this
could leeds to problem when you try to use in your app a class defined in
another bundle.
I've solved this problem by implementing my own IClassResolver. The
default Wicket DefaultClassResolver is a final class, so we must make a 
 copy
of it and make a little change at the end of resolveClass method.
   
The default implementation (DefaultClassResolver):
   
   synchronized (classes)
   {
   ClassLoader loader =
Thread.currentThread().getContextClassLoader();
   if (loader == null)
   {
   loader =
DefaultClassResolver.class.getClassLoader();
   }
   clazz = loader.loadClass(classname);
   }
   
When there is a ClassLoader attached to the current thread as 

Error using JUnit: Can't instantiate page using constructor

2008-04-04 Thread PhilipJohnson

Greetings, all,

I am getting started with Wicket and just wrote my first simple JUnit test
for a small Wicket application (taken from the Wicket in Action book). The
test is:

public class TestIndexPage {
  @Test public void labelContainsHelloWorld() {
WicketTester tester = new WicketTester(); 
tester.startPage(Index.class); 
tester.assertContains(Gouda);
}
}

When I run it, I get the following:

[junit] 407 [main] ERROR org.apache.wicket.RequestCycle - Can't
instantiate page using constructor public com.cheesr.Index()
[junit] org.apache.wicket.WicketRuntimeException: Can't instantiate page
using constructor public com.cheesr.Index()

I have searched this group but not found any relevant solutions.  I am too
new to Wicket to understand how to diagnose this problem.

I have written a page with a more complete description of my error,
including a link to a .zip file which you can use to reproduce the error
quickly and which includes complete sources at:

http://code.google.com/p/hackystat-ui-wicket/wiki/WicketJUnitError

I would be most grateful for any help you could provide.  I am a refugee
from the Stripes/Struts/GWT world and am quite excited by the approach taken
in Wicket. 

Thanks very much,
Philip Johnson
-- 
View this message in context: 
http://www.nabble.com/Error-using-JUnit%3A-Can%27t-instantiate-page-using-constructor-tp16498898p16498898.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: Error using JUnit: Can't instantiate page using constructor

2008-04-04 Thread Igor Vaynberg
look at the stacktrace, the root cause is:

Caused by: java.lang.ClassCastException:
org.apache.wicket.util.tester.WicketTester$DummyWebApplication cannot
be cast to com.cheesr.CheesrApplication


in your page you are trying to cast application to cheesrapplicatio,
but by default wickettester uses its own internal application class,
so you should do

WicketTester tester=new WicketTester(new CheesrApplication());

-igor


On Fri, Apr 4, 2008 at 1:44 PM, PhilipJohnson [EMAIL PROTECTED] wrote:

  Greetings, all,

  I am getting started with Wicket and just wrote my first simple JUnit test
  for a small Wicket application (taken from the Wicket in Action book). The
  test is:

  public class TestIndexPage {
   @Test public void labelContainsHelloWorld() {
 WicketTester tester = new WicketTester();
 tester.startPage(Index.class);
 tester.assertContains(Gouda);
 }
  }

  When I run it, I get the following:

 [junit] 407 [main] ERROR org.apache.wicket.RequestCycle - Can't
  instantiate page using constructor public com.cheesr.Index()
 [junit] org.apache.wicket.WicketRuntimeException: Can't instantiate page
  using constructor public com.cheesr.Index()

  I have searched this group but not found any relevant solutions.  I am too
  new to Wicket to understand how to diagnose this problem.

  I have written a page with a more complete description of my error,
  including a link to a .zip file which you can use to reproduce the error
  quickly and which includes complete sources at:

  http://code.google.com/p/hackystat-ui-wicket/wiki/WicketJUnitError

  I would be most grateful for any help you could provide.  I am a refugee
  from the Stripes/Struts/GWT world and am quite excited by the approach taken
  in Wicket.

  Thanks very much,
  Philip Johnson
  --
  View this message in context: 
 http://www.nabble.com/Error-using-JUnit%3A-Can%27t-instantiate-page-using-constructor-tp16498898p16498898.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]



wicketstuff-push-examples compilation error

2008-04-04 Thread Enrique Rodriguez
Hi, Wicket users,

I thought I'd examine wicketstuff-push, since I could use push on a
project.  After a fresh check-out of wicketstuff-push,
wicketstuff-push-examples, and wicket-stuff-dojo, I found that
wicketstuff-push-examples wouldn't compile.  Keep in mind I just
starting looking at this code, but I made the following change to
class WicketAbstractPushChat to get it to compile (and now the
examples do appear to work):

Replace:

final IPushTarget pushTarget = getPushService().installPush(this);
CHAT_ROOM.addListener(new ChatListener() { ... });

With:

final IPushInstaller pushInstaller = new IPushInstaller() {
public void install(Component component, final IPushTarget pushTarget) {
CHAT_ROOM.addListener(new ChatListener() {
public void onMessage(Message msg) {
if (pushTarget.isConnected()) {

pushTarget.appendJavascript(document.getElementById(' +
chat.getMarkupId() + ').innerHTML += ' + msg + br/');
pushTarget.trigger();
} else {
CHAT_ROOM.removeListener(this);
}
}
});
}
};

getPushService().installPush( this, pushInstaller );


Does that make sense?  Again it appears to work but there are a ton of
errors saying TimerPushService is not serializable.

Otherwise, looks pretty cool and I hope to do more experimenting next week.

HTH,

Enrique

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