Caching components

2010-03-24 Thread zkn
Hi,

since Wicket uses session to store the components hierarchy for a page is it 
possible to store parts of the hierarchy in the application context instead of 
the user session? If it's not possible do you consider it worth to add as 
feature request?

What's the idea: imagine a home page of a website where eventually for a short 
time of period( say 1 minute) the only dynamic component is a search form( and 
that's only in case the user hits search). The rest of the page consist of 
components that do not change for each user request - for example a block of 
news. If 100 users hit the page simultaneously they will actually see the same 
content in that block and there is nothing in that block that depends on the 
user session. The content may change in few minutes when a new article has been 
added. 

What if for example the developer has the option to make a component cacheable 
by implementing specific interface which will give the developer the option to 
use the cached version or render and possible store the new rendered component 
in cache? 

Seems like this can significantly improve performance in certain situations.

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



Re: Caching components

2010-03-24 Thread Jeremy Thomerson
Components are not thread safe, and not intended to be used in this way -
there would be a significant undertaking to make them cacheable, and the
cost of the synchronization would likely far outweigh the current costs of
component instantiation, etc...

Where you can make the biggest difference is caching your models.  If you
don't have to re-retrieve your model data, then you can get huge gains.

Of course, if you thoroughly do your performance testing and find that your
site really is so huge and has so much traffic that the extra instantiation
is hurting you, the way to go is caching the generated markup with a
frontend cache.

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



On Wed, Mar 24, 2010 at 2:15 AM, zkn z...@abv.bg wrote:

 Hi,

 since Wicket uses session to store the components hierarchy for a page is
 it possible to store parts of the hierarchy in the application context
 instead of the user session? If it's not possible do you consider it worth
 to add as feature request?

 What's the idea: imagine a home page of a website where eventually for a
 short time of period( say 1 minute) the only dynamic component is a search
 form( and that's only in case the user hits search). The rest of the page
 consist of components that do not change for each user request - for example
 a block of news. If 100 users hit the page simultaneously they will actually
 see the same content in that block and there is nothing in that block that
 depends on the user session. The content may change in few minutes when a
 new article has been added.

 What if for example the developer has the option to make a component
 cacheable by implementing specific interface which will give the developer
 the option to use the cached version or render and possible store the new
 rendered component in cache?

 Seems like this can significantly improve performance in certain
 situations.

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




Re: DEPLOYMENT PROBLEMS

2010-03-24 Thread Martijn Dashorst
Search the list, it has been brought up many times before.

Martijn

On Tue, Mar 23, 2010 at 10:56 PM, victorTrapiello vic...@trapiello.net wrote:

 Hello guys,

 I have finished my wicket application, with hibernate spring and postgresql
 for my database, I´m wodering wher I can deploy my appliucation, do you know
 any cheap hosting that offers me a good performance with java ie wicket
 hibernate, and also postgresql¿?


 Thank you very much guys

 Regards

 --
 View this message in context: 
 http://old.nabble.com/Required-Border...-tp28006887p28007709.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





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



Re: Caching components

2010-03-24 Thread Martin Sachs
hi,

we need caching of components, since the construction of huge
hierarchies is not cheap. The rendering ist fast. We cache the rendered
HTML of a hole component via a beheaviour and write them on the next
requests into a Label (unescaped). So instead of creating the complete
hierarchie on every request, we create a much smaller one. But you must
check, that the cachable components are stateless. Also we have JQuery
for client-effects in this components, this would also be cached.

The performance is much better with that: approx. 10-50 times better:
100ms with cache (the response time is not much depending on count
of users)
vs
1500 ms without cache depending how many parallel users.


in near feature i will announce the site officially here.

Martin


Jeremy Thomerson schrieb:
 Components are not thread safe, and not intended to be used in this way -
 there would be a significant undertaking to make them cacheable, and the
 cost of the synchronization would likely far outweigh the current costs of
 component instantiation, etc...

 Where you can make the biggest difference is caching your models.  If you
 don't have to re-retrieve your model data, then you can get huge gains.

 Of course, if you thoroughly do your performance testing and find that your
 site really is so huge and has so much traffic that the extra instantiation
 is hurting you, the way to go is caching the generated markup with a
 frontend cache.

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



 On Wed, Mar 24, 2010 at 2:15 AM, zkn z...@abv.bg wrote:

   
 Hi,

 since Wicket uses session to store the components hierarchy for a page is
 it possible to store parts of the hierarchy in the application context
 instead of the user session? If it's not possible do you consider it worth
 to add as feature request?

 What's the idea: imagine a home page of a website where eventually for a
 short time of period( say 1 minute) the only dynamic component is a search
 form( and that's only in case the user hits search). The rest of the page
 consist of components that do not change for each user request - for example
 a block of news. If 100 users hit the page simultaneously they will actually
 see the same content in that block and there is nothing in that block that
 depends on the user session. The content may change in few minutes when a
 new article has been added.

 What if for example the developer has the option to make a component
 cacheable by implementing specific interface which will give the developer
 the option to use the cached version or render and possible store the new
 rendered component in cache?

 Seems like this can significantly improve performance in certain
 situations.

 Regards,
 Ozkan
 -
 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



Strange DatePicker behavior (reset date to current)

2010-03-24 Thread Uladzimir
I use DatePicker enough easy way:
DateTextField dateTextField = new DateTextField( birthDate );
dateTextField.add( new DatePicker() {
@Override
protected boolean enableMonthYearSelection() {
return true;
}
 } );
I click on picker and select some date. It's Ok. Just I click next time -
the picker don't get previously selected date and reset date to current
(except year - year is correct). For example - I set date: 20.02.2005. Next
click and I have 24.03.2005 in the opened calendar. So I have to select date
again. 
I checked the example - http://wicketstuff.org/wicket/dates/
Example works absolutely correct. May be example uses old Wicket version?
Anybody has this problem?
I use Wicket 1.4.7
Thank you.



Resolved

2010-03-24 Thread Steamus

It was some javascript conflict. Early I used dynarch’s calendar and page
loaded calendar.js. When I removed old calendar.js the picker starts working
correct (expect problem with date 2000 for mask ‘’)
-- 
View this message in context: 
http://old.nabble.com/Strange-DatePicker-behavior-%28reset-date-to-current%29-tp28012471p28012642.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



feedbackpanel for component using ComponentFeedbackMessageFilter doesn't appear in Listview

2010-03-24 Thread ayman elwany
Hi All,


I had a reusable component which have a textfield with its feedback panel
 using ComponentFeedbackMessageFilter

add(new FeedbackPanel(firstFeedback, new
ComponentFeedbackMessageFilter(firstField)));

and it is working fine   but when  I put this component in a ListView the
feedback panel don't show any feedback messages as it supposed to do .

Any help???


DatePicker uses wrong date format

2010-03-24 Thread Tokalak Ahmet
Hi wicketians,

after updating to wicket 1.4.7 the DatePicker does not use the date format i 
passed to DateTextField any more:

form.add(new DateTextField(dateFilter.from, new 
PropertyModel(dateFilter, from), dd.MM.).setRequired(true).add(new 
DatePicker()));

Instead of dd.MM. the DatePicker uses  dd.MM.yy, only 2 digits for the 
year.

Regards


__
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen 
Massenmails. 
http://mail.yahoo.com 

Re: feedbackpanel for component using ComponentFeedbackMessageFilter doesn't appear in Listview

2010-03-24 Thread Pedro Santos
The ListView itens are rebuild every render. So the original field that you
made reference from the feedback filter, is longer presented by the
ListView. Take a look at
http://wicketinaction.com/2008/10/building-a-listeditor-form-component/
and the ListView.setReuseItems javadoc

On Wed, Mar 24, 2010 at 7:09 AM, ayman elwany aymanelw...@gmail.com wrote:

 Hi All,


 I had a reusable component which have a textfield with its feedback panel
  using ComponentFeedbackMessageFilter

 add(new FeedbackPanel(firstFeedback, new
 ComponentFeedbackMessageFilter(firstField)));

 and it is working fine   but when  I put this component in a ListView the
 feedback panel don't show any feedback messages as it supposed to do .

 Any help???




-- 
Pedro Henrique Oliveira dos Santos


Re: DatePicker uses wrong date format

2010-03-24 Thread Witold Czaplewski
see http://issues.apache.org/jira/browse/WICKET-2767

Regards,
Witold

Am Wed, 24 Mar 2010 10:39:49 + (GMT)
schrieb Tokalak Ahmet toka...@yahoo.de:

 Hi wicketians,
 
 after updating to wicket 1.4.7 the DatePicker does not use the date format i
 passed to DateTextField any more:
 
 form.add(new DateTextField(dateFilter.from, new
 PropertyModel(dateFilter, from), dd.MM.).setRequired(true).add(new
 DatePicker()));
 
 Instead of dd.MM. the DatePicker uses  dd.MM.yy, only 2 digits for
 the year.
 
 Regards
 
 
 __
 Do You Yahoo!?
 Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz
 gegen Massenmails. http://mail.yahoo.com 


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



Static files with Wicket and OSGi

2010-03-24 Thread Jaime Soriano Pastor
Hi,

I register a wicket application in an OSGi http service using for that
a WicketServlet with applicationClassName set to the name of my main
application class. My problem now is that I don't know how to serve
static files as CSS and so.
Is there any place used by default to contain the static files?
Could I mount a directory as a resource? How?
Or should I configure the resource locator in some way?

Many thanks in advance.


Jaime.

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



Re: Static files with Wicket and OSGi

2010-03-24 Thread Ernesto Reinaldo Barreiro
I see two options:

1-Use Wicket default machinery for serving resources (see
IResourceSettings).
2-Mount a dedicated servlet: the same way you register wicket servlet.

Ernesto

On Wed, Mar 24, 2010 at 12:19 PM, Jaime Soriano Pastor 
jsorianopas...@gmail.com wrote:

 Hi,

 I register a wicket application in an OSGi http service using for that
 a WicketServlet with applicationClassName set to the name of my main
 application class. My problem now is that I don't know how to serve
 static files as CSS and so.
 Is there any place used by default to contain the static files?
 Could I mount a directory as a resource? How?
 Or should I configure the resource locator in some way?

 Many thanks in advance.


 Jaime.

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




Re: Static files with Wicket and OSGi

2010-03-24 Thread Pedro Santos
Put then in the top-level directory of a web module.

http://java.sun.com/javaee/5/docs/tutorial/doc/bnadx.html#bnadz

A web module has a specific structure. The top-level directory of a web
module is the *document root* of the application. The document root is where
JSP pages, *client-side* classes and archives, and static web resources,
such as images, are stored.

On Wed, Mar 24, 2010 at 8:34 AM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 I see two options:

 1-Use Wicket default machinery for serving resources (see
 IResourceSettings).
 2-Mount a dedicated servlet: the same way you register wicket servlet.

 Ernesto

 On Wed, Mar 24, 2010 at 12:19 PM, Jaime Soriano Pastor 
 jsorianopas...@gmail.com wrote:

  Hi,
 
  I register a wicket application in an OSGi http service using for that
  a WicketServlet with applicationClassName set to the name of my main
  application class. My problem now is that I don't know how to serve
  static files as CSS and so.
  Is there any place used by default to contain the static files?
  Could I mount a directory as a resource? How?
  Or should I configure the resource locator in some way?
 
  Many thanks in advance.
 
 
  Jaime.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 




-- 
Pedro Henrique Oliveira dos Santos


Re: feedbackpanel for component using ComponentFeedbackMessageFilter doesn't appear in Listview

2010-03-24 Thread ayman elwany
Thx alot Pedro ,ListView.setReuseItems solved the problem

On Wed, Mar 24, 2010 at 12:54 PM, Pedro Santos pedros...@gmail.com wrote:

 The ListView itens are rebuild every render. So the original field that you
 made reference from the feedback filter, is longer presented by the
 ListView. Take a look at
 http://wicketinaction.com/2008/10/building-a-listeditor-form-component/
 and the ListView.setReuseItems javadoc

 On Wed, Mar 24, 2010 at 7:09 AM, ayman elwany aymanelw...@gmail.com
 wrote:

  Hi All,
 
 
  I had a reusable component which have a textfield with its feedback panel
   using ComponentFeedbackMessageFilter
 
  add(new FeedbackPanel(firstFeedback, new
  ComponentFeedbackMessageFilter(firstField)));
 
  and it is working fine   but when  I put this component in a ListView the
  feedback panel don't show any feedback messages as it supposed to do .
 
  Any help???
 



 --
 Pedro Henrique Oliveira dos Santos



Re: Static files with Wicket and OSGi

2010-03-24 Thread Ernesto Reinaldo Barreiro
*document root* on an OSGI environment?

Ernesto

On Wed, Mar 24, 2010 at 12:46 PM, Pedro Santos pedros...@gmail.com wrote:

 Put then in the top-level directory of a web module.

 http://java.sun.com/javaee/5/docs/tutorial/doc/bnadx.html#bnadz

 A web module has a specific structure. The top-level directory of a web
 module is the *document root* of the application. The document root is
 where
 JSP pages, *client-side* classes and archives, and static web resources,
 such as images, are stored.

 On Wed, Mar 24, 2010 at 8:34 AM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

  I see two options:
 
  1-Use Wicket default machinery for serving resources (see
  IResourceSettings).
  2-Mount a dedicated servlet: the same way you register wicket servlet.
 
  Ernesto
 
  On Wed, Mar 24, 2010 at 12:19 PM, Jaime Soriano Pastor 
  jsorianopas...@gmail.com wrote:
 
   Hi,
  
   I register a wicket application in an OSGi http service using for that
   a WicketServlet with applicationClassName set to the name of my main
   application class. My problem now is that I don't know how to serve
   static files as CSS and so.
   Is there any place used by default to contain the static files?
   Could I mount a directory as a resource? How?
   Or should I configure the resource locator in some way?
  
   Many thanks in advance.
  
  
   Jaime.
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 



 --
 Pedro Henrique Oliveira dos Santos



Re: Static files with Wicket and OSGi

2010-03-24 Thread Jaime Soriano Pastor
On Wed, Mar 24, 2010 at 12:57 PM, Ernesto Reinaldo Barreiro
reier...@gmail.com wrote:
 *document root* on an OSGI environment?

Yes, it's what I was just trying and it worked :)

Many thanks!

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



Re: Static files with Wicket and OSGi

2010-03-24 Thread Ernesto Reinaldo Barreiro
Are you using bridge servlet approach?

On Wed, Mar 24, 2010 at 12:59 PM, Jaime Soriano Pastor 
jsorianopas...@gmail.com wrote:

 On Wed, Mar 24, 2010 at 12:57 PM, Ernesto Reinaldo Barreiro
 reier...@gmail.com wrote:
  *document root* on an OSGI environment?
 
 Yes, it's what I was just trying and it worked :)

 Many thanks!

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




Re: Static files with Wicket and OSGi

2010-03-24 Thread Jaime Soriano Pastor
On Wed, Mar 24, 2010 at 1:05 PM, Ernesto Reinaldo Barreiro
reier...@gmail.com wrote:
 Are you using bridge servlet approach?

I don't think so... Is it needed to have several Servlets? I have only one.
What I do is to launch Apache Felix Http Jetty as implementation of
the OSGi HTTP service and register the wicket servlet from the
Activator on / using Apache Felix Http Whiteboard.

 On Wed, Mar 24, 2010 at 12:57 PM, Ernesto Reinaldo Barreiro
 reier...@gmail.com wrote:
  *document root* on an OSGI environment?
 
 Yes, it's what I was just trying and it worked :)

And.. I have just discovered that I can download any file in the
bundle (including .htmls, .classes...) as well as I can download the
CSSs...

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



Re: Static files with Wicket and OSGi

2010-03-24 Thread Ernesto Reinaldo Barreiro
Interesting but that is not the same as a document root as in mentioned
link. Isn't it? So, your document root is the root of the class-path?

Best,

Ernesto


On Wed, Mar 24, 2010 at 1:18 PM, Jaime Soriano Pastor 
jsorianopas...@gmail.com wrote:

 On Wed, Mar 24, 2010 at 1:05 PM, Ernesto Reinaldo Barreiro
 reier...@gmail.com wrote:
  Are you using bridge servlet approach?
 
 I don't think so... Is it needed to have several Servlets? I have only one.
 What I do is to launch Apache Felix Http Jetty as implementation of
 the OSGi HTTP service and register the wicket servlet from the
 Activator on / using Apache Felix Http Whiteboard.

  On Wed, Mar 24, 2010 at 12:57 PM, Ernesto Reinaldo Barreiro
  reier...@gmail.com wrote:
   *document root* on an OSGI environment?
  
  Yes, it's what I was just trying and it worked :)
 
 And.. I have just discovered that I can download any file in the
 bundle (including .htmls, .classes...) as well as I can download the
 CSSs...

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




Re: Static files with Wicket and OSGi

2010-03-24 Thread Ernesto Reinaldo Barreiro
Hi,

I have tried this with equinox and it works too. For instance I'm able to
read file

http://localhost:8080/hibernate.cfg.xml

which is on root of the class path. They are just served by
WicketServlet.fallback method.

Ernesto

On Wed, Mar 24, 2010 at 1:24 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Interesting but that is not the same as a document root as in mentioned
 link. Isn't it? So, your document root is the root of the class-path?

 Best,

 Ernesto



 On Wed, Mar 24, 2010 at 1:18 PM, Jaime Soriano Pastor 
 jsorianopas...@gmail.com wrote:

 On Wed, Mar 24, 2010 at 1:05 PM, Ernesto Reinaldo Barreiro
 reier...@gmail.com wrote:
  Are you using bridge servlet approach?
 
 I don't think so... Is it needed to have several Servlets? I have only
 one.
 What I do is to launch Apache Felix Http Jetty as implementation of
 the OSGi HTTP service and register the wicket servlet from the
 Activator on / using Apache Felix Http Whiteboard.

  On Wed, Mar 24, 2010 at 12:57 PM, Ernesto Reinaldo Barreiro
  reier...@gmail.com wrote:
   *document root* on an OSGI environment?
  
  Yes, it's what I was just trying and it worked :)
 
 And.. I have just discovered that I can download any file in the
 bundle (including .htmls, .classes...) as well as I can download the
 CSSs...

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





Re: Static files with Wicket and OSGi

2010-03-24 Thread Ernesto Reinaldo Barreiro
But it won't work if you mount the Servlet to something different than /.
E.g. mounting on /manager then

http://localhost:8080/manager/hibernate.cfg.xml

will not work. Just curious about what are the implications of mounting on
/ and what the OSGi specification says about this?

Ernesto

On Wed, Mar 24, 2010 at 1:33 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Hi,

 I have tried this with equinox and it works too. For instance I'm able to
 read file

 http://localhost:8080/hibernate.cfg.xml

 which is on root of the class path. They are just served by
 WicketServlet.fallback method.

 Ernesto


 On Wed, Mar 24, 2010 at 1:24 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

 Interesting but that is not the same as a document root as in mentioned
 link. Isn't it? So, your document root is the root of the class-path?

 Best,

 Ernesto



 On Wed, Mar 24, 2010 at 1:18 PM, Jaime Soriano Pastor 
 jsorianopas...@gmail.com wrote:

 On Wed, Mar 24, 2010 at 1:05 PM, Ernesto Reinaldo Barreiro
 reier...@gmail.com wrote:
  Are you using bridge servlet approach?
 
 I don't think so... Is it needed to have several Servlets? I have only
 one.
 What I do is to launch Apache Felix Http Jetty as implementation of
 the OSGi HTTP service and register the wicket servlet from the
 Activator on / using Apache Felix Http Whiteboard.

  On Wed, Mar 24, 2010 at 12:57 PM, Ernesto Reinaldo Barreiro
  reier...@gmail.com wrote:
   *document root* on an OSGI environment?
  
  Yes, it's what I was just trying and it worked :)
 
 And.. I have just discovered that I can download any file in the
 bundle (including .htmls, .classes...) as well as I can download the
 CSSs...

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






Re: Caching components

2010-03-24 Thread zkn

On 24.03.2010, at 09:23, Jeremy Thomerson wrote:

 Components are not thread safe, and not intended to be used in this way -
 there would be a significant undertaking to make them cacheable, and the
 cost of the synchronization would likely far outweigh the current costs of
 component instantiation, etc...

I see this could be a problem especially for with Java 1.4. With concurrency 
packages in Java 1.5  I believe this could easily be made thread safe with 
almost no cost for synchronization.

 
 Where you can make the biggest difference is caching your models.  If you
 don't have to re-retrieve your model data, then you can get huge gains.

Yes, but still keeping the rendered html for complex read-only components would 
be the fastest possible way.

 
 Of course, if you thoroughly do your performance testing and find that your
 site really is so huge and has so much traffic that the extra instantiation
 is hurting you, the way to go is caching the generated markup with a
 frontend cache.

I was first considering this approach especially with bookmarkable urls this 
could become beautiful. But would Wicket really allow using frontend cache 
cause it relies on user's session to handle form submits, ajax actions etc...?


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



Re: Required Border...

2010-03-24 Thread James Carman
Well, per the example in the forms with flair demo, I'm adding these
borders to my components on the fly using a visitor.  So, I don't
think the FormComponentFeedbackBorder thing will work, since I would
have to actually change the hierarchy by adding my component *to* the
border component (it doesn't implement IComponentBorder as required by
the setComponentBorder method).  Or, am I not understanding how to use
it (or something like it)?

On Tue, Mar 23, 2010 at 6:08 PM, TahitianGabriel glan...@piti.pf wrote:

 How about FormComponentFeedbackIndicator and FormComponentFeedbackBorder?
 Doesn't they fit your need? I think they worked with ajax.

 Gabriel.


 jwcarman wrote:

 Does anyone have a required border class (something that automatically
 puts a little red * next to a required field)?




 --
 View this message in context: 
 http://old.nabble.com/Required-Border...-tp28006887p28007855.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: Caching components

2010-03-24 Thread zkn
Thanks Martin!

If possible can you please give a hint how to use behavior to cache the 
rendered HTML for a component?

On 24.03.2010, at 10:26, Martin Sachs wrote:

 hi,
 
 we need caching of components, since the construction of huge
 hierarchies is not cheap. The rendering ist fast. We cache the rendered
 HTML of a hole component via a beheaviour and write them on the next
 requests into a Label (unescaped). So instead of creating the complete
 hierarchie on every request, we create a much smaller one. But you must
 check, that the cachable components are stateless. Also we have JQuery
 for client-effects in this components, this would also be cached.
 
 The performance is much better with that: approx. 10-50 times better:
100ms with cache (the response time is not much depending on count
 of users)
vs
1500 ms without cache depending how many parallel users.
 
 
 in near feature i will announce the site officially here.
 
 Martin


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



Feedback panel -- message resource bundle

2010-03-24 Thread ayman elwany
Hi all,

I update my feedback panel messages using wicketApplication.properties
 and  attach the message to the component path :


EXAMPLE :

Required=${label}
MinimumValidator=${label}
distributorForm.autoCompletePanel.borderOne.autoOne.Required=Do  Not Submit
Claim Without this field.
distributorForm.autoCompletePanel.borderOne.autoOne.MinimumValidator=value
must be  0.



I have 2 problems with this approach :

1- Difficulty in reusing messages  :  ex.  If I I want to reuse the the same
 validator message MinimumValidator in other 3 components I 'll have to copy
it 3 times for the other 3 compnents.

2- Message  Resource keys :

  a- more suitable and short keys instead of  using component path
as a key
  b- Reusing this key in any component in any other component in any
page


Any help


RE: RE: RE: Regarding TreeTable Horizontal Scrollbar

2010-03-24 Thread Vikash Shrivastava

Thanks to have your valuable reply  effort you made to answer my query. But 
let me to explain you again my problem statement because this solution won't 
help me to fix the issue I have. I need a CSS style at TreeTable markup level 
so that the Horizontal Scrollbar would be a part of TreeTable component. Here 
is my problem statement:

In my application, there are two scenarios: 

1) I need an entire table to be scrollable horizontally 
2) Horizontal scrolling on entire table except the tree node column.

Now I tried with changing both TreeTable markup  CSS attribute but couldn't 
get success. I am using wicket 1.4.5 version.

Actually the problem statement is, in my application, I need a TreeTable where 
first column should contain the data in a tree structure  rest others column 
will be the simple one. So, I used TreeTable wicket-extension component to get 
the requirement fulfill but the problem arises when table has many number of 
columns then the table should be horizontally scrollable. And as per my 
analysis, this existing treetable component doesn't provide this feature.

Could you please let me know that whether it's possible to customize component 
for above mentioned requirement? And if yes, then guide me to do this otherwise 
please let me know what would be the other approach.

Thanks  Regards
Vikash

-Original Message-
From: leo.erlands...@tyringe.com [mailto:leo.erlands...@tyringe.com] 
Sent: Thursday, March 18, 2010 3:19 PM
To: users@wicket.apache.org
Subject: Re: RE: RE: Regarding TreeTable Horizontal Scrollbar

 Anyone knows how to get the TreeTable Horizontal Scrollbar? If possible 
share the code snippet.
 Regards
 Vikash


Didn't you find any CSS Examples using Google?

This really is not a Wicket question, but a CSS question. However, I did a 
CSS Example for you.
Is this what you're looking for (click URL to see image)?

http://img514.imageshack.us/img514/1294/wicketscrollingtreetabl.jpg

It's all CSS. I took the Wicket TreeTable Example and added the following 
CSS (quick and dirty, there are more ways).
The magic is the CSS overflow-x: scroll;

wicket:head
style

div.my-tree  {
height: 20em;
width:1500px;
}

div.c {
width:1250px;
overflow-x: scroll;
}
/style
/wicket:head

wicket:extend
div class=c
div wicket:id=treeTable class=my-tree
/div
/div
/wicket:extend


iGATE is Ranked No. 1 in DQ-IDC best IT employer survey and Ranked No.2 
by Business Today-Mercer Human Resource Consulting-TNS  in a cross industry 
survey of Best Companies to work for in India
DISCLAIMER-
Information transmitted by this EMAIL is proprietary to iGATE Group of 
Companies and is intended for use only by the individual 
or entity to whom it is addressed and may contain information that is 
privileged, confidential, or exempt from disclosure under 
applicable law. If you are not the intended recipient of this EMAIL immediately 
notify the sender at iGATE or mailad...@igate.com 
and delete this EMAIL including any attachments


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



Re: Caching components

2010-03-24 Thread Antoine van Wel
Maybe this will get you started

http://twenty-six-wicket-tricks.googlecode.com/svn/trunk/twenty-six-wicket-tricks/src/main/java/com/locke/library/web/panels/caching/CachingPanel.java

After reading Jeremy's reply I think this code suffers some thread-safeness
issues though.


Antoine


On Wed, Mar 24, 2010 at 2:23 PM, zkn z...@abv.bg wrote:

 Thanks Martin!

 If possible can you please give a hint how to use behavior to cache the
 rendered HTML for a component?

 On 24.03.2010, at 10:26, Martin Sachs wrote:

  hi,
 
  we need caching of components, since the construction of huge
  hierarchies is not cheap. The rendering ist fast. We cache the rendered
  HTML of a hole component via a beheaviour and write them on the next
  requests into a Label (unescaped). So instead of creating the complete
  hierarchie on every request, we create a much smaller one. But you must
  check, that the cachable components are stateless. Also we have JQuery
  for client-effects in this components, this would also be cached.
 
  The performance is much better with that: approx. 10-50 times better:
 100ms with cache (the response time is not much depending on count
  of users)
 vs
 1500 ms without cache depending how many parallel users.
 
 
  in near feature i will announce the site officially here.
 
  Martin


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




Re: Static files with Wicket and OSGi

2010-03-24 Thread Jaime Soriano Pastor
Weird, I have also tried to register the application on /foo instead
of on / and, as you said, I cannot access to static files.
I haven't seen anything special about root alias on OSGi specification
(only that is the only alias allowed to end with /)

Jaime.

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



Re: Static files with Wicket and OSGi

2010-03-24 Thread Ernesto Reinaldo Barreiro
Haven't had time to check the specification but this behavior (mounting on
/) might pose a security risk as you can fetch invisible things form the
class path (e.g. configuration files containing sensitive information like
passwords). On the other hand I see HttpService class has a
registerResources method you could use to register static resources. Maybe
that is the one you need?

