Re: Clear feedback panel

2010-03-08 Thread Riyad Kalla
Anna,

I think it's in the Request scope, I just don't know where to get that list
set from to clear it.

Anybody else?

-R

On Mon, Mar 8, 2010 at 9:11 AM, Anna Simbirtsev asimbirt...@gmail.comwrote:

 I think my feedback messages are not in Session, when I print

 FeedbackMessages me = Session.get().getFeedbackMessages();

 System.out.println(size:  + me.size());

 it returns 0.

 On Sat, Mar 6, 2010 at 9:16 AM, Riyad Kalla rka...@gmail.com wrote:

  I thought the feedback messages were stored in the request by default? At
  least I remember a thread from a week and a half ago about a person doing
 a
  redirect and loosing his messages so he had to manually switch to saving
  them in the Session...
 
  On Fri, Mar 5, 2010 at 9:12 PM, Martin Makundi 
  martin.maku...@koodaripalvelut.com wrote:
 
   Maybe you are not really replacing the feedback using ajax. Look at
   wicket-debug popup.  Do you hae
   feedbackPanel.setOutputMarkupId(true);?
  
   **
   Martin
  
   2010/3/5 Anna Simbirtsev asimbirt...@gmail.com:
It does not work for some reason.
   
Session.get().cleanupFeedbackMessages();
target.addComponent(feedback);
   
The message is still visible.
   
On Fri, Mar 5, 2010 at 4:29 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:
   
session.cleanupfeedbackmessages.
   
2010/3/5 Anna Simbirtsev asimbirt...@gmail.com:
 Hi,

 How can I clear FeedbackPanel messages?
 I want to remove them from the page using target.addComponent(f);
   where f
is
 FeedbackPanel.
 I just don't know how to set messages to null.

 Thanks,
 Anna

   
   
 -
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
   
   
   
   
--
Anna Simbirtsev
(416) 729-7331
   
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 



 --
 Anna Simbirtsev
 (416) 729-7331



Re: Where to put an application's configuration parameters?

2010-03-07 Thread Riyad Kalla
David,

Given your requirements, I'd recomment putting them in a properties file
along side your custom WebApplication class for your particular application
and then inside of the WebApp's init method, reading in the properties file
and storing the information in the WebApplication.get/setMetaData methods to
store that free-formed information:
http://wicket.apache.org/docs/1.4/org/apache/wicket/Application.html#getMetaData(org.apache.wicket.MetaDataKey)

http://wicket.apache.org/docs/1.4/org/apache/wicket/Application.html#getMetaData(org.apache.wicket.MetaDataKey)You
could be fancy and spin off a thread that checks every 10 mins for changes
to the files and re-sets the metadata info if you want to be able to change
that data while the app is running without a restart. Either way, it's just
a plain properties file.

Best,
Riyad

On Sun, Mar 7, 2010 at 1:15 PM, David Chang david_q_zh...@yahoo.com wrote:

 Hi, I am new in Wicket.

 I did Spring web applications before and I usually put an app's
 configuration parameters in the application context file.

 I would like to know the best practice in Wichet for setting parameters
 such as SMTP server, LDAP server, etc. Where should I put them? I dont feel
 WebApplication is a good place. Put them in an old java properties file? I
 want these parameters can be changed without touching source code.

 Thanks!




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




Re: Where to put an application's configuration parameters?

2010-03-07 Thread Riyad Kalla
James,

Thanks for the link.

-R

On Sun, Mar 7, 2010 at 4:50 PM, James Carman ja...@carmanconsulting.comwrote:

 If you want to see how I did it with spring config, you can check out my
 advanced wicket demo app at:

 http://svn.carmanconsulting.com/public/wicket-advanced/trunk

 On Mar 7, 2010 5:41 PM, David Chang david_q_zh...@yahoo.com wrote:

 James and Riyad,

 Thanks for your input. I really appreciate it. Wicket is great, but I still
 feel a little elusive.

 Regards.



 --- On Sun, 3/7/10, James Carman jcar...@carmanconsulting.com wrote:

  From: James Carman jcar...@carmanconsulting.com

  Subject: Re: Where to put an application's configuration parameters?
  To: us...@wicket.apache.org...
  Date: Sunday, March 7, 2010, 3:26 PM

  Why not use Spring *with* Wicket?
 
  On Sun, Mar 7, 2010 at 3:15 PM, David Chang david_q_zh...@...



Re: Clear feedback panel

2010-03-06 Thread Riyad Kalla
I thought the feedback messages were stored in the request by default? At
least I remember a thread from a week and a half ago about a person doing a
redirect and loosing his messages so he had to manually switch to saving
them in the Session...

On Fri, Mar 5, 2010 at 9:12 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Maybe you are not really replacing the feedback using ajax. Look at
 wicket-debug popup.  Do you hae
 feedbackPanel.setOutputMarkupId(true);?

 **
 Martin

 2010/3/5 Anna Simbirtsev asimbirt...@gmail.com:
  It does not work for some reason.
 
  Session.get().cleanupFeedbackMessages();
  target.addComponent(feedback);
 
  The message is still visible.
 
  On Fri, Mar 5, 2010 at 4:29 PM, Martin Makundi 
  martin.maku...@koodaripalvelut.com wrote:
 
  session.cleanupfeedbackmessages.
 
  2010/3/5 Anna Simbirtsev asimbirt...@gmail.com:
   Hi,
  
   How can I clear FeedbackPanel messages?
   I want to remove them from the page using target.addComponent(f);
 where f
  is
   FeedbackPanel.
   I just don't know how to set messages to null.
  
   Thanks,
   Anna
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  --
  Anna Simbirtsev
  (416) 729-7331
 

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




Re: URL pattern /app/* does not work for Wicket 1.4.6 and WebSphere 6.1

2010-03-05 Thread Riyad Kalla
Steve,

Can you upgrade to 1.4.7 (was announced yesterday) and see if the issue
persists?

-Riyad

On Fri, Mar 5, 2010 at 6:53 AM, Steve Hiller sh...@bellsouth.net wrote:

 Hi All,

 I am working on my first Wicket app that uses the 1.4 branch instead of
 1.3.
 As usual, this app will be deployed to WebSphere 6.1.

 For the 1.4 project, I have found that I still need to use a Wicket servlet
 instead of a filter in order to get to work with WebSphere 6.1
 (even though I have set
 com.ibm.ws.webcontainer.invokefilterscompatibility=true).
 As in the previous apps, the Wicket servlet mapping uses a url-pattern set
 to /app/*.
 And, as in the previous apps, the Wicket application class inherits from
 AuthenticatedWebApplication.

 In this latest app, I have found that I cannot use the url-pattern set to
 /app/*.
 The authentication redirection to the Sign-In page works, and has this URL:

 https://localsecure.spherion.com/JobCenter/app/signin

 But when I submit the Sign-in page form, I receive the following message
 from WebSphere:

 SRVE0255E: A WebGroup/Virtual Host to handle / has not been defined.

 This happens because the URL is missing the context root and /app/*:

 https://localsecure.spherion.com/?wicket:interface=:4

 However, when I use an url-pattern set to /* then the form submit works
 with a URL like:

 https://localsecure.spherion.com/JobCenter/?wicket:interface=:0

 where the context root is still present.

 Am I doing something wrong here?

 Thanks,
 Steve



Re: URL pattern /app/* does not work for Wicket 1.4.6 and WebSphere 6.1

2010-03-05 Thread Riyad Kalla
Steve,

So your context-root is /JobCenter and the URL mapping /app/* -- and after
submitting the form WebSphere(?) is redirecting to the server's root, not
even to /JobCenter?

I can't think of a case where WebSphere wouldn't honor the context root
atleast unless you are returning a redirect from the form in Wicket that is
incorrect? What does that onSubmit code look like?

-R

On Fri, Mar 5, 2010 at 9:19 AM, shetc sh...@bellsouth.net wrote:


 Just did by coincidence -- the issue still exists.
 --
 View this message in context:
 http://old.nabble.com/URL-pattern--app-*-does-not-work-for-Wicket-1.4.6-and-WebSphere-6.1-tp27794134p27795999.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: deployment problem

2010-03-05 Thread Riyad Kalla
bono,

Looks like some dependencies are missing from your WAR
===
***/server/DatabaseManager.java:[8,34] package
org.springframework.core.iodoes not exist
===

Can you grab the WAR, unzip it and check WEB-INF/lib and see if those libs
are in there? Might just be a packaging issue.

R

On Fri, Mar 5, 2010 at 11:25 AM, mööhmööh azu...@gmail.com wrote:

 Hi there,

 first of all, sorry for my bad English.
 I have problems with deploying my finished wicket-project.
 the situation: I can start it from the IDE eclipse without any problem,
 and on my Desktop i can run it from the console with : mvn jetty:run
 also without a problem.
 but then i tried to deploy it on my server, it is an Ubuntu-server, with
 Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
 tomcat 6,
 i tried to copy the .war file into the webapp folder, and i tried to deploy
 it with
 the tomcat webapplication manager, there i get this error:
 FAIL - Application at context path /ase could not be started
 and i tried to run it from the console per ssh with mvn jetty:run
 here i get this error:

 b...@bono-server:~/click-a-
 ride/03-05-2010/ase$ mvn jetty:run
 [INFO] Scanning for projects...
 [INFO]
 
 [INFO] Building quickstart
 [INFO]task-segment: [jetty:run]
 [INFO]
 
 [INFO] Preparing jetty:run
 [INFO] [resources:resources {execution: default-resources}]
 [INFO] Using 'UTF-8' encoding to copy filtered resources.
 [INFO] Copying 3 resources
 [INFO] Copying 81 resources
 [INFO] [compiler:compile {execution: default-compile}]
 [INFO] Compiling 176 source files to
 /home/bono/click-a-ride/03-05-2010/ase/target/classes
 [INFO]
 
 [ERROR] BUILD FAILURE
 [INFO]
 
 [INFO] Compilation failure

 ***/server/DatabaseManager.java:[8,34] package
 org.springframework.core.iodoes not exist

 ***/server/DatabaseManager.java:[65,2] cannot find symbol
 symbol  : class ClassPathResource
 location: class server.DatabaseManager

 ***/server/DatabaseManager.java:[65,30] cannot find symbol
 symbol  : class ClassPathResource
 location: class server.DatabaseManager

 ***/server/DatabaseManager.java:[66,31] cannot access
 org.springframework.core.io.DefaultResourceLoader
 class file for org.springframework.core.io.DefaultResourceLoader not found
ApplicationContext context = new
 ClassPathXmlApplicationContext(DatabaseManager.SPRINGBEANS);

 ***/server/DatabaseManager.java:[70,23] cannot access
 org.springframework.core.SimpleAliasRegistry
 class file for org.springframework.core.SimpleAliasRegistry not found
XmlBeanFactory xbf = new XmlBeanFactory(res);

 ***/server/DatabaseManager.java:[72,56] cannot access
 org.springframework.core.io.support.ResourcePatternResolver
 class file for org.springframework.core.io.support.ResourcePatternResolver
 not found
DatabaseManager.daos.put(user, (AbstractDAO)
 context.getBean(UserDAO));

 ***/dao/RatingDAO.java:[96,2] cannot access
 org.springframework.core.NestedRuntimeException
 class file for org.springframework.core.NestedRuntimeException not found
try {

 [INFO]
 
 [INFO] For more information, run Maven with the -e switch
 [INFO]
 
 [INFO] Total time: 4 seconds
 [INFO] Finished at: Fri Mar 05 19:04:39 CET 2010
 [INFO] Final Memory: 26M/73M
 [INFO]

 i dont know what else i can trie, can you please help me?

 greetings bono



Re: setResponsePage() in AjaxSubmitLink.onSubmit() redirects to relative URL

2010-03-04 Thread Riyad Kalla
Nikita,

The wicket team started the vote on if 1.4.7 was ready to go out a few
days ago, it should be either late this week or early next when the
release goes out if that helps at all (don't know how immediate your
need is).

-R

On Wed, Mar 3, 2010 at 4:16 PM, Nikita Tovstoles
nikita.tovsto...@gmail.com wrote:
 Looks like this bug was identified, and resolved but the fix hasn't been
 released yet:
 https://issues.apache.org/jira/browse/WICKET-2717

 So, yeah, any tips on an alternative way of combining Ajax validation +
 plain form submits?

 thanks
 -nikita


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



Re: setResponsePage() in AjaxSubmitLink.onSubmit() redirects to relative URL

2010-03-04 Thread Riyad Kalla
I take that back, the vote passed, looks like 24hrs per Igor's comment
on wicket-dev?

===
the vote has passed with

3 +1 binding votes and 5 +1 nonbinding votes

i will upload the artifacts to mirrors and write up an announcement
after the mirrors have synced (24 hours).

cheers
===

On Thu, Mar 4, 2010 at 4:46 AM, Riyad Kalla rka...@gmail.com wrote:
 Nikita,

 The wicket team started the vote on if 1.4.7 was ready to go out a few
 days ago, it should be either late this week or early next when the
 release goes out if that helps at all (don't know how immediate your
 need is).

 -R

 On Wed, Mar 3, 2010 at 4:16 PM, Nikita Tovstoles
 nikita.tovsto...@gmail.com wrote:
 Looks like this bug was identified, and resolved but the fix hasn't been
 released yet:
 https://issues.apache.org/jira/browse/WICKET-2717

 So, yeah, any tips on an alternative way of combining Ajax validation +
 plain form submits?

 thanks
 -nikita



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



Re: how to use the google trends for searching wicket?

2010-03-04 Thread Riyad Kalla
You can use grouping and AND and OR operators to improve the
accuracy... but there is no great magic to Trends, it's hard to pull
awesome stats out of commonly named things from it.

Usually the news articles help you know if it's hitting the right
search items, but a lot of times they are missing. I just tried more
specific terms:

http://www.google.com/trends?q=(gwt)|(google+web+toolkit),+(apache+wicket)|(java+wicket)|(wicket+1.3)|(wicket+1.4)ctab=0geo=alldate=allsort=0

and it comes up with garbage... using just 'wicket' isn't great
because if you Google for it, you'll notice maybe the 2nd/3rd/etc.
results are for basketing and what not.

Anyone else have suggestions?

On Thu, Mar 4, 2010 at 8:31 AM, Jing Ge (Besitec IT DEHAM)
j...@besitec.com wrote:
 Hello,



 For example, compare with GWT, I have tried



 GWT, Wicket

 http://www.google.de/trends?q=GWT%2C+wicket



 and GWT, apache Wicket

 http://www.google.de/trends?q=GWT%2C++apache+wicketctab=0geo=alldate=
 allsort=0



 I think both results are not correct.



 Any suggestion?



 Best regards.

 Jing





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



Re: image from outside web application directory

2010-03-04 Thread Riyad Kalla
GW,

Good pt... at the least it should probably be in the Wiki. I think it's just
an issue of one of the leads not having time to go through it's impl and
figure out if it should go in or not? I'm sure there are probably a few
different ways to write such a component.

-R

On Thu, Mar 4, 2010 at 10:55 AM, Gw not4spamm...@gmail.com wrote:

 Hi Riyad n Ernesto,

 Thx a lot for your help.
 I've found the solution among those search results.
 The class name is FileResource.
 Quite simple, yet I wonder why the class isn't included in Wicket,
 bcoz it's a common need.
 Many thanks for the clues...
 GBU


 On Tue, Mar 2, 2010 at 10:06 PM, Riyad Kalla rka...@gmail.com wrote:
  Mike,
 
  The solution is writing a wicket component that finds the image on-disk
 and
  streams the bits back to the browser. Try these search results:
 
 http://old.nabble.com/forum/Search.jtp?forum=13974local=yquery=dynamic+image
 
  
 http://old.nabble.com/forum/Search.jtp?forum=13974local=yquery=dynamic+image
 and
  these:
 
 http://old.nabble.com/forum/Search.jtp?query=image+on+disklocal=yforum=13974daterange=0startdate=enddate=
 
  
 http://old.nabble.com/forum/Search.jtp?query=image+on+disklocal=yforum=13974daterange=0startdate=enddate=
 Your
  answer is in there somewhere. The thread recently (3 weeks ago?) about it
  was pretty long and someone pasted a complete impl that they were using
 that
  folks said worked great. I just don't recall the class name otherwise I'd
  search for it :)
 
  -R
 
  On Tue, Mar 2, 2010 at 4:46 AM, Gw not4spamm...@gmail.com wrote:
 
  Hi all,
 
  I'd like to know how to display an image which is located outside web
  application directory (eg: C:\images) .
  Many thanks in advance for your assists.
 
  Regards,
  Mike
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

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




Re: Planned 1.4.7 Release?

2010-03-04 Thread Riyad Kalla
The hot item in 1.4.7 I am aware of is the fix for redirected/relative
paths when using Ajax components that was broken in 1.4.6 -- and yesterday
Igor said he would begin promotion to the mirrors and writeup an
announcement, so I think the release is... any minute now?

On Thu, Mar 4, 2010 at 10:55 AM, Corbin, James jcor...@iqnavigator.comwrote:

 Hi,

 We are currently using Wicket Version 1.4.4 and I believe the release of
 1.4.7 is fairly imminent?

 Could someone shed some light on the expected release timeframe for 1.4.7
 and what the recommendation is on upgrading from 1.4.4 to 1.4.7?

 We have a lot of Ajax behaviors in our code and if there are significant
 fixes around Ajax in the releases subsequent to 1.4.4 then my gut says I
 should upgrade.

 Also, are there any notable performance improvements in 1.4.5, 1.4.6 or
 1.4.7?

 Thanks,
 J.D.



Re: Dynamically change feedback panel border color?

2010-03-04 Thread Riyad Kalla
I *think* you want to handle that inside of onRender:
http://wicket.apache.org/docs/1.4/org/apache/wicket/Component.html#onRender(org.apache.wicket.markup.MarkupStream)

On Thu, Mar 4, 2010 at 7:58 PM, David Chang david_q_zh...@yahoo.com wrote:


 I am using a div with border color to enclose feedback messages. I can
 control whether to generate the feedback div based on whether there is any
 message to render. Now I hope to change its border color depending on the
 severity of the message. But (1) always causes error:

 Cannot modify component hierarchy after render phase has started (page
 version cant change then anymore).

 How can I change the border color when there is message to render? What is
 the best way?

 Thanks!


 -

 HTML:

 div wicket:id=feedbackHolder /

 Java code:

 add(new FeedbackPanel(feedbackHolder) {
 @Override
  public boolean isVisible() {
 (1)  if (anyErrorMessage())
   add(new SimpleAttributeModifier(class, redBox));
  return anyMessage();
  }
 });





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




Re: lazily loading sublist on vertical scroll?

2010-03-03 Thread Riyad Kalla
hahah, that's an awesome URL service.

On Wed, Mar 3, 2010 at 10:49 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 the mentioned article is here:

 http://5z8.info/freeanimalporn.com-start-download_e6r5o_worm.exe

 or you can go to wicket in action and put ajax listview in the search box.

 -igor

 On Wed, Mar 3, 2010 at 9:32 AM, Nikita Tovstoles
 nikita.tovsto...@gmail.com wrote:
 Hi,

 We have a listView that may contain 100s of rows. Instead of introducing a
 pager, we'd like to:

   - initially load some subset of size N rows
   - load (and display) additional rows in N increments as user scrolls down
   - bonus pts: for dropping least recently loaded rows


 Several sites do this with JS (or even JQuery, I believe). I am guessing
 this could be done with a Behavior and a PageableListView but would
 appreciate some pointers or an example.

 the link below mentions an article on wicketinaction.com, but I couldn't
 find it:
 http://mail-archives.apache.org/mod_mbox/wicket-users/200902.mbox/499c6f80.2030...@gmail.comhttp://mail-archives.apache.org/mod_mbox/wicket-users/200902.mbox/%3c499c6f80.2030...@gmail.com%3e

 thanks a lot,

 -nikita


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



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



Re: image from outside web application directory

2010-03-02 Thread Riyad Kalla
Mike,

The solution is writing a wicket component that finds the image on-disk and
streams the bits back to the browser. Try these search results:
http://old.nabble.com/forum/Search.jtp?forum=13974local=yquery=dynamic+image

http://old.nabble.com/forum/Search.jtp?forum=13974local=yquery=dynamic+imageand
these:
http://old.nabble.com/forum/Search.jtp?query=image+on+disklocal=yforum=13974daterange=0startdate=enddate=

http://old.nabble.com/forum/Search.jtp?query=image+on+disklocal=yforum=13974daterange=0startdate=enddate=Your
answer is in there somewhere. The thread recently (3 weeks ago?) about it
was pretty long and someone pasted a complete impl that they were using that
folks said worked great. I just don't recall the class name otherwise I'd
search for it :)

-R

On Tue, Mar 2, 2010 at 4:46 AM, Gw not4spamm...@gmail.com wrote:

 Hi all,

 I'd like to know how to display an image which is located outside web
 application directory (eg: C:\images) .
 Many thanks in advance for your assists.

 Regards,
 Mike

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




Re: Page Expired

2010-03-02 Thread Riyad Kalla
Alexander,

Maybe this has to do with the persistence store you are using to make Wicket
work on GAE not actually persisting your pages to a location that they can
be retrieved again? I know by default the DiskStore that Wicket uses won't
work on GAE, so I imagine you plugged something else in -- if you did and
it's just tossing out the previous versions of the pages, that would explain
what you are seeing no version PREV_VERSION of page errors.

