OutOfMemoryError with lots of unit tests

2010-06-28 Thread Swanthe Lindgren

Hello
Has someone got any good tips about performing lots of render tests? We 
are using TestNG and maven/surefire test runner which results in 
OutOfMemoryError for our about 500 tests, where each test tries to 
render a page or panel. After a bit of redesigning our test classes and 
call WicketTester.destroy()  after each test, we were able to run about 
50 more tests, but now we are back at OutOfMemoryError.


//Swanthe


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



Re: OutOfMemoryError with lots of unit tests

2010-06-28 Thread Martin Makundi
Try this as args:

-Xms356m
-Xmx1024m
-XX:MaxPermSize=356m
-XX:HeapDumpPath=c:/temp
-Xss1024k


Also you can reuse Application instance etc.

**
Martin

2010/6/28 Swanthe Lindgren swanthe.lindg...@megasol.se:
 Hello
 Has someone got any good tips about performing lots of render tests? We are
 using TestNG and maven/surefire test runner which results in
 OutOfMemoryError for our about 500 tests, where each test tries to render a
 page or panel. After a bit of redesigning our test classes and call
 WicketTester.destroy()  after each test, we were able to run about 50 more
 tests, but now we are back at OutOfMemoryError.

 //Swanthe


 -
 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: OutOfMemoryError with lots of unit tests

2010-06-28 Thread Major Péter
Hi,

Try something like this:
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-surefire-plugin/artifactId
inheritedtrue/inherited
configuration
skipTestsfalse/skipTests
forkModeonce/forkMode
argLine-Xmx512m -XX:MaxPermSize=256m/argLine
/configuration
/plugin

maybe check out the perTest forkMode.

Regards,
Peter

2010-06-28 11:08 keltezéssel, Swanthe Lindgren írta:
 Hello
 Has someone got any good tips about performing lots of render tests? We
 are using TestNG and maven/surefire test runner which results in
 OutOfMemoryError for our about 500 tests, where each test tries to
 render a page or panel. After a bit of redesigning our test classes and
 call WicketTester.destroy()  after each test, we were able to run about
 50 more tests, but now we are back at OutOfMemoryError.
 
 //Swanthe

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



Re: How do you create a toolbar of buttons for a datatabe?

2010-06-28 Thread vov

Look to DefaultDataTable addBottomToolbar(new NoRecordsToolbar(this));
You can append custom Bottom Toolbar to your table instead NoRecordsToolbar:

public class MyBottomToolbar extends AbstractToolbar
{
  public MyBottomToolbar(DataTable? table)
  {
super(table);

RepeatingView headers = new RepeatingView(bottoms);
add(headers);

final IColumn?[] columns = table.getColumns();
for (final IColumn? column : columns)
{
  WebMarkupContainer item = new
WebMarkupContainer(headers.newChildId());
  headers.add(item);

  WebMarkupContainer header = new WebMarkupContainer(bottom);
  item.add(header);
  item.setRenderBodyOnly(true);
  header.add(new Button(button, new ModelString(asdf)));
}
  }
}

wicket:panel
tr

th wicket:id=bottomforminput type=button
wicket:id=button//form/th

/tr
/wicket:panel

in your DateTable constructor addBottomToolbar(new MyBottomToolbar(this));

Also you can create custom Column class for getting uniques property for
every Button(for example instead new Button you will call
column.getButtom())


-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-do-you-create-a-toolbar-of-buttons-for-a-datatabe-tp2270419p2270653.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: Asynchronous construction of page

2010-06-28 Thread Victor Volle

any progress w.r.t. to this question?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Asynchronous-construction-of-page-tp1892224p2270690.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



TagTester after Ajax

2010-06-28 Thread Wolfgang

TagTester works on the content of the last response which, in case of an Ajax
response, is not the whole page but only a small snippet. Even worse, this
snippet doesn't contain the wicket:ids anymore I use for testing.

Is there a way to Ajax-enable TagTester such that...
...you can use TagTester after Ajax refreshes without bothering about this
fact?
...you can use wicket:id attributes to evaluate the result?

It is because I want to test certain Ajax-relevant features that cannot be
tested using the component-based assert... methods on WicketTester and that
cannot be tested if Ajax is disabled.

I know it is a certain additional work for Wicket to enable that kind of
testing because, from the technical point of view, the required document is
not naturally available. However, since Wicket defines its own Ajax engine
it should be able to mock this one such that the Ajax responses are
incorporated in the document and the result can be evaluated as a whole.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TagTester-after-Ajax-tp2270712p2270712.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



Announcing WicketObjects v0.1

2010-06-28 Thread Dan Haywood

Hi all,

I'd like to announce a new open source (ASLv2) project to help develop 
Wicket applications - Wicket Objects.  This is an integration between 
Wicket and the Naked Objects framework.  The idea is that you can 
develop full webapps just by writing domain objects pojos, and Wicket 
Objects (with a little help from NOF) then renders your objects 
automatically.  You can then use your Wicket skills to customize the UI 
as need be.


There's some screenshots and a quick start on my blog 
(http://danhaywood.com) and there's a website too 
(http://wicketobjects.sourceforge.net).  To get started all you'll need 
is SVN and MVN.


I'm looking for feedback, and I'm also hoping that some of you smart web 
UI guys (not my strongest suit!) might be interested in helping me 
develop it up to a v1.0 release.


Thanks for reading,

Cheers
Dan Haywood
--
consultant, mentor, developer, author
agile, ddd, oo, java, .net, sybase
MA, MBCS, CITP, CEng
/mail: /d...@haywood-associates.co.uk mailto:d...@haywood-associates.co.uk
/book: /Domain Driven Design using Naked Objects 
http://pragprog.com/titles/dhnako

/blog: /http://danhaywood.com
/twitter: /http://twitter.com/dkhaywood



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

Reading cookies on first/each request

2010-06-28 Thread Bilgin Ibryam
Hi all,

I want to implement Remember me functionality  by storing the encrypted
and base64 encoded username in a cookie.
Then I'd like to check for the cookie on the very first request (or every
request) to the application.

Any tips whats the best way to access httpRequest object on each request to
the application? I suppose it has to do something with RequestCycle object,
but not sure.


Thanks in advance
Bilgin Ibryam


Jwicket and Wiquery

2010-06-28 Thread Josh Kamau
Hi team;

Whats the difference between jwicket and wiquery? I have already read
wiquery tutorials and seen some examples, but i dont need to find any for
jwicket. any help from jwicket team will do

Kind regards.

josh


Re: Reading cookies on first/each request

2010-06-28 Thread M. Hammer

Quoting Bilgin Ibryam bibr...@gmail.com:

I want to implement Remember me functionality  by storing the encrypted
and base64 encoded username in a cookie.
Then I'd like to check for the cookie on the very first request (or every
request) to the application.

Hi,

I do this in the newSession() method of my Application subclass. This  
method is called for the first request of a user, and possible for  
subsequent requests if the requested page is stateless. If a cookie is  
found, I copy the contents to the user's session and use it from there.
You have to cast Request and Response to WebRequest and WebResponse,  
and you can use getCookie() and addCookie(), respectively.


Regards,
  Moritz


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



RE: Jwicket and Wiquery

2010-06-28 Thread Stefan Lindner
There is no tutorial for jWicket yet. Take a look at the javadocs or look into 
the source code of the demo application.
And: If you are convinced that wiquery fulfills your requierements then take 
wiquery.