Ernesto



On Wed, Mar 24, 2010 at 2:59 PM, Jaime Soriano Pastor 
jsorianopas...@gmail.com wrote:

 Weird, I have also tried to register the application on /foo instead
 of on / and, as you said, I cannot access to static files.
 I haven't seen anything special about root alias on OSGi specification
 (only that is the only alias allowed to end with /)

 Jaime.

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




Re: Caching components

2010-03-24 Thread Jeremy Thomerson
On Wed, Mar 24, 2010 at 3:26 AM, Martin Sachs sachs.mar...@gmail.comwrote:

 hi,

 we need caching of components, since the construction of huge
 hierarchies is not cheap. The rendering ist fast. We cache the rendered
 HTML of a hole component via a beheaviour and write them on the next
 requests into a Label (unescaped). So instead of creating the complete
 hierarchie on every request, we create a much smaller one. But you must
 check, that the cachable components are stateless. Also we have JQuery
 for client-effects in this components, this would also be cached.

 The performance is much better with that: approx. 10-50 times better:
100ms with cache (the response time is not much depending on count
 of users)
vs
1500 ms without cache depending how many parallel user


A 15x gain is a big statement to make.  Can you please break this 1500ms
down into at least the following categories:

1 - time in IModel#getObject() and all child calls of this (IOW, loading
data)
2 - time in constructor of components (without loading data in the
constructor - hopefully you're not doing this)
3 - time in rendering of components

That would be a much better number to give other users.  I have NEVER seen
where creating / rendering components could take 1400ms - unless you're
doing something wrong like database calls in your component constructors.
 So, I suspect that most of that 1400ms (I would guess at least 1250ms) is
in your model loading.

The only time I've seen (or seen proof of) the component hierarchy actually
be the slow part of a Wicket page is if you were displaying a repeating view
of some sort with thousands of rows and each row had a bunch of components
in it - leading to tens of thousands of components being built in the
hierarchy.

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


Re: Static files with Wicket and OSGi

2010-03-24 Thread Jaime Soriano Pastor
On Wed, Mar 24, 2010 at 3:08 PM, Ernesto Reinaldo Barreiro
reier...@gmail.com wrote:
 Haven't had time to check the specification but this behavior (mounting on
 /) might pose a security risk as you can fetch invisible things form the
 class path (e.g. configuration files containing sensitive information like
 passwords). On the other hand I see HttpService class has a
 registerResources method you could use to register static resources. Maybe
 that is the one you need?