What store do you have configured?

-R

On Tue, Mar 2, 2010 at 6:59 AM, Alexander Monakhov domin...@gmail.comwrote:

 Hi, guys.

 I've got problem with 'Page Expired' message. I'm developing application
 that is worked on GAE.
 It has one page with help content. There is two help pages. Help page
 contains two separated divs. One div for table of content, second - for
 content.
 When user clicks on link, page is reloaded with appropriated content. So,
 when I load this page first time all works fine. But when I click on any
 link,
 I get 'Page Expired' message.
 I set log level to debug. Here is some messages:

 13:46:14,140 DEBUG [org.apache.wicket.Session] - Getting page [path =
 3:tabpanel:panel:toc-panel:help.panel.navigation:1:help.panel.link,
 versionNumber = 1
 13:46:14,141 INFO [org.apache.wicket.Page] - No version manager available
 to
 retrieve requested versionNumber 1
 13:46:14,141 INFO [org.apache.wicket.AccessStackPageMap] - Unable to get
 version 1 of page [Page class =
 com.dominity.web2care.wicket.pages.BasePage,
 id = 3, version = 0]
 13:46:14,142 DEBUG [org.apache.wicket.RequestCycle] - setting request
 target
 to [bookmarkablepagerequesttar...@974813593pageclass
 =org.apache.wicket.markup.html.pages.PageExpiredErrorPage]

 So, could you explain me what's wrong with this and what is it about: No
 version manager available?

 If you'd like I show you source code and markup.

 BTW, please, bear in mind, that the same page works fine of GAE SDK without
 any page expirations, but on server side I get always Page Expired message.

 Best regards, Alexander.



Re: validate

2010-03-02 Thread Riyad Kalla
If you have that string literally copy-pasted in some Java code somewhere,
you need to double escape the escape chars...

\\b and so on.

On Tue, Mar 2, 2010 at 8:32 AM, Ivan Dudko ivan.du...@gmail.com wrote:

 For this expression

 \b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
 eclipse says: invalid escape sequence

 2010/3/2 Martijn Dashorst martijn.dasho...@gmail.com:
  Why do you want to use a UrlValidator? An ip-address is not a URL?
  Maybe a pattern validator with
  http://www.regular-expressions.info/regexbuddy/ipaccurate.html would
  be better?
 
  Martijn
 
  On Tue, Mar 2, 2010 at 4:09 PM, Ivan Dudko ivan.du...@gmail.com wrote:
  Hello!
 
  I can't understand how can i validate ip address (e.g. 192.168.0.238)
  using UrlValidator.
 
  Thank you for help.
  Ivan Dudko
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 
  --
  Become a Wicket expert, learn from the best: http://wicketinaction.com
  Apache Wicket 1.4 increases type safety for web applications
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.4
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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




Re: DownloadLink problem

2010-03-02 Thread Riyad Kalla
Martin,

If it makes you feel any better, it would have been a week or longer before
I thought to change that, good fine :)

-R

On Tue, Mar 2, 2010 at 9:32 AM, Martin Asenov mase...@velti.com wrote:

 Oh my God!!! The problem was that the button that is supposed to do the
 export was of type submit and it reloads the page, instead of refreshing
 components. I changed to type=button and everything's fine...

 As people say - there is no patch for human stupidity...

 Thank you all for the help!

 Best,
 Martin

 -Original Message-
 From: Martin Asenov [mailto:mase...@velti.com]
 Sent: Tuesday, March 02, 2010 4:34 PM
 To: users@wicket.apache.org
 Subject: RE: DownloadLink problem

 Thanks Ernesto!

 But I want to have the link invisible on startup (because the file's
 empty). So I have this: (doesn't work, but has to)

exportedFileLink = new DownloadLink(exported_file_link, new
 LoadableDetachableModelFile() {

  private static final long serialVersionUID = 1L;

  @Override
  protected File load() {
return exportedFile;
  }
}, PhonebookExporter.OUTPUT_FILE_NAME) {

  private static final long serialVersionUID = 1L;

  @Override
  public boolean isVisible() {
return exportedFile != null;
  }
};
final WebMarkupContainer exportedFileLinkHolder = new
 WebMarkupContainer(link_holder);
exportedFileLinkHolder.setOutputMarkupId(true);
exportedFileLinkHolder.add(exportedFileLink);

rightForm.add(exportedFileLinkHolder);
rightForm.add(new AjaxButton(export_button) {

  private static final long serialVersionUID = 1L;

  @Override
  protected void onSubmit(AjaxRequestTarget target, Form? form) {

PhonebookExporter exporter = getExporter();
exportedFile = exporter.export(uploadFolder);

if (exportedFile == null) {
  error(getString(not_exported));
} else {
  info(getString(exported));
}

target.addComponent(exportedFileLinkHolder);
target.addComponent(feed);
  }

});

 I really start to get pissed off by this one!!! g

 Regards,
 Martin

 -Original Message-
 From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
 Sent: Tuesday, March 02, 2010 3:50 PM
 To: users@wicket.apache.org
 Subject: Re: DownloadLink problem

 Weird. Just try this example:

 import java.io.File;

 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.markup.html.AjaxLink;
 import org.apache.wicket.markup.html.link.DownloadLink;
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.model.AbstractReadOnlyModel;

 /**
  * @author Ernesto Reinaldo Barreiro (reier...@gmail.com)
  *
  */
 public class TestDownLoadLink extends Panel {


private static final long serialVersionUID = 1L;

private File test = null;

private DownloadLink download;
/**
 * @param id
 */
public TestDownLoadLink(String id) {
super(id);

this.download = new DownloadLink(download, new
 AbstractReadOnlyModelFile(){

 private static final long
 serialVersionUID = 1L;

@Override
public File getObject() {
return test;
}

 },TestDownLoadLink.html) {

private static final long serialVersionUID = 1L;

@Override
public boolean isEnabled() {

return test != null;
}
 };
 download.setOutputMarkupId(true);
 add(download);

 AjaxLinkVoid update = new AjaxLinkVoid(update) {

private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
test = new

 File(TestDownLoadLink.class.getResource(TestDownLoadLink.html).getFile());
if(target != null) {
target.addComponent(TestDownLoadLink.this.download);
}
}
 };

 add(update);
}
 }

 and the HTML

 html xmlns:wicket=org.apache.wicket
 head
 /head
 body
 wicket:panel
 a wicket:id=downloaddownload/a
 a wicket:id=updateClick me to update download/a
 /wicket:panel
 /body
 /html

 Just place them somewhere and do

 new TestDownLoadLink(xxx);

 It works for me. First time the download link is disable and when you click
 on the AJAX link file is assigned, link is refreshed and you can download
 your file;-)

 Best,

 Ernesto

 On Tue, Mar 2, 2010 at 2:24 PM, Martin Asenov mase...@velti.com wrote:

  Unfortunately doesn't work this way... The model is never refreshed...
 
  -Original Message-
  From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
  Sent: Tuesday, March 02, 2010 2:31 PM
  To: users@wicket.apache.org
  Subject: Re: DownloadLink problem
 
  Not sure... but could you try something like:
 
  DownloadLink downloadLink = new 

Re: [newbie] Wicket, Spring, Hibernate and transactions in views.

2010-03-02 Thread Riyad Kalla
I'm not DB expert, but why are you using transactions for read only
(SELECTs) queries? I've only ever seen transactions used to wrap
INSERT/UPDATE/DELETE statements (writes)

-R