Stefan

-Ursprüngliche Nachricht-
Von: Josh Kamau [mailto:joshnet2...@gmail.com] 
Gesendet: Montag, 28. Juni 2010 16:05
An: users@wicket.apache.org
Betreff: Jwicket and Wiquery

Hi team;

Whats the difference between jwicket and wiquery? I have already read
wiquery tutorials and seen some examples, but i dont need to find any for
jwicket. any help from jwicket team will do

Kind regards.

josh

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



Re: Jwicket and Wiquery

2010-06-28 Thread Josh Kamau
Thanks Stefan.

Actually i have an idea that jWicket is what i want. I have read that it
allows me to do the UI the jquery way but send events via ajax to the
server. The only thing stopping me here is lack of documentation.

Let me check out the demo .

Thanks again.


On Mon, Jun 28, 2010 at 5:15 PM, Stefan Lindner lind...@visionet.de wrote:

 There is no tutorial for jWicket yet. Take a look at the javadocs or look
 into the source code of the demo application.
 And: If you are convinced that wiquery fulfills your requierements then
 take wiquery.

 Stefan

 -Ursprüngliche Nachricht-
 Von: Josh Kamau [mailto:joshnet2...@gmail.com]
 Gesendet: Montag, 28. Juni 2010 16:05
 An: users@wicket.apache.org
 Betreff: Jwicket and Wiquery

 Hi team;

 Whats the difference between jwicket and wiquery? I have already read
 wiquery tutorials and seen some examples, but i dont need to find any for
 jwicket. any help from jwicket team will do

 Kind regards.

 josh

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




AW: Jwicket and Wiquery

2010-06-28 Thread Stefan Lindner
Hi Josh,

yes, jWicket does it the Wicket way.
Generally you have a Behavior (e.g. DraggabeBehavior) extending wicket's 
AjaxBehavior.

The you have some own component (a Panel e.g.)

Now you simply do

myPanel.add(new DraggableBehavior(...));

And DraggableBehavior let's you override some callbacks e.g.

DraggabeBehavior draggable = new DraggabeBehavior() {
onDragStop(final AjaxRequestTarget target, final SpecialKeys 
specialKeys) {
// react when dragging has stopped
}
};
Draggable.setWantOnDragStopNotification(true);


class MyPanel  extends Panel implements IDraggable { // only implements 
IDraggable if you need to react here
onDragStop(final AjaxRequestTarget target, final SpecialKeys 
specialKeys) {
// or react here when dragging has stopped
}
}

MyPanel myPanel = new MyPanel();
myPanel.add(draggable);

That's all.

Stefan


-Ursprüngliche Nachricht-
Von: Josh Kamau [mailto:joshnet2...@gmail.com] 
Gesendet: Montag, 28. Juni 2010 16:20
An: users@wicket.apache.org
Betreff: Re: Jwicket and Wiquery

Thanks Stefan.

Actually i have an idea that jWicket is what i want. I have read that it
allows me to do the UI the jquery way but send events via ajax to the
server. The only thing stopping me here is lack of documentation.

Let me check out the demo .

Thanks again.


On Mon, Jun 28, 2010 at 5:15 PM, Stefan Lindner lind...@visionet.de wrote:

 There is no tutorial for jWicket yet. Take a look at the javadocs or look
 into the source code of the demo application.
 And: If you are convinced that wiquery fulfills your requierements then
 take wiquery.

 Stefan

 -Ursprüngliche Nachricht-
 Von: Josh Kamau [mailto:joshnet2...@gmail.com]
 Gesendet: Montag, 28. Juni 2010 16:05
 An: users@wicket.apache.org
 Betreff: Jwicket and Wiquery

 Hi team;

 Whats the difference between jwicket and wiquery? I have already read
 wiquery tutorials and seen some examples, but i dont need to find any for
 jwicket. any help from jwicket team will do

 Kind regards.

 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



Upgrade wicketstuff-push to Cometd2

2010-06-28 Thread Martin Grigorov
Hi,

Last weekend I felt a bit bored and I decided to take a look at one of
the cool wicketstuff projects that I had on my list for quite some time
- wicketstuff-core/push-parent. Few minutes later I decided to upgrade
it to Cometd version 2.0.0.RC1 because this is how I understand how the
things work - by debugging them.

And the outcome is: http://github.com/martin-g/wicket-cometd2
It is almost the same as the original code:
- upgrade Maven dependencies
- upgrade it to the new API (just the Java part for now)
- code formatting

Next steps are:
- upgrade Dojo to its latest stable (+ dojox.cometd)
- add implementation with jquery.cometd
- upgrade Wicket to 1.5-SNAPSHOT

At the end I will probably merge it back to wicketstuff-core if the
other developers/maintainers are OK with that.
Until then don't hesitate to fork it or comment here or in github.

Cheers
martin-g


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



Re: regarding IModel's

2010-06-28 Thread Jeremy Thomerson
I'll try to give some quick help.  Ask again if you have more detailed
questions.

On Mon, Jun 28, 2010 at 8:04 AM, Marzia Forli marzia.fo...@yahoo.comwrote:

 I have a problem with IModel's... Right now I am doing my homework with
 'Wicket In Action' and I know that models are connections to a data...
 What I need to know if there is some kind of design pattern/advice about
 handling the models...
 For example there are some typical scenarios that appear in the apps'
 1) login form with some ILoginService which have: login (String username,
 String password) and returns User. Would I have to have user and password
 Strings as Form attributes or something else ?


Something like this can be done with a regular Model for each of the Strings
- the default implementation of IModel.  It simply holds a serializable
value.  Or, you can have two String properties in your SignInForm class
(which is probably a panel containing a form), and then give the TextFields
each an instance of PropertyModel that connects it to those properties on
the form class.


 2) user profile data which are in db


A LoadableDetachableModel should be in charge of loading these domain
objects from the database.


 3) detail of shopping cart


Again, probably a LoadableDetachableModel.  It depends on where you're
storing it.  You will likely store this in the Session (remember that the
session is not thread safe by default).  But, you may be storing it to the
DB so that it outlives the session.  Your call.


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


Re: Panel re-rendered twice, when the data is pulled in.

2010-06-28 Thread jammyjohn

Ed,

Thank you so much for the reply. Could you please send me the link to the
working example. I would like to compare with the one I have.

Btw, thanks for pointing out the improper usage of table fragment as
panel. I have modified to div

Appreciate your help in this regard.

J.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Panel-re-rendered-twice-when-the-data-is-fetched-tp2268924p2271215.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: OutOfMemoryError with lots of unit tests

2010-06-28 Thread Zilvinas Vilutis
perTest is deprecated I think, you should use always - although it adds
additional time for each test run.

Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cika...@gmail.com


2010/6/28 Major Péter majorpe...@sch.bme.hu

 Hi,

 Try something like this:
 plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-surefire-plugin/artifactId
inheritedtrue/inherited
configuration
skipTestsfalse/skipTests
forkModeonce/forkMode
argLine-Xmx512m -XX:MaxPermSize=256m/argLine
/configuration
 /plugin

 maybe check out the perTest forkMode.

 Regards,
 Peter

 2010-06-28 11:08 keltezéssel, Swanthe Lindgren írta:
  Hello
  Has someone got any good tips about performing lots of render tests? We
  are using TestNG and maven/surefire test runner which results in
  OutOfMemoryError for our about 500 tests, where each test tries to
  render a page or panel. After a bit of redesigning our test classes and
  call WicketTester.destroy()  after each test, we were able to run about
  50 more tests, but now we are back at OutOfMemoryError.
 
  //Swanthe

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