I'm using Whiteboard to register the application, so I don't have
access to the HttpService, I have discovered that Pax implementation
of whiteboard [0] can also publish resources, so I can use that to
control where I publish the static content. Anyway I'd still have the
security risk if I register the application in /.

[0] - Pax Whiteboard Extender -
http://wiki.ops4j.org/display/paxweb/Whiteboard+Extender

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



Choose One Text Without Property File?

2010-03-24 Thread Brad Grier
I'd like to be able to change the Choose One text for a DropDownChoice 
without using a property file. I have a dynamic form generator and I need the 
user to be able to designate the verbiage. Is this possible?

Thanks,
Brad

Re: Choose One Text Without Property File?

2010-03-24 Thread Matthias Keller

Hi Brad

You'd probably have to subclass DropDownChoice and override the method 
getDefaultChoice() to return whatever value you'd like.


Matt

On 2010-03-24 16:45, Brad Grier wrote:

I'd like to be able to change the Choose One text for a DropDownChoice 
without using a property file. I have a dynamic form generator and I need the user to be 
able to designate the verbiage. Is this possible?

Thanks,
Brad
   






smime.p7s
Description: S/MIME Cryptographic Signature


Re: Choose One Text Without Property File?

2010-03-24 Thread Pedro Santos
You can add to your application an Localizer that return the user designated
verbiage for the string key null

