Markup inheritance and constructors call

2011-05-20 Thread Mathilde Pellerin
Hi all,

I am new in wicket and I encountering a problem with my Markup inheritance.
In my BasePage (that extends WebPage), I have a menu with some
BookmarkablePageLink :
ul class=blocklist
!-- MENU --
li wicket:id=accueilpageaAccueil/a/li
li wicket:id=e4npageaInfos E4N/a/li
li wicket:id=faqpageaFAQ/a/li
li wicket:id=contactpageaContact/a/li
!-- END MENU --
/ul

and for each link I have a code like this in my BasePage constructor :
final BookmarkablePageLinkVoid lienAccueil = new
BookmarkablePageLinkVoid(accueilpage, AccueilPage.class);
add(lienAccueil);

It works well.
But now, I want to add an attribute class to the menu selected. For example,
in the AccueilPage constructor, I add that :
WebMarkupContainer lienAccueil = new WebMarkupContainer(accueilpage);
lienAccueil.add(new SimpleAttributeModifier(class, selected-item));

but it doesn't work.
I found that BasePage constructor is called before AND after my AccueilPage
constructor. That's why the attribute class doesn't appear : it is added by
AccueilPage but then, it remove by BasePage constructor I guess.

So I wonder : why BasePage constructor is called after AccueilPage
constructor? What am I doing wrong?

Thanks

Kind regards,
Mathilde

-- 
*Mathilde Pellerin*
Ingénieur en développement de logiciel

STATLIFE
tel : 01.42.11.64.88
mail : mathilde.pelle...@statlife.fr


Re: Markup inheritance and constructors call

2011-05-20 Thread Martin Grigorov
It shouldn't be called as you described it.
Put a breakpoint in BasePage's constructor and see the thread stack.


On Fri, May 20, 2011 at 10:17 AM, Mathilde Pellerin 
mathilde.pelle...@statlife.fr wrote:

 Hi all,

 I am new in wicket and I encountering a problem with my Markup inheritance.
 In my BasePage (that extends WebPage), I have a menu with some
 BookmarkablePageLink :
 ul class=blocklist
!-- MENU --
li wicket:id=accueilpageaAccueil/a/li
li wicket:id=e4npageaInfos E4N/a/li
li wicket:id=faqpageaFAQ/a/li
li wicket:id=contactpageaContact/a/li
!-- END MENU --
 /ul

 and for each link I have a code like this in my BasePage constructor :
 final BookmarkablePageLinkVoid lienAccueil = new
 BookmarkablePageLinkVoid(accueilpage, AccueilPage.class);
 add(lienAccueil);

 It works well.
 But now, I want to add an attribute class to the menu selected. For
 example,
 in the AccueilPage constructor, I add that :
 WebMarkupContainer lienAccueil = new WebMarkupContainer(accueilpage);
 lienAccueil.add(new SimpleAttributeModifier(class, selected-item));

 but it doesn't work.
 I found that BasePage constructor is called before AND after my AccueilPage
 constructor. That's why the attribute class doesn't appear : it is added by
 AccueilPage but then, it remove by BasePage constructor I guess.

 So I wonder : why BasePage constructor is called after AccueilPage
 constructor? What am I doing wrong?

 Thanks

 Kind regards,
 Mathilde

 --
 *Mathilde Pellerin*
 Ingénieur en développement de logiciel

 STATLIFE
 tel : 01.42.11.64.88
 mail : mathilde.pelle...@statlife.fr




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: Markup inheritance and constructors call

2011-05-20 Thread Mathilde Pellerin
thanks for your answer.
You are right : the second call is not due to Accueil Page.
In fact, I have an error404 page which is called when user try an url that
is not in the application. I don't know why, but the ErrorPage constructor
is called each time that I follow a link.
This is the part of web.xml for error page :

filter-mapping
filter-namewicket.WicketWarp/filter-name
url-pattern/*/url-pattern
dispatcherREQUEST/dispatcher
dispatcherERROR/dispatcher
/filter-mapping

error-page
error-code404/error-code
location/error404/location
/error-page

Do you know how avoid this issue?




2011/5/20 Martin Grigorov mgrigo...@apache.org

 It shouldn't be called as you described it.
 Put a breakpoint in BasePage's constructor and see the thread stack.


 On Fri, May 20, 2011 at 10:17 AM, Mathilde Pellerin 
 mathilde.pelle...@statlife.fr wrote:

  Hi all,
 
  I am new in wicket and I encountering a problem with my Markup
 inheritance.
  In my BasePage (that extends WebPage), I have a menu with some
  BookmarkablePageLink :
  ul class=blocklist
 !-- MENU --
 li wicket:id=accueilpageaAccueil/a/li
 li wicket:id=e4npageaInfos E4N/a/li
 li wicket:id=faqpageaFAQ/a/li
 li wicket:id=contactpageaContact/a/li
 !-- END MENU --
  /ul
 
  and for each link I have a code like this in my BasePage constructor :
  final BookmarkablePageLinkVoid lienAccueil = new
  BookmarkablePageLinkVoid(accueilpage, AccueilPage.class);
  add(lienAccueil);
 
  It works well.
  But now, I want to add an attribute class to the menu selected. For
  example,
  in the AccueilPage constructor, I add that :
  WebMarkupContainer lienAccueil = new WebMarkupContainer(accueilpage);
  lienAccueil.add(new SimpleAttributeModifier(class, selected-item));
 
  but it doesn't work.
  I found that BasePage constructor is called before AND after my
 AccueilPage
  constructor. That's why the attribute class doesn't appear : it is added
 by
  AccueilPage but then, it remove by BasePage constructor I guess.
 
  So I wonder : why BasePage constructor is called after AccueilPage
  constructor? What am I doing wrong?
 
  Thanks
 
  Kind regards,
  Mathilde
 
  --
  *Mathilde Pellerin*
  Ingénieur en développement de logiciel
 
  STATLIFE
  tel : 01.42.11.64.88
  mail : mathilde.pelle...@statlife.fr
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com http://jweekend.com/




-- 
 Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
06.60.78.79.03   E-mail
: mathilde.pelle...@gmail.com   Mon CV en ligne :
http://www.mathilde-pellerin.fr/ http://www.mathilde-pellerin.fr/Mes
liens :  http://www.viadeo.com/fr/profile/mathilde.pellerin
http://fr.linkedin.com/in/mathildepellerin


Re: Markup inheritance and constructors call

2011-05-20 Thread Martin Grigorov
You have a resource with broken url. Some css/js/image cannot be found.

On Fri, May 20, 2011 at 11:00 AM, Mathilde Pellerin 
mathilde.pelle...@gmail.com wrote:

 thanks for your answer.
 You are right : the second call is not due to Accueil Page.
 In fact, I have an error404 page which is called when user try an url that
 is not in the application. I don't know why, but the ErrorPage constructor
 is called each time that I follow a link.
 This is the part of web.xml for error page :

filter-mapping
filter-namewicket.WicketWarp/filter-name
url-pattern/*/url-pattern
dispatcherREQUEST/dispatcher
dispatcherERROR/dispatcher
/filter-mapping