including wicket component into jsp

2010-06-28 Thread rikizz

Hi all,

I know the many posts have been written on the same problem, but I have been
looking at the answers for 5 hours without having a simple example to work
with..
I basically need to include a single component (a menu) into my jsp pages,
because we are migrating the application from struts/jsp to wicket.
I tried with the following code but it didn't work:

WICKET APPLICATION:

public class WicketApplication extends WebApplication
{
public WicketApplication(){}
public ClassHomePage getHomePage(){   return HomePage.class;}
@Override
protected void init(){
getMarkupSettings().setStripWicketTags(true);

getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.ONE_PASS_RENDER);
}
}


PAGE MARKUP:
html
xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;

head  
titleWicket Quickstart Archetype Homepage/title
/head
body
strongWicket Quickstart Archetype Homepage/strong
br/br/
message will be here
/body
/html

PAGE CODE:

public class HomePage extends WebPage {
public HomePage(final PageParameters parameters) {
add(new Label(message, If you see this message wicket is properly
configured and running));
}
@Override
protected void onRender(final MarkupStream markupStream){
System.out.println(RENDER OF THE PAGE!!);
}
}

JSP PAGE:
jsp:include page=/wic/ /

WEB.XML:

web-app
filter
filter-namewicket.embedwicket/filter-name
filter-classembedwicket.WicketMenuFilter/filter-class
init-param
param-nameapplicationClassName/param-name
param-valueembedwicket.WicketApplication/param-value
/init-param
/filter

 filter-mapping
  filter-namewicket.embedwicket/filter-name
url-pattern/wic/*/url-pattern
dispatcherINCLUDE/dispatcher
dispatcherREQUEST/dispatcher
dispatcherFORWARD/dispatcher
 /filter-mapping
/web-app


WicketMenuFilter:
THIS IS MY CUSTOM WICKET FILTER TO MANAGE INCLUDE URI, AS IT WAS SUGGESTED
BY A GUY HERE:
http://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.html
http://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.html
 

Basically I overrided the method
public String getRelativePath(HttpServletRequest request)

buy copying it and replacing the following lines:

String path = Strings.stripJSessionId(request.getRequestURI());
String contextPath = request.getContextPath();

with:

String requestURI = (String)
request.getAttribute(javax.servlet.include.request_uri);
if (requestURI == null) {
requestURI = request.getRequestURI();
}
String path = Strings.stripJSessionId(requestURI);


I tried to debug the code and the filter is called, but then nothing is
displayed on the browser.. just a blank page..
If I call page directly(not the jsp) , it renders correctly..



Has anyone got a simple working example of this situation?

I would really appreciate id because I am going crazy..

Thank you very much.

Riccardo




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/including-wicket-component-into-jsp-tp2271266p2271266.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: including wicket component into jsp

2010-06-28 Thread bht
Have you checked that the wicket filter is called?

I found that the struts filter does not call filterChain.doFilter().
That may or may not be your problem depending whether anything else is
in its path after it. I suspect however that this is what you need
otherwise how can Wicket get the request if the wicket filter is not
called?

Regards

Bernard

On Mon, 28 Jun 2010 10:54:38 -0700 (PDT), you wrote:


Hi all,

I know the many posts have been written on the same problem, but I have been
looking at the answers for 5 hours without having a simple example to work
with..
I basically need to include a single component (a menu) into my jsp pages,
because we are migrating the application from struts/jsp to wicket.
I tried with the following code but it didn't work:

WICKET APPLICATION:

public class WicketApplication extends WebApplication
{
   public WicketApplication(){}
   public ClassHomePage getHomePage(){   return HomePage.class;}
   @Override
   protected void init(){
   getMarkupSettings().setStripWicketTags(true);
   
getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.ONE_PASS_RENDER);
   }
}


PAGE MARKUP:
html
xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;

head  
titleWicket Quickstart Archetype Homepage/title
/head
body
strongWicket Quickstart Archetype Homepage/strong
br/br/
message will be here
/body
/html

PAGE CODE:

public class HomePage extends WebPage {
public HomePage(final PageParameters parameters) {
add(new Label(message, If you see this message wicket is properly
configured and running));
}
@Override
protected void onRender(final MarkupStream markupStream){
   System.out.println(RENDER OF THE PAGE!!);
}
}

JSP PAGE:
jsp:include page=/wic/ /

WEB.XML:

web-app
   filter
   filter-namewicket.embedwicket/filter-name
   filter-classembedwicket.WicketMenuFilter/filter-class
   init-param
   param-nameapplicationClassName/param-name
   param-valueembedwicket.WicketApplication/param-value
   /init-param
   /filter

 filter-mapping
  filter-namewicket.embedwicket/filter-name
   url-pattern/wic/*/url-pattern
   dispatcherINCLUDE/dispatcher
   dispatcherREQUEST/dispatcher
   dispatcherFORWARD/dispatcher
 /filter-mapping
/web-app


WicketMenuFilter:
THIS IS MY CUSTOM WICKET FILTER TO MANAGE INCLUDE URI, AS IT WAS SUGGESTED
BY A GUY HERE:
http://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.html
http://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.html
 

Basically I overrided the method
public String getRelativePath(HttpServletRequest request)

buy copying it and replacing the following lines:

String path = Strings.stripJSessionId(request.getRequestURI());
String contextPath = request.getContextPath();

with:

String requestURI = (String)
request.getAttribute(javax.servlet.include.request_uri);
if (requestURI == null) {
   requestURI = request.getRequestURI();
}
String path = Strings.stripJSessionId(requestURI);


I tried to debug the code and the filter is called, but then nothing is
displayed on the browser.. just a blank page..
If I call page directly(not the jsp) , it renders correctly..



Has anyone got a simple working example of this situation?

I would really appreciate id because I am going crazy..

Thank you very much.

Riccardo


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



passing a map into PageParameters

2010-06-28 Thread Fernando Wermus
Hi all,
I need to pass a map into PageParameters. But I failed.

MapString, Object swfParameters=new HashMapString, Object();
...
swfParameters.put(token, abc);
p.put(PanelIframe.SWF_PARAMETERS, swfParameters);

...
RequestCycle.get().urlFor(clazz, p);

The map is converted to {token=abc} like.

But when the Page for this request is called, there is an empty map into
PageParameters,

Is there a way to pass a map into PageParameters?

-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: Submitting a component value on a ajax call of a different component

2010-06-28 Thread jammyjohn

Why is getCallbackScript(boolean onlyTargetActivePage) is not called in the
below code. I realized that it is not a @Override method. Not sure what is
wrong here