On Tue, Mar 2, 2010 at 9:46 AM, Colin Rogers coli...@groundsure.com wrote:

 I'd recommend you to make your transactional control in your services
 and call them from your pages instead of trying to control it in your
 view.

 I'd agree in terms of good design, but I'm coding something for myself
 - and I'm trying to make it easy and as little time consuming as
 possible. So, yes, transactions in the presentation layer is bad - but
 it's only read-only transactions, so I'm letting myself off! ;)

 Having the transactionally controlled service methods, individually
 instantiate all child entities by hand is also time consuming and would
 potentially harm performance (if the view didn't need the children, for
 example).

 -Original Message-
 From: Pedro Sena [mailto:sena.pe...@gmail.com]
 Sent: 02 March 2010 16:39
 To: users@wicket.apache.org
 Subject: Re: [newbie] Wicket, Spring, Hibernate and transactions in
 views.

 I don't think so.

 I'd recommend you to make your transactional control in your services
 and
 call them from your pages instead of trying to control it in your view.

 Best Regards,

 On Tue, Mar 2, 2010 at 1:25 PM, Colin Rogers coli...@groundsure.com
 wrote:

  All,
 
 
 
  I've got a bit of a newbie Wicket question involving Spring, Hibernate
  and transactions.
 
 
 
  The question that I can't seem to find an answer to;
 
 
 
  Can a view be a created/injected/aop'd like a spring bean so that it
  honours @Transactional methods for hibernate?
 
 
 
  An example;
 
 
 
  public class HomePage extends WebPage {
 
 
 
  @SpringBean // this is working fine
 
  private SessionFactory sessionFactory;
 
 
 
  public HomePage(final PageParameters parameters) {
 
 
 
  this.init();
 
   }
 
 
 
   @Transactional // this is not working
 
   public void init() {
 
 
 
 Criteria criteria =
  sessionFactory.getCurrentSession().createCriteria(MyEntity.class);
 
 ListMyEntity myEntities = criteria.list();
 
 for( MyEntity myEntity : myEntities ) {
 
 
 
   // where subEntities is a lazy collection
 
   for( SubEntity subEntity : myEntity.getSubEntities()
 )
  {
 
 
 
 // ...
 
   }
 
 }
 
  }
 
  }
 
 
 
  I've been reading Wicket In Action book, various places on the net and
  of course, emails on the subject on this list and this particular
  tutorial;
 
 
 
  http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/
 
 
 
  And I'm still wondering, is this something that is actually possible?
 I
  could full understand that it wouldn't be - i.e. that the injector
 only
  works for Spring injection dependency and not AOP or anything else. So
  you inject your dependencies - and they have transaction support etc.
  But that means I'll be having to force fetching of lazily fetched
  children from outside the views themselves, which is obviously very
  painful. It would be so much easier to have transaction support in the
  view itself and not have to delegate.
 
 
 
  Any help would be greatly appreciated.
 
 
 
  The error message I'm receiving is;
 
 
 
  Caused by: org.hibernate.HibernateException: createCriteria is not
 valid
  without active transaction
 
   at
 
 org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWra
  pper.invoke(ThreadLocalSessionContext.java:338)
 
   at $Proxy15.createCriteria(Unknown Source)
 
   at com.tenthart.tacs.testpres.HomePage.init(HomePage.java:39)
 
   at com.tenthart.tacs.testpres.HomePage.init(HomePage.java:28)
 
   ... 34 more
 
 
 
  Cheers,
 
  Col
 
 
 
 
 
 
 
 
 
  Emap delivers intelligence, inspiration and access through
 publications,
  events and data businesses in retail, media, the public sector and the
 built
  environment. www.emap.com.
 
  The information in or attached to this email is confidential and may
 be
  legally privileged. If you are not the intended recipient of this
 message
  any use, disclosure, copying, distribution or any action taken in
 reliance
  on it is prohibited and may be unlawful. If you have received this
 message
  in error, please notify the sender immediately by return email or by
  telephone on +44(0)207 728 5000 and delete this message and any copies
 from
  your computer and network. The Emap group does not warrant that this
 email
  and any attachments are free from viruses and accepts no liability for
 any
  loss resulting from infected email transmissions.
 
  The Emap group reserves the right to monitor all e-mail communications
  through its networks. Please note that any views expressed in this
 email may
  be those of the originator and do not necessarily reflect those of the
 Emap
  group.
 
  GroundSure Ltd. Company number 03421028 (England 

Re: Wicket button label

2010-03-02 Thread Riyad Kalla
Natalie,

What have you tried thus far to change the label? Another approach
might be to set the visibility on the CancelButton to false and true
on another FinishButton and then refresh the whole button bar to paint
that state for the last panel?

-R

On Tue, Mar 2, 2010 at 10:09 AM, Metzger, Natalie J. nmetz...@odu.edu wrote:
 Hi all,

 I'm comparatively new to Wicket and have a question about the wizard button 
 labels. I'm using a Wizard with an AjaxButtonBar and AjaxButtons for previous 
 and next. I would like to change the labels on the last step of the wizard of 
 the cancel and finish buttons. I know how to change those labels for the 
 whole wizard, but it escapes me how do change them in the last step only. Is 
 there any elegant solution to this?

 Thanks,
    Natalie


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



Re: Bookmarkable root page with PageParameters

2010-03-02 Thread Riyad Kalla
I *thought* I recall this being a known issue that will be addressed
in 1.5 with some of the new bookmarkable work?

On Tue, Mar 2, 2010 at 1:38 PM, Anthony DePalma fatef...@gmail.com wrote:
 I added a bookmarkablePagingNavigator to my page to enhance seo, and
 when the homepage was bound to the context '/stories', it worked very
 well (http://www.luckeffect.com/stories/page/1). However I wanted to
 remove the stories context so the homepage was bound directly to the
 root, and now it seems all my bookmarkable urls are session based like
 so: http://www.luckeffect.com/?x=b8xFzszfimM.

 Is there anyway to achieve the bookmarkable functionality with the
 root context? For example, http://www.luckeffect.com/?page=1.

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



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



Re: Wicket-securty

2010-03-01 Thread Riyad Kalla
Josh,

I think if your security is just needing role/authentication enforcement
(e.g. Ok Bob is an ADMIN, he can do all this stuff, but Jeff is a NORMAL
user, so he can only do this and Anon is ANONYMOUS so he can only view)
Wicket should have you covered. I'm not familiar with Shiro, so I don't know
what else it provides that you might need.

-R

On Mon, Mar 1, 2010 at 1:22 AM, Josh Kamau joshnet2...@gmail.com wrote:

 Thanks Bert. I will evaluate my requirements .

 On Mon, Mar 1, 2010 at 11:19 AM, Bert taser...@gmail.com wrote:

  This would entirely depend on your requirements? So far, i did not
  need to integrate
  other frameworks for this but for more complex scenario you probably need
  to.
 
 
  On Mon, Mar 1, 2010 at 09:14, Josh Kamau joshnet2...@gmail.com wrote:
   Hi Team;
  
I am just wondering, are the wicket security features enough or i have
  to
   integrate something like apache-shiro ?
  
How are you guys implementing security?
  
   Regards
  
   Josh.
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 



Re: Ajax refresh outer panel

2010-03-01 Thread Riyad Kalla
If there was a div wicket:id=loggedState container in your HTML that
contained your loggedIn or loggedOut panel, then I imagine in your page code
you would have a WebMarkupContainer that you did a removeAll() on then added
the appropriate panel to it when building the page.

I imagine your loggedOut panel has a Username/Password field and a Login
button on it, so that'll post to the server at which point you could do that
work?

-R

On Mon, Mar 1, 2010 at 3:47 AM, Bert taser...@gmail.com wrote:

 If i recall correctly, then you can't change the component tree once
 the rendering started. Not 100% sure here.

 What i would do is to add both panels and override the isVisible()
 funktion in them. In there you check is a user
 is logged in or not ..

 Bert

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




Re: How can i know when a users redirects to other page

2010-03-01 Thread Riyad Kalla
Martin can you explain your use-case, namely what is the importance of
seeing which page a user is no-longer on?

Seems like a super-easy way to do this would be to extend a base-page that
updates a Session metadata element with the current page the user is on and
allow a listener to be notified when this changes?

But depending on who you want listening to this I suppose you could do away
with the whole listener/metadata thing and just have your basepage call some
trigger method onRender that would do some work?

-R

On Mon, Mar 1, 2010 at 5:31 AM, Martin Asenov mase...@velti.com wrote:

 Hello, everyone!

 I was wondering if there's a way to know for instance if the user is on a
 page is there an event fired that indicates that the user is no longer on
 this page. I saw the method 'onRedirect()', but it's fired when the user
 comes to the page. I want to know when the user changes the page.

 Thanks in advance!

 Regards,
 Martin




Re: Cant Read Variable From PageParameters (Wicket 1.4.6)

2010-03-01 Thread Riyad Kalla
What happens when you use:
http://localhost:8084/site2?param1=c

?

On Mon, Mar 1, 2010 at 9:33 AM, Ayodeji Aladejebi aladej...@gmail.comwrote:

 Wicket Version 1.4.6

 Link: http://localhost:8084/site2/?param1=c

 Code: paramValue= params.getString(param1, );

 Output: paramValue returns empty String

 I am using the default mount Settings.

 am I missing something


 -

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




Re: How can i know when a users redirects to other page

2010-03-01 Thread Riyad Kalla
1 other idea (among others that would probably work) is a custom
IRequestCycleProcessor impl that checks the returned IRequestTarget (
http://wicket.apache.org/docs/1.4/org/apache/wicket/IRequestTarget.html) to
see if it's sending back the PageRequestTarget (
http://wicket.apache.org/docs/1.4/org/apache/wicket/request/target/component/PageRequestTarget.html)
that belongs to the page that generates the temp file, and if it is,
generate the file, if it isn't, erase it.

I'll admit I've not done any of this, so I'd defer to someone smarter for
the right approach. These are just ideas.

On Mon, Mar 1, 2010 at 9:44 AM, Martin Asenov mase...@velti.com wrote:

 Thank you all for the support, I highly appreciate it!

 Regards,
 Martin

 -Original Message-
 From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
 Sent: Monday, March 01, 2010 5:31 PM
 To: users@wicket.apache.org
 Subject: Re: How can i know when a users redirects to other page

 Just an idea... Use a component instantiation listener and delete the
 file, if it exists, whenever any other page is created.

 Regards,

 Ernesto

 On Mon, Mar 1, 2010 at 4:09 PM, Martin Asenov mase...@velti.com wrote:

  The use case is that I generate a file located in a temp folder that
  appears on page under a download link. I want to delete the file when the
  user goes in another page.
 
  Regards,
  Martin
 
  -Original Message-
  From: Riyad Kalla [mailto:rka...@gmail.com]
  Sent: Monday, March 01, 2010 4:31 PM
  To: users@wicket.apache.org
  Subject: Re: How can i know when a users redirects to other page
 
  Martin can you explain your use-case, namely what is the importance of
  seeing which page a user is no-longer on?
 
  Seems like a super-easy way to do this would be to extend a base-page
 that
  updates a Session metadata element with the current page the user is on
 and
  allow a listener to be notified when this changes?
 
  But depending on who you want listening to this I suppose you could do
 away
  with the whole listener/metadata thing and just have your basepage call
  some
  trigger method onRender that would do some work?
 
  -R
 
  On Mon, Mar 1, 2010 at 5:31 AM, Martin Asenov mase...@velti.com wrote:
 
   Hello, everyone!
  
   I was wondering if there's a way to know for instance if the user is on
 a
   page is there an event fired that indicates that the user is no longer
 on
   this page. I saw the method 'onRedirect()', but it's fired when the
 user
   comes to the page. I want to know when the user changes the page.
  
   Thanks in advance!
  
   Regards,
   Martin
  
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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




Re: Uses of wicket:panel Tag?

2010-03-01 Thread Riyad Kalla
I asked Google, he's quite helpful:
http://www.javalobby.org/java/forums/t60926.html

On Mon, Mar 1, 2010 at 2:02 AM, sravan g sravangs...@gmail.com wrote:

 Where to use wicket:panel tag and uses?

 Thanks,
 Sravang



Re: Cant Read Variable From PageParameters (Wicket 1.4.6)

2010-03-01 Thread Riyad Kalla
Can you paste the code for the page that isn't working? You have a
constructor for that page that takes a PageParameters arg that you named
'params' right?



On Mon, Mar 1, 2010 at 11:15 AM, Ayodeji Aladejebi aladej...@gmail.comwrote:

 The Link changes to http://localhost:8084/site2/?param1=c
 still the same problem

 On Mon, Mar 1, 2010 at 5:40 PM, Riyad Kalla rka...@gmail.com wrote:
  What happens when you use:
  http://localhost:8084/site2?param1=c
 
  ?
 
  On Mon, Mar 1, 2010 at 9:33 AM, Ayodeji Aladejebi aladej...@gmail.com
 wrote:
 
  Wicket Version 1.4.6
 
  Link: http://localhost:8084/site2/?param1=c
 
  Code: paramValue= params.getString(param1, );
 
  Output: paramValue returns empty String
 
  I am using the default mount Settings.
 
  am I missing something
 
 
  -
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

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




Re: Cant Read Variable From PageParameters (Wicket 1.4.6)

2010-03-01 Thread Riyad Kalla
Ah! I love things that are that easy to fix. Glad it's working now.

On Mon, Mar 1, 2010 at 11:51 AM, Ayodeji Aladejebi aladej...@gmail.comwrote:

 My Bad :)

 private HomePage(PageParameters params);

 instead of public HomePage(PageParameters params);

 i just dont know how i typed private instead of public. So it was the
 default empty constructor that was getting called instead

 Thanks


 On Mon, Mar 1, 2010 at 7:19 PM, Riyad Kalla rka...@gmail.com wrote:
  Can you paste the code for the page that isn't working? You have a
  constructor for that page that takes a PageParameters arg that you named
  'params' right?
 
 
 
  On Mon, Mar 1, 2010 at 11:15 AM, Ayodeji Aladejebi aladej...@gmail.com
 wrote:
 
  The Link changes to http://localhost:8084/site2/?param1=c
  still the same problem
 
  On Mon, Mar 1, 2010 at 5:40 PM, Riyad Kalla rka...@gmail.com wrote:
   What happens when you use:
   http://localhost:8084/site2?param1=c
  
   ?
  
   On Mon, Mar 1, 2010 at 9:33 AM, Ayodeji Aladejebi 
 aladej...@gmail.com
  wrote:
  
   Wicket Version 1.4.6
  
   Link: http://localhost:8084/site2/?param1=c
  
   Code: paramValue= params.getString(param1, );
  
   Output: paramValue returns empty String
  
   I am using the default mount Settings.
  
   am I missing something
  
  
   -
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

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




Re: Making label visible using Ajax, does not update model

2010-03-01 Thread Riyad Kalla
Anna,
Try this:

==
f.add(new Label(label1, new PopertyModel(data, label1)));
f.add(new Label(label2, new PopertyModel(data, label2)));
==

That way when the model is queried for the value, the propertymodel
will dynamically query data's appropriate property name (in this
case label1 and label2) for the values.

-R

On Mon, Mar 1, 2010 at 1:06 PM, Anna Simbirtsev asimbirt...@gmail.com wrote:

 But how can I use a label with a real model?

 On Mon, Mar 1, 2010 at 2:59 PM, James Carman
 jcar...@carmanconsulting.comwrote:

  You're not using a real model.  You're constructing the labels with an
  empty string (the data.getLabel1() is evaluated when you construct the
  Label object).
 
  On Mon, Mar 1, 2010 at 2:57 PM, Anna Simbirtsev asimbirt...@gmail.com
  wrote:
   Hi,
  
   I have labels defined in the following way:
  
   MarkupContainer f = new WebMarkupContainer(viewPanel);
  
   f.setOutputMarkupPlaceholderTag(true);
   form.add(f);
   f.setVisible(false);
  
   f.add(new Label(label1, data.getLabel1()));
   f.add(new Label(label2, data.getLabel2()));
  
   AjaxSubmitLink submitbutton = new AjaxSubmitLink(submit) {
  
              private static final long serialVersionUID = 1L;
  
              protected void onSubmit(AjaxRequestTarget target, Form?
  form)
   {
  
                  data = Manager.getData(data);
  
                  f.setVisible(true);
                  target.addComponent(f);
              }
    };
  
   div wicket:id=viewPanel
      div wicket:id=label1/div
      div wicket:id=label2/div
   /div
  
   Originally data.getLabel1() return empty string. Manager.getData(data)
  sets
   the values for the labels to some values.
   But when the panel becomes visible, the values are still empty. Why are
   models not updated to display new values?
  
   Thanks,
   Anna
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


 --
 Anna Simbirtsev
 (416) 729-7331

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



Re: Serialization and Form Models

2010-02-28 Thread Riyad Kalla
Matthew,

A quick absolute way to make sure those values are serialized is to use the
Java 'transient' keyword. But Wicket will be assuming that when a user hits
the Back button, that it can re-constitute the page from the serialized info
it has on disk, if it cannot, then yes you'll need a LoadableDetachable
model that can rebuild that expensive graph when demanded but you won't need
to persist it.

-R

On Sun, Feb 28, 2010 at 4:37 PM, Matthew Welch matt...@welchkin.net wrote:

 Models have been my achilles heel when it comes to Wicket. Not so much
 their
 explicit use, but understanding whe they data they wrap around is
 serialized
 or kept in session and when it's not. I was running some tests today to
 experiment with just this subject. The domain object I was using in my
 tests
 intentionally had one field that I could, as an option, populate with
 unserializable value. This made it easy for me to determine when Wicket was
 trying to store the object with the page, as it would throw an exception. I
 created a page with a form to create new instances of this particular
 object. I initialized the form with a CompoundPropertyModel wrapped around
 my domain object. When I submitted the form and saved the object to my
 backend store , I received a WicketNotSerializableException. I was
 initially
 surprised by this, but after a few moments I realized (and correct me if
 I'm
 wrong) that the model wasn't detachable and that when I saved it the
 attribute I mentioned above was being populated with that unserializable
 value, but wicket was trying to save the page (probably to disk) with the
 model wrapped around the now unserializable object.

 I guess this isn't a big deal, but what concerns me, and the reason I was
 running these tests, was that some of the objects I'm working with have
 huge
 data graphs attached to them. I don't want these huge objects stored in
 memory or serialized with any of the pages to disk. Can a form be backed by
 a detachable model? It certainly wouldn't be a loadable detachable model
 for new objects that are to be created as there's nothing yet to load. If
 one can back a form with detachable model, does that limit anything that
 you
 can do with the form?



Re: Print friendly panel

2010-02-27 Thread Riyad Kalla
This is what I've done in the past as well, allows your user to just print
the page they are staring at and have the browser do the right thing in
using an alternative style sheet for rendering the page -- this includes
using a lot of display:none to trim down the parts of the page that you
don't want printing. This way all you need on your page is a Print link
that invokes the Print dialog, no other popups ontop of popups.

Some info:
http://www.scottklarr.com/topic/15/css-create-a-style-sheet-for-print-only/

http://www.scottklarr.com/topic/15/css-create-a-style-sheet-for-print-only/
http://webdesign.about.com/cs/css/a/aa042103a.htm

On Sat, Feb 27, 2010 at 4:54 PM, Alex Rass a...@itbsllc.com wrote:

 Josh,

 This doesn't answer your question directly (about a popup).
 But a MUCH simpler way is to make your page printer friendly by supplying
 an
 alternative CSS for printing format (google on that). Makes life much
 easier.

 When you tell your page which css to use, you can say use this CSS for
 printing only. All transparent to the user.

 - Alex


 -Original Message-
 From: Josh Chappelle [mailto:jchappe...@4redi.com]
 Sent: Friday, February 26, 2010 4:09 PM
 To: users@wicket.apache.org
 Subject: Print friendly panel

 Hi,



 Does anyone know of a suggested method to render a printer friendly panel
 to
 a separate browser window so that user's can print? The only thing I have
 found is the following article and it looks a little clunky.



 http://cwiki.apache.org/WICKET/rendering-panel-to-a-string.html



 Basically I just need to be able to place a link that when clicked will pop
 up a new browser window with only the contents to the target panel. That
 way
 users can print that panel from there.



 Thanks,



 Josh







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




Re: Model to use for static Label text

2010-02-26 Thread Riyad Kalla
Serban,

I really wouldn't trying and mess with detachable models unless you were
dealing with 100s of individual Strings that were climbing up beyond 4k each
or something like that -- if you are literally talking about UI labels, that
is so few bytes that leaving them static references is going to far
out-weigh the extra byte code written to try and manage loading them each
time they are needed, even if it's from something fast like a local
properties file.

As for your last question, I think the answer is yes -- a stateful page is
a page that maintains state -- some dynamic state based on something the
user has done. In the case of a static label, there is no *state*. The label
Username always is the label Username no matter what, so it's not
stateful.

That's my 2 cents atleast.

On Tue, Feb 23, 2010 at 2:08 AM, Serban Balamaci serban.balam...@asf.rowrote:


 Yes you are right, if we set the variable in the constructor but make it
 null
 on detach, we will not have it on getObject on next render, so we need to
 keep a reference to it. I guess the only choice would be to the
 LoadableDetachableModel, which could be thought detrimental for code
 clearness outweighing the storage impact, maybe would make sense maybe for
 a
 large string - for ex. setting some generated javascript on a label.
 But is a page consider stateless if we only have this static string ending
 in the page store?


 bgooren wrote:
 
  Well, a couple of strings more or less usually don't make that much of a
  difference. I personally prefer to save some typing and have better
  readability then to save a few bytes here and there.
 
  Furthermore, if you were to create an implementation of IModel
  specifically for this case, you would always need to store the string as
  an instance variable, thus creating the problem you are trying to
 solve.
 
 
  Serban Balamaci wrote:
 
  Hello.
  I've always used
  add(new Label(alabel, new Model(A message)); - does this not save
 the
  A message string in the page store?
  Is it not better to do add(new Label(alabel, new
  LoadableDetachableModelString() {
 
  @Override
  protected String load() {
  return A message;
  }
  })); - while this option does not save it in the page store.
  Is it because of the coding amount that nobody is using this? I guess
 not
  because we could extend IModel and create a label model with a string
  property that is cleared on detach.
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 

 --
 View this message in context:
 http://old.nabble.com/Model-to-use-for-static-Label-text-tp27695054p27700379.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: format float/double in dataview

2010-02-26 Thread Riyad Kalla
new SimpleAttributeModifier(text-align, right) on the Label?

On Thu, Feb 25, 2010 at 4:39 AM, James Carman
jcar...@carmanconsulting.comwrote:

 I would think that you'd add either a style or class attribute to the
 cell, perhaps?

 On Thu, Feb 25, 2010 at 6:02 AM, Andreas Lüdtke sam.lued...@t-online.de
 wrote:
  James,
 
  thanks a lot for the code snippet. My numbers are now perfectly
 formatted. Do
  you know how to right align the column? Normally, I would do this in the
  markup but I don't see a possibility where I can modify this in the code.
 
  Thanks again
 
  Andreas
 
  -Original Message-
  From: James Carman [mailto:jcar...@carmanconsulting.com]
  Sent: Wednesday, February 24, 2010 8:35 PM
  To: users@wicket.apache.org
  Subject: Re: format float/double in dataview
 
  public class MessageFormatColumnT extends PropertyColumnT
  {
  private final String pattern;
 
  public MessageFormatColumn(IModelString displayModel, String
  propertyExpression, String pattern)
  {
  super(displayModel, propertyExpression);
  this.pattern = pattern;
  }
 
  public MessageFormatColumn(IModelString displayModel, String
  sortProperty, String propertyExpression, String pattern)
  {
  super(displayModel, sortProperty, propertyExpression);
  this.pattern = pattern;
  }
 
  @Override
  protected IModel? createLabelModel(IModelT itemModel)
  {
  IModel? superModel = super.createLabelModel(itemModel);
  return new ModelString(MessageFormat.format(pattern,
  superModel.getObject()));
  }
  }
 
 
  On Wed, Feb 24, 2010 at 1:43 PM, Andreas Lüdtke
  sam.lued...@t-online.de wrote:
   I'm displaying doubles in an AjaxFallbackDefaultDataTable.
  Is it possible to
   format them i.e. with a precision of 2 digits and right aligned?
  
   Currently I don't see a possibility to do this.
  
   Thanks
  
  Andreas
  
  
  
  -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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




Re: format float/double in dataview

2010-02-26 Thread Riyad Kalla
DOH, Wilhelmsen thanks for catching that.

On Fri, Feb 26, 2010 at 7:08 AM, Wilhelmsen Tor Iver toriv...@arrive.nowrote:

  new SimpleAttributeModifier(text-align, right) on the Label?

 text-align is not a known attribute. It is a CSS property so
 SimpleAttributeModifier(style, text-align: right) could work, or there
 is an attribute align that may or may not be OK depending on HTML spec.

 - Tor Iver

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




Re: format float/double in dataview

2010-02-26 Thread Riyad Kalla
Andreas,

Thanks for sharing that. I'm glad you got it working.

_R

On Fri, Feb 26, 2010 at 7:40 AM, Andreas Lüdtke sam.lued...@t-online.dewrote:

 Riyad,

 my code is as follows:

  @Override
  public void populateItem(ItemICellPopulatorT item, java.lang.String
 componentId, IModelT rowModel)
  {
item.add(new AttributeAppender(align, true, Model.of(right), ;));
super.populateItem(item, componentId, rowModel);
  }

 This way, the cell is right aligned.

 Andreas

  -Original Message-
  From: Riyad Kalla [mailto:rka...@gmail.com]
  Sent: Friday, February 26, 2010 3:06 PM
  To: users@wicket.apache.org
  Subject: Re: format float/double in dataview
 
  new SimpleAttributeModifier(text-align, right) on the Label?
 
  On Thu, Feb 25, 2010 at 4:39 AM, James Carman
  jcar...@carmanconsulting.comwrote:
 
   I would think that you'd add either a style or class
  attribute to the
   cell, perhaps?
  
   On Thu, Feb 25, 2010 at 6:02 AM, Andreas Lüdtke
  sam.lued...@t-online.de
   wrote:
James,
   
thanks a lot for the code snippet. My numbers are now perfectly
   formatted. Do
you know how to right align the column? Normally, I would
  do this in the
markup but I don't see a possibility where I can modify
  this in the code.
   
Thanks again
   
Andreas
   
-Original Message-
From: James Carman [mailto:jcar...@carmanconsulting.com]
Sent: Wednesday, February 24, 2010 8:35 PM
To: users@wicket.apache.org
Subject: Re: format float/double in dataview
   
public class MessageFormatColumnT extends PropertyColumnT
{
private final String pattern;
   
public MessageFormatColumn(IModelString
  displayModel, String
propertyExpression, String pattern)
{
super(displayModel, propertyExpression);
this.pattern = pattern;
}
   
public MessageFormatColumn(IModelString
  displayModel, String
sortProperty, String propertyExpression, String pattern)
{
super(displayModel, sortProperty, propertyExpression);
this.pattern = pattern;
}
   
@Override
protected IModel? createLabelModel(IModelT itemModel)
{
IModel? superModel = super.createLabelModel(itemModel);
return new ModelString(MessageFormat.format(pattern,
superModel.getObject()));
}
}
   
   
On Wed, Feb 24, 2010 at 1:43 PM, Andreas Lüdtke
sam.lued...@t-online.de wrote:
 I'm displaying doubles in an AjaxFallbackDefaultDataTable.
Is it possible to
 format them i.e. with a precision of 2 digits and
  right aligned?

 Currently I don't see a possibility to do this.

 Thanks

Andreas



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


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


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




Re: Conditionally Render Different Fragments (via Radio Choice Selection)?

2010-02-26 Thread Riyad Kalla
JD,

If you flip the initial visible fragment to the 2nd one, does the inverse
condition apply? (frag2 is visible and frag1 isn't visible?)

If you check the source of the generated HTML, you are seeing the generated
placeholder tag for the 2nd fragment so it can be made visible right?

-R

On Fri, Feb 26, 2010 at 12:04 PM, Corbin, James jcor...@iqnavigator.comwrote:

 I have radio group (RadioChoice) with two options that conditionally
 renders one of two fragments.

 The two fragments are pre-created and then attach onchange ajax behavior to
 the RadioChoice component that toggles the visibility of the fragments
 depending upon the selection made for the RadioChoice component.

 When I toggle the radio choice to the second option, my fragment isn't
 being rendered when I setVisible(true).

 In my ajax update method, I toggle the visibility for the fragments and
 then
 target.addComponent(fragment1);
 target.addComponent(fragment2);

 I tried target.addComponent(form), where form is the container for the
 RadioChoice and Fragments.

 I made sure that I specify setOutputMarkupPlaceholderTag(true) on both
 fragments at creation time.

 I'm not sure what is going on here?

 J.D.



Re: Conditionally Render Different Fragments (via Radio Choice Selection)?

2010-02-26 Thread Riyad Kalla
J.D.,

What did your HTML look like for each of these conditional fragments and
how were they represented in your code before you fixed it?

Curious what it looked like before/after for my own know-how.

-R

On Fri, Feb 26, 2010 at 12:26 PM, Corbin, James jcor...@iqnavigator.comwrote:

 I looked at the ajax debug output and noticed there was no reference to one
 of the fragments.

 With only one div for the fragment, what I needed to do was conditionally
 add and remove the fragment components depending upon the selection of the
 RadioChoice and re-add the form via target.addComponent(...)

 Another option I considered and went with was just to add another div for
 the second fragment adding both to the container form and conditionally
 rendering them by setting their visibility appropriately.

 J.D.

 -Original Message-
 From: Riyad Kalla [mailto:rka...@gmail.com]
 Sent: Friday, February 26, 2010 12:16 PM
 To: users@wicket.apache.org
 Subject: Re: Conditionally Render Different Fragments (via Radio Choice
 Selection)?

 JD,

 If you flip the initial visible fragment to the 2nd one, does the inverse
 condition apply? (frag2 is visible and frag1 isn't visible?)

 If you check the source of the generated HTML, you are seeing the generated
 placeholder tag for the 2nd fragment so it can be made visible right?

 -R

 On Fri, Feb 26, 2010 at 12:04 PM, Corbin, James jcor...@iqnavigator.com
 wrote:

  I have radio group (RadioChoice) with two options that conditionally
  renders one of two fragments.
 
  The two fragments are pre-created and then attach onchange ajax behavior
 to
  the RadioChoice component that toggles the visibility of the fragments
  depending upon the selection made for the RadioChoice component.
 
  When I toggle the radio choice to the second option, my fragment isn't
  being rendered when I setVisible(true).
 
  In my ajax update method, I toggle the visibility for the fragments and
  then
  target.addComponent(fragment1);
  target.addComponent(fragment2);
 
  I tried target.addComponent(form), where form is the container for the
  RadioChoice and Fragments.
 
  I made sure that I specify setOutputMarkupPlaceholderTag(true) on both
  fragments at creation time.
 
  I'm not sure what is going on here?
 
  J.D.
 


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




Re: Debugging in Netbeans - Lists don't load

2010-02-26 Thread Riyad Kalla
Garrett,

I would start simple, remove Wicket as much as possible from this situation
first. In your DAO or whatever you are using to do the query and load the
results from the DB -- just System.out the contents of the list to the
console.

Until you get that working, don't bother thinking about Wicket and what is
going on there -- it will just muddy the water.

Check your console logs on startup, your persistence framework (Hibernate)
may be crapping out an error that is scrolling by really quick, like it
cannot find a driver or your credentials for the DB connection are wrong.

Also try and check the console when issuing your first query, look for the
same sort of data.

Troubleshoot that DB connection first and foremost. At that point, it's
either a Spring issue or something else, but make sure you get that data out
of the DB first before moving on.

-R

On Fri, Feb 26, 2010 at 4:28 PM, Garrett Fry gnu...@sdf.lonestar.orgwrote:


 Qualifying information: Im a noob

 Trying to get a DropDownChoice working. Ive read every post I can find, and
 slowly losing my mind. I like to solve my own problems if I can, but I can't
 even debug properly. Everytime I set a breakpoint and step through... the
 Lists that are loaded via spring/hibernate don't get loaded.
 They read size(0). Because the lists dont load, I can't even find out whats
 going wrong in the DropDownChoice. gnu...@sdf.lonestar.org
 SDF Public Access UNIX System - http://sdf.lonestar.org

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




Re: [OT] Wicket App Hosting

2010-02-25 Thread Riyad Kalla
Slicehost or RimuHosting - support from both is excellent and immediately
accessible which I find invaluable given that when things are working,
almost any of the 150 VPS hosts out there are all the same.. it is when
stuff breaks that they differentiate themselves.

Best,
Riyad

On Thu, Feb 25, 2010 at 10:42 AM, Matej Knopp matej.kn...@gmail.com wrote:

 If you want dedicated server you can consider hetzner, although the
 hosting is in germany which might be an issue

 http://www.hetzner.de/en/hosting/produkte_rootserver/eq4/

 -Matej

 On Thu, Feb 25, 2010 at 6:38 PM, Mauro Ciancio maurocian...@gmail.com
 wrote:
  Thanks all for the responses.
 
  Cheers.
 
  On Thu, Feb 25, 2010 at 12:46 PM, Apple Grew appleg...@gmail.com
 wrote:
  I am using http://www.eapps.com . Very good service and hosting option.
 They
  are not cheap but not too exorbitant either.
 
  Regards,
  Apple Grew
  my blog @ http://blog.applegrew.com/
 
 
  On Thu, Feb 25, 2010 at 7:15 PM, Fatih Mehmet Ucar fmu...@gmail.com
 wrote:
 
  linode is the best for me up to now
 
  www.linode.com  you may need to know a little bit linux/unix though
 
  On 25 February 2010 12:39, Josh Kamau joshnet2...@gmail.com wrote:
   When i wanted to do the same,  i bought a server space at
   www.theserverexperts.com  and installed my staff there . ie. Jetty,
  postgres
   and the like. I then bought a domain and liked it with my public ip
  address.
  
   Regards.
  
   On Thu, Feb 25, 2010 at 3:50 AM, Mauro Ciancio 
 maurocian...@gmail.com
  wrote:
  
   Hello everyone,
  
I need to deploy a couple of wicket apps (2 or 3 apps). I'm looking
 for
   advices
   in order to get a good hosting service. In fact, I think i'll get a
 vps
   service.
  
   Any advices? Which vps providers are good?
  
   Thanks in advance.
   Cheers!
   --
   Mauro Ciancio maurociancio at gmail dot com
  
  
 -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 
 
  --
  Mauro Ciancio maurociancio at gmail dot com
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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




Re: Wicket used for mobile.walmart.com

2010-02-22 Thread Riyad Kalla
That is seriously cool Joachim, thanks for the heads up!

On Mon, Feb 22, 2010 at 10:04 AM, Joachim F. Kainz j...@jolira.com wrote:

  Fellow Wicket Users,

 The question if Wicket is suitable for large enterprises has just become
 easier to answer: The largest enterprise in the world is now using Wicket
 for its mobile site. Check out mobile.walmart.com (or just point your
 mobile phone to www.walmart.com and get redirected automatically).

 The reason why my client decided to go with Wicket makes it easy to support
 multiple different types of devices. The walmart mobile application supports
 different HTML for three categories of devices (L1: iPhones  challengers,
 L2: BlackBerries, L3: Plain Old Devices). These three experiences are
 supported by the same Java code on the server side.

 We added a few components to Wicket, mostly because in the retail arena
 being stateless is very important. Our components are available at
 http://code.google.com/p/jolira-tools/.

 Wicket is an awesome product and I would like to thank the Wicket team for
 all there work. One day I hope to get the largest enterprise in the world to
 donate an appropriate amount of money for future development! [image: :)]

 Best regards,

 Joachim

 http://www.jolira.com






Re: Wicket used for mobile.walmart.com

2010-02-22 Thread Riyad Kalla
Joachim,

Very very cool info. A few days ago folks were talking about slides for
convincing management of Wicket and trying to create some common slides
for folks to utilize -- information like *this* (Walmart, Wells Fargo) is a
gold-mine for those business cases for Wicket.

Would it be alright with you if that info (that wicket was deployed on those
two mobile sites) were shared in that slide set or by people trying to make
cases for Wicket in their workplace? (I assume yes since this is a public
mailing list, but want to make sure)

Best,
Riyad

On Mon, Feb 22, 2010 at 12:52 PM, Joachim F. Kainz j...@jolira.com wrote:

 I am trying to get authorization to share this information.

 Let me put it this way: I have also create mobile.wellsfargo.com (Wells
 is one of the top three banks in the US).  The first hour of operation
 of mobile.walmart.com we had significantly more traffic than during the
 first month of mobile.wellsfargo.com.

 I will be able to share some wicket-related profiling information, if
 people are interested. I should have very good data from product
 available in about a week from now.

 On Mon, 2010-02-22 at 19:01 +0100, nino martinez wael wrote:

  Nice.. Any load statistics? Would be nice with that kind of information..
 :)
 
  regards Nino
 
  2010/2/22 Joachim F. Kainz j...@jolira.com
 
Fellow Wicket Users,
  
   The question if Wicket is suitable for large enterprises has just
 become
   easier to answer: The largest enterprise in the world is now using
 Wicket
   for its mobile site. Check out mobile.walmart.com (or just point your
   mobile phone to www.walmart.com and get redirected automatically).
  
   The reason why my client decided to go with Wicket makes it easy to
 support
   multiple different types of devices. The walmart mobile application
 supports
   different HTML for three categories of devices (L1: iPhones 
 challengers,
   L2: BlackBerries, L3: Plain Old Devices). These three experiences are
   supported by the same Java code on the server side.
  
   We added a few components to Wicket, mostly because in the retail arena
   being stateless is very important. Our components are available at
   http://code.google.com/p/jolira-tools/.
  
   Wicket is an awesome product and I would like to thank the Wicket team
 for
   all there work. One day I hope to get the largest enterprise in the
 world to
   donate an appropriate amount of money for future development! [image:
 :)]
  
   Best regards,
  
   Joachim
  
   http://www.jolira.com
  
  
  
  



Re: Wicket used for mobile.walmart.com

2010-02-22 Thread Riyad Kalla
Peter, yep that's the one, thanks for sharing it. I'm always wary of kicking
my own links out to lists and seeming pushy ;)