On Wed, Mar 24, 2010 at 12:51 PM, Matthias Keller
matthias.kel...@ergon.chwrote:

 Hi Brad

 You'd probably have to subclass DropDownChoice and override the method
 getDefaultChoice() to return whatever value you'd like.

 Matt


 On 2010-03-24 16:45, Brad Grier wrote:

 I'd like to be able to change the Choose One text for a DropDownChoice
 without using a property file. I have a dynamic form generator and I need
 the user to be able to designate the verbiage. Is this possible?

 Thanks,
 Brad








-- 
Pedro Henrique Oliveira dos Santos


Re: Feedback panel -- message resource bundle

2010-03-24 Thread ayman elwany
Any another approach that's help me to to use resources key instead of
companent path  key 

On Wed, Mar 24, 2010 at 3:26 PM, ayman elwany aymanelw...@gmail.com wrote:

 Hi all,

 I update my feedback panel messages using wicketApplication.properties
  and  attach the message to the component path :


 
 EXAMPLE :

 Required=${label}
 MinimumValidator=${label}
 distributorForm.autoCompletePanel.borderOne.autoOne.Required=Do  Not
 Submit Claim Without this field.
 distributorForm.autoCompletePanel.borderOne.autoOne.MinimumValidator=value
 must be  0.


 

 I have 2 problems with this approach :

 1- Difficulty in reusing messages  :  ex.  If I I want to reuse the the
 same  validator message MinimumValidator in other 3 components I 'll have to
 copy it 3 times for the other 3 compnents.

 2- Message  Resource keys :

   a- more suitable and short keys instead of  using component path
 as a key
   b- Reusing this key in any component in any other component in
 any page


 Any help





Re: Required Border...

2010-03-24 Thread TahitianGabriel

For FormComponentFeedbackBorder you'll have to change your hierarchy like
that :

HTML :
input type=text wicket:id=field

Java :
form.add(new FormComponentFeedbackBorder(border).add(new
TextField(field)));


Why can't you use FormComponentFeedbackIndicator so you can add it on the
fly :

HTML : 
input type=text wicket:id=field /

Java : 
RequiredTextFieldInteger field = new RequiredTextFieldInteger(field);
form.add(field);
final FormComponentFeedbackIndicator indicator = new
FormComponentFeedbackIndicator(indicator);
indicator.setOutputMarkupPlaceholderTag(true);
indicator.setIndicatorFor(field);
form.add(indicator);

Regards,

Gabriel.


James Carman-3 wrote:
 
 Well, per the example in the forms with flair demo, I'm adding these
 borders to my components on the fly using a visitor.  So, I don't
 think the FormComponentFeedbackBorder thing will work, since I would
 have to actually change the hierarchy by adding my component *to* the
 border component (it doesn't implement IComponentBorder as required by
 the setComponentBorder method).  Or, am I not understanding how to use
 it (or something like it)?
 

-- 
View this message in context: 
http://old.nabble.com/Required-Border...-tp28006887p28019255.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



Palette Problem

2010-03-24 Thread Josh Chappelle
Hi,

 

I'm having a problem that is about to drive me nuts. I have a Palette that
won't display the selected values. I am able to reproduce my problem with a
simple version so here it is:

 

ListString current = new ArrayListString();

current.add(ABC);

ListString available = new ArrayListString();

available.add(DEF);

available.add(123);



ChoiceRenderer renderer = new ChoiceRenderer()

{

 

@Override

public Object getDisplayValue(Object
object)

{

return object.toString();

}

 

@Override

public String getIdValue(Object object,
int index)

{

return object.toString();

}



};

 

new PaletteString(views, new Model((Serializable)current), new
Model((Serializable)available), renderer, 10, true);

 

When I add this Palette to a form it only displays DEF and 123 in the
available part. I can't get anything to show in the selected part.

 

Someone please help. 

 

Thanks,

 

Josh



Re: Wicketstuff versioning

2010-03-24 Thread nino martinez wael
 Yes, confluence is great, but a bit of useless since the spam-incident.
 I think the confluence is still full of with spammer users and
 spamcontents. Also the registration doesn't work, but this is an another
 issue. Nino, if I remember correctly, you can access confluence, right?
 Could you do something with these?
Yeah can acess confluence, but there are A LOT of spammer users, and I
gave up deleting them last time after using ½ an hour. I think it
would be easier using a sql connection and droping the spammer users
through there. What are you suggesting?

 Also TeamCity is failing lately, since there is some network error, and
 it cannot access the svn (Connection refused).

Hmmm we had that problem with bamboo too :/ Im not sure it's the same though..