error-page
error-code404/error-code
location/error404/location
/error-page

 Do you know how avoid this issue?




 2011/5/20 Martin Grigorov mgrigo...@apache.org

  It shouldn't be called as you described it.
  Put a breakpoint in BasePage's constructor and see the thread stack.
 
 
  On Fri, May 20, 2011 at 10:17 AM, Mathilde Pellerin 
  mathilde.pelle...@statlife.fr wrote:
 
   Hi all,
  
   I am new in wicket and I encountering a problem with my Markup
  inheritance.
   In my BasePage (that extends WebPage), I have a menu with some
   BookmarkablePageLink :
   ul class=blocklist
  !-- MENU --
  li wicket:id=accueilpageaAccueil/a/li
  li wicket:id=e4npageaInfos E4N/a/li
  li wicket:id=faqpageaFAQ/a/li
  li wicket:id=contactpageaContact/a/li
  !-- END MENU --
   /ul
  
   and for each link I have a code like this in my BasePage constructor :
   final BookmarkablePageLinkVoid lienAccueil = new
   BookmarkablePageLinkVoid(accueilpage, AccueilPage.class);
   add(lienAccueil);
  
   It works well.
   But now, I want to add an attribute class to the menu selected. For
   example,
   in the AccueilPage constructor, I add that :
   WebMarkupContainer lienAccueil = new WebMarkupContainer(accueilpage);
   lienAccueil.add(new SimpleAttributeModifier(class, selected-item));
  
   but it doesn't work.
   I found that BasePage constructor is called before AND after my
  AccueilPage
   constructor. That's why the attribute class doesn't appear : it is
 added
  by
   AccueilPage but then, it remove by BasePage constructor I guess.
  
   So I wonder : why BasePage constructor is called after AccueilPage
   constructor? What am I doing wrong?
  
   Thanks
  
   Kind regards,
   Mathilde
  
   --
   *Mathilde Pellerin*
   Ingénieur en développement de logiciel
  
   STATLIFE
   tel : 01.42.11.64.88
   mail : mathilde.pelle...@statlife.fr
  
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com http://jweekend.com/
 



 --
  Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
 06.60.78.79.03   E-mail
 : mathilde.pelle...@gmail.com   Mon CV en ligne :
 http://www.mathilde-pellerin.fr/ http://www.mathilde-pellerin.fr/Mes
 liens :  http://www.viadeo.com/fr/profile/mathilde.pellerin
 http://fr.linkedin.com/in/mathildepellerin




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: Markup inheritance and constructors call

2011-05-20 Thread Mathilde Pellerin
You are right again : when I remove the css file of ma BasePage, errorPage
constructor is not called.

So, what is the good practice to declare style css file when you use Markup
Inheritance?
I thougth that put the link :
link rel=stylesheet href=styles.css type=text/css /

in the head of basePage was enougth, but visibly not...


2011/5/20 Martin Grigorov mgrigo...@apache.org

 You have a resource with broken url. Some css/js/image cannot be found.

 On Fri, May 20, 2011 at 11:00 AM, Mathilde Pellerin 
 mathilde.pelle...@gmail.com wrote:

  thanks for your answer.
  You are right : the second call is not due to Accueil Page.
  In fact, I have an error404 page which is called when user try an url
 that
  is not in the application. I don't know why, but the ErrorPage
 constructor
  is called each time that I follow a link.
  This is the part of web.xml for error page :
 
 filter-mapping
 filter-namewicket.WicketWarp/filter-name
 url-pattern/*/url-pattern
 dispatcherREQUEST/dispatcher
 dispatcherERROR/dispatcher
 /filter-mapping
 
 error-page
 error-code404/error-code
 location/error404/location
 /error-page
 
  Do you know how avoid this issue?
 
 
 
 
  2011/5/20 Martin Grigorov mgrigo...@apache.org
 
   It shouldn't be called as you described it.
   Put a breakpoint in BasePage's constructor and see the thread stack.
  
  
   On Fri, May 20, 2011 at 10:17 AM, Mathilde Pellerin 
   mathilde.pelle...@statlife.fr wrote:
  
Hi all,
   
I am new in wicket and I encountering a problem with my Markup
   inheritance.
In my BasePage (that extends WebPage), I have a menu with some
BookmarkablePageLink :
ul class=blocklist
   !-- MENU --
   li wicket:id=accueilpageaAccueil/a/li
   li wicket:id=e4npageaInfos E4N/a/li
   li wicket:id=faqpageaFAQ/a/li
   li wicket:id=contactpageaContact/a/li
   !-- END MENU --
/ul
   
and for each link I have a code like this in my BasePage constructor
 :
final BookmarkablePageLinkVoid lienAccueil = new
BookmarkablePageLinkVoid(accueilpage, AccueilPage.class);
add(lienAccueil);
   
It works well.
But now, I want to add an attribute class to the menu selected. For
example,
in the AccueilPage constructor, I add that :
WebMarkupContainer lienAccueil = new
 WebMarkupContainer(accueilpage);
lienAccueil.add(new SimpleAttributeModifier(class,
 selected-item));
   
but it doesn't work.
I found that BasePage constructor is called before AND after my
   AccueilPage
constructor. That's why the attribute class doesn't appear : it is
  added
   by
AccueilPage but then, it remove by BasePage constructor I guess.
   
So I wonder : why BasePage constructor is called after AccueilPage
constructor? What am I doing wrong?
   
Thanks
   
Kind regards,
Mathilde
   
--
*Mathilde Pellerin*
Ingénieur en développement de logiciel
   
STATLIFE
tel : 01.42.11.64.88
mail : mathilde.pelle...@statlife.fr
   
  
  
  
   --
   Martin Grigorov
   jWeekend
   Training, Consulting, Development
   http://jWeekend.com http://jweekend.com/
  
 
 
 
  --
   Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
  06.60.78.79.03   E-mail
  : mathilde.pelle...@gmail.com   Mon CV en ligne :
  http://www.mathilde-pellerin.fr/ http://www.mathilde-pellerin.fr/
  Mes
  liens :  http://www.viadeo.com/fr/profile/mathilde.pellerin
  http://fr.linkedin.com/in/mathildepellerin
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com http://jweekend.com/




-- 
 Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
06.60.78.79.03   E-mail
: mathilde.pelle...@gmail.com   Mon CV en ligne :
http://www.mathilde-pellerin.fr/ http://www.mathilde-pellerin.fr/Mes
liens :  http://www.viadeo.com/fr/profile/mathilde.pellerin
http://fr.linkedin.com/in/mathildepellerin


Re: Markup inheritance and constructors call

2011-05-20 Thread Martin Grigorov
where is located styles.css in the file system ?
it should either be in WEB-INF/ folder or you should use wicket:linklink
...//wicket:link

On Fri, May 20, 2011 at 11:27 AM, Mathilde Pellerin 
mathilde.pelle...@gmail.com wrote:

 You are right again : when I remove the css file of ma BasePage, errorPage
 constructor is not called.

 So, what is the good practice to declare style css file when you use Markup
 Inheritance?
 I thougth that put the link :
 link rel=stylesheet href=styles.css type=text/css /

 in the head of basePage was enougth, but visibly not...


 2011/5/20 Martin Grigorov mgrigo...@apache.org

  You have a resource with broken url. Some css/js/image cannot be found.
 
  On Fri, May 20, 2011 at 11:00 AM, Mathilde Pellerin 
  mathilde.pelle...@gmail.com wrote:
 
   thanks for your answer.
   You are right : the second call is not due to Accueil Page.
   In fact, I have an error404 page which is called when user try an url
  that
   is not in the application. I don't know why, but the ErrorPage
  constructor
   is called each time that I follow a link.
   This is the part of web.xml for error page :
  
  filter-mapping
  filter-namewicket.WicketWarp/filter-name
  url-pattern/*/url-pattern
  dispatcherREQUEST/dispatcher
  dispatcherERROR/dispatcher
  /filter-mapping
  
  error-page
  error-code404/error-code
  location/error404/location
  /error-page
  
   Do you know how avoid this issue?
  
  
  
  
   2011/5/20 Martin Grigorov mgrigo...@apache.org
  