On Mon, Feb 22, 2010 at 8:55 PM, Peter Thomas ptrtho...@gmail.com wrote:

 Great, I think Riyad just put up a blog post on this.  Here's the DZone
 link
 ;)

 http://www.dzone.com/links/apache_wicket_powers_mobilewalmartcom.html

 On Tue, Feb 23, 2010 at 3:01 AM, Joachim F. Kainz j...@jolira.com wrote:

  Riyad,
 
  Yes, please go ahead and share this information.
 
  Best regards,
 
  Joachim
 
  On Mon, 2010-02-22 at 13:50 -0700, Riyad Kalla wrote:
 
   Joachim,
  
   Very very cool info. A few days ago folks were talking about slides for
   convincing management of Wicket and trying to create some common
 slides
   for folks to utilize -- information like *this* (Walmart, Wells Fargo)
 is
  a
   gold-mine for those business cases for Wicket.
  
   Would it be alright with you if that info (that wicket was deployed on
  those
   two mobile sites) were shared in that slide set or by people trying to
  make
   cases for Wicket in their workplace? (I assume yes since this is a
 public
   mailing list, but want to make sure)
  
   Best,
   Riyad
  
   On Mon, Feb 22, 2010 at 12:52 PM, Joachim F. Kainz j...@jolira.com
  wrote:
  
I am trying to get authorization to share this information.
   
Let me put it this way: I have also create mobile.wellsfargo.com
 (Wells
is one of the top three banks in the US).  The first hour of
 operation
of mobile.walmart.com we had significantly more traffic than during
  the
first month of mobile.wellsfargo.com.
   
I will be able to share some wicket-related profiling information, if
people are interested. I should have very good data from product
available in about a week from now.
   
On Mon, 2010-02-22 at 19:01 +0100, nino martinez wael wrote:
   
 Nice.. Any load statistics? Would be nice with that kind of
  information..
:)

 regards Nino

 2010/2/22 Joachim F. Kainz j...@jolira.com

   Fellow Wicket Users,
 
  The question if Wicket is suitable for large enterprises has just
become
  easier to answer: The largest enterprise in the world is now
 using
Wicket
  for its mobile site. Check out mobile.walmart.com (or just point
  your
  mobile phone to www.walmart.com and get redirected
 automatically).
 
  The reason why my client decided to go with Wicket makes it easy
 to
support
  multiple different types of devices. The walmart mobile
 application
supports
  different HTML for three categories of devices (L1: iPhones 
challengers,
  L2: BlackBerries, L3: Plain Old Devices). These three experiences
  are
  supported by the same Java code on the server side.
 
  We added a few components to Wicket, mostly because in the retail
  arena
  being stateless is very important. Our components are available
 at
  http://code.google.com/p/jolira-tools/.
 
  Wicket is an awesome product and I would like to thank the Wicket
  team
for
  all there work. One day I hope to get the largest enterprise in
 the
world to
  donate an appropriate amount of money for future development!
  [image:
:)]
 
  Best regards,
 
  Joachim
 
  http://www.jolira.com
 
 
 
 
   
 



Re: [OT] Wicket changed my life !

2010-02-20 Thread Riyad Kalla
That depends on how much traffic your app gets. GAE isn't cheap if you start
getting serious traffic and depends on the services you tie into.

On Sat, Feb 20, 2010 at 1:38 PM, nicolas melendez nfmelen...@gmail.comwrote:

 programming web applications with wicket is as funny as play a game :).
 And with GAE, you don't need to paid for expensive Hosting :) .
 NM

 On Sat, Feb 20, 2010 at 2:18 AM, Ben Tilford bentilf...@gmail.com wrote:

  Models are the hardest part to learn...
 
  Because they are really models.
 
  On Sat, Feb 20, 2010 at 12:05 AM, Eelco Hillenius 
  eelco.hillen...@gmail.com
   wrote:
 
   Thanks for the kind words people. Definitively a key part of Wicket's
   success has been an enthusiastic community.
  
The learning curve was slightly steep once we started doing
 interesting
   UI
interactions (and also that really annoying LazyLoad exception during
   tests
that I still can't figure out), but it's worth the effort.
  
   Detachable models are your friend.
  
   Eelco
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 



Re: OnChangeAjaxBehavior: nth character

2010-02-13 Thread Riyad Kalla
Cemal, very intuitive -- thanks for that.

On Sat, Feb 13, 2010 at 6:26 AM, Cemal Bayramoglu 
jweekend_for...@cabouge.com wrote:

 Steven,

 Start with something like this:

 zipcodeField.add(new OnChangeAjaxBehavior() {
 @Override protected void onUpdate(AjaxRequestTarget target) {
 // do your stuff here
}
@Override protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
@Override public CharSequence decorateScript(CharSequence
 script) {
return if(this.value.length % 5 == 0){ + script + };
}
};
}
 });

 Regards - Cemal
 jWeekend
 OO  Java Technologies, Wicket
 Consulting, Development, Training
 http://jWeekend.com


 On 12 February 2010 20:45, Steven Haines lyg...@yahoo.com wrote:
  Hi,
 
  I
  would like to add AJAX behavior to an application that sends an update
  to my application after a certain number of characters have been typed.
  For example, if the user is entering a zipcode, I would like a callback
  to my application to be made after the user enters the fifth character.
 
  I've
  written code using OnChangeAjaxBehavior that sends messages back to my
  application after every character has been typed, such as the following:
 
 final TextFieldString zipcodeField = new TextFieldString(
 zipcode );
 form.add( zipcodeField.setRequired( true ) );
 OnChangeAjaxBehavior zipcodeUpdated = new OnChangeAjaxBehavior() {
   @Override
   protected void onUpdate( AjaxRequestTarget target ) {
 System.out.println( Zipcode value:  +
 zipcodeField.getDefaultModelObjectAsString() );
   }
 };
 zipcodeField.add( zipcodeUpdated );
 
 
  I
  could check to see the size of the zipcodeField (in this example), but
  it makes my application more chatty than it needs to be. I also tried
  using onblur, which works fine, but does not satisfy my business
  requirements:
 
   final TextFieldString zipcodeField = new TextFieldString( zipcode
 );
   form.add( zipcodeField.setRequired( true ) );
 
   AjaxFormComponentUpdatingBehavior zipcodeOnBlur = new
 AjaxFormComponentUpdatingBehavior( onblur ) {
   @Override
   protected void onUpdate( AjaxRequestTarget target ) {
   System.out.println( Zipcode value (form component):  +
 getFormComponent().getModelObject() );
   }
   };
   zipcodeField.add( zipcodeOnBlur );
 
 
 
  Prior
  to using Wicket (which I'm currently prototyping for my company), we
  would handle this logic in JavaScript (observe changes to the field and
  when the user enters the fifth character then we made an AJAX call back
  our Struts 2 application.)
 
  What is the best way to achieve the same end using Wicket?
 
  Thanks, in advance, for your help!
  Steve
 
  P.S.
  I started using Wicket as part of an article series (because of all of
  your passion for it) and I have to say all of you are doing incredible
  work - I love it.. Here's the link to the article series in case any of
  you are interested:
  http://www.informit.com/guides/content.aspx?g=javaseqNum=529
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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




Re: Authorization and

2010-02-12 Thread Riyad Kalla
Daniele,

I think you're exactly right to use the
get/setMetaDatahttp://wicket.apache.org/docs/1.4/org/apache/wicket/Component.html#setMetaData(org.apache.wicket.MetaDataKey,
M) methods, per the Javadoc on
MetaDataKeyhttp://wicket.apache.org/docs/1.4/org/apache/wicket/MetaDataKey.html(example
code uses ROLE) it seems that was one of the intents.

On Fri, Feb 12, 2010 at 3:39 AM, Daniele Dellafiore ilde...@gmail.com
wrote:
 I am facing authorization problems this days, as you see in onother
message.


 when I started to deal with this problem I were also uncomfortable at the
 idea to use annotation on components or even specific class (like
 SecureComponent). Too much noise in the code and too much interference of
 authorization stuff in the operational code.

 I wanted to move everything in the AuthorizationStrategy to keep the
 panels/page code almost authorizazion unaware.

 Actually I think that that target could be achieved only for some simple
 situation. My advice is to try using the wicket component.setMetaData. You
 can put there you access authorization key and check for it in
 AuthorizationStrategy.

 This is easy to understand and keep the code clean.


 On Fri, Feb 12, 2010 at 9:07 AM, Wilhelmsen Tor Iver toriv...@arrive.no
wrote:

 We have an app with three user types and two user levels (read  or
 read-write in effect). We want to use these in authorization, and thought
 about an approach using annotations. However, at the point of the Wicket
 auth. interface methods, only class-targeted annotations are visible, and
 that will lead to excessive subclassing (especially since Java does not
let
 you annotate anonymous inner classes).

 Would it be a better approach to use behaviorless Behavior objects that
 we add to the relevant components and look for in isActionAuthorized()?

 Med vennlig hilsen

 TOR IVER WILHELMSEN
 Senior systemutvikler
 Arrive AS
 T (+47) 48 16 06 18
 E-post: toriv...@arrive.no
 http://www.arrive.no
 http://servicedesk.arrive.no






 --
 Daniele Dellafiore
 http://danieledellafiore.net



Re: Scroll to Anchor on Form Submit

2010-02-12 Thread Riyad Kalla
Tony,

I'm not sure if you can mess with the URL (e.g. append a #errors) from
within Wicket without causing a redirect (and loosing your errors from the
request and form state) -- someone smarter than me can address that -- but
if you wanted to get creative, maybe in the onError handler your can
contribute a behavior of some 'window.onload' JavaScript to the body of the
page that does a 'window.location=currentURL#errors' or somethig like
that, so as soon as the page comes back up, the JS redirects to the exact
same page but an anchor on it.

Not sure if that would cause a redirect or not...

-R

On Fri, Feb 12, 2010 at 10:26 AM, Tony Wu e90t...@gmail.com wrote:

 Is there a way in Wicket for Button form onSubmit to refresh the page and
 scroll to a particular anchor? For example if I have 3 separate forms with
 a
 FeedbackPanel in each, if I click the submit button for the final form and
 there's a validation error, when the page refreshes the error messages are
 at the bottom. It's not apparent to the user anything happened unless they
 manually scroll down. It would be great if there's a way to scroll to
 href=#someanchor. I think there's a setAnchor function in wicket, but
 that's only for Links. Is there anything that works for Buttons/Form
 submission?



Re: OnChangeAjaxBehavior: nth character

2010-02-12 Thread Riyad Kalla
Vineet is exactly right, just to further flesh it out:

You want to add a subclass of AbstractDefaultAjaxBehavior to your page, this
automatically contributes the wicket-ajax.js file to your page which exposes
these JavaScript methods for you:

===
function wicketAjaxGet(url, successHandler, failureHandler, precondition,
channel)
and
function wicketAjaxPost(url, body, successHandler, failureHandler,
precondition, channel)
===

(paraphrased from Wiki)

The part I'm not clear on is which URL do you call with the JavaScript and
which method on the server side is intercepting the GET (or POST)?

That information seems to be missing from the wiki unless it's easier than I
realize and I'm overthinking this...

On Fri, Feb 12, 2010 at 2:15 PM, vineet semwal
vineetsemwal1...@gmail.comwrote:

 you can do the same thing with wicket ie. on 5th char typed,make a
 ajaxcallback to wicket,

 1)you need to add behavior to component and implement it's respond method
 the way it suits your need.
 2)in the js part you  will make a callback on 5th char typed,callbackurl
 you
 will get from the behavior you
 added to the component.
 take a look at

 http://cwiki.apache.org/confluence/display/WICKET/Calling+Wicket+from+Javascript

 On Sat, Feb 13, 2010 at 2:15 AM, Steven Haines lyg...@yahoo.com wrote:

  Hi,
 
  I
  would like to add AJAX behavior to an application that sends an update
  to my application after a certain number of characters have been typed.
  For example, if the user is entering a zipcode, I would like a callback
  to my application to be made after the user enters the fifth character.
 
  I've
  written code using OnChangeAjaxBehavior that sends messages back to my
  application after every character has been typed, such as the following:
 
 final TextFieldString zipcodeField = new TextFieldString(
 zipcode
  );
 form.add( zipcodeField.setRequired( true ) );
 OnChangeAjaxBehavior zipcodeUpdated = new OnChangeAjaxBehavior() {
   @Override
   protected void onUpdate( AjaxRequestTarget target ) {
 System.out.println( Zipcode value:  +
  zipcodeField.getDefaultModelObjectAsString() );
   }
 };
 zipcodeField.add( zipcodeUpdated );
 
 
  I
  could check to see the size of the zipcodeField (in this example), but
  it makes my application more chatty than it needs to be. I also tried
  using onblur, which works fine, but does not satisfy my business
  requirements:
 
   final TextFieldString zipcodeField = new TextFieldString( zipcode
 );
   form.add( zipcodeField.setRequired( true ) );
 
   AjaxFormComponentUpdatingBehavior zipcodeOnBlur = new
  AjaxFormComponentUpdatingBehavior( onblur ) {
   @Override
   protected void onUpdate( AjaxRequestTarget target ) {
   System.out.println( Zipcode value (form component):  +
  getFormComponent().getModelObject() );
   }
   };
   zipcodeField.add( zipcodeOnBlur );
 
 
 
  Prior
  to using Wicket (which I'm currently prototyping for my company), we
  would handle this logic in JavaScript (observe changes to the field and
  when the user enters the fifth character then we made an AJAX call back
  our Struts 2 application.)
 
  What is the best way to achieve the same end using Wicket?
 
  Thanks, in advance, for your help!
  Steve
 
  P.S.
  I started using Wicket as part of an article series (because of all of
  your passion for it) and I have to say all of you are doing incredible
  work - I love it.. Here's the link to the article series in case any of
  you are interested:
  http://www.informit.com/guides/content.aspx?g=javaseqNum=529
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


 --
 regards,
 Vineet Semwal



Re: OnChangeAjaxBehavior: nth character

2010-02-12 Thread Riyad Kalla
Ah! Thanks Vineet.

On Fri, Feb 12, 2010 at 3:42 PM, vineet semwal
vineetsemwal1...@gmail.comwrote:

 Riyad,
 1)url is callbackurl you will get from
 abstractdefaultajaxbehavior.getcallbackurl()
 2)method you need to implement is the abstractdefaultajaxbehavior's respond
 method

 On Sat, Feb 13, 2010 at 3:58 AM, Riyad Kalla rka...@gmail.com wrote:

  Vineet is exactly right, just to further flesh it out:
 
  You want to add a subclass of AbstractDefaultAjaxBehavior to your page,
  this
  automatically contributes the wicket-ajax.js file to your page which
  exposes
  these JavaScript methods for you:
 
  ===
  function wicketAjaxGet(url, successHandler, failureHandler, precondition,
  channel)
  and
  function wicketAjaxPost(url, body, successHandler, failureHandler,
  precondition, channel)
  ===
 
  (paraphrased from Wiki)
 
  The part I'm not clear on is which URL do you call with the JavaScript
 and
  which method on the server side is intercepting the GET (or POST)?
 
  That information seems to be missing from the wiki unless it's easier
 than
  I
  realize and I'm overthinking this...
 
  On Fri, Feb 12, 2010 at 2:15 PM, vineet semwal
  vineetsemwal1...@gmail.comwrote:
 
   you can do the same thing with wicket ie. on 5th char typed,make a
   ajaxcallback to wicket,
  
   1)you need to add behavior to component and implement it's respond
 method
   the way it suits your need.
   2)in the js part you  will make a callback on 5th char
 typed,callbackurl
   you
   will get from the behavior you
   added to the component.
   take a look at
  
  
 
 http://cwiki.apache.org/confluence/display/WICKET/Calling+Wicket+from+Javascript
  
   On Sat, Feb 13, 2010 at 2:15 AM, Steven Haines lyg...@yahoo.com
 wrote:
  
Hi,
   
I
would like to add AJAX behavior to an application that sends an
 update
to my application after a certain number of characters have been
 typed.
For example, if the user is entering a zipcode, I would like a
 callback
to my application to be made after the user enters the fifth
 character.
   
I've
written code using OnChangeAjaxBehavior that sends messages back to
 my
application after every character has been typed, such as the
  following:
   
   final TextFieldString zipcodeField = new TextFieldString(
   zipcode
);
   form.add( zipcodeField.setRequired( true ) );
   OnChangeAjaxBehavior zipcodeUpdated = new OnChangeAjaxBehavior() {
 @Override
 protected void onUpdate( AjaxRequestTarget target ) {
   System.out.println( Zipcode value:  +
zipcodeField.getDefaultModelObjectAsString() );
 }
   };
   zipcodeField.add( zipcodeUpdated );
   
   
I
could check to see the size of the zipcodeField (in this example),
 but
it makes my application more chatty than it needs to be. I also tried
using onblur, which works fine, but does not satisfy my business
requirements:
   
 final TextFieldString zipcodeField = new TextFieldString(
  zipcode
   );
 form.add( zipcodeField.setRequired( true ) );
   
 AjaxFormComponentUpdatingBehavior zipcodeOnBlur = new
AjaxFormComponentUpdatingBehavior( onblur ) {
 @Override
 protected void onUpdate( AjaxRequestTarget target ) {
 System.out.println( Zipcode value (form component):  +
getFormComponent().getModelObject() );
 }
 };
 zipcodeField.add( zipcodeOnBlur );
   
   
   
Prior
to using Wicket (which I'm currently prototyping for my company), we
would handle this logic in JavaScript (observe changes to the field
 and
when the user enters the fifth character then we made an AJAX call
 back
our Struts 2 application.)
   
What is the best way to achieve the same end using Wicket?
   
Thanks, in advance, for your help!
Steve
   
P.S.
I started using Wicket as part of an article series (because of all
 of
your passion for it) and I have to say all of you are doing
 incredible
work - I love it.. Here's the link to the article series in case any
 of
you are interested:
http://www.informit.com/guides/content.aspx?g=javaseqNum=529
   
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
   
   
  
  
   --
   regards,
   Vineet Semwal
  
 



 --
 regards,
 Vineet Semwal



Re: expecting different behavior from form validation - potential bug?

2010-02-11 Thread Riyad Kalla
Antoine,

I think this was discussed 3 days ago in the thread titled
Form#anyComponentError change in 1.4 breaks validation (Russel
Morrisey), basically noting that in a recent release of Wicket, the
form onError behavior was changed to checking for errors on ANY
component in the form, to just Form-based components.