2010/3/23 Major Péter majorpe...@sch.bme.hu:
 Hi,

 +1 on creating wicketstuff-core jira to coordinate release process.

 Here it is: http://wicketstuff.org/jira/secure/Dashboard.jspa

 +1 on creating a wicketstuff-core/wicketstuff-test module to share
 testing code between core projects.

 +1 on running integration tests to find run-time issues before release
 on the generated project artifacts (i.e. like selenium through maven
 integration-test phase).  I know this is hard but maybe a special
 profile in the pom to allow these extended quality checks to be run
 outside of a continuous integration environment prior to release.

 This testing would be really great, but I think this is more of a dream,
 rather then a real purpose right now. The project maintainers are doing
 their work in their freetime, making them mandatory to create testcases,
 may scare them, because they don't have the time to maintain those too.

 +1 improving the wicketstuff developer wiki with details on how the
 release process works  (I'm volunteering)

 Yes, confluence is great, but a bit of useless since the spam-incident.
 I think the confluence is still full of with spammer users and
 spamcontents. Also the registration doesn't work, but this is an another
 issue. Nino, if I remember correctly, you can access confluence, right?
 Could you do something with these?

 Also TeamCity is failing lately, since there is some network error, and
 it cannot access the svn (Connection refused).

 Thanks,
 Peter

 -
 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



Spring problems

2010-03-24 Thread Eric Reagan
I am trying to setup a spring application and I can't seam to get past a
NoWebApplicationContext found.

I have followed the online tutorials (and the example code from the 1.4.7
directory) and I am still not having any luck.

In my web.xml file I have


servlet
servlet-nameservlet/servlet-name

servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class
init-param
param-nameapplicationFactoryClassName/param-name

param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
/init-param
load-on-startup1/load-on-startup
/servlet


context-param
param-namecontextConfigLocation/param-name
param-value/WEB-INF/springContext.xml/param-value
/context-param



in my springContext.xml file I have
   bead id=wicketApp class=pathToMyApplication /

and in my WebApplication file I have the generic default constructor

...
init()
getDebugSettings().setDevelopmentUtilitiesEnabled(true);
addComponentInstantiationListener(new
SpringComponentInjector(this));

Is there something I am missing in setting up Wicket and Spring?

thank you for the help.
-- 
Eric Reagan


Re: Spring problems

2010-03-24 Thread Martin Phee
The SpringWebApplicationFactory is the to create the WebApplicaiton.   
You still need to setup spring properly.


 context-param
param-namecontextConfigLocation/param-name
param-value
classpath:spring-annotation.xml
classpath:spring-hibernate.xml
classpath:spring-resources.xml
classpath:spring-security.xml
classpath:spring-mail.xml
/param-value
/context-param


listener
listener-classorg.springframework.web.context.ContextLoaderListener 
/listener-class

/listener
listener
listener-classorg.springframework.web.context.request.RequestContextListener 
/listener-class

/listener


On Mar 24, 2010, at 2:29 PM, Eric Reagan wrote:

I am trying to setup a spring application and I can't seam to get  
past a

NoWebApplicationContext found.

I have followed the online tutorials (and the example code from the  
1.4.7

directory) and I am still not having any luck.

In my web.xml file I have


   servlet
   servlet-nameservlet/servlet-name

servlet-classorg.apache.wicket.protocol.http.WicketServlet/ 
servlet-class

   init-param
   param-nameapplicationFactoryClassName/param-name

param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/ 
param-value

   /init-param
   load-on-startup1/load-on-startup
   /servlet


   context-param
   param-namecontextConfigLocation/param-name
   param-value/WEB-INF/springContext.xml/param-value
   /context-param



in my springContext.xml file I have
  bead id=wicketApp class=pathToMyApplication /

and in my WebApplication file I have the generic default constructor

...
init()
   getDebugSettings().setDevelopmentUtilitiesEnabled(true);
   addComponentInstantiationListener(new
SpringComponentInjector(this));

Is there something I am missing in setting up Wicket and Spring?

thank you for the help.
--
Eric Reagan



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



Re: Required Border...

2010-03-24 Thread James Carman
So, I don't have to put the indicator into my markup?   It somehow
automatically adds itself?

On Wed, Mar 24, 2010 at 2:21 PM, TahitianGabriel glan...@piti.pf wrote:

 For FormComponentFeedbackBorder you'll have to change your hierarchy like
 that :

 HTML :
 input type=text wicket:id=field

 Java :
 form.add(new FormComponentFeedbackBorder(border).add(new
 TextField(field)));


 Why can't you use FormComponentFeedbackIndicator so you can add it on the
 fly :

 HTML :
 input type=text wicket:id=field /

 Java :
 RequiredTextFieldInteger field = new RequiredTextFieldInteger(field);
 form.add(field);
 final FormComponentFeedbackIndicator indicator = new
 FormComponentFeedbackIndicator(indicator);
 indicator.setOutputMarkupPlaceholderTag(true);
 indicator.setIndicatorFor(field);
 form.add(indicator);

 Regards,

 Gabriel.


 James Carman-3 wrote:

 Well, per the example in the forms with flair demo, I'm adding these
 borders to my components on the fly using a visitor.  So, I don't
 think the FormComponentFeedbackBorder thing will work, since I would
 have to actually change the hierarchy by adding my component *to* the
 border component (it doesn't implement IComponentBorder as required by
 the setComponentBorder method).  Or, am I not understanding how to use
 it (or something like it)?


 --
 View this message in context: 
 http://old.nabble.com/Required-Border...-tp28006887p28019255.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: Spring problems

2010-03-24 Thread James Carman
If you want an example that works out-of-the-box, check out:

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



On Wed, Mar 24, 2010 at 3:29 PM, Eric Reagan reaga...@gmail.com wrote:
 I am trying to setup a spring application and I can't seam to get past a
 NoWebApplicationContext found.

 I have followed the online tutorials (and the example code from the 1.4.7
 directory) and I am still not having any luck.

 In my web.xml file I have

 
    servlet
        servlet-nameservlet/servlet-name

 servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class
        init-param
            param-nameapplicationFactoryClassName/param-name

 param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
        /init-param
        load-on-startup1/load-on-startup
    /servlet


    context-param
        param-namecontextConfigLocation/param-name
        param-value/WEB-INF/springContext.xml/param-value
    /context-param

 

 in my springContext.xml file I have
   bead id=wicketApp class=pathToMyApplication /

 and in my WebApplication file I have the generic default constructor

 ...
 init()
        getDebugSettings().setDevelopmentUtilitiesEnabled(true);
        addComponentInstantiationListener(new
 SpringComponentInjector(this));

 Is there something I am missing in setting up Wicket and Spring?

 thank you for the help.
 --
 Eric Reagan


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



Re: Help with integrating NTLM in wicket application

2010-03-24 Thread Bryan Montgomery
Thanks, this pointed me in the wrong direction. I then ended up calling this
from within the onBeforeRender method to get it to handle the redirect
correctly on login. Another issue was that I was calling another part of the
code and should have been calling AuthenticatedWebSession.get().signIn

So, what I was now trying is to have the login process handle the situation
when a windows / ntlm userid is not found and fall back to the 'legacy' form
based log in.

I am able to display the form, however, the form post never seems to work.
Checking the source code of the html sent to the browser, the form is
defined there, and if I construct a url with the form fields  it works, and
the fields are available inside the wicket code. But they're not there when
I post the form.

If I set a property to ignore the ntlm process and start with a new browser,
the login form works fine.

Any thoughts? I guess I'll try and compare the html generated to see if
there is any difference. I'll also double check the program flow if the ntlm
is called but the authentication fails.

Thanks - Bryan.

On Sun, Mar 21, 2010 at 9:17 PM, Josh Chappelle jchappe...@4redi.comwrote:

 Bryan,

 We have an NTLMPage that we redirect the browser to. If there is no
 authorization header this is what we do.

 String auth = request.getHeader(Authorization);
if (auth == null)
{
setRedirect(false);
response.setHeader(WWW-Authenticate, NTLM);
throw new AbortWithHttpStatusException(401, false);

}

 I hope this helps.

 Thanks,

 Josh

 -Original Message-
 From: Bryan Montgomery [mailto:mo...@english.net]
 Sent: Friday, March 19, 2010 3:36 PM
 To: users@wicket.apache.org
 Subject: Help with integrating NTLM in wicket application

 Hello,
 I have two applications, one a stand alone web app and one wicket based.
 Currently they both use form authentication however I am trying to add NTLM
 authentication for SSO from our windows intranet.

 Leveraging jcifs, I've been able to do this pretty easily with the stand
 alone web app. However I've been struggling over the last couple of days
 with the wicket app.

 I'll preface this with the caveat that I have only done some very simple
 stuff with wicket to date.

 The flow is that the user makes a request and the program flow is
 redirected
 to LoginPage, and in turn to LoginPanel. In LoginPanel the first thing it
 does is check if there is an authentication header, if not which is the
 case, it sets the status to SC_UNAUTHORIZED and adds a header of
 WWW-Authenticate: NTLM. I then started with flushing the response and not
 adding anything else.

 In theory this response should tell the browser to resubmit the same
 request
 with the authentication information. However, from our log files I can see
 that the request second time around only has the Login in the request
 cycle,
 compared to the startup page being in the request cycle initally.

 After looking on the web I've tried various combinations including trying
 continueToOriginalDestination in the onBeforeRender method.

 One thing I've noticed is that it seems that setting the status and header
 on the
 ((WebResponse)response).getHttpServletResponse() only takes effect when I
 do
 not call flushBuffer() on it. This subseqently throws an exception in the
 wicket processing because the response has already been closed.

 I feel that I am so close - but can't quite get it right!

 I was hoping to integrate this with minimal changes to the code but am
 thinking that maybe I should start from scratch? I've found a few posts
 online of similar situations but I haven't been able to put all the pieces
 together yet.

 Appreciate the help in getting this sorted out.

 Thanks,
 Bryan.


 http://markmail.org/message/cjy4o4ndtigius55#query:+page:1+mid:t3foamferfh2t
 wwj+state:results

 http://old.nabble.com/Wicket-NTLM-Single-sign-on-integration-Question-td1786
 8669.html


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




Re: Required Border...

2010-03-24 Thread James Carman
Also, they way I'm adding the required indicator to my fields is by
using a visitor in the onBeforeRender method (again per the forms with
flair example).  So, you're not exactly allowed to change the
hierarchy at this point from what I understand, so calling the
form.add() wouldn't work I don't think.

On Wed, Mar 24, 2010 at 2:21 PM, TahitianGabriel glan...@piti.pf wrote:

 For FormComponentFeedbackBorder you'll have to change your hierarchy like
 that :

 HTML :
 input type=text wicket:id=field

 Java :
 form.add(new FormComponentFeedbackBorder(border).add(new
 TextField(field)));


 Why can't you use FormComponentFeedbackIndicator so you can add it on the
 fly :

 HTML :
 input type=text wicket:id=field /

 Java :
 RequiredTextFieldInteger field = new RequiredTextFieldInteger(field);
 form.add(field);
 final FormComponentFeedbackIndicator indicator = new
 FormComponentFeedbackIndicator(indicator);
 indicator.setOutputMarkupPlaceholderTag(true);
 indicator.setIndicatorFor(field);
 form.add(indicator);

 Regards,

 Gabriel.


 James Carman-3 wrote:

 Well, per the example in the forms with flair demo, I'm adding these
 borders to my components on the fly using a visitor.  So, I don't
 think the FormComponentFeedbackBorder thing will work, since I would
 have to actually change the hierarchy by adding my component *to* the
 border component (it doesn't implement IComponentBorder as required by
 the setComponentBorder method).  Or, am I not understanding how to use
 it (or something like it)?


 --
 View this message in context: 
 http://old.nabble.com/Required-Border...-tp28006887p28019255.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: Palette Problem

2010-03-24 Thread James Carman
Doesn't your current have to be a subset of available?

On Wed, Mar 24, 2010 at 2:58 PM, Josh Chappelle jchappe...@4redi.com wrote:
 Hi,



 I'm having a problem that is about to drive me nuts. I have a Palette that
 won't display the selected values. I am able to reproduce my problem with a
 simple version so here it is:



                        ListString current = new ArrayListString();

                        current.add(ABC);

                        ListString available = new ArrayListString();

                        available.add(DEF);

                        available.add(123);



                        ChoiceRenderer renderer = new ChoiceRenderer()

                        {



                                   �...@override

                                    public Object getDisplayValue(Object
 object)

                                    {

                                                return object.toString();

                                    }



                                   �...@override

                                    public String getIdValue(Object object,
 int index)

                                    {

                                                return object.toString();

                                    }



                        };



 new PaletteString(views, new Model((Serializable)current), new
 Model((Serializable)available), renderer, 10, true);



 When I add this Palette to a form it only displays DEF and 123 in the
 available part. I can't get anything to show in the selected part.



 Someone please help.



 Thanks,



 Josh



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



RE: Palette Problem

2010-03-24 Thread Josh Chappelle
Yes that was it. I wish I had those 4 hours back. Thank you.

-Original Message-
From: James Carman [mailto:jcar...@carmanconsulting.com] 
Sent: Wednesday, March 24, 2010 3:34 PM
To: users@wicket.apache.org
Subject: Re: Palette Problem

Doesn't your current have to be a subset of available?

On Wed, Mar 24, 2010 at 2:58 PM, Josh Chappelle jchappe...@4redi.com
wrote:
 Hi,



 I'm having a problem that is about to drive me nuts. I have a Palette that
 won't display the selected values. I am able to reproduce my problem with
a
 simple version so here it is:



                        ListString current = new ArrayListString();

                        current.add(ABC);

                        ListString available = new ArrayListString();

                        available.add(DEF);

                        available.add(123);



                        ChoiceRenderer renderer = new ChoiceRenderer()

                        {



                                   �...@override

                                    public Object getDisplayValue(Object
 object)

                                    {

                                                return object.toString();

                                    }



                                   �...@override

                                    public String getIdValue(Object object,
 int index)

                                    {

                                                return object.toString();

                                    }



                        };



 new PaletteString(views, new Model((Serializable)current), new
 Model((Serializable)available), renderer, 10, true);



 When I add this Palette to a form it only displays DEF and 123 in the
 available part. I can't get anything to show in the selected part.



 Someone please help.



 Thanks,



 Josh



-
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: Palette Problem

2010-03-24 Thread James Carman
No problem, man.  Sorry about the 4 hours.  That's what paired
programming is for! :)  Glad to help.