It shouldn't be called as you described it.
Put a breakpoint in BasePage's constructor and see the thread stack.
   
   
On Fri, May 20, 2011 at 10:17 AM, Mathilde Pellerin 
mathilde.pelle...@statlife.fr wrote:
   
 Hi all,

 I am new in wicket and I encountering a problem with my Markup
inheritance.
 In my BasePage (that extends WebPage), I have a menu with some
 BookmarkablePageLink :
 ul class=blocklist
!-- MENU --
li wicket:id=accueilpageaAccueil/a/li
li wicket:id=e4npageaInfos E4N/a/li
li wicket:id=faqpageaFAQ/a/li
li wicket:id=contactpageaContact/a/li
!-- END MENU --
 /ul

 and for each link I have a code like this in my BasePage
 constructor
  :
 final BookmarkablePageLinkVoid lienAccueil = new
 BookmarkablePageLinkVoid(accueilpage, AccueilPage.class);
 add(lienAccueil);

 It works well.
 But now, I want to add an attribute class to the menu selected. For
 example,
 in the AccueilPage constructor, I add that :
 WebMarkupContainer lienAccueil = new
  WebMarkupContainer(accueilpage);
 lienAccueil.add(new SimpleAttributeModifier(class,
  selected-item));

 but it doesn't work.
 I found that BasePage constructor is called before AND after my
AccueilPage
 constructor. That's why the attribute class doesn't appear : it is
   added
by
 AccueilPage but then, it remove by BasePage constructor I guess.

 So I wonder : why BasePage constructor is called after AccueilPage
 constructor? What am I doing wrong?

 Thanks

 Kind regards,
 Mathilde

 --
 *Mathilde Pellerin*
 Ingénieur en développement de logiciel

 STATLIFE
 tel : 01.42.11.64.88
 mail : mathilde.pelle...@statlife.fr

   
   
   
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/
   
  
  
  
   --
Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
   06.60.78.79.03   E-mail
   : mathilde.pelle...@gmail.com   Mon CV en ligne :
   http://www.mathilde-pellerin.fr/ http://www.mathilde-pellerin.fr/
   Mes
   liens :  http://www.viadeo.com/fr/profile/mathilde.pellerin
   http://fr.linkedin.com/in/mathildepellerin
  
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com http://jweekend.com/
 



 --
  Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
 06.60.78.79.03   E-mail
 : mathilde.pelle...@gmail.com   Mon CV en ligne :
 http://www.mathilde-pellerin.fr/ http://www.mathilde-pellerin.fr/Mes
 liens :  http://www.viadeo.com/fr/profile/mathilde.pellerin
 http://fr.linkedin.com/in/mathildepellerin




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: Markup inheritance and constructors call

2011-05-20 Thread Mathilde Pellerin
it was in the webapp folder, so I put it in the WEB-INF folder and I put
images folder in the WEB-INF folder to, put the error page is still called.

I don't understand what happen cause css styles are visibly there in base
page and in extends pages.

this is my basePage head :
head
meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
link rel=stylesheet href=styles.css type=text/css /
titlePrototype E4N/title
/head

and my extends pages head:
head
titlePrototype E4N/title
/head

Put
link rel=stylesheet href=styles.css type=text/css /

in all extends pages head doesn't change anything.

maybe I have to use instead...
wicket:linklink ...//wicket:link
should these tag be use in all pages or only on basepage?




2011/5/20 Martin Grigorov mgrigo...@apache.org

 where is located styles.css in the file system ?
 it should either be in WEB-INF/ folder or you should use wicket:linklink
 ...//wicket:link

 On Fri, May 20, 2011 at 11:27 AM, Mathilde Pellerin 
 mathilde.pelle...@gmail.com wrote:

  You are right again : when I remove the css file of ma BasePage,
 errorPage
  constructor is not called.
 
  So, what is the good practice to declare style css file when you use
 Markup
  Inheritance?
  I thougth that put the link :
  link rel=stylesheet href=styles.css type=text/css /
 
  in the head of basePage was enougth, but visibly not...
 
 
  2011/5/20 Martin Grigorov mgrigo...@apache.org
 
   You have a resource with broken url. Some css/js/image cannot be found.
  
   On Fri, May 20, 2011 at 11:00 AM, Mathilde Pellerin 
   mathilde.pelle...@gmail.com wrote:
  
thanks for your answer.
You are right : the second call is not due to Accueil Page.
In fact, I have an error404 page which is called when user try an url
   that
is not in the application. I don't know why, but the ErrorPage
   constructor