Instead of using typeOption.add(new AbstractDefaultAjaxBehavior(), I also
tried using typeOption.add(new
AjaxFormComponentUpdatingBehavior(onchange). the onUpdate method is
called, but not the getCallbackScript method..

Could anybody please help me?

Thanks,
J
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Submitting-a-component-value-on-a-ajax-call-of-a-different-component-tp2264940p2271345.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: passing a map into PageParameters

2010-06-28 Thread jammyjohn

PageParameters parameters = new PageParameters(swfParameters);

This is how the hashmap is constructed in PageParameters..

Thanks,
J
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/passing-a-map-into-PageParameters-tp2271341p2271351.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: passing a map into PageParameters

2010-06-28 Thread Fernando Wermus
This is not what I want to achieve.

I need to pass a map of  parameters as just an entry into PageParameters and
other entries too.

For instance,


Map swfParameters=new HashMap();
swfParameteres.put(a, 1);
swfParameteres.put(b, 2);

PageParameters p=new PageParameters();
p.put(swfParameters, swfParameters);
p.put(other, other);

On Mon, Jun 28, 2010 at 4:15 PM, jammyjohn jchinnas...@yahoo.com wrote:


 PageParameters parameters = new PageParameters(swfParameters);

 This is how the hashmap is constructed in PageParameters..

 Thanks,
 J
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/passing-a-map-into-PageParameters-tp2271341p2271351.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




-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: including wicket component into jsp

2010-06-28 Thread rikizz

Hi,

thanks for the reply. Yes i checked, and the wicket filter is called but
debugging wicket code i found that is not calling the onrender method. I
will investigate to find out way..
If anyone has a working example it would be great..
thanks
riccardo

On 28 June 2010 19:40, bht [via Apache Wicket] 
ml-node+2271310-405062206-282...@n4.nabble.comml-node%2b2271310-405062206-282...@n4.nabble.com
 wrote:

 Have you checked that the wicket filter is called?

 I found that the struts filter does not call filterChain.doFilter().
 That may or may not be your problem depending whether anything else is
 in its path after it. I suspect however that this is what you need
 otherwise how can Wicket get the request if the wicket filter is not
 called?

 Regards

 Bernard

 On Mon, 28 Jun 2010 10:54:38 -0700 (PDT), you wrote:

 
 Hi all,
 
 I know the many posts have been written on the same problem, but I have
 been
 looking at the answers for 5 hours without having a simple example to work

 with..
 I basically need to include a single component (a menu) into my jsp pages,

 because we are migrating the application from struts/jsp to wicket.
 I tried with the following code but it didn't work:
 
 WICKET APPLICATION:
 
 public class WicketApplication extends WebApplication
 {
  public WicketApplication(){}
  public ClassHomePage getHomePage(){ return HomePage.class;}
  @Override
  protected void init(){
  getMarkupSettings().setStripWicketTags(true);
 
 getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.ONE_PASS_RENDER);

  }
 }
 
 
 PAGE MARKUP:
 html
 xmlns:wicket=
 http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;
 
 head
 titleWicket Quickstart Archetype Homepage/title
 /head
 body
 strongWicket Quickstart Archetype Homepage/strong
 br/br/
 message will be here
 /body
 /html
 
 PAGE CODE:
 
 public class HomePage extends WebPage {
 public HomePage(final PageParameters parameters) {
 add(new Label(message, If you see this message wicket is
 properly
 configured and running));
 }
 @Override
 protected void onRender(final MarkupStream markupStream){
  System.out.println(RENDER OF THE PAGE!!);
 }
 }
 
 JSP PAGE:
 jsp:include page=/wic/ /
 
 WEB.XML:
 
 web-app
  filter
  filter-namewicket.embedwicket/filter-name
  filter-classembedwicket.WicketMenuFilter/filter-class
  init-param
  param-nameapplicationClassName/param-name
  param-valueembedwicket.WicketApplication/param-value
  /init-param
  /filter
 
  filter-mapping
   filter-namewicket.embedwicket/filter-name
  url-pattern/wic/*/url-pattern
  dispatcherINCLUDE/dispatcher
  dispatcherREQUEST/dispatcher
  dispatcherFORWARD/dispatcher
  /filter-mapping
 /web-app
 
 
 WicketMenuFilter:
 THIS IS MY CUSTOM WICKET FILTER TO MANAGE INCLUDE URI, AS IT WAS SUGGESTED

 BY A GUY HERE:
 
 http://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.htmlhttp://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.html?by-user=t
 
 http://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.htmlhttp://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.html?by-user=t

 
 Basically I overrided the method
 public String getRelativePath(HttpServletRequest request)
 
 buy copying it and replacing the following lines:
 
 String path = Strings.stripJSessionId(request.getRequestURI());
 String contextPath = request.getContextPath();
 
 with:
 
 String requestURI = (String)
 request.getAttribute(javax.servlet.include.request_uri);
 if (requestURI == null) {
  requestURI = request.getRequestURI();
 }
 String path = Strings.stripJSessionId(requestURI);
 
 
 I tried to debug the code and the filter is called, but then nothing is
 displayed on the browser.. just a blank page..
 If I call page directly(not the jsp) , it renders correctly..
 
 
 
 Has anyone got a simple working example of this situation?
 
 I would really appreciate id because I am going crazy..
 
 Thank you very much.
 
 Riccardo


 -
 To unsubscribe, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=2271310i=0
 For additional commands, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=2271310i=1



 --
  View message @
 http://apache-wicket.1842946.n4.nabble.com/including-wicket-component-into-jsp-tp2271266p2271310.html
 To unsubscribe from including wicket component into jsp, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/subscriptions/Unsubscribe.jtp?code=bXVyYS5yaWNjYXJkb0BnbWFpbC5jb218MjI3MTI2NnwtODk5MjkyMjU5.




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/including-wicket-component-into-jsp-tp2271266p2271389.html
Sent from the Wicket - User mailing list archive at Nabble.com.


Generating static HTML pages with Wicket

2010-06-28 Thread jverstry

Hi,

I am new to Wicket. I would like to use Wicket to generate static html pages
from a Java application. I have created a MyPage.html and corresponding
MyPage.java files. MyPage extends WebPage.

I would to know if it is possible to generate the 'final' html page that
would be sent and displayed in a browser and save it in a local html file
instead. Is there a special method I could call on WebPage? Can you give an
example?

Many thanks, 

JVerstry
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Generating-static-HTML-pages-with-Wicket-tp2271517p2271517.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: Jwicket and Wiquery

2010-06-28 Thread Stefan Lindner
Hi Josh,

it would be nice to her from you. Regardless of your decision. And while 
jwicket is a work in progres I am always glad to receive any feedback from 
users.

Stefan

-Ursprüngliche Nachricht-
Von: Josh Kamau [mailto:joshnet2...@gmail.com] 
Gesendet: Montag, 28. Juni 2010 16:20
An: users@wicket.apache.org
Betreff: Re: Jwicket and Wiquery

Thanks Stefan.

Actually i have an idea that jWicket is what i want. I have read that it
allows me to do the UI the jquery way but send events via ajax to the
server. The only thing stopping me here is lack of documentation.

Let me check out the demo .

Thanks again.


On Mon, Jun 28, 2010 at 5:15 PM, Stefan Lindner lind...@visionet.de wrote:

 There is no tutorial for jWicket yet. Take a look at the javadocs or look
 into the source code of the demo application.
 And: If you are convinced that wiquery fulfills your requierements then
 take wiquery.

 Stefan

 -Ursprüngliche Nachricht-
 Von: Josh Kamau [mailto:joshnet2...@gmail.com]
 Gesendet: Montag, 28. Juni 2010 16:05
 An: users@wicket.apache.org
 Betreff: Jwicket and Wiquery

 Hi team;

 Whats the difference between jwicket and wiquery? I have already read
 wiquery tutorials and seen some examples, but i dont need to find any for
 jwicket. any help from jwicket team will do

 Kind regards.

 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



Links in DataTable

2010-06-28 Thread Nelson Segura
I am trying to create a table based on DataTable, in which one of the
columns has links on it.
I tried to use the strategy described here (LinkPanel):

https://cwiki.apache.org/WICKET/adding-links-in-a-defaultdatatable.html

But this has a problem: clicking in the links in succession soon causes
component not found exceptions, or opening the link in a new window or tab
renders the current page unusable, with the same exception.

rg.apache.wicket.WicketRuntimeException: component . not found on page ...
 at 
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426)
 at 
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471)
 at 
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
...

I believe this is due to the fact that a new LinkPanel is created when
rendering each column cell, and that when the click happens, the current
LinkPanels are replaced by new ones, and so the original page is not usable
anymore, because it is referring to the original LinkPanels.

Our users make heavy use of opening links in a list in new pages or tabs, so
this is a big deal for us :(

Is there any solution for this problem? The only one I can think of is to
use AjaxLink instead, but I am not sure whether that is correct, or if it
could cause even more problems.

Any help?

-Nelson


Re: Links in DataTable

2010-06-28 Thread Jeremy Thomerson
please show some code

On Mon, Jun 28, 2010 at 6:39 PM, Nelson Segura nsegu...@gmail.com wrote:

 I am trying to create a table based on DataTable, in which one of the
 columns has links on it.
 I tried to use the strategy described here (LinkPanel):

 https://cwiki.apache.org/WICKET/adding-links-in-a-defaultdatatable.html

 But this has a problem: clicking in the links in succession soon causes
 component not found exceptions, or opening the link in a new window or
 tab
 renders the current page unusable, with the same exception.

 rg.apache.wicket.WicketRuntimeException: component . not found on page
 ...
 at
 org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426)
 at
 org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471)
 at
 org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
 ...

 I believe this is due to the fact that a new LinkPanel is created when
 rendering each column cell, and that when the click happens, the current
 LinkPanels are replaced by new ones, and so the original page is not usable
 anymore, because it is referring to the original LinkPanels.

 Our users make heavy use of opening links in a list in new pages or tabs,
 so
 this is a big deal for us :(

 Is there any solution for this problem? The only one I can think of is to
 use AjaxLink instead, but I am not sure whether that is correct, or if it
 could cause even more problems.

 Any help?

 -Nelson




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


Re: Panel re-rendered twice, when the data is fetched.

2010-06-28 Thread jammyjohn

Hi,

I figured out the issue for panel being rendered twice :)

The addresspanel.html was not started  with table tag... It directly has a
tr tag..

It worked fine, when I constructed the tags with proper
tabletrtd../td/tr/table. 

Thanks a lot...

J
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Panel-re-rendered-twice-when-the-data-is-fetched-tp2268924p2271624.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: Links in DataTable

2010-06-28 Thread Nelson Segura
Jeremy, the code is below.

I did notice something while researching/testing more.
The LinkPanel solution DOES work for a DataTable. The problem starts when
changed to a AjaxFallbackDefaultDataTable.
I did testing based in the datatable example in the wicket examples.
Maybe using an AjaxLink instead of a normal link in the table is the right
answer.


Code is mostly taken from the page linked in the original email

public abstract class LinkPanelT extends Panel {

private static final long serialVersionUID = 2062173455224348354L;

public LinkPanel(final Item? item, final String componentId,
final IModelT model, final String property) {
super(componentId, model);

AjaxLinkT link = new AjaxLinkT(linkCell) {

private static final long serialVersionUID =
2574434147588617330L;

@Override
public void onClick(AjaxRequestTarget target) {
LinkPanel.this.onClick();
}


};
add(link);
link.add(new Label(label, new PropertyModel(model,property)));
}

protected abstract void onClick();
}

- Usage ---

public class LinkPanelPage extends WebPage {

public LinkPanelPage() {
Form form = new Form(form);
final LinkPanelListProvider provider = new LinkPanelListProvider();
ListIColumn columnList = new ArrayListIColumn(3);
//columnList.add(new PropertyColumn(new
Model(eMailAddress),eMailAddress));
columnList.add(new AbstractColumn(new Model(eMailAddress),
eMailAddress) {
private static final long serialVersionUID =
-1822504503325964706L;

@Override
@SuppressWarnings(unchecked)
public void populateItem(Item cellItem, String componentId,
final IModel rowModel) {
cellItem.add(new LinkPanel(cellItem, componentId, rowModel,
getSortProperty()) {

private static final long serialVersionUID =
-4615958634366803506L;

@Override
protected void onClick() {
System.out.println(clicked on link);
}
});
}

});

columnList.add(new PropertyColumn(new
Model(firstName),firstName));
columnList.add(new PropertyColumn(new
Model(lastName),lastName));
AjaxFallbackDefaultDataTable table = new
AjaxFallbackDefaultDataTable(link-panel-table, columnList, provider, 3);
form.add(table);
add(form);
}
}

-Nelson

On Mon, Jun 28, 2010 at 5:14 PM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 please show some code

 On Mon, Jun 28, 2010 at 6:39 PM, Nelson Segura nsegu...@gmail.com wrote:

  I am trying to create a table based on DataTable, in which one of the
  columns has links on it.
  I tried to use the strategy described here (LinkPanel):
 
  https://cwiki.apache.org/WICKET/adding-links-in-a-defaultdatatable.html
 
  But this has a problem: clicking in the links in succession soon causes
  component not found exceptions, or opening the link in a new window or
  tab
  renders the current page unusable, with the same exception.
 
  rg.apache.wicket.WicketRuntimeException: component . not found on
 page
  ...
  at
 
 org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426)
  at
 
 org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471)
  at
 
 org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
  at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
  ...
 
  I believe this is due to the fact that a new LinkPanel is created when
  rendering each column cell, and that when the click happens, the current
  LinkPanels are replaced by new ones, and so the original page is not
 usable
  anymore, because it is referring to the original LinkPanels.
 
  Our users make heavy use of opening links in a list in new pages or tabs,
  so
  this is a big deal for us :(
 
  Is there any solution for this problem? The only one I can think of is to
  use AjaxLink instead, but I am not sure whether that is correct, or if it
  could cause even more problems.
 
  Any help?
 
  -Nelson
 



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



Re: AW: Jwicket and Wiquery

2010-06-28 Thread Sam Stainsby
On Mon, 28 Jun 2010 16:29:51 +0200, Stefan Lindner wrote:

 Hi Josh,
 
 yes, jWicket does it the Wicket way.
 Generally you have a Behavior (e.g. DraggabeBehavior) extending wicket's
 AjaxBehavior.

So does Wiquery:

label = new Label(item-name, model)
draggableBehavior = new DraggableBehavior
draggableBehavior.setOpacity(0.75f)
draggableBehavior.setRevert(new DraggableRevert(true))
label.add(draggableBehavior)


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



Re: Links in DataTable

2010-06-28 Thread Nelson Segura
Since AjaxLink is AJAX and not a proper link, then it does behave as a
normal link, i.e. middle click (open link in new tab or new window) does not
trigger the AJAX click even, which means you cannot chose to open the link
in a new page.

back to square one, except that know I know is a problem with
AjaxFallbackDefaultDataTable, not with DataTable.


-Nelson

On Mon, Jun 28, 2010 at 5:47 PM, Nelson Segura nsegu...@gmail.com wrote:

 Jeremy, the code is below.

 I did notice something while researching/testing more.
 The LinkPanel solution DOES work for a DataTable. The problem starts when
 changed to a AjaxFallbackDefaultDataTable.
 I did testing based in the datatable example in the wicket examples.
 Maybe using an AjaxLink instead of a normal link in the table is the right
 answer.


 Code is mostly taken from the page linked in the original email

 public abstract class LinkPanelT extends Panel {

 private static final long serialVersionUID = 2062173455224348354L;

 public LinkPanel(final Item? item, final String componentId,
 final IModelT model, final String property) {
 super(componentId, model);

 AjaxLinkT link = new AjaxLinkT(linkCell) {

 private static final long serialVersionUID =
 2574434147588617330L;

 @Override
 public void onClick(AjaxRequestTarget target) {
 LinkPanel.this.onClick();
 }


 };
 add(link);
 link.add(new Label(label, new PropertyModel(model,property)));
 }

 protected abstract void onClick();
 }

 - Usage ---

 public class LinkPanelPage extends WebPage {

 public LinkPanelPage() {
 Form form = new Form(form);
 final LinkPanelListProvider provider = new LinkPanelListProvider();
 ListIColumn columnList = new ArrayListIColumn(3);
 //columnList.add(new PropertyColumn(new
 Model(eMailAddress),eMailAddress));
 columnList.add(new AbstractColumn(new Model(eMailAddress),
 eMailAddress) {
 private static final long serialVersionUID =
 -1822504503325964706L;

 @Override
 @SuppressWarnings(unchecked)
 public void populateItem(Item cellItem, String componentId,
 final IModel rowModel) {
 cellItem.add(new LinkPanel(cellItem, componentId, rowModel,
 getSortProperty()) {

 private static final long serialVersionUID =
 -4615958634366803506L;

 @Override
 protected void onClick() {
 System.out.println(clicked on link);
 }
 });
 }

 });

 columnList.add(new PropertyColumn(new
 Model(firstName),firstName));
 columnList.add(new PropertyColumn(new
 Model(lastName),lastName));
 AjaxFallbackDefaultDataTable table = new
 AjaxFallbackDefaultDataTable(link-panel-table, columnList, provider, 3);
 form.add(table);
 add(form);
 }
 }

 -Nelson


 On Mon, Jun 28, 2010 at 5:14 PM, Jeremy Thomerson 
 jer...@wickettraining.com wrote:

 please show some code

 On Mon, Jun 28, 2010 at 6:39 PM, Nelson Segura nsegu...@gmail.com
 wrote:

  I am trying to create a table based on DataTable, in which one of the
  columns has links on it.
  I tried to use the strategy described here (LinkPanel):
 
  https://cwiki.apache.org/WICKET/adding-links-in-a-defaultdatatable.html
 
  But this has a problem: clicking in the links in succession soon causes
  component not found exceptions, or opening the link in a new window or
  tab
  renders the current page unusable, with the same exception.
 
  rg.apache.wicket.WicketRuntimeException: component . not found on
 page
  ...
  at
 
 org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426)
  at
 
 org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471)
  at
 
 org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
  at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
  ...
 
  I believe this is due to the fact that a new LinkPanel is created when
  rendering each column cell, and that when the click happens, the current
  LinkPanels are replaced by new ones, and so the original page is not
 usable
  anymore, because it is referring to the original LinkPanels.
 
  Our users make heavy use of opening links in a list in new pages or
 tabs,
  so
  this is a big deal for us :(
 
  Is there any solution for this problem? The only one I can think of is
 to
  use AjaxLink instead, but I am not sure whether that is correct, or if
 it
  could cause even more problems.
 
  Any help?
 
  -Nelson
 



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





extending AbstractFormValidator as a validation adapter

2010-06-28 Thread Ray Weidner
Hi all,

The application that I'm current writing already has its own validation
logic, but I would like to integrate its results into the existing Wicket
form validation so as to unify the feedback.  To this end, I'm trying to
extend AbstractFormValidator to wrap my system's logic.

The way my system's validation works is pretty simple and self-explanatory:

*public interface Validator {*
* **public ValidationResult validate (Record record, Action action);*
*}*
*
*
*public interface ValidationResult {*
* **public boolean isValid ();*
*
*
* **public Set String getGeneralErrorMessages ();*
* *
* **public Set String getFieldErrorFieldNames ();*
* *
* **public Set String getFieldErrorMessages (String fieldName);*
*}*

The ValidationResultImpl is pretty much a simple bean for setting and
getting error messages, both general, and by field.  Validator
implementations are specific to the need, and the specifics aren't important
here.

For my adapter, I'm able to get to a certain point, and I'm not sure what
call to make next:

*public class RecordFormValidator extends AbstractFormValidator {*
* **private Validator validator = null;*
* **private Action action = null;*
* *
* **public RecordFormValidator (Validator validator, Action action) {*
* **this.validator = validator;*
* **this.action = action;*
* **}*
*
*
* *...@override*
* **public FormComponent ? [] getDependentFormComponents () {*
* **return new FormComponent [0];*
* **}*
*
*
* *...@override*
* **public void validate (Form ? arg0) {*
* **Record record = ((Form Record) arg0).getModel ().getObject ();*
* **Validation result = validator.validate (record, action);*
* *
* **for (String generalErrorMessage : result.getGeneralErrorMessages ()) {*
* **// TODO: ???*
* **}*
* **for (String fieldName : result.getFieldErrorFieldNames ()) {*
* **for (String fieldErrorMessage : result.getFieldErrorMessages (fieldName))
{*
* **// TODO: ???*
* **}*
* **}*
* **}*
*}*
*
*
In examples I see online, validation errors seem to be registered by calls
of the #error method.  It seems like I should be doing that here, too, but
what I don't know is:

   - Which object's #error method should be called?  The validator's?  The
   FormComponent corresponding to the field in question?  I want field-specific
   errors appropriately associated with their fields, so I can use filters for
   field-specific feedback, etc.
   - I already have my actual error strings, so how do I skip around the
   resource logic to just set the error message?
   - What should I do with my generalErrorMessages, which aren't tied to
   any specific field?