Related JIRA Issues:
http://issues.apache.org/jira/browse/WICKET-2202
http://issues.apache.org/jira/browse/WICKET-2026

And eventually this issue created:
https://issues.apache.org/jira/browse/WICKET-2734


Hope that helps incase you wanted to jump in on any of that.

-R


On Thu, Feb 11, 2010 at 10:02 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 please create a quickstart and attach it to jira

 -igor

 On Thu, Feb 11, 2010 at 6:53 AM, Antoine van Wel
 antoine.van@gmail.com wrote:
 hi,

 In a nested form the onValidate() is overridden.
 It sets an error message on a component inside this form - so not on
 the form itself.

 However the submit on the form itself is executed as if no error
 exists. What I see when debugging is that hasErrorMessages on the
 inside nested form returns false. Is this correct? Should I explicitly
 set an error on the form, or something else to indicate the form
 itself has an error?

 ..using 1.4.6


 Antoine.

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



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



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



Re: add form components via ajax

2010-02-11 Thread Riyad Kalla
setMarkupId(true) is used to ensure there is a placeholder generated
in the HTML where the addition of the div (or whatever) will take
place.

You don't set this typically on the form itself, but on a placeholder
inside the form that you probably replace with a MarkupContainer of
some kind with the same name that contained the new form elements that
you wanted to inject.

On Thu, Feb 11, 2010 at 9:56 AM, wic...@geofflancaster.com
wic...@geofflancaster.com wrote:
 I'm trying to add form components to a form using ajax. i've set
 setMarkupId(true); on the form but when I run it, i get an error saying
 cannot update component that does not have setOutputMarkupId property set
 to true. Component: [MarkupContainer [Component id = realTimeForm...

 So basically when someone moves 1 or more selections from the available to
 the selected side of the palette, i want it to add another palette to the
 form.

 Code Snippet:

 List valueList = new ArrayList(); // this actually has values
 IChoiceRenderer renderer = new ChoiceRenderer();
 Palette palette = new Palette(palette, new Model(new ArrayList()), new
 Model(valueList), renderer, 5, false){
       �...@override
        protected Recorder newRecorderComponent() {
                Recorder rec = super.newRecorderComponent();
                rec.setRequired(true);
                rec.add(new AjaxFormComponentUpdatingBehavior(onchange) {
                       �...@override
                        protected void onUpdate(AjaxRequestTarget target) {
                            Palette newPalette = new
 Palette(newPalette,new Model(new ArrayList()),new Model(new
 ArrayList()),renderer,5,false);
                            target.addComponent(newPalette);
                        }
                });
                return rec;
        }
 };

 public Constructor(){
 Form form = new Form(realTimeForm);
 form.setOutputMarkupId(true);  //enable ajax on the form
 form.add(palette);
 add(form);
 }

 
 myhosting.com - Premium Microsoft® Windows® and Linux web and application
 hosting - http://link.myhosting.com/myhosting



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



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



Re: Listening key pressings on server side

2010-02-10 Thread Riyad Kalla
Roland,

It might be the browser + event that you are listening for that is the
issue. Try onkeyup, here's a ref:
http://www.tutorialized.com/view/tutorial/Get-key-press-event-using-JavaScript/9689

or onkeydown:
http://www.dreamincode.net/code/snippet1246.htm

Otherwise I think you had the right idea at the beginning with where
to add the listener to, hopefully it's just the event that is the
issue.

-R

On Wed, Feb 10, 2010 at 12:11 AM, Roland rolan...@gmail.com wrote:
 Hello,

 I'd like to know whether there is a way to listen certain key pressings (key
 a,,1,...) on server side in wicket.

 I've tried
 .html:
 body wicket:id =body/body
 .java
 body = new WebMarkupContainer(body);
 body.add(new AjaxEventBehavior(onkeypress){

               protected void onEvent(final AjaxRequestTarget target) {
                       LOG.debug(keypress);
               }
       });
 Problem here is that event is generated only for onclick event, in case of
 onkeypress, nothing happens.
 And even if I would be able to catch the onkeypress event, I'd still have
 to figure out, which key was pressed.

 And also I've tried wicket-contrib-input-events

 add(new InputBehavior(new KeyType[] { KeyType.Left },
                EventType.click));

        add(new AjaxEventBehavior(onclick){

           �...@override
            protected void onEvent(AjaxRequestTarget target) {
                LOG.debug(Clicked left);

            }

        });


 But problem there is that EventType.onkeypress is not supported.

 Examples I made on main page, but eventually I would need to listen key
 pressings on modalwindow's panel, which is placed on a page.

 Thanks in advance,
 Roland


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



Re: Example for Combobox wanted

2010-02-10 Thread Riyad Kalla
Nino,

I think what PDiefent wants is literally to re-create the Swing
combobox component, so something like:

[TEXT_FIELD][BUTTON]

and when you click [BUTTON] it causes a DIV to appear with a list of
choices, but the user can also type their own in.

PD, the only way I can think to do this is just to distill the issue
down to it's simplest components in Wicket and give it a go.

input wicket:id=textfield type=text /input
wicket:id=dropdownButton type=button/
div wicket:id=popupListBox/div

where I imagine dropdownButton would be an AjaxButton of some kind
that would set the visibility of the popupListBox when clicked.
popupListBox would be a ListView of some kind.

This is all just guess-work from my part, I haven't tried to build a
component like this before. Sorry.

On Wed, Feb 10, 2010 at 10:25 AM, PDiefent pdief...@csc.com wrote:

 I don't understand. How do I create a textfield and a dropdown in one markup
 field. And how to synchronize the two contents?
 I didn't find any example in the wicket examples ...

 nino martinez wael wrote:

 Yes it's possible, just make a panel with a drop down and textfield, and
 ajax enable both.. It should be simple.. Have you checked the wicket
 examples?

 2010/2/8 Peter Diefenthaeler pdief...@csc.com


 Hi,
 I'm looking for an example of a ComboBox which is a combination of a
 textfield and DropDownChoice.
 It should be possible to type in a new value and submit it, or to select
 from the values in the DropDownChoice and submit it.
 The AJAX autocomplete example seems to be good, but you have to type in
 one
 character to get a choice ...
 Thanks, Peter


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





 --
 View this message in context: 
 http://old.nabble.com/Example-for-Combobox-wanted-tp27495901p27534457.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Changes of html-files are not directly available - need to re-deploy

2010-02-09 Thread Riyad Kalla
Joachim,

Troubleshooting redeployment issues can be maddening. The *very first*
thing you have to rule out is that the file is actually getting placed
on disk in the deployed location. I don't know how NetBeans handles
it's deployments, if it points Tomcat at the internal project and runs
in place or if it actually copies out the project contents on-disk
to some deployed location.

Regardless, find the deployed location. Go change your HTML, save it,
then using a file explorer, go to the deployed location and manually
open the file that is in the deployed location (e.g. using Gedit on
Ubuntu) and confirm that those changes are in that HTML.

If they are, then the issue would be with Wicket polling and seeing
the changes and reloading them. If you don't see the changes, then the
issue is with NetBeans either not placing the files in the right
location or not being *Able to* place them -- i.e. a permission
problem (That running as root should have addressed).

NOTE: 1 last thing, I don't know how you are running Tomcat, but if
you are running it externally make sure it's running as the same user
as NetBeans. Othertiwse you could run into a silly situation of
NetBeans writing out files as root and Tomcat trying to read/load
the deployed files but not having read-perms on those root-owned
files.

Just want to avoid weirdness.

-R

On Tue, Feb 9, 2010 at 1:33 PM, Joachim Rohde
mailingl...@joachimrohde.com wrote:
 First of all: I asked this question already at
 http://www.coderanch.com/t/481846/Application-Frameworks/Application-Frameworks/Wicket-Changes-html-files-are
 where no one could help me.

 To my problem:

 I have here a little bug which is completly weird in my opinion.
 Usually when you are changing a html-file, you just need to save it and it
 is directly available in the browser after a refresh. But this behaviour is
 not working in my environment. I always have to deploy the complete project.
 It is not a problem of my project. I verified this by trying the exactly
 same project and also the quickstart from the official Wicket site on a
 different machine where it works as expected. So it must be somewhere in my
 configuration but I cannot figured it out where / what / why.

 Machine one, where it is not working runs on Ubuntu 9.10, IDE is Netbeans
 6.8 with Maven 2.2.1, server is a Tomcat 6.0.24 (also tried Tomcat 6.0.18
 and also Jetty).
 Machine two, where it is working runs on Windows XP, IDE is Netbeans 6.7.1
 with Maven 2.2.1, server is a Tomcat 6.0.18.

 I am definitely running the development mode (verified this also by calling
 Application.get().getConfigurationType()). I tried the Wicket versions
 1.4.4, 1.4.5 and 1.4.6. All the same. On the Ubuntu-System it's not working.
 I also tried already to start Netbeans as root-user on the Linux-system,
 just in case some access rights on my file-system are not sufficient.
 Without any change in the result.

 Only thing I found while searching was
 http://markmail.org/message/fqpioxh7dir67ttj#query:wicket%20html%20refresh+page:1+mid:ca74uawyqzjyj5v5+state:results
 where a mismatched dependency was the problem. But this does not seem to be
 my problem. In JIRA I couldn't find anything related.

 Anyone else encountered this problem? And even if not, I'm also open for
 blue shots what I might try because I have no clue what might cause this
 behaviour. Or anyone knows in which class the code for the reloading
 resides? I haven't found it yet, after a quick glance at the wicket sources.
 Help here is really appreciated. Thanks in advance for any comments.

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



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



Re: TabbedPanel replaced by AjaxTabbedPanel shows request NS_BINDING_ABORTED

2010-02-08 Thread Riyad Kalla
Kulbhushan,

I think this is the result of Wicket using abort() calls on the
recycled XMLHttpRequest objects that are pooled as discussed here?
http://old.nabble.com/Ajax-request-bug--td27324473.html#a27327789



On Mon, Feb 8, 2010 at 3:17 AM, Kulbhushan Sharma
kbs_kulbhus...@yahoo.com wrote:
 Hello,

 I have the following code to implement a Ajax Tabbed Panel.

 public class TBPage extends WebPage{

    public TBPage() {
        AjaxTabbedPanel tabPanel = null;
        List tabs = new ArrayListAbstractTab(2);

        tabs.add(new TabOne());
        tabs.add(new TabTwo());

        tabPanel = new AjaxTabbedPanel(tabs, tabs);
        this.add(tabPanel);


    }

 }

 When I access this page with FireFox and with HTTPFox enabled --- everytime I 
 click on a Tab I get NS_BINDING_ABORTED as return status of the request 
 before the tab appears. If I just replace AjaxTabbedPanel by TabbedPanel 
 there is no such problem --- but obviously the whole page refreshes and I do 
 not want that.

 Please note, all functionality works fine --- but I am concerned that this 
 error may be root cause of something else. The link 
 http://markmail.org/message/m6z77uoixf3qu7u6 tells us some request was 
 aborted --- but what is that?

 Thanks for your response in advance.

 Regards,
 Kulbhushan



      Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! 
 http://downloads.yahoo.com/in/internetexplorer/

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



Re: TabbedPanel replaced by AjaxTabbedPanel shows request NS_BINDING_ABORTED

2010-02-08 Thread Riyad Kalla
No problem.

On Mon, Feb 8, 2010 at 11:02 PM, Kulbhushan Sharma
kbs_kulbhus...@yahoo.com wrote:
 Riyad, thanks for the explaination and the links.





 
 From: Riyad Kalla rka...@gmail.com
 To: users@wicket.apache.org
 Sent: Mon, 8 February, 2010 11:12:22 PM
 Subject: Re: TabbedPanel replaced by AjaxTabbedPanel shows request  
 NS_BINDING_ABORTED

 Kulbhushan,

 I think this is the result of Wicket using abort() calls on the
 recycled XMLHttpRequest objects that are pooled as discussed here?
 http://old.nabble.com/Ajax-request-bug--td27324473.html#a27327789



 On Mon, Feb 8, 2010 at 3:17 AM, Kulbhushan Sharma
 kbs_kulbhus...@yahoo.com wrote:
 Hello,

 I have the following code to implement a Ajax Tabbed Panel.

 public class TBPage extends WebPage{

    public TBPage() {
        AjaxTabbedPanel tabPanel = null;
        List tabs = new ArrayListAbstractTab(2);

        tabs.add(new TabOne());
        tabs.add(new TabTwo());

        tabPanel = new AjaxTabbedPanel(tabs, tabs);
        this.add(tabPanel);


    }

 }

 When I access this page with FireFox and with HTTPFox enabled --- everytime 
 I click on a Tab I get NS_BINDING_ABORTED as return status of the request 
 before the tab appears. If I just replace AjaxTabbedPanel by TabbedPanel 
 there is no such problem --- but obviously the whole page refreshes and I do 
 not want that.

 Please note, all functionality works fine --- but I am concerned that this 
 error may be root cause of something else. The link 
 http://markmail.org/message/m6z77uoixf3qu7u6 tells us some request was 
 aborted --- but what is that?

 Thanks for your response in advance.

 Regards,
 Kulbhushan



      Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! 
 http://downloads.yahoo.com/in/internetexplorer/

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


      Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! 
 http://downloads.yahoo.com/in/internetexplorer/

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



Re: [announce] better look modern css for wicket examples contest

2010-02-07 Thread Riyad Kalla
or a ton of apps that look a lot alike :)

On Sun, Feb 7, 2010 at 9:20 AM, Andrew Lombardi and...@mysticcoders.com wrote:
 This isn't a modification for all the wicket examples, this is just for the 
 maven archetype, the examples are a much larger undertaking.

 Focus here was to make it simple, and provide some references that people 
 could find useful.  There's no reason to extrapolate out and design a crazy 
 quickstart page because it will be deleted pretty quickly (we hope)

 On Feb 7, 2010, at 1:25 AM, nino martinez wael wrote:

 Great. We need more people though to make it a real contest! :) And more
 focus on looks.

 2010/2/6 Andrew Lombardi and...@mysticcoders.com

 I agree.  I had a few moments tonight and put this together.  It includes
 the standard wicket label message showing that Wicket is parsing properly.

 It also includes links to: examples, javadoc, books about wicket, and
 blogs.  and will show the version you used to install from archetype.

 Thoughts?  You can click through on the bug and see an attached screenshot

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

 On Feb 2, 2010, at 11:26 AM, mbrictson wrote:


 In addition to the examples, I think it would be nice to apply a pleasant
 CSS
 skin to the Wicket quickstart archetype. Instead of an un-styled
 QuickStart message, how about a nicely formatted short intro with links
 to
 tutorials, reference documentation, etc.?

 As an example, I like the it worked! welcome page that Django provides:

 http://i46.tinypic.com/2q025g9.jpg


 nino martinez wael wrote:

 Hi

 Someone mentioned that we could have a better look  feel for wicket,
 since
 there are no designers in the core team. I proposed a contest, to make
 the
 coolest slickest css for wicket. So please feel free to apply.


 Requirements:

 your css should be compatible with the basic browsers, Firefox , IE ,
 Safari
 etc. And retain heavy use of embedded js. And it should be a drop on,
 using
 existing id's  hierachy for design.

 Practical info:

 The contest ends in 2 months April 2nd.

 Get the wicket examples here:
 http://svn.apache.org/repos/asf/wicket/trunk/wicket-examples/

 If you need it you can put your css in svn at wicketstuff, write to this
 list for details on howto get commit rights, you should add your css to
 sandbox and sf user name (
 https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/sandbox/).

 Yes as with all contest there is a prize, you can win the wicket t-shir
 along with the honor if your css are the winner. This
 http://www.cafepress.com/apachewicket.317298148 or this
 http://www.cafepress.com/apachewicket.317298083 depending on your age
 :)

 Just reply to this thread to enter the contest.

 Regards Nino on behalf of the Wicket People



 --
 View this message in context:
 http://old.nabble.com/-announce--better-look---modern-css-for-wicket-examples-contest-tp27425107p27426016.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



 To our success!

 Mystic Coders, LLC | Code Magic | www.mysticcoders.com

 ANDREW LOMBARDI | and...@mysticcoders.com
 2321 E 4th St. Ste C-128, Santa Ana CA 92705
 ofc: 714-816-4488
 fax: 714-782-6024
 cell: 714-697-8046
 linked-in: http://www.linkedin.com/in/andrewlombardi
 twitter: http://www.twitter.com/kinabalu

 Eco-Tip: Printing e-mails is usually a waste.

 
 This message is for the named person's use only. You must not, directly or
 indirectly, use,
 disclose, distribute, print, or copy any part of this message if you are
 not the intended recipient.
 




 To our success!

 Mystic Coders, LLC | Code Magic | www.mysticcoders.com

 ANDREW LOMBARDI | and...@mysticcoders.com
 2321 E 4th St. Ste C-128, Santa Ana CA 92705
 ofc: 714-816-4488
 fax: 714-782-6024
 cell: 714-697-8046
 linked-in: http://www.linkedin.com/in/andrewlombardi
 twitter: http://www.twitter.com/kinabalu

 Eco-Tip: Printing e-mails is usually a waste.

 
 This message is for the named person's use only. You must not, directly or 
 indirectly, use,
  disclose, distribute, print, or copy any part of this message if you are not 
 the intended recipient.
 



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



Re: Wicket best practice

2010-02-06 Thread Riyad Kalla
Vineet, very cool stuff you are wooing on. As for best practices with regard
to layout, there is actually a Maven Wicket archetype that would probably
answer those questions well. From what I remember its pretty straight
forward maven web layout. And yes, HTML and Java source are in same main
packages together.

On Feb 6, 2010 1:33 PM, Vineet Manohar vineet.mano...@gmail.com wrote:

Hi,

I am trying to write a code generator (using Clickframes code generation
framework) which would generate a fully working Wicket project directly from
the Spec. Is there a document which describes the best practice for
folder/package structure in a wicket project.

To write the code generator, the only thing I need to know is the Wicket
project structure that I should be created. For example:
1) should html files be colocated in src/main/java/com/mypackage/ along with
Java files (as in the helloworld example) or in src/main/webapp.
2) should there be one html file per page (I am assuming yes)
... and other such questions related to folder structure