is called each time that I follow a link.
This is the part of web.xml for error page :
   
   filter-mapping
   filter-namewicket.WicketWarp/filter-name
   url-pattern/*/url-pattern
   dispatcherREQUEST/dispatcher
   dispatcherERROR/dispatcher
   /filter-mapping
   
   error-page
   error-code404/error-code
   location/error404/location
   /error-page
   
Do you know how avoid this issue?
   
   
   
   
2011/5/20 Martin Grigorov mgrigo...@apache.org
   
 It shouldn't be called as you described it.
 Put a breakpoint in BasePage's constructor and see the thread
 stack.


 On Fri, May 20, 2011 at 10:17 AM, Mathilde Pellerin 
 mathilde.pelle...@statlife.fr wrote:

  Hi all,
 
  I am new in wicket and I encountering a problem with my Markup
 inheritance.
  In my BasePage (that extends WebPage), I have a menu with some
  BookmarkablePageLink :
  ul class=blocklist
 !-- MENU --
 li wicket:id=accueilpageaAccueil/a/li
 li wicket:id=e4npageaInfos E4N/a/li
 li wicket:id=faqpageaFAQ/a/li
 li wicket:id=contactpageaContact/a/li
 !-- END MENU --
  /ul
 
  and for each link I have a code like this in my BasePage
  constructor
   :
  final BookmarkablePageLinkVoid lienAccueil = new
  BookmarkablePageLinkVoid(accueilpage, AccueilPage.class);
  add(lienAccueil);
 
  It works well.
  But now, I want to add an attribute class to the menu selected.
 For
  example,
  in the AccueilPage constructor, I add that :
  WebMarkupContainer lienAccueil = new
   WebMarkupContainer(accueilpage);
  lienAccueil.add(new SimpleAttributeModifier(class,
   selected-item));
 
  but it doesn't work.
  I found that BasePage constructor is called before AND after my
 AccueilPage
  constructor. That's why the attribute class doesn't appear : it
 is
added
 by
  AccueilPage but then, it remove by BasePage constructor I guess.
 
  So I wonder : why BasePage constructor is called after
 AccueilPage
  constructor? What am I doing wrong?
 
  Thanks
 
  Kind regards,
  Mathilde
 
  --
  *Mathilde Pellerin*
  Ingénieur en développement de logiciel
 
  STATLIFE
  tel : 01.42.11.64.88
  mail : mathilde.pelle...@statlife.fr
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com http://jweekend.com/

   
   
   
--
 Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
06.60.78.79.03   E-mail
: mathilde.pelle...@gmail.com   Mon CV en ligne :
http://www.mathilde-pellerin.fr/ http://www.mathilde-pellerin.fr/
Mes
liens :  http://www.viadeo.com/fr/profile/mathilde.pellerin
http://fr.linkedin.com/in/mathildepellerin
   
  
  
  
   --
   Martin Grigorov
   jWeekend
   Training, Consulting, Development
   http://jWeekend.com http://jweekend.com/
  
 
 
 
  --
   Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél 

Re: Markup inheritance and constructors call

2011-05-20 Thread Martin Grigorov
sorry. it should be next to WEB-INF/, not inside it.

On Fri, May 20, 2011 at 11:48 AM, Mathilde Pellerin 
mathilde.pelle...@gmail.com wrote:

 it was in the webapp folder, so I put it in the WEB-INF folder and I put
 images folder in the WEB-INF folder to, put the error page is still called.

 I don't understand what happen cause css styles are visibly there in base
 page and in extends pages.

 this is my basePage head :
 head
 meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
 link rel=stylesheet href=styles.css type=text/css /
 titlePrototype E4N/title
 /head

 and my extends pages head:
 head
 titlePrototype E4N/title
 /head

 Put
 link rel=stylesheet href=styles.css type=text/css /

 in all extends pages head doesn't change anything.

 maybe I have to use instead...
 wicket:linklink ...//wicket:link
 should these tag be use in all pages or only on basepage?




 2011/5/20 Martin Grigorov mgrigo...@apache.org

  where is located styles.css in the file system ?
  it should either be in WEB-INF/ folder or you should use
 wicket:linklink
  ...//wicket:link
 
  On Fri, May 20, 2011 at 11:27 AM, Mathilde Pellerin 
  mathilde.pelle...@gmail.com wrote:
 
   You are right again : when I remove the css file of ma BasePage,
  errorPage
   constructor is not called.
  
   So, what is the good practice to declare style css file when you use
  Markup
   Inheritance?
   I thougth that put the link :
   link rel=stylesheet href=styles.css type=text/css /
  
   in the head of basePage was enougth, but visibly not...
  
  
   2011/5/20 Martin Grigorov mgrigo...@apache.org
  
You have a resource with broken url. Some css/js/image cannot be
 found.
   
On Fri, May 20, 2011 at 11:00 AM, Mathilde Pellerin 
mathilde.pelle...@gmail.com wrote:
   
 thanks for your answer.
 You are right : the second call is not due to Accueil Page.
 In fact, I have an error404 page which is called when user try an
 url
that
 is not in the application. I don't know why, but the ErrorPage
constructor
 is called each time that I follow a link.
 This is the part of web.xml for error page :

filter-mapping
filter-namewicket.WicketWarp/filter-name
url-pattern/*/url-pattern
dispatcherREQUEST/dispatcher
dispatcherERROR/dispatcher
/filter-mapping

error-page
error-code404/error-code
location/error404/location
/error-page

 Do you know how avoid this issue?




 2011/5/20 Martin Grigorov mgrigo...@apache.org

  It shouldn't be called as you described it.
  Put a breakpoint in BasePage's constructor and see the thread
  stack.
 
 
  On Fri, May 20, 2011 at 10:17 AM, Mathilde Pellerin 
  mathilde.pelle...@statlife.fr wrote:
 
   Hi all,
  
   I am new in wicket and I encountering a problem with my Markup
  inheritance.
   In my BasePage (that extends WebPage), I have a menu with some
   BookmarkablePageLink :
   ul class=blocklist
  !-- MENU --
  li wicket:id=accueilpageaAccueil/a/li
  li wicket:id=e4npageaInfos E4N/a/li
  li wicket:id=faqpageaFAQ/a/li
  li wicket:id=contactpageaContact/a/li
  !-- END MENU --
   /ul
  
   and for each link I have a code like this in my BasePage
   constructor
:
   final BookmarkablePageLinkVoid lienAccueil = new
   BookmarkablePageLinkVoid(accueilpage, AccueilPage.class);
   add(lienAccueil);
  
   It works well.
   But now, I want to add an attribute class to the menu selected.
  For
   example,
   in the AccueilPage constructor, I add that :
   WebMarkupContainer lienAccueil = new
WebMarkupContainer(accueilpage);
   lienAccueil.add(new SimpleAttributeModifier(class,
selected-item));
  
   but it doesn't work.
   I found that BasePage constructor is called before AND after my
  AccueilPage
   constructor. That's why the attribute class doesn't appear : it
  is
 added
  by
   AccueilPage but then, it remove by BasePage constructor I
 guess.
  
   So I wonder : why BasePage constructor is called after
  AccueilPage
   constructor? What am I doing wrong?
  
   Thanks
  
   Kind regards,
   Mathilde
  
   --
   *Mathilde Pellerin*
   Ingénieur en développement de logiciel
  
   STATLIFE
   tel : 01.42.11.64.88
   mail : mathilde.pelle...@statlife.fr
  
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com http://jweekend.com/
 



 --
  Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
 06.60.78.79.03   E-mail
 : mathilde.pelle...@gmail.com   Mon CV en ligne :
 http://www.mathilde-pellerin.fr/
 http://www.mathilde-pellerin.fr/
 Mes
 

Re: Markup inheritance and constructors call