Any help would be appreciated, thanks!

Ray Weidner


Re: ajaxPagingNavigation and CheckGroup

2010-06-28 Thread Igor Vaynberg
use ajaxsubmitlink in your paging navigator

-igor

2010/6/22 Fernando Wermus fernando.wer...@gmail.com:
 Hola,
    Quería saber si existe alguna manera de no perder los items
 seleccionados de un checkgroup - check en una lista que esta paginada con
 AjaxPagingNavigation.

 saludos!

 --
 Fernando Wermus.

 www.linkedin.com/in/fernandowermus


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



Re: handling error in DataProvider

2010-06-28 Thread Igor Vaynberg
the exception will be thrown as many times as there are tables. but
this exception does not fill in the stack trace so it should be fast.
profile the code and see where the time is.

-igor

On Wed, Jun 23, 2010 at 1:56 AM, Decebal Suiu decebal.s...@asf.ro wrote:

 The problem with RestartResponsePage approach is that when multiple data
 tables (for example last 2 tables from 10) are in error I have a performance
 problem. Is it true my observation?

 Thanks,
 Decebal
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/handling-error-in-DataProvider-tp2264242p2265293.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: passing a map into PageParameters

2010-06-28 Thread Ray Weidner
I haven't had any success storing anything other than Strings in
PageParameters objects.  It makes sense, since these are supposed to
represent bookmarkable (i.e. GET) parameters.  If you're hoping to throw
arbitrary Maps into a PageParameters, you're going to be disappointed.  But
if you have an idea what kind of data is going to be in the Map (especially
if you're using generics, unlike your example), then you can write a pair of
methods to translate between Map and String for this purpose.

I'm not sure what limitations on characters that you might run into due to
the fact that they have to be embedded in a URL, so you have to try it out.
 However, I wouldn't be surprised if Wicket escapes everything cleanly,
meaning that you don't have to worry about such things.

Of course, you don't have to embed your Map within a PageParameters if the
page that you want to go to doesn't need to be bookmarkable.  In that case,
just pass your Map to the destination page object through a constructor of
your design, and call #setResponsePage on the page object.


On Mon, Jun 28, 2010 at 3:23 PM, Fernando Wermus
fernando.wer...@gmail.comwrote:

 This is not what I want to achieve.

 I need to pass a map of  parameters as just an entry into PageParameters
 and
 other entries too.

 For instance,


 Map swfParameters=new HashMap();
 swfParameteres.put(a, 1);
 swfParameteres.put(b, 2);

 PageParameters p=new PageParameters();
 p.put(swfParameters, swfParameters);
 p.put(other, other);

 On Mon, Jun 28, 2010 at 4:15 PM, jammyjohn jchinnas...@yahoo.com wrote:

 
  PageParameters parameters = new PageParameters(swfParameters);
 
  This is how the hashmap is constructed in PageParameters..
 
  Thanks,
  J
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/passing-a-map-into-PageParameters-tp2271341p2271351.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
 
 


 --
 Fernando Wermus.

 www.linkedin.com/in/fernandowermus



Re: Security questions

2010-06-28 Thread Igor Vaynberg
On Wed, Jun 23, 2010 at 7:45 AM, danisevsky danisev...@gmail.com wrote:
 I would like to implement guest book panel and I have two security question.

 1) Need I captcha when there will be only ajax submit link? I think that
 robots can't submit form thru javascript.