On Wed, Mar 24, 2010 at 4:44 PM, Josh Chappelle jchappe...@4redi.com wrote:
 Yes that was it. I wish I had those 4 hours back. Thank you.

 -Original Message-
 From: James Carman [mailto:jcar...@carmanconsulting.com]
 Sent: Wednesday, March 24, 2010 3:34 PM
 To: users@wicket.apache.org
 Subject: Re: Palette Problem

 Doesn't your current have to be a subset of available?

 On Wed, Mar 24, 2010 at 2:58 PM, Josh Chappelle jchappe...@4redi.com
 wrote:
 Hi,



 I'm having a problem that is about to drive me nuts. I have a Palette that
 won't display the selected values. I am able to reproduce my problem with
 a
 simple version so here it is:



                        ListString current = new ArrayListString();

                        current.add(ABC);

                        ListString available = new ArrayListString();

                        available.add(DEF);

                        available.add(123);



                        ChoiceRenderer renderer = new ChoiceRenderer()

                        {



                                   �...@override

                                    public Object getDisplayValue(Object
 object)

                                    {

                                                return object.toString();

                                    }



                                   �...@override

                                    public String getIdValue(Object object,
 int index)

                                    {

                                                return object.toString();

                                    }



                        };



 new PaletteString(views, new Model((Serializable)current), new
 Model((Serializable)available), renderer, 10, true);



 When I add this Palette to a form it only displays DEF and 123 in the
 available part. I can't get anything to show in the selected part.



 Someone please help.



 Thanks,



 Josh



 -
 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: Required Border...

2010-03-24 Thread TahitianGabriel

Sorry, Nabble swallowed the span tag!

FormComponentFeedbackBorder:
lt;span wicket:id=borderinput type=text wicket:id=fieldlt;/span

FormComponentFeedbackIndicator :
input type=text wicket:id=field /lt;span
wicket:id=indicatorlt;/span 

But I understand it doesn't fit your need.

Gabriel.
-- 
View this message in context: 
http://old.nabble.com/Required-Border...-tp28006887p28021216.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



Wicketstuff updated!

2010-03-24 Thread Boris Goldowsky
As discussed, and not hearing any objections, I've updated the 
wicketstuff-core project to depend on Wicket 1.4.7.  wicketstuff-core's 
version number is now 1.4.7-SNAPSHOT, and the idea is that people can 
test it, and barring any major problems it can be released as a stable 
version 1.4.7 .


Now, before people can easily test this, the artifacts need to get into 
the wicket snapshots maven repository, right?  Can someone with the 
requisite permissions make this happen?  In the meantime of course 
people are encouraged to download the projects and build and test them 
locally.


In addition to wicket, the following dependencies were also updated to 
the latest stable version within the same major version of the project.  
I did not attempt to move Lucene from version 2.4.1 to 3.0.1, for 
instance, since more significant changes might be required for this (if 
any subproject is actually using it).


 Jetty: 6.1.22
 Lucene: 2.4.1
 slf4j: 1.5.11
 JUnit: 4.8.1

I had to make a couple of changes to get everything to build with the 
new dependencies (commented out wagon-ssh-external extension from 
inmethod-grid; added new required constructor argument to two instances 
of SpringComponentInjector).  People should test the build and make sure 
these changes are ok.  But at least for me, I can do a mvn install at 
the top level and it works.


Bng


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



Input and Model

2010-03-24 Thread Xavier López
I have a Form with a list of Checks in a CheckGroup. In the same Form, there
is a DropDownChoice with a dynamic choices model. The choices are the
selected checks plus some fixed options.
It has to be considered that some Checks can be preselected at construction
time, and that the choices have to be updated while the user checks the
Checks. The Checks have an EventAjaxBehavior(onclick) in order to do some
processing and update the ddc's choice Model.

So, the Choices Model looks like this:

IModel choiceModel = new AbstractReadOnlyModel(){
   public Object get(){
  ListString checkeds;
  if (!checkGroup.hasRawInput()){
  // With no input, get the ModelObject - construction time case
  checkeds = checkGroup.getModelObject();
  }
  else {
  checkeds = checkGroup.getConvertedInput();
  }
  // Add fixed options
  checkeds.add (...);
  return checkeds;
   }
};

I find it quite annoying to have to do that kind of conditional. I have seen
there is the getValue() method, but that method returns getInput() or
getModelObjectAsString(). Isn't there any method to get ConvertedInput or
ModelObject instead ? Or any better way to achieve this ?

Also, I don't know if the choices Model will be updated automatically, or if
I have to perform some manual operation, if possible at all. Even if it's
not possible, I found this issue in other circumstances...

Cheers,
Xavier


Re: Wicketstuff updated!

2010-03-24 Thread nino martinez wael
artifacts should find their way into the repo once team city builds..

2010/3/24 Boris Goldowsky bgoldow...@cast.org:
 As discussed, and not hearing any objections, I've updated the
 wicketstuff-core project to depend on Wicket 1.4.7.  wicketstuff-core's
 version number is now 1.4.7-SNAPSHOT, and the idea is that people can test
 it, and barring any major problems it can be released as a stable version
 1.4.7 .

 Now, before people can easily test this, the artifacts need to get into the
 wicket snapshots maven repository, right?  Can someone with the requisite
 permissions make this happen?  In the meantime of course people are
 encouraged to download the projects and build and test them locally.

 In addition to wicket, the following dependencies were also updated to the
 latest stable version within the same major version of the project.  I did
 not attempt to move Lucene from version 2.4.1 to 3.0.1, for instance, since
 more significant changes might be required for this (if any subproject is
 actually using it).

  Jetty: 6.1.22
  Lucene: 2.4.1
  slf4j: 1.5.11
  JUnit: 4.8.1

 I had to make a couple of changes to get everything to build with the new
 dependencies (commented out wagon-ssh-external extension from inmethod-grid;
 added new required constructor argument to two instances of
 SpringComponentInjector).  People should test the build and make sure these
 changes are ok.  But at least for me, I can do a mvn install at the top
 level and it works.

 Bng


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



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