2011-05-20 Thread Martin Grigorov
On Fri, May 20, 2011 at 11:48 AM, Mathilde Pellerin 
mathilde.pelle...@gmail.com wrote:

 it was in the webapp folder, so I put it in the WEB-INF folder and I put
 images folder in the WEB-INF folder to, put the error page is still called.

 I don't understand what happen cause css styles are visibly there in base
 page and in extends pages.

 this is my basePage head :
 head
 meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
 link rel=stylesheet href=styles.css type=text/css /
 titlePrototype E4N/title
 /head

 and my extends pages head:
 head
 titlePrototype E4N/title
 /head

 Put
 link rel=stylesheet href=styles.css type=text/css /

 in all extends pages head doesn't change anything.

 maybe I have to use instead...
 wicket:linklink ...//wicket:link
 should these tag be use in all pages or only on basepage?

 Only in the base page.
All inherited pages should use wicket:head if they want to donate to the
header.
Change the url to href=/styles.css. This way it will work. But this is
application specific and depends on the filter path you use in your web.xml.
If you want to make it independent then you should put the .css file next to
MyPage.html and use Wicket's ResourceReference to put it in the header.




 2011/5/20 Martin Grigorov mgrigo...@apache.org

  where is located styles.css in the file system ?
  it should either be in WEB-INF/ folder or you should use
 wicket:linklink
  ...//wicket:link
 
  On Fri, May 20, 2011 at 11:27 AM, Mathilde Pellerin 
  mathilde.pelle...@gmail.com wrote:
 
   You are right again : when I remove the css file of ma BasePage,
  errorPage
   constructor is not called.
  
   So, what is the good practice to declare style css file when you use
  Markup
   Inheritance?
   I thougth that put the link :
   link rel=stylesheet href=styles.css type=text/css /
  
   in the head of basePage was enougth, but visibly not...
  
  
   2011/5/20 Martin Grigorov mgrigo...@apache.org
  
You have a resource with broken url. Some css/js/image cannot be
 found.
   
On Fri, May 20, 2011 at 11:00 AM, Mathilde Pellerin 
mathilde.pelle...@gmail.com wrote:
   
 thanks for your answer.
 You are right : the second call is not due to Accueil Page.
 In fact, I have an error404 page which is called when user try an
 url
that
 is not in the application. I don't know why, but the ErrorPage
constructor
 is called each time that I follow a link.
 This is the part of web.xml for error page :