should be ok


 2) New comments will users write in Rich Text Editor (
 http://visural-wicket-examples.appspot.com/app/rich-text-editor Reduced
 Functionality Example)
 so I must setEscapeModelStrings(false) on the label which shows comments. Is
 this big security issue?

not as long as you properly sanitize the code, if you dont then
someone can submit script tags inside their comment and create an
xss attack.

-igor


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



Re: Problems with AjaxPagingNavigation

2010-06-28 Thread Igor Vaynberg
use the navigator

-igor

On Wed, Jun 23, 2010 at 8:10 AM, Matthias Klass
matthias.kl...@fh-augsburg.de wrote:
 Hi,

 I've added a AjaxPagingNavigation to a Panel. Yet, when clicking on the
 created link nothing happens - no redirection to the new page. When I copy
 the link directly from the markup and paste it into the browser window, the
 new page shows up - it's just about the click link.

 First I created a PageableListView:

 /PageableListViewCampaign campaignList = new
 PageableListViewCampaign(campaignList, campaigns, pagesize) {
    (...)
 }/

 Afterwards I added the campaignList and the Navigator to a markup container:

 /        WebMarkupContainer container = new
 WebMarkupContainer(campaignList.listContainer);
        container.add(campaignList);


        AjaxPagingNavigation navigation = new
 AjaxPagingNavigation(campaignList.navigation, campaignList);
        container.add(navigation);

        if (campaignList.getModelObject().size()  pagesize) {
            navigation.setVisible(false);
        }

        add(container);/

 The markup is the following:
 / div wicket:id=campaignList.listContainer
 ul class=campaignListlist
            (...)
 /ul

 span wicket:id=campaignList.navigation
 a wicket:id=pageLink href=#
 span wicket:id=pageNumber/span
 /a
 /span
 /div
 /
 What am I doing wrong? Should I use the AjexPagingNavigator instead? What's
 the difference?

 Thank you very much in advance,
 Matthias



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