Re: how to clear validation error

2010-03-24 Thread Nikola Šaub

Man thanks so much for this! The SAME thing happened to me. I left
cleanupFeedbackMessages()
empty after extending WebSession. I almost went crazy figuringthis out ;). 
 

Chuck Brinkman-2 wrote:
 
 The messages are kept in WebSession and WebSession has
 cleanupFeedbackMessages() but this is never called.
 
 Got it.  The session I created had a empty cleanupFeedbackMessages()
 method.  Thanks for reading along.
 
 On Fri, Jan 8, 2010 at 9:48 PM, Chuck Brinkman chasb1...@gmail.com
 wrote:
 
 I got the code for wicket 1.4.5 and stepped through to see what is
 causing
 the problem.  Form.anyFormComponentError checks all the components on the
 form to see if 1) input is required and 2) is an error message exists for
 the component.  It appears to me that once a message is set that it is
 never
 reset.  I don't see how this could be working for others and not working
 for
 me.  Any ideas?  Is there some setup or configuration I'm missing that
 causes error messages to be cleared?


 On Fri, Jan 8, 2010 at 10:51 AM, Chuck Brinkman
 chasb1...@gmail.comwrote:

 Thanks for your help but I don't understand.  I even got the source code
 for
 http://www.wicket-library.com/wicket-examples/signin/?wicket:bookmarkablePage=:org.apache.wicket.examples.signin.SignInand
 when I run this in my environment I have the same issue I have with my
 code.  Once I get a validation error onSubmit is never called even after
 the
 input error is fixed.  This works fine when running at
 www.wicket-library.com.  What should I do in the onError method to
 correct this situation?  Sorry to be so lame and thanks for your help.



 
 

-- 
View this message in context: 
http://old.nabble.com/how-to-clear-validation-error-tp27072529p28021934.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: Feedback and field validation

2010-03-24 Thread alexander.elsholz

hi anna,

feedback-messages will clear after the request processing.  build a visitor
that checks the 
feedbackmassges of every component. your components have to hold the
messages when error, info and warn will called. clear on successful
validate.

alex


Anna Simbirtsev wrote:
 
 Hi,
 
 I validate fields using AjaxFormComponentUpdatingBehavior(onblur). When
 I
 am on field 1, and data is invalid, it displays feedback message, and I
 can
 see this message in session. When I move to a different field, this
 feedback
 message is no longer in the session. Can somebody explain that?
 
 Thanks,
 Anna
 
 

-- 
View this message in context: 
http://old.nabble.com/Feedback-and-field-validation-tp27924233p28022371.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: Export wicket rendered page to pdf

2010-03-24 Thread Richard Nichols
I've used PD4ML - http://pd4ml.com/ with some success, but you need to
tailor the HTML/CSS to it's renderer for best results.



On 24 March 2010 05:08, Rodolfo Cartas rodolfocar...@gmail.com wrote:
 Hi all! Is there a way to export a page rendered in wicket to a pdf
 file within the application?

 Best regards,

 Rodolfo

 --
 Rodolfo Cartas
 rodolfocar...@gmail.com
 http://www.flickr.com/photos/rodolfocartas
 http://www.facebook.com/rodolfo.cartas

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





-- 
Richard Nichols :: http://www.visural.com/ :: http://www.richardnichols.net/

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



RE: Help with integrating NTLM in wicket application

2010-03-24 Thread Josh Chappelle
Bryan,

Sorry for pointing you in the wrong direction. Below is the NTLMPage that we
use. Notice that it redirects the user to the login page if it can't log
them in through NTLM. I hope this helps.

import java.io.IOException;

import javax.servlet.http.*;

import jcifs.ntlmssp.Type3Message;
import jcifs.util.Base64;

import org.apache.wicket.RestartResponseAtInterceptPageException;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.WebRequest;
import org.apache.wicket.protocol.http.servlet.AbortWithHttpStatusException;


public class NTLMPage extends WebPage 
{
public NTLMPage()
{
HttpServletRequest request =
((WebRequest)getRequest()).getHttpServletRequest();
HttpServletResponse response =
getWebRequestCycle().getWebResponse().getHttpServletResponse();
String auth = request.getHeader(Authorization);
MySession session = MySession.get();
setStatelessHint(true);

if (auth == null) 
{
setRedirect(false);
response.setHeader(WWW-Authenticate, NTLM);
throw new AbortWithHttpStatusException(401, false);

}
if (auth.startsWith(NTLM )) 
{ 
byte[] msg;
try 
{
msg = new
sun.misc.BASE64Decoder().decodeBuffer(auth.substring(5));

if (msg[8] == 1) 
{ 
byte z = 0;
byte[] msg1 =
{(byte)'N', (byte)'T', (byte)'L',
(byte)'M', (byte)'S',
(byte)'S',
(byte)'P', z,
(byte)2, z, z, z, z,
z, z, z,
(byte)40, z, z, z,
(byte)1, (byte)2, (byte)8, z,
z, (byte)2, (byte)2,
(byte)2, z, z, z, z, 
z, z, z, z, z, z, z,
z};
setRedirect(false);

response.setHeader(WWW-Authenticate, NTLM  + new
sun.misc.BASE64Encoder().encodeBuffer(msg1).trim());
throw new
AbortWithHttpStatusException(401, false);

} 
else if (msg[8] == 3) 
{ 
getSession().bind();
final Type3Message type3msg = new
Type3Message(Base64.decode(auth.substring(5)));
if(type3msg.getUser() != null)
{
User user = new UserImpl();

user.setUserName(type3msg.getUser());

session.setDomain(type3msg.getDomain());

session.setHostname(type3msg.getWorkstation());
session.setUser(user);
}
} 
} 
catch (IOException e) 
{
e.printStackTrace();
}

}
if(session.getUser() == null)
{
setResponsePage(LoginPage.class);
}
else
{
setRedirect(false);
throw new
RestartResponseAtInterceptPageException(HomePage.class);
}
}

@Override
public boolean isVersioned() 
{
return false;
}
}
-Original Message-
From: Bryan Montgomery [mailto:mo...@english.net] 
Sent: Wednesday, March 24, 2010 3:31 PM
To: users@wicket.apache.org
Subject: Re: Help with integrating NTLM in wicket application

Thanks, this pointed me in the wrong direction. I then ended up calling this
from within the onBeforeRender method to get it to handle the redirect
correctly on login. Another issue was that I was calling another part of the
code and should have been calling AuthenticatedWebSession.get().signIn

So, what I was now trying is to have the login process handle the situation
when a windows / ntlm userid is not found and fall back to the 'legacy' form
based log in.

I am able to display the form, however, the form post never seems to work.
Checking the source code of the html sent to the browser, the form is
defined there, and if I construct a url with the form fields  it works, and
the fields are available inside the wicket code. But they're not there when
I post the form.

If I 

Re: Help with integrating NTLM in wicket application

2010-03-24 Thread Bryan Montgomery
oops, sorry Josh. I appreciate your hlelp. I _meant_ to say pointed me in
the RIGHT direction. Brain and fingers weren't connecting as I was trying to
finish sending before leaving the office! Though this looks like it will be
cleaner than what I currently have, thanks again.

On Wed, Mar 24, 2010 at 8:49 PM, Josh Chappelle jchappe...@4redi.comwrote:

 Bryan,

 Sorry for pointing you in the wrong direction. Below is the NTLMPage that
 we
 use. Notice that it redirects the user to the login page if it can't log
 them in through NTLM. I hope this helps.

 import java.io.IOException;

 import javax.servlet.http.*;

 import jcifs.ntlmssp.Type3Message;
 import jcifs.util.Base64;

 import org.apache.wicket.RestartResponseAtInterceptPageException;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.protocol.http.WebRequest;
 import
 org.apache.wicket.protocol.http.servlet.AbortWithHttpStatusException;


 public class NTLMPage extends WebPage
 {
public NTLMPage()
{
HttpServletRequest request =
 ((WebRequest)getRequest()).getHttpServletRequest();
HttpServletResponse response =
 getWebRequestCycle().getWebResponse().getHttpServletResponse();
String auth = request.getHeader(Authorization);
MySession session = MySession.get();
setStatelessHint(true);

if (auth == null)
{
setRedirect(false);
response.setHeader(WWW-Authenticate, NTLM);
throw new AbortWithHttpStatusException(401, false);

}
if (auth.startsWith(NTLM ))
{
byte[] msg;
try
{
msg = new
 sun.misc.BASE64Decoder().decodeBuffer(auth.substring(5));

if (msg[8] == 1)
{
byte z = 0;
byte[] msg1 =
{(byte)'N', (byte)'T', (byte)'L',
 (byte)'M', (byte)'S',
(byte)'S',
 (byte)'P', z,
(byte)2, z, z, z, z,
 z, z, z,
(byte)40, z, z, z,
 (byte)1, (byte)2, (byte)8, z,
z, (byte)2, (byte)2,
 (byte)2, z, z, z, z,
z, z, z, z, z, z, z,
 z};
setRedirect(false);

 response.setHeader(WWW-Authenticate, NTLM  + new
 sun.misc.BASE64Encoder().encodeBuffer(msg1).trim());
throw new
 AbortWithHttpStatusException(401, false);

}
else if (msg[8] == 3)
{
getSession().bind();
final Type3Message type3msg = new
 Type3Message(Base64.decode(auth.substring(5)));
if(type3msg.getUser() != null)
{
User user = new UserImpl();

 user.setUserName(type3msg.getUser());

 session.setDomain(type3msg.getDomain());

 session.setHostname(type3msg.getWorkstation());
session.setUser(user);
}
}
}
catch (IOException e)
{
e.printStackTrace();
}

}
if(session.getUser() == null)
{
setResponsePage(LoginPage.class);
}
else
{
setRedirect(false);
throw new
 RestartResponseAtInterceptPageException(HomePage.class);
}
}

@Override
public boolean isVersioned()
{
return false;
}
 }
 -Original Message-
 From: Bryan Montgomery [mailto:mo...@english.net]
 Sent: Wednesday, March 24, 2010 3:31 PM
 To: users@wicket.apache.org
  Subject: Re: Help with integrating NTLM in wicket application

 Thanks, this pointed me in the wrong direction. I then ended up calling
 this
 from within the onBeforeRender method to get it to handle the redirect
 correctly on login. Another issue was that I was calling another part of
 the
 code and should have been calling AuthenticatedWebSession.get().signIn

 So, what I was now trying is to have the login process handle the situation
 when a windows / ntlm userid is not found and fall back to the 'legacy'
 form
 based log in.

 I am able to 