I am the lead developer of open source code generation framework Clickframes
(http://www.clickframes.org) and have written a similar code generator for
JSF/Seam which instantly gives you a working app directly from the spec
which the developer can then customize. I think a similar approach for
Wicket would be very helpful to Wicket users who are trying to start a brand
new project.

Here's what I have so far.
http://code.google.com/p/clickframes-wicket-plugin/

I am a Wicket novice, so any help or direction is appreciated.

Thanks,

Vineet Manohar
http://www.vineetmanohar.com


Re: Fix super(new CompoundPropertyModel(this)) error in the WIA book

2010-02-05 Thread Riyad Kalla
As someone working his way through WIA as well, will there be another wiki
entry showing differences between book and 1.5? (I'm fairly interested in
page mounting and nice URLs as well).

-- also I realize the cost to constantly maintain book diffs by the authors
is high, but just wanted to ask incase there were plans for it.

-R

On Fri, Feb 5, 2010 at 5:09 AM, Martijn Dashorst martijn.dasho...@gmail.com
 wrote:

 On Fri, Feb 5, 2010 at 10:16 AM, Wilhelmsen Tor Iver toriv...@arrive.no
 wrote:
super(new CompoundPropertyModel(this));
 
  This seems wrong: A call to super() cannot reference this directly or
 indirectly:
 
  JLS §8.8.7 says:
  It is a compile-time error for a constructor to directly or indirectly
 invoke itself through a series of one or more explicit constructor
 invocations involving this.

 Yup, this is a bug in the book's example code. Has nothing to do with
 1.3 or 1.4.

 And yes, the book is still valid apart from the model changes. My
 guess is that 1.5 will invalidate a bit more, but not too much. Mostly
 the part about page mounting and nice URLs will change. The internal
 request processing implementation is completely rewritten, but that
 should be transparent to the most of us (and was not covered in the
 book). The same goes for Wicket Ajax: completely rewritten,
 transparent for most users.

 Martijn

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




Re: Settings an HTML page as home page?

2010-02-05 Thread Riyad Kalla
+1 to what James said:

Home.html
html
  body
Yay, static content!
  /body
/html

Home.java
public class Home extends WebPage {
// no-op impl
}

On Fri, Feb 5, 2010 at 3:24 AM, Ashika Umanga Umagiliya 
auma...@biggjapan.com wrote:

 Greetings,

 How can I set an static HTML page in webapp folder as my home page  in
 Application  class instead of using Wicket Page ?

 thanks in advance,
 umanga



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




Re: How reRender a component from parent page?

2010-02-05 Thread Riyad Kalla
What do the tasty HTML bits look like? (wicket:ids and what not)

On Fri, Feb 5, 2010 at 12:50 PM, Rangel Preis rangel...@gmail.com wrote:
 How can I use Ajax to change value from a parent page in my layout. I
 try to change values in header using a action from content page.

 I have this:

    |---|
    |           HEADER           |
    |---|
    | MENU |   CONTENT   |
    |             |                       |
    |             |                       |
    |             |                       |
    |---|---|
    |          FOOTER            |
    |---|

 public class MyTemplate{
  public MyTemplate() {
         super();

         this.add(CSSPackageResource.getHeaderContribution(...);

         this.add(AbstractTemplatePage.FEEDBACK);

         this.addOrReplace(new Header());

         this.add(new Menu());

         this.add(new Footer());
     .


 public class MyContetPage extends MyTemplate {
 public MyContetPage(final PageParameters _parameters) {
 add(new AjaxFallbackLinkVoid(rem) {

    �...@override
     public void onClick(final AjaxRequestTarget target) {
         …...
      }
    });
 ….
 }
 }

 How change value in the header when i click on the ajaxlink of my content 
 page?

 In the onClick i try this; but don't work

 //some function to change the model value...
 this.getPage().get(header:component).modelChanged();
 target.addComponent(this.getPage().get(header:component));

 And in my Header.java I override onModelChanged:
     protected void onModelChanged() {
         super.onModelChanged();
         this.addOrReplace(component).setOutputMarkupId(true));
     }

 Thanks all.

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



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



Re: Highlight invalid field

2010-02-04 Thread Riyad Kalla
Anna, I think James literally meant this presentation, it's got the code
snippets you want:
http://londonwicket.googlecode.com/files/LondonWicket-FormsWithFlair.pdf

-R

On Thu, Feb 4, 2010 at 12:25 PM, Anna Simbirtsev asimbirt...@gmail.comwrote:

 Can you give an example please?
 Actually I am validating uniqueness of the name, i just put the length as
 an
 example.
 But if you could give me an example of how to change the class using a
 behaviour, that would be nice.

 On Thu, Feb 4, 2010 at 2:20 PM, James Carman
 jcar...@carmanconsulting.comwrote:

  It's better to use a validator for this.  And, you can add a behavior
  (look at forms with flair presentation) to change the class (I would
  do that instead of in-lining the style) of the components in error.
 
  On Thu, Feb 4, 2010 at 2:05 PM, Anna Simbirtsev asimbirt...@gmail.com
  wrote:
   Hi,
  
   I am validating a field(user presses validation button) and if its
  invalid I
   highlight the field in the following way:
  
   AjaxSubmitLink checkName = new AjaxSubmitLink(check_name, form) {
  
   public void onSubmit(AjaxRequestTarget target, Form? form) {
   if (name.length()  5) {
name.add(new SimpleAttributeModifier(
  style,
   color:red;border-color:red;));
target.addComponent(domain_name);
   }
   }
   }
  
   Then when the user modifies the name field, I need to remove the red
  color
   from the field.
   Is it better to do it with behaviour and look for onchange event? If
 yes,
   which one?
  
   Thank you
   Anna
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


 --
 Anna Simbirtsev
 (416) 729-7331



Re: How to simulate browser back button?

2010-02-02 Thread Riyad Kalla
JavaScript is your only option -- that should work in IE, that's some pretty
classic JavaScript right there.

If your IE install has JS turned off, I'm not aware of any other way to
programatically issue a 'back' to the browser.

On Tue, Feb 2, 2010 at 1:09 AM, PDiefent pdief...@csc.com wrote:


 It's not that simple! My IE doesn't accept the onclick in the   tag.
 Is it poosible to run the code in the onSubmit method of a Wicket button?


 Erik van Oosten wrote:
 
  No problem:
 
   # back
 
 
  Peter Diefenthaeler wrote:
  Hallo Wicket users.
  is there an easy way to simulate the browsers back button with an own
  button in a form?
 
  Thank in advance
  Peter
 
 
  --
  Send from my SMTP compliant software
  Erik van Oosten
  http://day-to-day-stuff.blogspot.com/
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

 --
 View this message in context:
 http://old.nabble.com/How-to-simulate-browser-back-button--tp27404303p27416704.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: AjaxFallbackDefaultDataTable and delete via ModalWindow

2010-02-02 Thread Riyad Kalla
Andreas,

Sorry I think my reply came across confusing -- I'm very green with Wicket,
so I can't help with more complex use-case using
the AjaxFallbackDefaultDataTable -- which is probably the right component to
use.

On Tue, Feb 2, 2010 at 1:20 AM, Andreas Lüdtke sam.lued...@t-online.dewrote:

 Riyad,

 I saw the stop() method and that would help if I only delete one row. But
 what should I do when the second row on that page is deleted? There is no
 restart() or start() method in the timer. Maybe I'm not aware of a method
 to
 re-enable/re-start the timer.

 Ok Riyad, what is smarter than the AjaxFallbackDefaultDataTable in your
 opinion ;-)

 Andreas

  -Original Message-
  From: Riyad Kalla [mailto:rka...@gmail.com]
  Sent: Monday, February 01, 2010 4:40 PM
  To: users@wicket.apache.org; sam.lued...@t-online.de
  Subject: Re: AjaxFallbackDefaultDataTable and delete via ModalWindow
 
  Andreas,
 
  I'm glad you nailed down what was going on -- that being
  said, can you just issue a .stop() on the timer on the first
  callback? So you get your 1 update, then the timer gets
  killed off and you are good to go?
 
  Don't know that much about the Ajax Data Table, otherwise I
  would recommend something way smarter :)
 
  -R
 
 
  On Sat, Jan 30, 2010 at 2:11 AM, Andreas Lüdtke
  sam.lued...@t-online.de wrote:
 
 
Riyad,
 
it's not a dumb question. I asked that already myself
  and checked via the
debugger that the object is really deleted. But you've
  put me on the right
track: I placed a link where I do a
AjaxFallbackDefaultDataTable.modelChanged(); and that
  did the job. Now I've
added an AbstractAjaxTimerBehavior with a duration of 1
  second and that is
updating the table after one second.
 
Now I'm curious: do I generate too much Ajax traffic if
  that timer is running
every second? I only need it to run once after I
  changed the model...
 
Thanks
 
Andreas
 
 
 -Original Message-
 From: Riyad Kalla [mailto:rka...@gmail.com]
 Sent: Friday, January 29, 2010 8:35 PM
 To: users@wicket.apache.org; sam.lued...@t-online.de
 Subject: Re: AjaxFallbackDefaultDataTable and delete
  via ModalWindow

 Andreas,

 This might be a dumb question, but are you sure at the point
 that the page
 reloads and re-renders, the object *has* been erased from the
 database or
 cache you are utilizing? For example, right after you delete,
 if you put in
 some silly/junk code to immediately re-query for that object,
 it comes back
 null right?

 I'm sure this is an Ajax/model issue, but 1 time it took me 2
 days trying to
 figure out why something Wasn't deleting just to find out
 it was, but my
 cache was deferring the operation to a few seconds later. So
 I figured I'd
 throw that out there just incase.

 -R

 On Fri, Jan 29, 2010 at 10:23 AM, Andreas Lüdtke
 sam.lued...@t-online.dewrote:

  Hi,
 
  I have an AjaxFallbackDefaultDataTable on a page and when I
 delete a row of
  the displayed data, I can't get the DataTable to
  reload and show the
  reduced
  list. I tried already the following:
 
  - delete the object (row) in the database
  - reload the ISortableDataProvider class I'm using -- this
 is actually not
  needed, because the object is removed
  - AjaxFallbackDefaultDataTable.modelChanged()
 
  If I refresh the browser window I see that one object is
 missing in the
  list,
  but this way I lose the sorting the user has done.
 
  Am I missing something? How do I bring the
 AjaxFallbackDefaultDataTable to
  reflect the changes?
 
  Andreas
 
 
 

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

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


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




Re: component .... not found on page

2010-02-02 Thread Riyad Kalla
What version of Wicket?

On Tue, Feb 2, 2010 at 10:11 AM, Eugene Malan eug...@emalan.com wrote:

 I am wrestling with the same Exception. I think I am doing something
 similar, in that I have a DataView with a link to a detail Page and then I
 return to the list page usingsetResponsePage(returnPage);

 Different browsers react differently. On my Mac...
 Chrome:  gives the Exception on first load of the page.
 Safari: gives Exception after a few renderings of the Page.
 Firefox: Cannot re-create the Exception.

 What browser are you using?

 In my instance it is a Link that cannot be found

 item.add(new LinkEntry(entryName, new ModelEntry(entry)){

@Override
public void onClick() {
setResponsePage(new OBOEntryViewPage(entry, getPage()));
}

@Override
protected void onComponentTagBody(MarkupStream markupStream,
 ComponentTag openTag) {
replaceComponentTagBody(markupStream, openTag,
 getModelObject().getName());
}

 });



 On 02 Feb 2010, at 9:57 AM, cresc wrote:


 Forgot to copy the error message.

 Root cause:

 org.apache.wicket.WicketRuntimeException: component
 content-panel:table-container:table-content:tcontainer:list:1:viewDetail
 not
 found on page com.mypackage.ordertracking.client.TrackingHomePage[id = 3],
 listener interface = [RequestListenerInterface name=IBehaviorListener,
 method=public abstract void
 org.apache.wicket.behavior.IBehaviorListener.onRequest()]
 at

 org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426)
 at

 org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471)
 at

 org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)

 So
 --
 View this message in context:
 http://old.nabble.com/component--not-found-on-page-tp27421536p27421759.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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





Re: AjaxFallbackDefaultDataTable and delete via ModalWindow

2010-02-01 Thread Riyad Kalla
Andreas,

I'm glad you nailed down what was going on -- that being said, can you just
issue a .stop() on the timer on the first callback? So you get your 1
update, then the timer gets killed off and you are good to go?

Don't know that much about the Ajax Data Table, otherwise I would recommend
something way smarter :)

-R

On Sat, Jan 30, 2010 at 2:11 AM, Andreas Lüdtke sam.lued...@t-online.dewrote:

 Riyad,

 it's not a dumb question. I asked that already myself and checked via the
 debugger that the object is really deleted. But you've put me on the right
 track: I placed a link where I do a
 AjaxFallbackDefaultDataTable.modelChanged(); and that did the job. Now I've
 added an AbstractAjaxTimerBehavior with a duration of 1 second and that is
 updating the table after one second.

 Now I'm curious: do I generate too much Ajax traffic if that timer is
 running
 every second? I only need it to run once after I changed the model...

 Thanks

 Andreas

  -Original Message-
  From: Riyad Kalla [mailto:rka...@gmail.com]
  Sent: Friday, January 29, 2010 8:35 PM
  To: users@wicket.apache.org; sam.lued...@t-online.de
  Subject: Re: AjaxFallbackDefaultDataTable and delete via ModalWindow
 
  Andreas,
 
  This might be a dumb question, but are you sure at the point
  that the page
  reloads and re-renders, the object *has* been erased from the
  database or
  cache you are utilizing? For example, right after you delete,
  if you put in
  some silly/junk code to immediately re-query for that object,
  it comes back
  null right?
 
  I'm sure this is an Ajax/model issue, but 1 time it took me 2
  days trying to
  figure out why something Wasn't deleting just to find out
  it was, but my
  cache was deferring the operation to a few seconds later. So
  I figured I'd
  throw that out there just incase.
 
  -R
 
  On Fri, Jan 29, 2010 at 10:23 AM, Andreas Lüdtke
  sam.lued...@t-online.dewrote:
 
   Hi,
  
   I have an AjaxFallbackDefaultDataTable on a page and when I
  delete a row of
   the displayed data, I can't get the DataTable to reload and show the
   reduced
   list. I tried already the following:
  
   - delete the object (row) in the database
   - reload the ISortableDataProvider class I'm using -- this
  is actually not
   needed, because the object is removed
   - AjaxFallbackDefaultDataTable.modelChanged()
  
   If I refresh the browser window I see that one object is
  missing in the
   list,
   but this way I lose the sorting the user has done.
  
   Am I missing something? How do I bring the
  AjaxFallbackDefaultDataTable to
   reflect the changes?
  
   Andreas
  
  
  
  -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 


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




Re: Mounting problem with GlassFishv3

2010-02-01 Thread Riyad Kalla
Peter, keep us posted on what the GF team comes back with.

Best,
Riyad

2010/1/31 Major Péter majorpe...@sch.bme.hu

 Hi,

 I made some investigation today, and found out the followings:
 With GlassFishv2 when the bookmarkablepagelink calculates the url,
 finally it goes to
 ServletWebRequest#getRelativePathPrefixToWicketHandler() .
 The difference is on line #270:
 String forwardUrl =
 (String)httpRequest.getAttribute(javax.servlet.forward.servlet_path);

 With v2, the forwardUrl is
 /asdf (the wrong url again)

 With v3 the forwardUrl is null!

 It looks like there were some changes in the servlet API, namely: The
 HttpServletRequest's dispatcherType is now an enum instead of Integer (I
 don't know if this is relevant to the issue), and also, the HSR contains
 a HashMap called specialAttributes, which with GFv2 contains the forward
 attributes, but not with GFv3.

 After further tests, I checked the whole thing without wicket with just
 simple servlets, and this behaviour is appearing there too. Now I'm
 gonna go and ask the GlassFish team what they think about this issue and
 return here with the answer.

 Thanks,
 Peter


 2010-01-30 20:28 keltezéssel, Major Péter írta:
  Hi,
 
  I've an application, which in its web.xml has a 404 page declared:
  error-page
  error-code404/error-code
  location/error/NotFound/location
  /error-page
 
  The filter-mapping for wicket that's why has the ERROR dispatcher.
 
  I created a NotFound page and mounted it via:
  mount(/error, PackageName.forClass(NotFound.class));
  and the homepage is mounted via:
  mountBookmarkablePage(/homepage, HomePage.class);
 
  So, if the error page has a bookmarkablepagelink, which is pointing to
  the Homepage, and I request a wrong URL (e.g. 'asdf'), then the link is
  'error/NotFound/homepage' instead of 'homepage'.
  But when I get the page with error/NotFound the link works just fine.
 
  I have a Quickstart app which demonstrates the problem, and it looks
  like with Jetty and GFv2 it works, but not with GFv3.
  Should I create a JIRA issue for this? I'm not sure that the
  web.xml-like errorpage is causing the error or the mount is the problem..
  I also checked version-compatibilities, and both with 1.4.1 and 1.3.6 I
  got the same behaviour.
 
  Thanks,
  Peter

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




Re: Save a form's markup

2010-02-01 Thread Riyad Kalla
At first I thought you would override the Component.onRender method to see
what is going back to the client and save that, but iterating through the
MarkupElements looks expensive (to rebuild the page) and might leave the
response in an unexpected state. Also though you could possibly override
WicketFilter.doFilter call to try and snag the response on render, but then
realized searching for form HTML specifically is going to suck.

I then found this example on getting Wicket components to cough up their
HTML into a dummy output stream that you can do what you want with:
http://www.danwalmsley.com/2008/10/21/render-a-wicket-page-to-a-string-for-html-email/

http://www.danwalmsley.com/2008/10/21/render-a-wicket-page-to-a-string-for-html-email/THEN
I was reading on the Wicket Wiki (the WiWi if you will) about rendering
Panels to Strings, which is essentially what I think you want to do, and
found this:
http://cwiki.apache.org/WICKET/rendering-panel-to-a-string.html#RenderingPaneltoaString-renderpanelstring

http://cwiki.apache.org/WICKET/rendering-panel-to-a-string.html#RenderingPaneltoaString-renderpanelstring--
I just included all the other resources incase they help with what you are
trying to do, wasn't clear on the use-case.

Have fun

On Mon, Feb 1, 2010 at 4:41 AM, Branden Tanga branden.ta...@gmail.comwrote:

 Hello,

 I would like to save a form's markup as a string when the form's submit
 button is pressed. The part that I am having difficulty with is
 understanding how to use wicket to grab a form's rendered markup. I have a
 feeling it must be pretty simple, but I'm getting lost in the wicket
 documentation. Any tips?



 Thanks,
 Branden Tanga
 Programmer / EHR Systems Engineer



Re: better look modern css for wicket

2010-02-01 Thread Riyad Kalla
Shipping a few different custom themes as part of the Wicket SDK could be
interesting -- for the standard Wicket components that just back HTML4
elements it's a little less necessary I suppose, but for those custom
components, like Data Tables, making them look nice out of the box could be
a nice win. I suppose the same goes for some standard HTML widgets
(buttons?)

I wonder if there could be a Wicket 1.6 addition of a ThemeManager that all
wicket components could call into for default styles -- including the
custom components -- allowing artists to define well-known style names that
would get applied automatically and allow Wicket to ship themes out of the
box with it?

e.g. in Application.init() -- ThemeManager.setDefault(green-gloss.css)

As superficial as it is, we all know bling counts. If there is a huge demand
for making Wicket components look like an 1990s AOL webpage, I'll take the
lead on this... otherwise we should probably ask if anyone is a designer? :)

On Mon, Feb 1, 2010 at 9:04 AM, Jing Ge (Besitec IT DEHAM)
j...@besitec.comwrote:

 Hi guys,

 I just ask myself, why the wicket team does not provide a better look,
 more modern css? A css which will let people say WOW! when they open
 the wicket demo page, like Vaadin does.

 Such a css can let more people pay attention to wicket. Why don't do it?


 BTW, The wicket is really cool! I like it!

 Regards
 Jing


Re: Mounting problem with GlassFishv3

2010-02-01 Thread Riyad Kalla
Nice catch Peter

2010/2/1 Major Péter majorpe...@sch.bme.hu

 Hi,

 the result is this ticket:
 https://issues.apache.org/jira/browse/WICKET-2712
 See more details there.

 Regards,
 Peter

 2010-02-01 16:42 keltezéssel, Riyad Kalla írta:
  Peter, keep us posted on what the GF team comes back with.
 
  Best,
  Riyad
 
  2010/1/31 Major Péter majorpe...@sch.bme.hu
 
  Hi,
 
  I made some investigation today, and found out the followings:
  With GlassFishv2 when the bookmarkablepagelink calculates the url,
  finally it goes to
  ServletWebRequest#getRelativePathPrefixToWicketHandler() .
  The difference is on line #270:
  String forwardUrl =
  (String)httpRequest.getAttribute(javax.servlet.forward.servlet_path);
 
  With v2, the forwardUrl is
  /asdf (the wrong url again)
 
  With v3 the forwardUrl is null!
 
  It looks like there were some changes in the servlet API, namely: The
  HttpServletRequest's dispatcherType is now an enum instead of Integer (I
  don't know if this is relevant to the issue), and also, the HSR contains
  a HashMap called specialAttributes, which with GFv2 contains the forward
  attributes, but not with GFv3.
 
  After further tests, I checked the whole thing without wicket with just
  simple servlets, and this behaviour is appearing there too. Now I'm
  gonna go and ask the GlassFish team what they think about this issue and
  return here with the answer.
 
  Thanks,
  Peter
 
 
  2010-01-30 20:28 keltezéssel, Major Péter írta:
  Hi,
 
  I've an application, which in its web.xml has a 404 page declared:
  error-page
  error-code404/error-code
  location/error/NotFound/location
  /error-page
 
  The filter-mapping for wicket that's why has the ERROR dispatcher.
 
  I created a NotFound page and mounted it via:
  mount(/error, PackageName.forClass(NotFound.class));
  and the homepage is mounted via:
  mountBookmarkablePage(/homepage, HomePage.class);
 
  So, if the error page has a bookmarkablepagelink, which is pointing to
  the Homepage, and I request a wrong URL (e.g. 'asdf'), then the link is
  'error/NotFound/homepage' instead of 'homepage'.
  But when I get the page with error/NotFound the link works just fine.
 
  I have a Quickstart app which demonstrates the problem, and it looks
  like with Jetty and GFv2 it works, but not with GFv3.
  Should I create a JIRA issue for this? I'm not sure that the
  web.xml-like errorpage is causing the error or the mount is the
 problem..
  I also checked version-compatibilities, and both with 1.4.1 and 1.3.6 I
  got the same behaviour.
 
  Thanks,
  Peter

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




Re: RIA solution based on wicket

2010-01-31 Thread Riyad Kalla
Great idea -- probably just boils down to a time/resource issue more than
anything.

On Sun, Jan 31, 2010 at 10:28 PM, Josh Kamau joshnet2...@gmail.com wrote:

 Hi guys;

 I would like to get your opinions and also share some of my views. I have
 been test-driving wicket for a couple of weeks now and i found it quite
 impressive. However , i would like to say that IMHO wicket is more suitable
 for creating websites as opposed to RIA applications. I would like to make
 applications that look and feel like desktop applications but running on a
 browser, i have a solid GWT background and i used to make this kind of
 applications but alot of work is involved. Should we not have a ria
 framework based on wicket? It could just be some nice CSS based theme or an
 intergration with something like extJs or something like this. WiQuery is a
 great step in this direction but it lacks components for making the main
 application layout.

 In the meantime, i will be trying out Vaadin.

 Regards.



Re: Fwd: Date Format on text field

2010-01-29 Thread Riyad Kalla
The good part:
=
 DateTextField dateTextField = new DateTextField(dateTextField, new
PropertyModelDate(
this, date), new StyleDateConverter(S-, true))
=

You'll need wicket-stuff