Re: fast user input speed

2010-06-28 Thread Igor Vaynberg
this is not your typical usecase for a web application :) web
applications are limited by the round trip to the server - which is
limited by how fast your server is and what the user's connection
speed is.

i would try to profile your application and see if you can make it
faster, but i dont think you can do anything about a super fast enter
key double hit, the browser will lose the second key event while
trying to process the first.

i think you may be better off using something like gwt and pushing as
much of your business logic into the client as you can.

-igor

On Thu, Jun 24, 2010 at 12:30 PM, Joerib joe...@yahoo.com wrote:
 Hello,

 We are
 developping an application using Wicket 1.4. The application is a rewrite of 
 an
 old Delphi program.  The users have a special requirement that all input
 data must be done via the right hand keypad.  Input data is mostly numeric
 data and field submission is done with the right keypad “ENTER” key or the
 right keypad “+” sign.

 We solved
 this by capturing the “ENTER” and “+” sign key code on the key down event and
 triggered an Ajax request.  The reasons why were doing this via Ajax
 events and not plain JavaScript is because the next focus field is dependent 
 on
 the entered data.  This cannot be determent in advance.  Between
 field submissions there is also business logic validation happening.

 This was
 working perfectly until the users were getting to know the application better
 and their input speed was increasing.  After a while the application
 couldn’t follow their input speed and the users were not happy with the
 result.  Using the Delphi program they didn’t have this “input lag”.

 I would
 like to hear some ideas on how you guys made the user experience for a web
 application as close to a fat client application?  The biggest complaint
 they have is when they type the “enter” key a few times the application only
 responds to the first event.

 Regards,
 Joeri




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



Re: CryptedUrlWebRequestCodingStrategy with JMeter

2010-06-28 Thread Igor Vaynberg
it is very hard to test this with jmeter because urls generated will
be different every time since a new random key is generated for every
session. you will be better served by turning off the crypted url
coding strategy for your junit tests.

-igor

On Thu, Jun 24, 2010 at 1:22 PM,  gurpreet.si...@wellsfargo.com wrote:
 Hi All,

 I am trying to do use JMeter with Wicket. Our application use 
 CryptedUrlWebRequestCodingStrategy.

 I looked on Wiki page for JMeter and tried to use regular expression for form 
 id's. But with CryptedUrlWebRequestCodingStrategy  it's not working .

 Any one has idea how to get  formId's  for JMeter to submit.

 My JMeter Test Plan is kind of typical web application flow:

 Home Page -  Login Page -   Welcome Page .. some more tests involved Ajax 
 components



 Thanks
 Preet




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



Re: Docu/Examples of Models and Generics in Wicket 1.4?

2010-06-28 Thread Igor Vaynberg
there is the wicket-examples module which contains...examples. if you
have more specific questions im sure someone will answer them.

-igor