filter-mapping
filter-namewicket.WicketWarp/filter-name
url-pattern/*/url-pattern
dispatcherREQUEST/dispatcher
dispatcherERROR/dispatcher
/filter-mapping

error-page
error-code404/error-code
location/error404/location
/error-page

 Do you know how avoid this issue?




 2011/5/20 Martin Grigorov mgrigo...@apache.org

  It shouldn't be called as you described it.
  Put a breakpoint in BasePage's constructor and see the thread
  stack.
 
 
  On Fri, May 20, 2011 at 10:17 AM, Mathilde Pellerin 
  mathilde.pelle...@statlife.fr wrote:
 
   Hi all,
  
   I am new in wicket and I encountering a problem with my Markup
  inheritance.
   In my BasePage (that extends WebPage), I have a menu with some
   BookmarkablePageLink :
   ul class=blocklist
  !-- MENU --
  li wicket:id=accueilpageaAccueil/a/li
  li wicket:id=e4npageaInfos E4N/a/li
  li wicket:id=faqpageaFAQ/a/li
  li wicket:id=contactpageaContact/a/li
  !-- END MENU --
   /ul
  
   and for each link I have a code like this in my BasePage
   constructor
:
   final BookmarkablePageLinkVoid lienAccueil = new
   BookmarkablePageLinkVoid(accueilpage, AccueilPage.class);
   add(lienAccueil);
  
   It works well.
   But now, I want to add an attribute class to the menu selected.
  For
   example,
   in the AccueilPage constructor, I add that :
   WebMarkupContainer lienAccueil = new
WebMarkupContainer(accueilpage);
   lienAccueil.add(new SimpleAttributeModifier(class,
selected-item));
  
   but it doesn't work.
   I found that BasePage constructor is called before AND after my
  AccueilPage
   constructor. That's why the attribute class doesn't appear : it
  is
 added
  by
   AccueilPage but then, it remove by BasePage constructor I
 guess.
  
   So I wonder : why BasePage constructor is called after
  AccueilPage
   constructor? What am I doing wrong?
  
   Thanks
  
   Kind regards,
   Mathilde
  
   --
   *Mathilde Pellerin*
   Ingénieur en développement de logiciel
  
   STATLIFE
   tel : 01.42.11.64.88
   mail : mathilde.pelle...@statlife.fr
  
 
 
 
  --
  Martin Grigorov
  jWeekend

Re: Markup inheritance and constructors call

2011-05-20 Thread Mathilde Pellerin
OK, I tried /style.css but it didn't work : style is apply but error page
is called (maybe for images used in style.css?)

So, I try to implement the other solution.
I found example on the wiki (
https://cwiki.apache.org/WICKET/including-css-resources.html). I try with
wicket:head
  wicket:link
link rel=stylesheet type=text/css href=style.css/
  /wicket:link
/wicket:head
on basePage.html, but style is not apply and error page still called.

so I try the other solution : I remove wicket:head block and I add

add(CSSPackageResource.getHeaderContribution(BasePageVisiteur.class,
style.css));

in BasePage.java constructor, but style is not apply, error page still
called, and there is this warning message in Eclipse console :
WARN  - PackageResource- Unable to find package resource [path =
fr/statlife/protoE4N/style.css, style = null, locale = null]

So I do not the right thing, and I am pretty lost... I'm sorry cause it's
certainly very simple to do that. I don't understand what am I doing wrong.


2011/5/20 Martin Grigorov mgrigo...@apache.org

 On Fri, May 20, 2011 at 11:48 AM, Mathilde Pellerin 
 mathilde.pelle...@gmail.com wrote:

  it was in the webapp folder, so I put it in the WEB-INF folder and I put
  images folder in the WEB-INF folder to, put the error page is still
 called.
 
  I don't understand what happen cause css styles are visibly there in base
  page and in extends pages.
 
  this is my basePage head :
  head
  meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
  link rel=stylesheet href=styles.css type=text/css /
  titlePrototype E4N/title
  /head
 
  and my extends pages head:
  head
  titlePrototype E4N/title
  /head
 
  Put
  link rel=stylesheet href=styles.css type=text/css /
 
  in all extends pages head doesn't change anything.
 
  maybe I have to use instead...
  wicket:linklink ...//wicket:link
  should these tag be use in all pages or only on basepage?
 
  Only in the base page.
 All inherited pages should use wicket:head if they want to donate to the
 header.
 Change the url to href=/styles.css. This way it will work. But this is
 application specific and depends on the filter path you use in your
 web.xml.
 If you want to make it independent then you should put the .css file next
 to
 MyPage.html and use Wicket's ResourceReference to put it in the header.




Re: Markup inheritance and constructors call

2011-05-20 Thread Martin Grigorov
1. the images in .css should use relative urls to the .css file.
For beginning put .css and the images in the same folder and reference them
with url('someImage.png')

2. Did you move style(s).css in fr/statlife/protoE4N/ folder ?
If you use Wicket's resources then you should put the .css (and the images)
next to the component's .class/.html files

Using  add(CSSPackageResource.getHeaderContribution(BasePageVisiteur.class,
style.css));
means that style.css should be next to BasePageVisiteur.class in the
classpath. Ensure your IDE copies the .css (and images) in the build path.

On Fri, May 20, 2011 at 12:44 PM, Mathilde Pellerin 
mathilde.pelle...@gmail.com wrote:

 OK, I tried /style.css but it didn't work : style is apply but error page
 is called (maybe for images used in style.css?)

 So, I try to implement the other solution.
 I found example on the wiki (
 https://cwiki.apache.org/WICKET/including-css-resources.html). I try with
 wicket:head
  wicket:link
link rel=stylesheet type=text/css href=style.css/
  /wicket:link
 /wicket:head
 on basePage.html, but style is not apply and error page still called.

 so I try the other solution : I remove wicket:head block and I add

add(CSSPackageResource.getHeaderContribution(BasePageVisiteur.class,
 style.css));

 in BasePage.java constructor, but style is not apply, error page still
 called, and there is this warning message in Eclipse console :
 WARN  - PackageResource- Unable to find package resource [path
 =
 fr/statlife/protoE4N/style.css, style = null, locale = null]

 So I do not the right thing, and I am pretty lost... I'm sorry cause it's
 certainly very simple to do that. I don't understand what am I doing wrong.


 2011/5/20 Martin Grigorov mgrigo...@apache.org

  On Fri, May 20, 2011 at 11:48 AM, Mathilde Pellerin 
  mathilde.pelle...@gmail.com wrote:
 
   it was in the webapp folder, so I put it in the WEB-INF folder and I
 put
   images folder in the WEB-INF folder to, put the error page is still
  called.
  
   I don't understand what happen cause css styles are visibly there in
 base
   page and in extends pages.
  
   this is my basePage head :
   head
   meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
   link rel=stylesheet href=styles.css type=text/css /
   titlePrototype E4N/title
   /head
  
   and my extends pages head:
   head
   titlePrototype E4N/title
   /head
  
   Put
   link rel=stylesheet href=styles.css type=text/css /
  
   in all extends pages head doesn't change anything.
  
   maybe I have to use instead...
   wicket:linklink ...//wicket:link
   should these tag be use in all pages or only on basepage?
  
   Only in the base page.
  All inherited pages should use wicket:head if they want to donate to
 the
  header.
  Change the url to href=/styles.css. This way it will work. But this is
  application specific and depends on the filter path you use in your
  web.xml.
  If you want to make it independent then you should put the .css file next
  to
  MyPage.html and use Wicket's ResourceReference to put it in the header.
 
 




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: Markup inheritance and constructors call

2011-05-20 Thread Mathilde Pellerin
OK, I found the problem : I used style.css instead of styles.css.
Now, .css and images folder are in the right place (next to BasePage.html in
the package) and they are in the class path.
Thanks to that configuration, when I tried, I had this warning message :
INFO  - haredResourceRequestTarget - shared resource
fr.statlife.protoE4N.BasePageVisiteur/images/content-bg.jpg not found or not
allowed access

and this is why I am in trouble since the beginning : in styles.css, there
was a link to an image that it is not in the images folder. So I remove this
link and try again and now it works :)

Thanks a lot for your help !!

I have a second question : how add a class style to my bookMarkableLink only
when it in use?
I try to add

WebMarkupContainer lienAccueil = new
WebMarkupContainer(accueilpage);
lienAccueil.add(new SimpleAttributeModifier(class,
selected-item));

in the AccueilPage constructor, but it doesn't work : the class attribute is
not add to accueilpage markup...



2011/5/20 Martin Grigorov mgrigo...@apache.org

 1. the images in .css should use relative urls to the .css file.
 For beginning put .css and the images in the same folder and reference them
 with url('someImage.png')

 2. Did you move style(s).css in fr/statlife/protoE4N/ folder ?
 If you use Wicket's resources then you should put the .css (and the images)
 next to the component's .class/.html files

 Using  add(CSSPackageResource.getHeaderContribution(BasePageVisiteur.class,
 style.css));
 means that style.css should be next to BasePageVisiteur.class in the
 classpath. Ensure your IDE copies the .css (and images) in the build path.

 On Fri, May 20, 2011 at 12:44 PM, Mathilde Pellerin 
 mathilde.pelle...@gmail.com wrote:

  OK, I tried /style.css but it didn't work : style is apply but error
 page
  is called (maybe for images used in style.css?)
 
  So, I try to implement the other solution.
  I found example on the wiki (
  https://cwiki.apache.org/WICKET/including-css-resources.html). I try
 with
  wicket:head
   wicket:link
 link rel=stylesheet type=text/css href=style.css/
   /wicket:link
  /wicket:head
  on basePage.html, but style is not apply and error page still called.
 
  so I try the other solution : I remove wicket:head block and I add
 
 
  add(CSSPackageResource.getHeaderContribution(BasePageVisiteur.class,
  style.css));
 
  in BasePage.java constructor, but style is not apply, error page still
  called, and there is this warning message in Eclipse console :
  WARN  - PackageResource- Unable to find package resource
 [path
  =
  fr/statlife/protoE4N/style.css, style = null, locale = null]
 
  So I do not the right thing, and I am pretty lost... I'm sorry cause it's
  certainly very simple to do that. I don't understand what am I doing
 wrong.
 
 
  2011/5/20 Martin Grigorov mgrigo...@apache.org
 
   On Fri, May 20, 2011 at 11:48 AM, Mathilde Pellerin 
   mathilde.pelle...@gmail.com wrote:
  
it was in the webapp folder, so I put it in the WEB-INF folder and I
  put
images folder in the WEB-INF folder to, put the error page is still
   called.
   
I don't understand what happen cause css styles are visibly there in
  base
page and in extends pages.
   
this is my basePage head :
head
meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
link rel=stylesheet href=styles.css type=text/css /
titlePrototype E4N/title
/head
   
and my extends pages head:
head
titlePrototype E4N/title
/head
   
Put
link rel=stylesheet href=styles.css type=text/css /
   
in all extends pages head doesn't change anything.
   
maybe I have to use instead...
wicket:linklink ...//wicket:link
should these tag be use in all pages or only on basepage?
   
Only in the base page.
   All inherited pages should use wicket:head if they want to donate to
  the
   header.
   Change the url to href=/styles.css. This way it will work. But this
 is
   application specific and depends on the filter path you use in your
   web.xml.
   If you want to make it independent then you should put the .css file
 next
   to
   MyPage.html and use Wicket's ResourceReference to put it in the header.
  
  
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com http://jweekend.com/




-- 
 Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
06.60.78.79.03   E-mail
: mathilde.pelle...@gmail.com   Mon CV en ligne :
http://www.mathilde-pellerin.fr/ http://www.mathilde-pellerin.fr/Mes
liens :  http://www.viadeo.com/fr/profile/mathilde.pellerin
http://fr.linkedin.com/in/mathildepellerin


Re: Wicket Cookbook - preventing multiple form submits

2011-05-20 Thread lucast
Hi Andrea,
As you have suggested, on the SubmitOnceForm class, I've added two
variables, page reference and page relative path,
on calling process I get the copy the values:
public void process(IFormSubmittingComponent submittingComponent)
{
pageReference = getPage().getPageReference();
pageRelativePath = getPageRelativePath();
if (isAlreadyProcessed())...
 ..
   }
And I am now getToken has the returns those copied values:
private FormToken getToken()
{
return new FormToken(pageReference, pageRelativePath);
}

That is the exception thrown solved. Thank you very much for taking the
time. Seriously, I really appreciate it.
I still have the problem that when I click the save button, If I go back,
the fields are blank.
If I fill the fields again and navigate back and forth with the internet
browser arrows then the form fields keep their values.
I suspect it has something to do with the submit button. 
That's something I need to investigate further.
Cheers,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Cookbook-preventing-multiple-form-submits-tp3535159p3538263.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Apache Wicket Cookbook Published!

2011-05-20 Thread Mihai Postelnicu

I've just ordered a copy and already received the eBook ! :)

Thanks Igor !

Mihai

On 04/13/2011 07:43 PM, Igor Vaynberg wrote:

thanks! i am happy you are enjoying it!

-igor


On Wed, Apr 13, 2011 at 1:24 AM, lucastlucastol...@hotmail.com  wrote:

Hi Igor,
Congratulations on your new book. I have already got a copy and I have been
using it as reference from day 1. I particularly like the straightforward
structure: this is the scenario, this is how you implement it. It is very
well written.
I find the data tables section particularly useful as I'm implementing a
search functionality that will use data tables to list the results.
Great job and I thoroughly recommend the book.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Cookbook-Published-tp3406012p3446584.html
Sent from the Users forum mailing list archive at Nabble.com.

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



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




--

*Mihai Postelnicu*, Software Architect
*Development Gateway*
1889 F Street N.W. . Second Floor . Washington, D.C. 20006
(O) +40 780 979 313 . (M) +358 458 782 152 . (Skype) mihaipostelnicu
mposteln...@developmentgateway.org 
mailto:mposteln...@developmentgateway.org

www.developmentgateway.org http://www.developmentgateway.org/

Information Tools. Global Partnerships. Effective Aid.




wicket push startup error messages

2011-05-20 Thread Doug Leeper
Not sure if any anyone else has experienced this.

On startup of my wicket app...I get the following messages:

I searched the web and nothing I found was conclusive.

Any help would be appreciated.

java.lang.IllegalStateException: STATE!=START
at
org.mortbay.jetty.AbstractGenerator.setVersion(AbstractGenerator.java:319)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:870)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:558)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)


Then after that I consistently get the following:

java.lang.IllegalStateException: STREAM
at org.mortbay.jetty.Response.getWriter(Response.java:616)
at org.cometd.server.transport.JSONTransport.send(JSONTransport.java:71)
at
org.cometd.server.transport.LongPollingTransport.handle(LongPollingTransport.java:293)
at org.cometd.server.CometdServlet.service(CometdServlet.java:201)
at org.cometd.server.CometdServlet.service(CometdServlet.java:165)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:370)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)


Any idea what I need to do to rectify these?

Thanks in advance.

- Doug


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-push-startup-error-messages-tp3538871p3538871.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: wicket push startup error messages

2011-05-20 Thread Doug Leeper
Never mind.

I just found the cometd web site and the following post:

http://cometd.org/documentation/2.x/howtos/servlet-containers

I added to my web.xml:

filter
filter-namecontinuation/filter-name
   
filter-classorg.eclipse.jetty.continuation.ContinuationFilter/filter-class
/filter
filter-mapping
filter-namecontinuation/filter-name
url-pattern/cometd/*/url-pattern
/filter-mapping