On Fri, Jan 29, 2010 at 1:43 AM, Martin Grigorov mcgreg...@e-card.bgwrote:

 see http://wicketstuff.org/wicket14/dates/
 There is a link in the upper right corner Source code

 On Fri, 2010-01-29 at 11:29 +0300, Josh Kamau wrote:
  Hi ;
 
   I have a text field that has a model of type java.util.Date. How do i
 set
  the format of how the components displays the date?
 
  I am using it with the datePicker .
 
  DatePicker datePicker = new DatePicker();
txtStartDate.add(datePicker());
 
 
 
  Regards.
 
 
  -- Forwarded message --
  From: Josh Kamau joshnet2...@gmail.com
  Date: Fri, Jan 29, 2010 at 11:13 AM
  Subject: Date Format on text field
  To: users@wicket.apache.org
 
 
  Hi ;
 
   I have a text field that has a model of type java.util.Date. How do i
 set
  the format of how the components displays the date?
 
  Regards.



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




Re: Howto load StringResources from Database for Iternationalization?

2010-01-29 Thread Riyad Kalla
self-learning, wow... it sounds like the custom IStringResourceLoader was
the easy part of this problem :D

On Fri, Jan 29, 2010 at 3:15 AM, MattyDE ufer.mar...@gmail.com wrote:


 Thanks a lot you both,
 it work very nice with

 private class DatabaseResourceLoader implements IStringResourceLoader{
 ... }

 so i will implement a self-learning translation-database in the next days
 :)

 Have a nice weekend,
 Martin


 German Morales-3 wrote:
 
  Hoi Martin,
 
  we have a subclass of ComponentStringResourceLoader, overriding
  #loadStringResource methods, which we then register in our application
  #init
  method:
 getResourceSettings().addStringResourceLoader(new
  YourStringResourceLoader());
  and it works well for our needs.
 
  Then you should decide if it's better to load all resources in advance
  (for
  example, on Application #init) or if you want to get them on demand
  (performance and memory considerations).
  If you wait for calls for loadStringResource to get resources
  individually,
  you will get lots of requests to the database, but then the results
 should
  be cached by wicket, so the next user asking for the resource should have
  it
  already there. On the other hand, you don't load all the stuff in
 advance.
  We prefer for the moment to load all resources first, but we must still
  analyze better if this is the best way.
 
  Grüsse,
 
  German
 
 
  2010/1/29 Martin U ufer.mar...@googlemail.com
 
  Hello Folks,
 
 
  i don't know if this question was ever done, but i didn't find anything
  suitable for me.
 
  In a huge webapplication which is being in the first steps of
  implementation, we want to use a Database (table) to store there
  any String Resources by locale for translation.
 
  I have been jumping through the class-hierarchy for many hours but i
  haven't
  found the right point to plug-in a ResourceLoader
  from Database.
 
  There are some different Interface of them i could imagine This is
 the
  right place but I am not sure at all.
 
  Have i to Implement my own *IResourceSettings*? I hope not, cause the
  Implementation Settings looks very complicated to me.
  or is it enough to implement *IStringResourceLoader*? But then, where
 can
  i
  add my own loader to the Chain of processing?
 
  Thanks a lot for any hints. Its very urgently to know and to understand
  if
  wicket is useful for our wishes before we really
  decide which framework we want to use.
 
  Please apologise for my English, its not my mothers tongue.
 
  - Matty
 
 
 

 --
 View this message in context:
 http://old.nabble.com/Howto-load-StringResources-from-Database-for-Iternationalization--tp27368172p27369874.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: AjaxFallbackDefaultDataTable and delete via ModalWindow

2010-01-29 Thread Riyad Kalla
Andreas,

This might be a dumb question, but are you sure at the point that the page
reloads and re-renders, the object *has* been erased from the database or
cache you are utilizing? For example, right after you delete, if you put in
some silly/junk code to immediately re-query for that object, it comes back
null right?

I'm sure this is an Ajax/model issue, but 1 time it took me 2 days trying to
figure out why something Wasn't deleting just to find out it was, but my
cache was deferring the operation to a few seconds later. So I figured I'd
throw that out there just incase.

-R

On Fri, Jan 29, 2010 at 10:23 AM, Andreas Lüdtke sam.lued...@t-online.dewrote:

 Hi,

 I have an AjaxFallbackDefaultDataTable on a page and when I delete a row of
 the displayed data, I can't get the DataTable to reload and show the
 reduced
 list. I tried already the following:

 - delete the object (row) in the database
 - reload the ISortableDataProvider class I'm using -- this is actually not
 needed, because the object is removed
 - AjaxFallbackDefaultDataTable.modelChanged()

 If I refresh the browser window I see that one object is missing in the
 list,
 but this way I lose the sorting the user has done.

 Am I missing something? How do I bring the AjaxFallbackDefaultDataTable to
 reflect the changes?

 Andreas


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




Re: images not under the context root directory

2010-01-29 Thread Riyad Kalla
Matthew, this seems like a glassfish question... if you can mount local
system dirs in glassfish as web dirs, for example:
alternatedocroot_1 from=/uploads/*
dir=/Users/insane/path/under/netbeans/glassfish/domain1/uploads/Videos

would you access that content using http://www.mysite.com/uploads/*

Again, I'm not sure how that mounting rule in glassfish works, it might be
relative to your app root, but it seems it should work and just be treated
as a normal path -- in the case of the previous fellow I understood his
situation to be that he *had* to host resources out of a system directory
that wasn't web-addressable. I believe in your case they are web addressable
if that glassfish feature mounts them up as such?

-R

On Fri, Jan 29, 2010 at 12:17 PM, Matthew J msj...@gmail.com wrote:

 Question, as I am dealing with a similar issue, except I save my file to my
 glassfish directory (ie: glassfish/domains/domain1/uploads/Videos/...). I
 can't seem to find the url though I have tried many different types of
 urls...

 For the record

 ((WebApplication)WebApplication.get()).getServletContext().getRealPath(newFile.getCanonicalPath())
 returns:

 /Users/msj121/NetBeansProjects/WebBuilder/dist/gfdeploy/WebBuilder/WebBuilder-war_war/Applications/Programs/NetBeans/sges-v3/glassfish/domains/domain1/uploads/Videos/...


 btw, for those using Glassfish you can have urls to physical hard drive
 space even not in the context root by using an alternatedocroot (ie:
 alternatedocroot_1 from=/uploads/* dir=/).


 I assume my directory is in the context root and I should be able to find
 it, no?


 On 29-Jan-10, at 12:47 AM, Ernesto Reinaldo Barreiro wrote:

  Hi Riyad,

 I didn't get offended by your message... which otherwise raised a very
 valid
 issue.

 Cheers,

 Ernesto

 On Thu, Jan 28, 2010 at 5:26 PM, Riyad Kalla rka...@gmail.com wrote:

  Ernesto,

 Sorry about that -- I didn't mean to imply your impl was back, that was
 more
 directed at Francois along the lines of that's a lot of overhead, are
 you
 sure you need to do that? -- but now that I understand what his use-case
 is
 (saw his last reply about /usr/ext/img/IMAGES HERE) I get it. I was
 thinking they were under /webapp/images.

 I'll go back to sitting in my corner ;)

 -R

 On Wed, Jan 27, 2010 at 9:54 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

  Sure it is overhead but he wanted to serve images from a folder not
 under application
 context root directory... Then, you have to serve them somehow? The

 options

 I see are

 1-A dedicated servlet?
 2-With Wicket... and thats what the code shows... and for sure it can be
 done in a simpler way...

 A would try to use 1. As then Wicket would not have to serve the images.

 Regards,

 Ernesto

 On Wed, Jan 27, 2010 at 9:43 PM, Riyad Kalla rka...@gmail.com wrote:

  This seems like adding a large amount of overhead to an image-heavy

 site

 (e.g. image blog or something), I thought I read in Wicket in Action

 that

 WicketFilter ignored HTTP requests for non-wicket resources now and

 passed

 them through to the underlying server to handle avoiding the need to

 remap

 your wicket URLs to something like /app/* so you could have /images and
 other resources under root and not have them go through the filter.

 Is this not the case?

 On Wed, Jan 27, 2010 at 1:38 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

  Hi Francois,

 Following example works.

 1-Create this class anywhere you want need.

 package com.antilia.demo.manager.img;

 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;

 import org.apache.wicket.AttributeModifier;
 import org.apache.wicket.markup.html.image.Image;
 import

 org.apache.wicket.markup.html.image.resource.DynamicImageResource;

 import org.apache.wicket.model.Model;
 import org.apache.wicket.protocol.http.WebApplication;
 import org.apache.wicket.protocol.http.WebRequestCycle;
 import org.apache.wicket.util.file.Folder;

 /**
 *
 * @author  Ernesto Reinaldo Barreiro (reier...@gmail.com)
 *
 */
 public abstract class MountedImageFactory {


 static int BUFFER_SIZE = 10*1024;
 /**
   * Copies one stream into the other..
 * @param is source Stream
 * @param os destination Stream
 * */
 static public void copy(InputStream is, OutputStream os) throws

 IOException

 {
 byte[] buf = new byte[BUFFER_SIZE];
 while (true) {
 int tam = is.read(buf);
 if (tam == -1) {
 return;
 }
 os.write(buf, 0, tam);
 }
 }
 public static  byte[] bytes(InputStream is) throws IOException {
 ByteArrayOutputStream out = new ByteArrayOutputStream();
 copy(is, out);
 return out.toByteArray();
 }
 private static ImageFromFolderWebResource dynamicResource;
 private static class ImageFromFolderWebResource extends
 DynamicImageResource {
 private static final long serialVersionUID = 1L;

 private File folder;
 public ImageFromFolderWebResource(File

Re: images not under the context root directory

2010-01-29 Thread Riyad Kalla
Good call -- going the intercept-and-stream route is great when you cannot
read from a web-addressable folder, but if you can do that, and can avoid
all that server-side processing by using a direct URL and just let the app
server do it's thing, then +1 on that.

Sounds like you got it going that way.

-R

On Fri, Jan 29, 2010 at 1:25 PM, m j msj...@gmail.com wrote:

 Well after my question I started researching and changed my upload folder
 to:

 String path = WebApplication.get().getServletContext().getRealPath();
 Folder uploadFolder = new Folder(path+/uploads);

 I can now reference the files via the url (.../uploads/..), so much simpler
 this way... I suppose this is what I was trying to do from the beginning.

 Thanks for the help.


 On Fri, Jan 29, 2010 at 2:51 PM, Matthew J msj...@gmail.com wrote:

  Correct, Glassfish would allow this; however, if I can do it
  programmatically with ease I would rather do this (as installations may
  change and I would rather not have the static uri). I assumed Wicket had
  access to all files in the context root (or what I assume is one, which
  maybe isn't).
 
  I am currently trying the code posted below (MountedImageFactory), though
 I
  need to alter it to work with all files, and its a little bulky.
 
  I am not bound to where I upload, is there a way to upload to a Folder
 that
  wicket would be able to find easily? I currently make an upload Folder:
  Folder upload = new Folder(uploads); I upload to it similar to the
  wicket-examples.
 
 
  On 29-Jan-10, at 2:39 PM, Riyad Kalla wrote:
 
   ot sure how that mounting rule in glassfish works, it might be
  relative to your app root, but it seems it should work and just be
 treated
  as a normal path -- in the case of the previous fellow I understood his
  situation to be that he *had* to host resources out of a system
 directory
  that wasn't web-addressable. I believe in your case they are web
  addressable
  if that glassfis
 
 
 



Re: nested forms onSubmit

2010-01-29 Thread Riyad Kalla
Are nested forms a valid HTML construct? I'm running through the use-case
here in my head and it doesn't click -- form submission is 1:1 with an HTTP
POST, what do multiple embedded forms even mean in this regard?

I don't think this is kosher...

On Fri, Jan 29, 2010 at 2:04 PM, Dave Kallstrom dave.kallst...@gmail.comwrote:

 Hi,
 Is there anyway to notify nested forms that they are being submitted?  The
 onSubmit method of nested forms do not get called when the parent form is
 submitted.
 I tried implementing IFormSubmitListener but that didn't seem to help.

 --
 Dave Kallstrom



Re: Repeating View Horizontally

2010-01-28 Thread Riyad Kalla
Josh,

Just what Tor said -- repeaters will just repeat whatever markup you feed it
over and over again doing substitution on each one according to the backing
components. So just make sure you are repeating an element that flows right
to left -- a td or span -- probably a span is what you want (or heck,
even LI's that are styled like a menu to flow left to right would work, just
takes more CSS). Don't use divs because they are block level elements and
won't flow the way (l  r) you want them to.

Best,
Riyad

On Thu, Jan 28, 2010 at 3:06 AM, Wilhelmsen Tor Iver toriv...@arrive.nowrote:

  How do you make repeating view to repeat the items horizontally? The
  number
  of items is not known at the time of creating the markup.

 Repeaters do not care about horizontal vs. vertical; it all comes down to
 the markup.

 E.g. you can have a ListView which generates a sequence of table cells:

 trtd wicket:id=myListspan wicket:id=subelementSubelement
 here/span/td/tr

 where you have a new ListViewFoo(myList, ...)

 - Tor Iver

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




Re: know the last page user comes from

2010-01-28 Thread Riyad Kalla
Martin,

It looks like you are trying to implement the flow for authorization
manually (User tries to go from PageA to PageB, but they require
authorization, so you temporarily send them to PageC -- if they fail, send
them back to PageA, if they succeed, send them to PageB).

The good news is that Wicket has nice support for denoting pages as
requiring authorization and then automatically walking users through an
auth-page and handling moving them forward or back for you if necessary.

Also you can checkout the wicket signin example:
http://wicketstuff.org/wicket14/signin/;jsessionid=1FF7784E87DBECFF9CF8624411BA0FA8?wicket:bookmarkablePage=:org.apache.wicket.examples.signin.SignIn

http://wicketstuff.org/wicket14/signin/;jsessionid=1FF7784E87DBECFF9CF8624411BA0FA8?wicket:bookmarkablePage=:org.apache.wicket.examples.signin.SignIn
-R

On Thu, Jan 28, 2010 at 3:08 AM, Martin Asenov mase...@velti.com wrote:

 Thank you, Thomas, for your time!

 Most likely this will help me solve the problem.

 Have a nice day!

 -Original Message-
 From: Thomas Kappler [mailto:thomas.kapp...@isb-sib.ch]
 Sent: Thursday, January 28, 2010 11:16 AM
 To: users@wicket.apache.org
 Subject: Re: know the last page user comes from

 On 01/28/10 10:01, Martin Asenov wrote:
  Yes I know about it, but never used it, is it suitable in the case I
 mentioned above? Would you give me some hints on how to implement it?

 Sure, here's some code from a small internal app I wrote recently. I got
 most of it from either the wiki or the list archive, but I can't find it
 right now.


 If a page needs authentication and the user is not signed in, I throw a
 RestartResponseAtInterceptPageException. This IAuthorizationStrategy is
 set in WebApplication.init(), via
 getSecuritySettings().setAuthorizationStrategy(...). Code:


 public class SimpleAuthorizationStrategy implements IAuthorizationStrategy
 {

public boolean isActionAuthorized(Component arg0, Action arg1)
{
return true;
}

@SuppressWarnings(unchecked)
public boolean isInstantiationAuthorized(Class componentClass)
{
// Does this page need authentication?
if
 (AuthenticatedBasePage.class.isAssignableFrom(componentClass))
{
if (NewtSession.get().isSignedIn())
return true;
else
throw new
 RestartResponseAtInterceptPageException(SignInPage.class);
}
return true;
}
 }

 Then in my sign-in page, I can just say

 if (NewtSession.get().authenticate(username.value(), password.value()))
 {
 if (!continueToOriginalDestination())
 setResponsePage(getApplication().getHomePage());
 ...

 The continueToOriginalDestination() gets the user to where the
 RestartResponseAtInterceptPageException was thrown.

 HTH,
 Thomas


 
  -Original Message-
  From: Thomas Kappler [mailto:thomas.kapp...@isb-sib.ch]
  Sent: Thursday, January 28, 2010 10:47 AM
  To: users@wicket.apache.org
  Subject: Re: know the last page user comes from
 
  On 01/28/10 09:36, Martin Asenov wrote:
  Hello, everyone, I was just wondering how could I know what's the page
 the user comes from, when he comes into a new page. In need that in order to
 redirect to previous page in my access denied page.
 
  Do you know about Component.continueToOriginalDestination() ?
 
  -- Thomas


 --
 ---
   Thomas Kapplerthomas.kapp...@isb-sib.ch
   Swiss Institute of Bioinformatics Tel: +41 22 379 51 89
   CMU, rue Michel Servet 1
   1211 Geneve 4
   Switzerland  http://www.uniprot.org
 ---

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


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




Re: images not under the context root directory

2010-01-28 Thread Riyad Kalla
Ernesto,

Sorry about that -- I didn't mean to imply your impl was back, that was more
directed at Francois along the lines of that's a lot of overhead, are you
sure you need to do that? -- but now that I understand what his use-case is
(saw his last reply about /usr/ext/img/IMAGES HERE) I get it. I was
thinking they were under /webapp/images.

I'll go back to sitting in my corner ;)

-R

On Wed, Jan 27, 2010 at 9:54 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Sure it is overhead but he wanted to serve images from a folder not
 under application
 context root directory... Then, you have to serve them somehow? The options
 I see are

 1-A dedicated servlet?
 2-With Wicket... and thats what the code shows... and for sure it can be
 done in a simpler way...

 A would try to use 1. As then Wicket would not have to serve the images.

 Regards,

 Ernesto

 On Wed, Jan 27, 2010 at 9:43 PM, Riyad Kalla rka...@gmail.com wrote:

  This seems like adding a large amount of overhead to an image-heavy site
  (e.g. image blog or something), I thought I read in Wicket in Action that
  WicketFilter ignored HTTP requests for non-wicket resources now and
 passed
  them through to the underlying server to handle avoiding the need to
 remap
  your wicket URLs to something like /app/* so you could have /images and
  other resources under root and not have them go through the filter.
 
  Is this not the case?
 
  On Wed, Jan 27, 2010 at 1:38 PM, Ernesto Reinaldo Barreiro 
  reier...@gmail.com wrote:
 
   Hi Francois,
  
   Following example works.
  
   1-Create this class anywhere you want need.
  
   package com.antilia.demo.manager.img;
  
   import java.io.ByteArrayOutputStream;
   import java.io.File;
   import java.io.FileInputStream;
   import java.io.IOException;
   import java.io.InputStream;
   import java.io.OutputStream;
  
   import org.apache.wicket.AttributeModifier;
   import org.apache.wicket.markup.html.image.Image;
   import
 org.apache.wicket.markup.html.image.resource.DynamicImageResource;
   import org.apache.wicket.model.Model;
   import org.apache.wicket.protocol.http.WebApplication;
   import org.apache.wicket.protocol.http.WebRequestCycle;
   import org.apache.wicket.util.file.Folder;
  
   /**
*
* @author  Ernesto Reinaldo Barreiro (reier...@gmail.com)
*
*/
   public abstract class MountedImageFactory {
  
  
   static int BUFFER_SIZE = 10*1024;
/**
   * Copies one stream into the other..
* @param is source Stream
* @param os destination Stream
* */
   static public void copy(InputStream is, OutputStream os) throws
  IOException
   {
   byte[] buf = new byte[BUFFER_SIZE];
   while (true) {
   int tam = is.read(buf);
   if (tam == -1) {
   return;
   }
   os.write(buf, 0, tam);
   }
   }
public static  byte[] bytes(InputStream is) throws IOException {
   ByteArrayOutputStream out = new ByteArrayOutputStream();
   copy(is, out);
   return out.toByteArray();
   }
private static ImageFromFolderWebResource dynamicResource;
private static class ImageFromFolderWebResource extends
   DynamicImageResource {
private static final long serialVersionUID = 1L;
  
private File folder;
public ImageFromFolderWebResource(File folder, String mountPoint) {
   this.folder = folder;
   WebApplication.get().getSharedResources().add(mountPoint, this);
   WebApplication.get().mountSharedResource(mountPoint,
   org.apache.wicket.Application/+mountPoint);
   }
@Override
   protected byte[] getImageData() {
   try {
   String name = WebRequestCycle.get().getRequest().getParameter(name);
   return bytes(new FileInputStream(new File(getFolder().getAbsolutePath()
 +
   System.getProperty(file.separator)+(name;
   } catch (Exception e) {
   //TODO: do this properly
   return null;
   }
   }
  
   public File getFolder() {
   return folder;
   }
   }
/**
* @return Folder from where images will be retrieved.
*/
   protected abstract Folder getFolder();
/**
* @return the URL to mount the dynamic WEB resource.e.g.
*/
   protected abstract String getMountPoint();
public Image createImage(String id, final String imageName) {
   if(dynamicResource == null)
   dynamicResource = new ImageFromFolderWebResource(getFolder(),
   getMountPoint());
   return new Image(id) {
private static final long serialVersionUID = 1L;
  
   @Override
   protected void onBeforeRender() {
   String path = WebRequestCycle.get().getRequest().getURL();
   path = path.substring(0, path.indexOf('/'));
   add(new AttributeModifier(src,true, new
   ModelString(/+path+/+getMountPoint()+?name=+imageName)));
   super.onBeforeRender();
   }
   };
   }
   }
  
   2- Create a test page.
  
   import org.apache.wicket.markup.html.WebPage;
   import org.apache.wicket.markup.html.image.Image;
   import org.apache.wicket.util.file.Folder;
  
   /**
* @author  Ernesto Reinaldo Barreiro (reier...@gmail.com)
*
*/
   public class TestPage extends WebPage

Re: Wicket Pattern to reduce session size

2010-01-28 Thread Riyad Kalla
Gaetan,

You can mark whatever instance that is causing the session to be so large as
'transient' to avoid it being serialized -- you'd have to recreate it each
time it was needed though. So if it's in your model:

=
private String chartName;
private String chartArguments; // maybe from a page param or something?
private transient DynamicImageResource chartImage; // won't get serialized
=

-R

On Thu, Jan 28, 2010 at 3:28 AM, Gaetan Zoritchak 
g.zoritc...@virtual-soft.com wrote:

 Hi all,

 I was debugging my sessions size in order to reduce it and I saw that one
 of
 my page spend 20ko because of an dynamic image generated with JFreeChart.
 JFreeChart was serialized with my DynamicImageRessource.

 My first optimisation is to make JFreeChart a static field initialized in a
 static bloc.

 Is it an valid way of handling that problem?

 Gaetan Zoritchak,



Re: Nasty problem with component not found and images [solved]

2010-01-27 Thread Riyad Kalla
Thomas, as someone who frequently likes trying really dumb things -- I
appreciate you giving a heads up on this issue. I was likely going to run
into this at some point anyway ;)

On Wed, Jan 27, 2010 at 3:46 AM, Thomas Kappler
thomas.kapp...@isb-sib.chwrote:

 Earlier this month, there was a thread [1] about the component not found
 problem. I can't reply as I wasn't subscribed yet.

 [1]
 http://old.nabble.com/component-xxx:yyy:zzz-not-found-on-page-td27080437.html

 I had the same problem recently, and after banging my head against the wall
 for a while, I figured it out.

 I had a RepeatingView on the page that consisted of markup containers that
 had some text, and some had an external image (hosted outside the wicket
 app), while others did not. I tought I'd keep it simple and wrote img
 src=# / in the markup. In the Java code, I'd check each item whether it
 had a URL to an image, and if so, would insert that into the src attribute
 with an AttributeModifier. For the other items it just stayed at the #
 value.

 Now # means the current page, so for each page load, the browser would
 actually load the page several times, once for each empty img. When using
 ajax, this completely breaks things, of course (besides making the page
 really slow).

 Note that an empty value of src= can also cause this at least with older
 versions of Firefox.

 Making it so that the img markup is only inserted for actual images
 solved it.

 Maybe that was really dumb, but I thought I'd share it for the mailing list
 archive.

 -- Thomas

 --
 ---
  Thomas Kapplerthomas.kapp...@isb-sib.ch
  Swiss Institute of Bioinformatics Tel: +41 22 379 51 89
  CMU, rue Michel Servet 1
  1211 Geneve 4
  Switzerland  http://www.uniprot.org
 ---

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




Re: AjaxSubmitLink + setResponsePage = feedback message problem on new page

2010-01-27 Thread Riyad Kalla
Igor, will FeedbackPanel correctly consume the messages from the session
scope and remove them -- or do you have to manually remove them once they've
been rendered?

On Wed, Jan 27, 2010 at 11:42 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 the problem is that there is a redirect between your calling info()
 and the feedback panel rendering. this is because thats the only way
 to do it in ajax  - issue a window.location=...

 if you are doing feedback messages across requests then use
 getsession().info(...)

 -igor

 On Wed, Jan 27, 2010 at 10:15 AM, Wayne Pope
 waynemailingli...@googlemail.com wrote:
  Hello all,
 
  Ok I cannot figure this one out.
  I have a  Page that contains a Form with a AjaxSubmitLink:
 
  AjaxSubmitLink submitLink= new AjaxSubmitLink(submitLink) {
 @Override
 protected void onSubmit(AjaxRequestTarget target,
 Form? form) {
 
 
  info(getString(admin.paymentSuccesfull));
 
  setResponsePage(Application.get().getHomePage());
 }
 
 @Override
 protected void onError(AjaxRequestTarget target,
 Form? form) {
 target.addComponent(feedback);
 }
 };
 
 
  On the home page I have a Panel that contains a FeedbackPanel - this
  feedback panel works fine when using elements on that page.
 
  However when submitting the form and displaying the home page I get
  the message in the logs:
 
  Component-targetted feedback message was left unrendered. This could
  be because you are missing a FeedbackPanel on the page.  Message:
  [FeedbackMessage message =  ...
 
  And the message is not displayed.
 
  Any ideas why wicket cannot find the feedback panel in the page? (its
  definitely there in a Panel)
 
  feedback panel is added as such:
  FeedbackPanel feedback = new FeedbackPanel(feedbackPanel);
  add(feedback);
 
 
  many thanks
  Wayne
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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




Re: images not under the context root directory

2010-01-27 Thread Riyad Kalla
This seems like adding a large amount of overhead to an image-heavy site
(e.g. image blog or something), I thought I read in Wicket in Action that
WicketFilter ignored HTTP requests for non-wicket resources now and passed
them through to the underlying server to handle avoiding the need to remap
your wicket URLs to something like /app/* so you could have /images and
other resources under root and not have them go through the filter.

Is this not the case?

On Wed, Jan 27, 2010 at 1:38 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Hi Francois,

 Following example works.

 1-Create this class anywhere you want need.

 package com.antilia.demo.manager.img;

 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;

 import org.apache.wicket.AttributeModifier;
 import org.apache.wicket.markup.html.image.Image;
 import org.apache.wicket.markup.html.image.resource.DynamicImageResource;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.protocol.http.WebApplication;
 import org.apache.wicket.protocol.http.WebRequestCycle;
 import org.apache.wicket.util.file.Folder;

 /**
  *
  * @author  Ernesto Reinaldo Barreiro (reier...@gmail.com)
  *
  */
 public abstract class MountedImageFactory {


 static int BUFFER_SIZE = 10*1024;
  /**
 * Copies one stream into the other..
  * @param is source Stream
  * @param os destination Stream
  * */
 static public void copy(InputStream is, OutputStream os) throws IOException
 {
 byte[] buf = new byte[BUFFER_SIZE];
 while (true) {
 int tam = is.read(buf);
 if (tam == -1) {
 return;
 }
 os.write(buf, 0, tam);
 }
 }
  public static  byte[] bytes(InputStream is) throws IOException {
 ByteArrayOutputStream out = new ByteArrayOutputStream();
 copy(is, out);
 return out.toByteArray();
 }
  private static ImageFromFolderWebResource dynamicResource;
  private static class ImageFromFolderWebResource extends
 DynamicImageResource {
  private static final long serialVersionUID = 1L;

  private File folder;
  public ImageFromFolderWebResource(File folder, String mountPoint) {
 this.folder = folder;
 WebApplication.get().getSharedResources().add(mountPoint, this);
 WebApplication.get().mountSharedResource(mountPoint,
 org.apache.wicket.Application/+mountPoint);
 }
  @Override
 protected byte[] getImageData() {
 try {
 String name = WebRequestCycle.get().getRequest().getParameter(name);
 return bytes(new FileInputStream(new File(getFolder().getAbsolutePath() +
 System.getProperty(file.separator)+(name;
 } catch (Exception e) {
 //TODO: do this properly
 return null;
 }
 }

 public File getFolder() {
 return folder;
 }
 }
  /**
  * @return Folder from where images will be retrieved.
  */
 protected abstract Folder getFolder();
  /**
  * @return the URL to mount the dynamic WEB resource.e.g.
  */
 protected abstract String getMountPoint();
  public Image createImage(String id, final String imageName) {
 if(dynamicResource == null)
 dynamicResource = new ImageFromFolderWebResource(getFolder(),
 getMountPoint());
 return new Image(id) {
  private static final long serialVersionUID = 1L;

 @Override
 protected void onBeforeRender() {
 String path = WebRequestCycle.get().getRequest().getURL();
 path = path.substring(0, path.indexOf('/'));
 add(new AttributeModifier(src,true, new
 ModelString(/+path+/+getMountPoint()+?name=+imageName)));
 super.onBeforeRender();
 }
 };
 }
 }

 2- Create a test page.

 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.image.Image;
 import org.apache.wicket.util.file.Folder;

 /**
  * @author  Ernesto Reinaldo Barreiro (reier...@gmail.com)
  *
  */
 public class TestPage extends WebPage {

 private static final MountedImageFactory IMAGE_FACTORY = new
 MountedImageFactory() {
  @Override
 protected Folder getFolder() {
 return new Folder(C:/temp/images);
 }
  @Override
 protected String getMountPoint() {
 return test;
 }
  };
  /**
  *
  */
 public TestPage() {
 Image img = IMAGE_FACTORY.createImage(img, test.png);
 add(img);
 }
 }

 and the HTML markup

 html xmlns:wicket=org.apache.wicket
 head/head
 body
img wicket:id=img alt=Test/
 /body
 /html

 3- If you place a test.png on your C:/temp/images then you should be
 able to see the image when you hit the page.

 Hope you can adapt this to your needs?

 Regards,

 Ernesto

 2010/1/27 François Meillet fm...@meillet.com

  Thank for yours posts.
  I try the solutions, but  I can't figure out how to serve images as
 static
  images.
  F.
 
  Le 27 janv. 2010 à 16:10, Thomas Kappler a écrit :
 
   On 01/27/10 15:57, Jonas wrote:
   Have you tried the following:
  
   WebComponent image = new WebComponent(someWicketId);
   image.add(new SimpleAttributeModifier(src, http://.jpg;));
   add(image);
  
   with markup
  
   img wicket:id=someWicketId /
  
  
   that should work just fine...
  
   if you cannot hardcode the 

Re: contributing components

2010-01-27 Thread Riyad Kalla
Sam,
Sounds like some pretty nice new components. Thanks for kicking those back
into the community.

R

On Jan 27, 2010 3:36 PM, Sam Barrow s...@sambarrow.com wrote:

I sent an email to this list the other day about releasing my wicket
component toolkit. Anybody know how to go about this?

I have some pretty interesting stuff, like a BeanPanel that displays a
bean's properties in a nice looking key:value format, and another one
that allows you to upload a file, but is abstracted so you can upload
from a file on the local computer or from a web URL.

My most innovative one accepts a list of files as input, and
automatically generates zip/tar.gz/tar.bz2 archive downloads. I'm sure
these will come in useful to many. If anybody knows how to go about this
please let me know.


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


Re: Image Bundler For Apache Wicket

2010-01-26 Thread Riyad Kalla
Very cool Anantha, do you have a site online that uses the bundler that we
could take a peek at as a running example?

On Tue, Jan 26, 2010 at 7:42 AM, Anantha Kumaran
ananthakuma...@gmail.comwrote:

 http://ananthakumaran.github.com/imagebundler-wicket



Re: Page load after an action

2010-01-26 Thread Riyad Kalla
Stephane,

I'll let someone smarter than me address the wicket issue of removing the
item from the ListView and seeing if that helps -- but is there a chance you
are using Hibernate and the Level 2 ehcache plugin or any 2nd-level caching
with your persistence code? I ask because I've seen code like this I don't
see my changes until the 2nd refresh! a lot with folks using 2nd level
caches and not seeing immediate persistence of those changes.

On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:


 Please find my code just below :


 public class NewsListPage  {

   protected static transient NewsDao myNewsDao;

   public NewsListPage() {
   PageableListViewNews news =
   new PageableListViewNews(list, new NewsModel(), 15){

   @Override
   protected void populateItem(final ListItemNews item) {
   ourLogger.debug(Getting item value
 +item.getModelObject().getTitle());

   News news = item.getModelObject();
 item.add(new Label(date, new
 Model(news.getDate(;
 LinkNews l = new LinkNews(edit){

   @Override
   public void onClick() {
   setResponsePage(new NewsPage(item.getModelObject()));
 }
 };

   item.add(l);
   l.add(new Label(title, news.getTitle()));

   item.add(new LinkNews(delete, new Model()){

   @Override
   public void onClick() {
   // TODO : check the refresh issue
   getNewsDao().delete(item.getModelObject());
   ourLogger.debug(News deleted);
 }
 });
 }

 };

   add(news);
   add(new OrPagingNavigator(navigator, news));
 add(new BookmarkablePageLinkVoid(add, NewsPage.class));

 }

   /**
* Model for the news List to load the news from the db each time
*
*/
   public class NewsModel extends LoadableDetachableModelListNews {

   @Override
   protected ListNews load() {
   ourLogger.debug(Loading all news);
   return new NewsDao().load();
   }


   }
  }



 Jeremy Thomerson a écrit :

  You're probably not using models correctly - specifically for your list
 view.  You could post some code, but make sure that you're reloading the
 data for the list view after the onClick is called and the item is
 deleted.

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



 On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:



 Hello,

 My page displays a list of items, for each of them, an icon is available
 to
 delete it. The action is managed in a Link.onClick() method.
 When I click on the link, the page is refreshed but the item is always in
 my list, I have to do refresh again manually the page to have a list
 wihtout
 this item.

 In the logs, it seems that the deletion in the onClick() method is called
 after the load of the page :(

 Somebody has an idea to avoid this manual refresh ?

 Thanks,

 Stéphane

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











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




Re: Page load after an action

2010-01-26 Thread Riyad Kalla
Seems weird to me as well that 'detach' has to be explicitly called. Also
still curious why Stephane was seeing the log ordering he did when the link
was clicked:


Loading all news
News deleted


I'd expect to see news deleted first, from his onClick handler then the
loading all news caused by the call to load() before the response was
sent -- in which case it seems he wouldn't have run into this issue in the
first place.

It's entirely possible I'm missing the wicket processing sequence here being
something else which would explain this.

On Tue, Jan 26, 2010 at 9:59 AM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:


 Thanks Pedro, it's ok now ;-)

 I use LoadableDetachableModel to avoid the call to detach() method. It does
 not seem that is the right way. Somebody can explain me why ?

 Stéphane


 Pedro Santos a écrit :

  by calling getDefaultModel inside onClick, you get an reference to the
 link
 component model. You need to detach the model on your list view. You has
 an
 reference to it on your variable news. So:
 news.getDefaultModel().detach()
 If you need, you can change that variable modifiers or turn it an instance
 variable for have acess to it inside your onClick implementation.

 On Tue, Jan 26, 2010 at 2:01 PM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:



 The behaviour is the same with the following code :(


  public void onClick() {
  // TODO : check the refresh issue
  getNewsDao().delete(item.getModelObject());
  ourLogger.debug(News deleted);
  getDefaultModel().detach();
}


 Pedro Santos a écrit :

  missing line: call detach method just after delete your item.


 On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos pedros...@gmail.com
 wrote:





 Call news.getDefaultModel().detach(), and look for more info about
 detachable models.

 http://cwiki.apache.org/WICKET/detachable-models.html

 On Tue, Jan 26, 2010 at 1:35 PM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:





 Hi,

 I don't use Hibernate. My persistence layer uses JDBC.

 What is strange when I click the delete link, it's the logs order :

 Loading all news
 News deleted

 So it seems that the deletion is done after the data reload :(

 Stéphane


 Riyad Kalla a écrit :

  Stephane,




 I'll let someone smarter than me address the wicket issue of removing
 the
 item from the ListView and seeing if that helps -- but is there a
 chance
 you
 are using Hibernate and the Level 2 ehcache plugin or any 2nd-level
 caching
 with your persistence code? I ask because I've seen code like this I
 don't
 see my changes until the 2nd refresh! a lot with folks using 2nd
 level
 caches and not seeing immediate persistence of those changes.

 On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:







 Please find my code just below :


 public class NewsListPage  {

  protected static transient NewsDao myNewsDao;

  public NewsListPage() {
PageableListViewNews news =
new PageableListViewNews(list, new NewsModel(), 15){

@Override
protected void populateItem(final ListItemNews item) {
ourLogger.debug(Getting item value
 +item.getModelObject().getTitle());

News news = item.getModelObject();
  item.add(new Label(date, new
 Model(news.getDate(;
  LinkNews l = new LinkNews(edit){

@Override
public void onClick() {
setResponsePage(new
 NewsPage(item.getModelObject()));
  }
 };

item.add(l);
l.add(new Label(title, news.getTitle()));

item.add(new LinkNews(delete, new Model()){

@Override
public void onClick() {
// TODO : check the refresh issue
getNewsDao().delete(item.getModelObject());
ourLogger.debug(News deleted);
  }
  });
  }

  };

add(news);
add(new OrPagingNavigator(navigator, news));
  add(new BookmarkablePageLinkVoid(add, NewsPage.class));

  }

  /**
  * Model for the news List to load the news from the db each time
  *
  */
  public class NewsModel extends LoadableDetachableModelListNews
 {

@Override
protected ListNews load() {
ourLogger.debug(Loading all news);
return new NewsDao().load();
}


  }
  }



 Jeremy Thomerson a écrit :

  You're probably not using models correctly - specifically for your
 list






 view.  You could post some code, but make sure that you're
 reloading
 the
 data for the list view after the onClick is called and the item is
 deleted.

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



 On Tue, Jan 26, 2010 at 8

Re: Should Duration be deprecated?

2010-01-26 Thread Riyad Kalla
... touche? :)

On Tue, Jan 26, 2010 at 2:00 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 i thought they were all stored as electrons

 -igor

 On Tue, Jan 26, 2010 at 12:00 PM, James Carman
 jcar...@carmanconsulting.com wrote:
  All data in Java is ultimately stored as some sort of primitive type.
 
  On Tue, Jan 26, 2010 at 2:55 PM, Jonathan Locke
  jonathan.lo...@gmail.com wrote:
 
 
  TimeUnit is icky and storing time values in primitive types is a bad
 idea.
 
 
  Alexandru Objelean wrote:
 
  I was wondering why would wicket need Duration class as long as java
  provides a similar TimeUnit. Maybe it would be a good idea to deprecate
  this
  class  encourage usage of TimeUnit?
 
  Alex Objelean
 
 
 
  --
  View this message in context:
 http://old.nabble.com/Should-Duration-be-deprecated--tp27323675p27328738.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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




Re: Image Bundler For Apache Wicket

2010-01-26 Thread Riyad Kalla
Just ran across another base64-based method of spriting images that
Cappuccino is using:
http://cappuccino.org/discuss/2009/11/11/just-one-file-with-cappuccino-0-8

pretty interesting and supports back to IE6. Just wanted to share incase
anyone else reading on this subject was curious about other techniques.

-R

On Tue, Jan 26, 2010 at 1:59 PM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 Looks cool - but rather than generating a static string, why don't you
 generate a string that includes a call to urlFor(Class, imageName) so that
 you can allow for internationalization? (Wicket will generate the proper
 internationalized URL for you this way)...

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



 On Tue, Jan 26, 2010 at 8:42 AM, Anantha Kumaran
 ananthakuma...@gmail.comwrote:

  http://ananthakumaran.github.com/imagebundler-wicket
 



Best way to create a Root Page that every page in your app extends

2008-08-06 Thread Riyad Kalla

Hey guys, having a major brain-fart today... I swear I had this figured out
at one point.

I essentially want to create a RootPage (extends WebPage) that represents
the root of every page in my app. It has an associated RootPage.html file
with it that has all the DOCTYPE stuff in it, sets all the meta-tags at the
top and page title, and right inside the body tags, it has a:

div wicket:id=pageBody/div

The idea being that every page that extends RootPage, would provide the
actual body of the page.

I know I can do this with Panels, in that every single sub-page would
actually supply a Panel with the id pageBody to be added, but I was
curious what the right way to do this is.


-- 
View this message in context: 
http://www.nabble.com/Best-way-to-create-a-%22Root-Page%22-that-every-page-in-your-app-extends-tp18853127p18853127.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: Best way to create a Root Page that every page in your app extends

2008-08-06 Thread Riyad Kalla

Igor,
Thanks for the reply, found the page (ref:
http://cwiki.apache.org/WICKET/markup-inheritance.html), read it, felt
really stupid, and am now happily making pages :)

I think I just got a little bamboozed with all the seemingly different ways
to do this, but MI is exactly the type of solution I was looking for.

Best,
Riyad


igor.vaynberg wrote:
 
 see markup inheritance page on the wiki
 
 -igor
 
 On Wed, Aug 6, 2008 at 8:01 AM, Riyad Kalla [EMAIL PROTECTED] wrote:

 Hey guys, having a major brain-fart today... I swear I had this figured
 out
 at one point.

 I essentially want to create a RootPage (extends WebPage) that represents
 the root of every page in my app. It has an associated RootPage.html file
 with it that has all the DOCTYPE stuff in it, sets all the meta-tags at
 the
 top and page title, and right inside the body tags, it has a:

 div wicket:id=pageBody/div

 The idea being that every page that extends RootPage, would provide the
 actual body of the page.

 I know I can do this with Panels, in that every single sub-page would
 actually supply a Panel with the id pageBody to be added, but I was
 curious what the right way to do this is.


 --
 View this message in context:
 http://www.nabble.com/Best-way-to-create-a-%22Root-Page%22-that-every-page-in-your-app-extends-tp18853127p18853127.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/Best-way-to-create-a-%22Root-Page%22-that-every-page-in-your-app-extends-tp18853127p18853506.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]