On Fri, Jun 25, 2010 at 2:23 AM, Alessandro Bottoni
alexbott...@yahoo.it wrote:
 Hi All,
 I'm new to Wicket and I'm studying it with Wicket in Action. As you
 surely know, this book is based on Wicket 1.3, that does NOT use
 generics, while the current version is 1.4 and DOES use them (as will do
 the next ones).

 Put aside this page:

 https://cwiki.apache.org/WICKET/migrating-to-wicket-14.html#MigratingtoWicket1.4-Modelchanges

 I was unable to find any other documentation and/or example  regarding
 the use of Java Generics with Wicket 1.4. (Actually, there is also this
 historically-interesting report of the discussion about generics:
 https://cwiki.apache.org/WICKET/generics.html).

 Does anybody know of any other documentation or example I can/should use
 as a reference while studying this part of Wicket 1.4?

 Thanks in advance.
 --

 Alessandro Bottoni
 Website: http://www.alessandrobottoni.it/

 All is mystery; but he is a slave who will not struggle to penetrate
 the dark veil.
     -- Benjamin Disraeli

 -
 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: CryptedUrlWebRequestCodingStrategy, mounted stateless pages and IOException

2010-06-28 Thread Igor Vaynberg
On Mon, Jun 28, 2010 at 6:36 AM, nmetzger nmetz...@odu.edu wrote:

 Hi all,

 I'm running into problems with my CryptedUrlWebRequestCodingStrategy. First
 a question:

 I understand that the CryptedUrlWebRequestCodingStrategy creates a http
 session for all pages, even stateless ones. If I mount my stateless pages in
 my application, does this override the session creation? (My stateless pages
 are the homepage, login page, faq etc).

the session is created to keep the encryption key the strategy uses.

-igor


 Second, I occasionally see the following error in my application logs, but
 haven't been able to reproduce it in my test environment. Has any one any
 idea where this is coming from? I'm using wicket 1.4.9 with Shiro 1.0

 Exception:
 java.lang.IllegalStateException: IOException: Premature end of POST data
        at
 com.evermind.server.http.EvermindHttpServletRequest.getParameterMap(EvermindHttpServletRequest.java:1642)
        at
 javax.servlet.ServletRequestWrapper.getParameterMap(ServletRequestWrapper.java:211)
        at
 org.apache.wicket.protocol.http.servlet.ServletWebRequest.getParameterMap(ServletWebRequest.java:147)
        at
 org.apache.wicket.protocol.http.request.CryptedUrlWebRequestCodingStrategy$DecodedUrlRequest.init(CryptedUrlWebRequestCodingStrategy.java:434)
        at
 org.apache.wicket.protocol.http.request.CryptedUrlWebRequestCodingStrategy.decode(CryptedUrlWebRequestCodingStrategy.java:124)
        at org.apache.wicket.Request.getRequestParameters(Request.java:183)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
        at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
        at
 org.apache.wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:160)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at
 com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
        at
 org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:359)
        at
 org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:275)
        at
 org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
        at
 org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
        at
 org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:343)
        at
 org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:272)
        at
 org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:83)
        at
 com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623)
        at
 com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
        at
 com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:889)
        at
 com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
        at
 com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
        at
 com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
        at
 oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
        at
 com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
        at java.lang.Thread.run(Thread.java:595)
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/CryptedUrlWebRequestCodingStrategy-mounted-stateless-pages-and-IOException-tp2270917p2270917.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: Reading cookies on first/each request

2010-06-28 Thread Igor Vaynberg
alternatively requestcycle#onbeginrequest() is also a good place

-igor

On Mon, Jun 28, 2010 at 7:05 AM, M. Hammer nab...@hammer-tour.com wrote:
 Quoting Bilgin Ibryam bibr...@gmail.com:

 I want to implement Remember me functionality  by storing the encrypted
 and base64 encoded username in a cookie.
 Then I'd like to check for the cookie on the very first request (or every
 request) to the application.

 Hi,

 I do this in the newSession() method of my Application subclass. This method
 is called for the first request of a user, and possible for subsequent
 requests if the requested page is stateless. If a cookie is found, I copy
 the contents to the user's session and use it from there.
 You have to cast Request and Response to WebRequest and WebResponse, and you
 can use getCookie() and addCookie(), respectively.

 Regards,
  Moritz


 -
 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: Generating static HTML pages with Wicket

2010-06-28 Thread Igor Vaynberg
see our unit tests, this is how wickettester works and you can use
that to render the page outside a webrequest

-igor

On Mon, Jun 28, 2010 at 2:59 PM, jverstry jvers...@gmail.com wrote:

 Hi,

 I am new to Wicket. I would like to use Wicket to generate static html pages
 from a Java application. I have created a MyPage.html and corresponding
 MyPage.java files. MyPage extends WebPage.

 I would to know if it is possible to generate the 'final' html page that
 would be sent and displayed in a browser and save it in a local html file
 instead. Is there a special method I could call on WebPage? Can you give an
 example?

 Many thanks,

 JVerstry
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Generating-static-HTML-pages-with-Wicket-tp2271517p2271517.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: extending AbstractFormValidator as a validation adapter

2010-06-28 Thread Igor Vaynberg
On Mon, Jun 28, 2010 at 9:27 PM, Ray Weidner
ray.weidner.develo...@gmail.com wrote:
 Hi all,

 The application that I'm current writing already has its own validation
 logic, but I would like to integrate its results into the existing Wicket
 form validation so as to unify the feedback.  To this end, I'm trying to
 extend AbstractFormValidator to wrap my system's logic.

 The way my system's validation works is pretty simple and self-explanatory:

 *public interface Validator {*
 * **public ValidationResult validate (Record record, Action action);*
 *}*
 *
 *
 *public interface ValidationResult {*
 * **public boolean isValid ();*
 *
 *
 * **public Set String getGeneralErrorMessages ();*
 * *
 * **public Set String getFieldErrorFieldNames ();*
 * *
 * **public Set String getFieldErrorMessages (String fieldName);*
 *}*

 The ValidationResultImpl is pretty much a simple bean for setting and
 getting error messages, both general, and by field.  Validator
 implementations are specific to the need, and the specifics aren't important
 here.

 For my adapter, I'm able to get to a certain point, and I'm not sure what
 call to make next:

 *public class RecordFormValidator extends AbstractFormValidator {*
 * **private Validator validator = null;*
 * **private Action action = null;*
 * *
 * **public RecordFormValidator (Validator validator, Action action) {*
 * **this.validator = validator;*
 * **this.action = action;*
 * **}*
 *
 *
 * *...@override*
 * **public FormComponent ? [] getDependentFormComponents () {*
 * **return new FormComponent [0];*
 * **}*
 *
 *
 * *...@override*
 * **public void validate (Form ? arg0) {*
 * **Record record = ((Form Record) arg0).getModel ().getObject ();*
 * **Validation result = validator.validate (record, action);*
 * *
 * **for (String generalErrorMessage : result.getGeneralErrorMessages ()) {*
 * **// TODO: ???*
 * **}*
 * **for (String fieldName : result.getFieldErrorFieldNames ()) {*
 * **for (String fieldErrorMessage : result.getFieldErrorMessages (fieldName))
 {*
 * **// TODO: ???*
 * **}*
 * **}*
 * **}*
 *}*
 *
 *
 In examples I see online, validation errors seem to be registered by calls
 of the #error method.  It seems like I should be doing that here, too, but
 what I don't know is:

   - Which object's #error method should be called?  The validator's?  The
   FormComponent corresponding to the field in question?  I want field-specific
   errors appropriately associated with their fields, so I can use filters for
   field-specific feedback, etc.

if you want formcomponent specific errors then you have to map the
errors from your business logic to the wicket components and call
error on them.

   - I already have my actual error strings, so how do I skip around the
   resource logic to just set the error message?

there is error(IValidationError) but there is also error(String), call
the latter.

   - What should I do with my generalErrorMessages, which aren't tied to
   any specific field?

i usually report these kinds of errors on the form itself and have a
special feedbackpanel that filters those.

-igor


 Any help would be appreciated, thanks!

 Ray Weidner


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