and the messages disappeared.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-push-startup-error-messages-tp3538871p3538892.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket Cookbook - preventing multiple form submits

2011-05-20 Thread Andrea Del Bene

Your welcome lucast!

Don't hesitate to post again if you need more help or some other tricks.


Hi Andrea,
As you have suggested, on the SubmitOnceForm class, I've added two
variables, page reference and page relative path,
on calling process I get the copy the values:
public void process(IFormSubmittingComponent submittingComponent)
{
pageReference = getPage().getPageReference();
pageRelativePath = getPageRelativePath();
 if (isAlreadyProcessed())...
  ..
}
And I am now getToken has the returns those copied values:
private FormToken getToken()
{
return new FormToken(pageReference, pageRelativePath);
}

That is the exception thrown solved. Thank you very much for taking the
time. Seriously, I really appreciate it.
I still have the problem that when I click the save button, If I go back,
the fields are blank.
If I fill the fields again and navigate back and forth with the internet
browser arrows then the form fields keep their values.
I suspect it has something to do with the submit button.
That's something I need to investigate further.
Cheers,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Cookbook-preventing-multiple-form-submits-tp3535159p3538263.html
Sent from the Users forum mailing list archive at Nabble.com.

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






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



Re: Wicket Cookbook - preventing multiple form submits

2011-05-20 Thread Andrea Del Bene
By the way, I gave for granted that you move back from the view person 
panel to the create person one with browser 'back' button. Is it correct 
or do you use a specific link or button?

Hi Andrea,
As you have suggested, on the SubmitOnceForm class, I've added two
variables, page reference and page relative path,
on calling process I get the copy the values:
public void process(IFormSubmittingComponent submittingComponent)
{
pageReference = getPage().getPageReference();
pageRelativePath = getPageRelativePath();
 if (isAlreadyProcessed())...
  ..
}
And I am now getToken has the returns those copied values:
private FormToken getToken()
{
return new FormToken(pageReference, pageRelativePath);
}

That is the exception thrown solved. Thank you very much for taking the
time. Seriously, I really appreciate it.
I still have the problem that when I click the save button, If I go back,
the fields are blank.
If I fill the fields again and navigate back and forth with the internet
browser arrows then the form fields keep their values.
I suspect it has something to do with the submit button.
That's something I need to investigate further.
Cheers,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Cookbook-preventing-multiple-form-submits-tp3535159p3538263.html
Sent from the Users forum mailing list archive at Nabble.com.

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






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



Re: Set FeedbackPanel with Error from JavaScript?

2011-05-20 Thread eugenebalt
Thanks, which one is easier?

Are there any examples of how this would be done?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Set-FeedbackPanel-with-Error-from-JavaScript-tp3536164p3538940.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket Cookbook - preventing multiple form submits

2011-05-20 Thread lucast
Hi Andrea, 
That's correct, I move back from the view person panel to the create person
one with browser 'back' button.
Many thanks,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Cookbook-preventing-multiple-form-submits-tp3535159p3539086.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Set FeedbackPanel with Error from JavaScript?

2011-05-20 Thread eugenebalt
Sorry, but can someone help? This is pretty urgent.