How to provide a value to a message's argument

2010-03-24 Thread David Chang

HTML:

span wicket:id=x[sample text]/span

Java:

add(new Label(x, new ResourceModel(x)));

Resource file:

entry key=xHello ${label} !/entry

In the above Java, I cannot find a way to provide a value to the argument of 
the string. I want the program to display 

Hello David! 
Hello Carmen!

Regards.


  

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



Re: How to provide a value to a message's argument

2010-03-24 Thread Igor Vaynberg
see StringResourceModel

-igor

On Wed, Mar 24, 2010 at 8:42 PM, David Chang david_q_zh...@yahoo.com wrote:

 HTML:

 span wicket:id=x[sample text]/span

 Java:

 add(new Label(x, new ResourceModel(x)));

 Resource file:

 entry key=xHello ${label} !/entry

 In the above Java, I cannot find a way to provide a value to the argument of 
 the string. I want the program to display

 Hello David!
 Hello Carmen!

 Regards.




 -
 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: AjaxSubmitLink not calling the onsubmit event handler

2010-03-24 Thread Richard Nichols
Hi Anantha,

Did you get a resolution to this issue? I have the same problem.

Is this expected behavior I wonder, or a bug?

SubmitLink will call the form's onsubmit='???' handler,
AjaxSubmitLink does not.


On 4 January 2010 23:05, Anantha Kumaran ananthakuma...@gmail.com wrote:
 hi pieter

 my problem is that the AjaxSubmitLink is not behaving like the SubmitLink
 which calls the onsubmit before submitting
 the form.currently i am using the mousedown(can't use onclick) of the
 AjaxSubmitLink to do the validation stuffs but it breaks when the user
 submit the form by pressing the return.




 On Mon, Jan 4, 2010 at 12:03 AM, Pieter Degraeuwe 
 pieter.degrae...@systemworks.be wrote:

 If you want to do some additional stuff, you can do it in the form a a
 Behaviour.. I did use such behaviour to ask a javascript confirm. If user
 does not confirm, the form is not submitted.

 new AttributeModifier(onclick, true, new ModelString(if (!confirm(' +
 msg + ')) { /* do some additional stuff if not confirmed*/return;} else {
 /*do some stuff beform submitting the form*/})) {
           �...@override
            protected String newValue(String currentValue, String
 replacementValue) {
                return replacementValue + currentValue;
            }
        };

 On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran ananthakuma...@gmail.com
 wrote:

  is there any way to do this on the client side.I want to do some client
  side
  stuff before submitting the form.
 
  On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson 
  wicket.program...@gmail.com
   wrote:
 
  
   form.add ( new AjaxSubmitLink(){
  
   protected void onSubmit(AjaxRequestTarget target, Form form){
     // Add  feedback and do ajax stuff.
   }
  
   protected void onError(AjaxRequestTarget target, Form form){
     // Add FeedbackPanel here
     target.add( feedback );
   }});
   --
   View this message in context:
  
 
 http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.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
  
  
 



 --
 Pieter Degraeuwe
 Systemworks bvba
 Belgiëlaan 61
 9070 Destelbergen
 GSM: +32 (0)485/68.60.85
 Email: pieter.degrae...@systemworks.be
 visit us at http://www.systemworks.be





-- 
Richard Nichols :: http://www.visural.com/ :: http://www.richardnichols.net/

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



RE: Help with integrating NTLM in wicket application

2010-03-24 Thread Josh Chappelle
No problem Bryan. Glad I can help. Let me know if you hit a problem.

Josh

-Original Message-
From: Bryan Montgomery [mailto:mo...@english.net] 
Sent: Wednesday, March 24, 2010 8:22 PM
To: users@wicket.apache.org
Subject: Re: Help with integrating NTLM in wicket application

oops, sorry Josh. I appreciate your hlelp. I _meant_ to say pointed me in
the RIGHT direction. Brain and fingers weren't connecting as I was trying to
finish sending before leaving the office! Though this looks like it will be
cleaner than what I currently have, thanks again.

On Wed, Mar 24, 2010 at 8:49 PM, Josh Chappelle jchappe...@4redi.comwrote:

 Bryan,

 Sorry for pointing you in the wrong direction. Below is the NTLMPage that
 we
 use. Notice that it redirects the user to the login page if it can't log
 them in through NTLM. I hope this helps.

 import java.io.IOException;

 import javax.servlet.http.*;

 import jcifs.ntlmssp.Type3Message;
 import jcifs.util.Base64;

 import org.apache.wicket.RestartResponseAtInterceptPageException;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.protocol.http.WebRequest;
 import
 org.apache.wicket.protocol.http.servlet.AbortWithHttpStatusException;


 public class NTLMPage extends WebPage
 {
public NTLMPage()
{
HttpServletRequest request =
 ((WebRequest)getRequest()).getHttpServletRequest();
HttpServletResponse response =
 getWebRequestCycle().getWebResponse().getHttpServletResponse();
String auth = request.getHeader(Authorization);
MySession session = MySession.get();
setStatelessHint(true);

if (auth == null)
{
setRedirect(false);
response.setHeader(WWW-Authenticate, NTLM);
throw new AbortWithHttpStatusException(401, false);

}
if (auth.startsWith(NTLM ))
{
byte[] msg;
try
{
msg = new
 sun.misc.BASE64Decoder().decodeBuffer(auth.substring(5));

if (msg[8] == 1)
{
byte z = 0;
byte[] msg1 =
{(byte)'N', (byte)'T', (byte)'L',
 (byte)'M', (byte)'S',
(byte)'S',
 (byte)'P', z,
(byte)2, z, z, z,
z,
 z, z, z,
(byte)40, z, z, z,
 (byte)1, (byte)2, (byte)8, z,
z, (byte)2,
(byte)2,
 (byte)2, z, z, z, z,
z, z, z, z, z, z,
z,
 z};
setRedirect(false);

 response.setHeader(WWW-Authenticate, NTLM  + new
 sun.misc.BASE64Encoder().encodeBuffer(msg1).trim());
throw new
 AbortWithHttpStatusException(401, false);

}
else if (msg[8] == 3)
{
getSession().bind();
final Type3Message type3msg = new
 Type3Message(Base64.decode(auth.substring(5)));
if(type3msg.getUser() != null)
{
User user = new UserImpl();

 user.setUserName(type3msg.getUser());

 session.setDomain(type3msg.getDomain());

 session.setHostname(type3msg.getWorkstation());
session.setUser(user);
}
}
}
catch (IOException e)
{
e.printStackTrace();
}

}
if(session.getUser() == null)
{
setResponsePage(LoginPage.class);
}
else
{
setRedirect(false);
throw new
 RestartResponseAtInterceptPageException(HomePage.class);
}
}

@Override
public boolean isVersioned()
{
return false;
}
 }
 -Original Message-
 From: Bryan Montgomery [mailto:mo...@english.net]
 Sent: Wednesday, March 24, 2010 3:31 PM
 To: users@wicket.apache.org
  Subject: Re: Help with integrating NTLM in wicket application

 Thanks, this pointed me in the wrong direction. I then ended up calling
 this
 from within the onBeforeRender method to get it to handle the redirect
 correctly on login. Another issue was that I was calling 

Re: How to provide a value to a message's argument

2010-03-24 Thread David Chang
Igor, thanks for the info. It worked for me. Just a suggestion. Hope to see a 
convenience constructor such as:

StringResourceModel(resourceKey, java.lang.Object[] parameters)

In which, model is null. IMHO, Spring has many convenience methods. It would be 
good to see Wicket does the same (maybe already does it, but I dont know about).

Regards.

--- On Wed, 3/24/10, Igor Vaynberg igor.vaynb...@gmail.com wrote:

 From: Igor Vaynberg igor.vaynb...@gmail.com
 Subject: Re: How to provide a value to a message's argument
 To: users@wicket.apache.org
 Date: Wednesday, March 24, 2010, 11:49 PM
 see StringResourceModel
 
 -igor
 
 On Wed, Mar 24, 2010 at 8:42 PM, David Chang david_q_zh...@yahoo.com
 wrote:
 
  HTML:
 
  span wicket:id=x[sample text]/span
 
  Java:
 
  add(new Label(x, new ResourceModel(x)));
 
  Resource file:
 
  entry key=xHello ${label} !/entry
 
  In the above Java, I cannot find a way to provide a
 value to the argument of the string. I want the program to
 display
 
  Hello David!
  Hello Carmen!
 
  Regards.
 
 
 
 
 
 -
  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