I like the 2nd idea, it looks easier to implement. I need to issue an AJAX
request for the FeedbackPanel inside of JavaScript. The only thing is, I
haven't used AJAX by itself. Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Set-FeedbackPanel-with-Error-from-JavaScript-tp3536164p3539185.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket Cookbook - preventing multiple form submits

2011-05-20 Thread aladejebi
Is Wicket cookbook the most comprehensive wicket book around? Is it available 
in hard copy too?
Sent via my BlackBerry Device  from MTN

-Original Message-
From: Andrea Del Bene adelb...@ciseonweb.it
Date: Fri, 20 May 2011 18:08:06 
To: users@wicket.apache.org
Reply-To: users@wicket.apache.org
Subject: Re: Wicket Cookbook - preventing multiple form submits

By the way, I gave for granted that you move back from the view person 
panel to the create person one with browser 'back' button. Is it correct 
or do you use a specific link or button?
 Hi Andrea,
 As you have suggested, on the SubmitOnceForm class, I've added two
 variables, page reference and page relative path,
 on calling process I get the copy the values:
   public void process(IFormSubmittingComponent submittingComponent)
   {
   pageReference = getPage().getPageReference();
   pageRelativePath = getPageRelativePath();
  if (isAlreadyProcessed())...
   ..
 }
 And I am now getToken has the returns those copied values:
 private FormToken getToken()
   {
   return new FormToken(pageReference, pageRelativePath);
   }

 That is the exception thrown solved. Thank you very much for taking the
 time. Seriously, I really appreciate it.
 I still have the problem that when I click the save button, If I go back,
 the fields are blank.
 If I fill the fields again and navigate back and forth with the internet
 browser arrows then the form fields keep their values.
 I suspect it has something to do with the submit button.
 That's something I need to investigate further.
 Cheers,
 Lucas

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Cookbook-preventing-multiple-form-submits-tp3535159p3538263.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





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



Setting the value of a HiddenField from JavaScript

2011-05-20 Thread eugenebalt
Hi,

As was posted before, the FileUploadField resets its model on Submit. We
lose the user's input.

I need to save the user's input because, in case the file doesn't exist, the
error message has to mention it by name: File [XYZ] does not exist.

In JavaScript, I can easily get the user's input. I was trying to save it in
a Hidden Field:

document.getElementById('hiddenField').value =
document.getElementById('filename')

The problem is, this saving of the value doesn't propagate to Wicket. The
HiddenField in my model is NULL when the form goes to the Validation phase.
Does anyone know how I can propagate this value change to my model?

My problem is, I need to save the user's FileUpload Input no matter what,
and make this value available to Wicket.

Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Setting-the-value-of-a-HiddenField-from-JavaScript-tp3539234p3539234.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Setting the value of a HiddenField from JavaScript

2011-05-20 Thread eugenebalt
Working now, disregard. The HiddenField route works for saving the user's
input, I had a small mistake.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Setting-the-value-of-a-HiddenField-from-JavaScript-tp3539234p3539264.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket Cookbook - preventing multiple form submits

2011-05-20 Thread lucast
Hi Ayodeji,
The book is not an introduction to Wicket. It's for current users of Wicket.
I can personally say its a really good book and I wish it was published 5
months ago, at the beginning of my pet project.
you can find it in https://www.packtpub.com/ in hardcopy or electronic copy.
Amazon sells it too.
I recommend it.
Cheers,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Cookbook-preventing-multiple-form-submits-tp3535159p3539314.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Customize Validator Message based on Dynamic Variable

2011-05-20 Thread eugenebalt
In the Validators we override the method getResourceKey() to get a message
from .properties.

My problem is, my error message includes the value of a component on the
form. So I only know the full message AFTER I get to onValidate().

How can I construct the message string here? Is there a way to provide the
message right before issuing error() ?

Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Customize-Validator-Message-based-on-Dynamic-Variable-tp3539384p3539384.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Change Order (Priority) of Validator Msgs?

2011-05-20 Thread eugenebalt
How can I change the order (priority) of validator messages?

I have a Form-level validator and 3 Component-level validators. The
Form-level one is coming up on the bottom. I need to make it display first. 

I tried adding the Form after adding the validator on the Page, but that's
not working.

Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Change-Order-Priority-of-Validator-Msgs-tp3539436p3539436.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Big Brazilian e-Stores using Wicket

2011-05-20 Thread Bruno Borges
I've come to know that these websites are using Wicket on their mainstream
apps (not just intranet stuff):

- www.americanas.com.br  (go to this specific URL:
https://carrinho.nova.americanas.com.br/CustomerWeb/pages/Login and look at
the source for 'wicket')
- www.submarino.com.br
- www.shoptime.com.br

The first one is already in production and the laters are on final stage.

Wicket wins more portfolio. :-)

#FTW \o/

Cheers!!
*Bruno Borges*
www.brunoborges.com.br
+55 21 76727099


Re: Customize Validator Message based on Dynamic Variable

2011-05-20 Thread Clint Checketts
You could override the variablesMap() method to add in your values that the
message in the properties file contains:

Similar to the message: '${input}' isn't a valid widget.


-Clint

On Fri, May 20, 2011 at 2:34 PM, eugenebalt eugeneb...@yahoo.com wrote:

 In the Validators we override the method getResourceKey() to get a message
 from .properties.

 My problem is, my error message includes the value of a component on the
 form. So I only know the full message AFTER I get to onValidate().

 How can I construct the message string here? Is there a way to provide the
 message right before issuing error() ?

 Thanks

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Customize-Validator-Message-based-on-Dynamic-Variable-tp3539384p3539384.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: Set FeedbackPanel with Error from JavaScript?

2011-05-20 Thread Igor Vaynberg
class specialpanel extends feedbackpanel implements iheadercontributor {
  abstractdefaultajaxbehavior callback;
  public specialpanel() {
 callback=new abstractdefaultajaxbehavior() {
  getCallbackUrl(boolean active) {
  return super.getCallbackUrl+message='+message+'';
  }

  onevent(target) {
 string message=getrequest().getparameter(message);
 error(message);
 target.addcomponent(specialpanel.this);
  };
 add(callback);
   }
  onrenderhead(response) {
   response.renderjavascript(function report(message) {
+callback.getcallbackscript() + });
   }
  }


then in your js call report(message)

-igor

On Fri, May 20, 2011 at 11:04 AM, eugenebalt eugeneb...@yahoo.com wrote:
 Sorry, but can someone help? This is pretty urgent.

 I like the 2nd idea, it looks easier to implement. I need to issue an AJAX
 request for the FeedbackPanel inside of JavaScript. The only thing is, I
 haven't used AJAX by itself. Thanks

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Set-FeedbackPanel-with-Error-from-JavaScript-tp3536164p3539185.html
 Sent from the Users forum mailing list archive at Nabble.com.

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



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



Re: Big Brazilian e-Stores using Wicket

2011-05-20 Thread Jonathan Locke
Sweet!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Big-Brazilian-e-Stores-using-Wicket-tp3539473p3539633.html
Sent from the Users forum mailing list archive at Nabble.com.

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