Re: Apache Wicket is a Flawed Framework

2011-11-22 Thread Eelco Hillenius
 @Alex Objelean  Igor Vanyberg-2
 Yea, my bad on just posting something up here without looking at any
 previous posts.  Look, it was my rant and how I felt about things at the
 time.  Nothing personal.  This was actually the clean version for public
 consumption.  It was probably still too rude though.  Sorry about that.  I
 suppose it would be lame to spend a lot of time on a framework and then have
 some kid post up a “Wicket Sucks” post.

If you want to blow off steam and tell people you think X sucks,
that's fine, but do it on a blog or something. It's just bad style to
do this on a list that is meant to help out with X. If at all, the
developer list would be better, but even then, you may want to
consider having a chat with some of the developers first to see what
their reasons for some of the things you dislike may be. Anyway,
constructive criticism is good on a list like that, but I didn't get
much of the constructiveness...

 @Jonathan Locke
 I agree that Java is fast.  I don't worry about scaling and performance
 because of that.  To the people worrying about memory, I don't think that is
 a big deal.  Sure any framework is going to waste more memory than bare
 bones JSP/Servlets, but memory is cheap.  Eclipse is like the biggest hog
 ever and look at how successful it is.

 Also, I am sticking with Java.  I have a really good job and such.  The only
 reason I would ever move is if I could land a leet job in the Valley doing
 Python at some sweet start-up.  Not likely though.

Do you live in the Bay Area? Seems to me there's plenty of work for
folks wanting to do coding in other languages than Java, particularly
for startups.

 Java is better than some
 of the alternatives out there:
 http://harmful.cat-v.org/software/ruby/rails/is-a-ghetto.  Scala is still
 too unstable.  The other Java web-frameworks are all flawed too.  I don't
 hate my job either.

Any choice will have it's own disadvantages. Also depends on what you
use a language for. I'm not sold on Scala, but I wouldn't think it's
not stable enough for production. May have to be careful doing
upgrades maybe.

 @sthomps
 LOL!  You know Eleco Hilenius wrote the “Wicket in Action” book?  For some
 reason I can't stop laughing.  Now everyone is going to think you are a
 badass at work.  The book is decent, but it would be nice if the next
 edition would have a chapter at the end that rewrites the “Cheese Store”
 into  “Cheese Store 2.0,” using all the advanced stuff that was explained in
 the latter chapters.  It would help Wicket newcomers like me.  It would also
 show how to do a real app with best-practices.

Well, I can tell you that I hated every minute of writing it :-) One
of these things one can do to 'just have done once in a life' and I'm
happy to hear from people that were helped by it, and hope it helped
the framework reach a certain stage of 'maturity', but never again
will I write tech book in my life.

Anyway, I always thought and still think that a good set of examples
and test cases are often more valuable to a project. Imho the first
chapter of Wicket In Action is the most important one, as it goes into
the why and rough outline of how. After that, I think you should hit
the examples and dig through the code. That at least works best for
me... then again, I'm very much an autodidact kind of guy and respect
that this is not the best way for everyone.

Now, since I'm typing anyway, here are my 2c on your points:

* Violates Dry - It does a bit, but I believe for a reasonable
purpose. We've explored several alternatives at some point, but felt
this was the least of evils

* Not previewable - Hah, this one is funny... point by point;
- First, we don't have seperate designers at my company - so...
who's fault is that?
- Second, it is better if the samer person - ah, so you think that
1 is a good idea. Well, I - as I'm sure most people who've worked on
projects with some scale will agree with - disagree with you on that.
Unless you are a fantastic UX persons. But most likely (just
statistics, sorry) as you're posting to a programming list, you're not
does development and design.
- Third, if you use extends your page will not be priviewable... -
Yep. So if you use it, you lose that benefit. You could not use it, or
just suck it up and still be happy with the other benefits that a good
separation of concerns give you.

* Violates MVC - Who cares about MVC purity. It hasn't been 'pure'
since the original article. Funny you mention Spring MVC, as I think
that having special constructs for 'flow' is just very silly unless
maybe you are writing a business process engine.

* Excessively verbose and complicated - Verbosity is often there to
make it easier to understand what something is/ might do. I'm sure we
don't always succeed in that. Complicated is something that Wicket is
also. We've been trying to find the right balance between that and
power. Some things worked out better than others.

* Breaks POJOS - every frameworks comes with 

Re: Apache Wicket is a Flawed Framework

2011-11-22 Thread Gaetan Zoritchak
I didn't have a look one the wicket books for quite while. Good you told
us. I orderered yours yesterday on Amazon. :)

2011/11/18 Igor Vaynberg igor.vaynb...@gmail.com

 * there are three books written about wicket: two for beginners and
 one for intermediate-advanced users.
 * there is a searchable mailing list archive that spans years upon
 years of users asking questions and getting answers.
 * there is a wiki that lists examples and has some good articles.
 * there is stack overflow questions and answers.

 is there an answer to every single possible question out there? of
 course not. no framework has that. look at projects like spring and
 hibernate. do those have great documentation? i bet you would say
 yes. are their mailing lists any less busy than our own? no. so what
 does that say?

 if i had to make up a number i would say that armed with the resources
 i listed you would be able to answer about 80% of your own questions.
 and i think that is a pretty good number. there is a very active user
 list to help you answer questions you cant answer yourself, usually
 faster then a commercial support contract. for free.

 not too shabby.

 -igor

 On Thu, Nov 17, 2011 at 3:30 PM, Gaetan Zoritchak
 g.zoritc...@moncoachfinance.com wrote:
  I must admit that I agree with you. While I think Wicket is a
  great framework, the documentation is not up to par. This tool seems a
  little too elitist. If you're strong enough you will find
  a great framework. It's a shame because even if the mailing list is very
  effective it slows down the adoption of wicket.
 
  2011/11/17 geraldkw geral...@gmail.com
 
  This is not an april fool's day, it is just an opinion of an
 inexperienced
  developer. 
 
  This illustrates one of the traditional logical fallacies. If you can't
  effectively attack the argument, attack the speaker.
 
  My biggest problem with Wicket is that I haven't found any
 documentation on
  the web that really lets me get a solid grasp on the key concepts. I
 read a
  lot of poorly written documentation, weak examples and forum posts
  dealing
  with something that is only vaguely related to my goals, maybe learn a
  fragment of useful info, and then suffer while trying to apply it.
 
  I haven't looked a Wicket in Action or other Wicket Books, but I have
 not
  heard good things. Also, this is the Internet Age and this is web
  programming. I have no problem finding documentation on other web
  programming languages/frameworks like I do with Wicket.
 
  If I am wrong, point me to some solid learning materials, and you stand
 a
  chance of changing my mind.
 
  geraldkw
 
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-is-a-Flawed-Framework-tp4080411p4081206.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

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




Re: Apache Wicket is a Flawed Framework

2011-11-22 Thread Gaetan Zoritchak
Super cool list, thanks a lot.

2011/11/18 robert.mcguinness robert.mcguinness@gmail.com

 i'm baffled when people say the documentation is poor, the javadocs are
 excellent and like igor said there are some great books (blogs too!).
  books
 and blogs get outdated fast since technlogy is rapidly advancing, so *use
 the source luke!*.  Not only will you learn Wicket, but I guarantee your
 Java skills will improve.


 awesome examples:



 https://github.com/apache/wicket https://github.com/apache/wicket  (scan
 over the unit test, best way to learn any framework not just wicket)

 https://github.com/55minutes/fiftyfive-wicket
 https://github.com/55minutes/fiftyfive-wicket  (fantastic)

 https://github.com/42Lines https://github.com/42Lines

 https://github.com/wicketstuff/core https://github.com/wicketstuff/core (a
 gem, tons of examples on how to pretty much do anything)

 http://code.google.com/p/wiquery/source/checkout
 http://code.google.com/p/wiquery/source/checkout

 https://github.com/jolira/wicket-stateless
 https://github.com/jolira/wicket-stateless  (wicket stateless is
 excellent,
 even easier with wicket 1.5)

 https://github.com/reaktor/oegyscroll
 https://github.com/reaktor/oegyscroll
 (endless pagination)

 http://code.google.com/p/wiquery/source/browse/core
 http://code.google.com/p/wiquery/source/browse/core  (jquery)

 http://code.google.com/p/jqwicket/source/browse/
 http://code.google.com/p/jqwicket/source/browse/  (jquery, learn from the
 code and roll your own if it doesn't fit your needs, super easy

 https://github.com/rjnichols/visural-wicket
 https://github.com/rjnichols/visural-wicket  (great ui tools)

 https://xaloon.googlecode.com/svn/ https://xaloon.googlecode.com/svn/
 (excellent!)



 rob

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-is-a-Flawed-Framework-tp4080411p4082034.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Creating Folder within the webapps folder.

2011-11-22 Thread crackAT
Hy guys, 

I need help. I want to create a folder within the webapps folder so that
user can upload pics in it. 

The default Pics of the wicket java application will be loaded via
ResourceReference. Is there a way to create new resource folder with
ResourceReference?

Thanks for help. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Creating-Folder-within-the-webapps-folder-tp4094979p4094979.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Chained dropdowns

2011-11-22 Thread Tito
Let me use the real situation:

Client 1--* Account 1--* Context 1--* Schedule

Here is the code simplified as much I can. If you think I have to add
something else just tell me:

public class AssignationPanel extends Panel {

 @SpringBean
private WSServicesIF services;
 private IModelListString assignationRolsModel = new
AssignationRolsModel();

public AssignationPanel(String id, IModelAssignationBean model) {
 super(id, model);

 final FormVoid form = new FormVoid(form);

final PropertyModelClient selectedClient = new
PropertyModelClient(model, client);
 final PropertyModelAccount selectedAccount = new
PropertyModelAccount(model, account);
 final PropertyModelContentType selectedContext = new
PropertyModelContentType(model, context);

final Component clientSelector = new DropDownChoiceClient(clients,
selectedClient, new ClientsModel(services), new
ClientRenderer()).setNullValid(false);
 final Component accountSelector = new DropDownChoiceAccount(accounts,
selectedAccount, new AccountsOfClientModel(selectedClient, services), new
AccountRenderer()).setNullValid(false).setOutputMarkupId(true);
 final Component contextSelector = new
DropDownChoiceContentType(contexts, selectedContext, new
ContextsOfAccountModel(selectedAccount, services), new
ContextRenderer()).setNullValid(false).setOutputMarkupId(true);
 final Component scheduleSelector = new
DropDownChoiceSchedule(schedule, new PropertyModelSchedule(model,
schedule), new SchedulesOfContextModel(selectedContext, services), new
ScheduleRenderer()).setNullValid(false).setOutputMarkupId(true);
 clientSelector.add(new AjaxFormComponentUpdatingBehavior(onChange) {

@Override
 protected void onUpdate(AjaxRequestTarget target) {
target.addComponent(accountSelector);
 target.addComponent(contextSelector);
target.addComponent(scheduleSelector);
 }
});
 accountSelector.add(new AjaxFormComponentUpdatingBehavior(onChange) {

@Override
 protected void onUpdate(AjaxRequestTarget target) {
target.addComponent(contextSelector);
 target.addComponent(scheduleSelector);
}
 });
contextSelector.add(new AjaxFormComponentUpdatingBehavior(onChange) {

@Override
 protected void onUpdate(AjaxRequestTarget target) {
target.addComponent(scheduleSelector);
 }
});

form.add(clientSelector);
 form.add(accountSelector);
form.add(contextSelector);
 form.add(scheduleSelector, new
SimpleMessageComponentFeedbackPanel(scheduleError, scheduleSelector));

add(form);
 }
}

public class ClientsModel extends LoadableDetachableModelListClient {

private WSServicesIF services;

public ClientsModel(WSServicesIF services) {
 this.services = services;
}

@Override
 protected ListClient load() {
return new ArrayListClient(services.getClients());
 }
}

public class AccountsOfClientModel extends
LoadableDetachableModelListAccount {

 private WSServicesIF services;
private IModelClient client;

 public AccountsOfClientModel(IModelClient client, WSServicesIF services)
{
this.services = services;
 this.client = client;
}

@Override
 protected ListAccount load() {
Client object = client.getObject();
 if (object == null) {
return new ArrayListAccount();
} else {
 return services.getSortedAccounts(object.getId().toString());
}
}
}

public class ContextsOfAccountModel extends
LoadableDetachableModelListContentType {

private WSServicesIF services;
 private IModelAccount account;

public ContextsOfAccountModel(IModelAccount account, WSServicesIF
services) {
 this.account = account;
this.services = services;
}

@Override
protected ListContentType load() {
Account object = account.getObject();
 if (object == null || object.getId() == null) {
return new ArrayListContentType();
 } else {
return services.getContentTypeForAccount(object.getId().toString());
 }
}
}

public class SchedulesOfContextModel extends
LoadableDetachableModelListSchedule {

private WSServicesIF services;
private IModelContentType context;

public SchedulesOfContextModel(IModelContentType context, WSServicesIF
services) {
this.context = context;
 this.services = services;
}

@Override
 protected ListSchedule load() {
ContentType object = context.getObject();
 if (object == null) {
return new ArrayListSchedule();
} else {
 return new
ArrayListSchedule(services.getSchedulesForContext(object.getId().toString()));
}
 }
}



First is the code of a panel with dropdowns and then I pasted models of
choices to show the way I provide options. I can't see the problem, and in
a way is working, but fails following steps I mentioned in my previous mail.

Thanks for helping!


Norberto

2011/11/19 Jeremy Thomerson jer...@wickettraining.com

 show the code

 On Fri, Nov 18, 2011 at 1:36 PM, Tito njyt...@gmail.com wrote:

  Hi, I'm trying to connect three drowpdowns.
 
  For example.
 
  combo1: Country
  combo2: Province
  combo3: City
 
  I'm updating dropdowns by Ajax with
  AjaxFormComponentUpdatingBehavior(onChange) and it works ok.
  But if you choose a Country, then a Province, then a City and after that
  you change the Country, the Province changes but 

Re: Creating Folder within the webapps folder.

2011-11-22 Thread Martijn Dashorst
This is a bad idea: when you redeploy your application, boom: gone are
the images. Store the images in a separate folder *OUTSIDE* your
webapp/container.

Martijn

On Tue, Nov 22, 2011 at 10:22 AM, crackAT manfred.kram...@everyone.at wrote:
 Hy guys,

 I need help. I want to create a folder within the webapps folder so that
 user can upload pics in it.

 The default Pics of the wicket java application will be loaded via
 ResourceReference. Is there a way to create new resource folder with
 ResourceReference?

 Thanks for help.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Creating-Folder-within-the-webapps-folder-tp4094979p4094979.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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



AJAX update and file download on Wicket 1.5

2011-11-22 Thread Jordi Deu-Pons
Hi,

 I want to do an AJAX update and then start a file download.

 I've found this solution for Wicket 1.4.x
https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html

 This is not working on Wicket 1.5 because this deprecated code:

public void onRequest()
{
getComponent().getRequestCycle().setRequestTarget(
new ResourceStreamRequestTarget(getResourceStream(), 
getFileName()));
}


Which is the best way to do this in 1.5 ?

Thanks!.


-- 
a10! i fins aviat.
J:-Deu


Re: Creating Folder within the webapps folder.

2011-11-22 Thread crackAT
I did it outside. 

but the problem is, that wicket is using for every pic the resourcereference
and not only for the application pics. The application pics will be loaded
and i can see them but the userpics which are saved outside the webbapps
folder won't be loaded. 

Wicket is writing src=resources/clazz/  pathToOutsideUserFolder in the
source of the image but I told wicket this:

add(new Image(wicket-id, pathToOutsideUserFolder)

I didn't told wicket anything about the ResourceReference for this Pic.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Creating-Folder-within-the-webapps-folder-tp4094979p4095286.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Radio button selection

2011-11-22 Thread Tito
I think I can give you another option based on Alexander's code. I added
comments to explain how does it works. I didn't test it but If you have any
problem just tell me:

// model that indicates if I have to show the textfield
 final IModelBoolean yesNoState = new ModelBoolean();

// this is because when textfield is hidden you can't reference it by
markupid because html component doesn't exists.
 final WebMarkupContainer fieldContainer = new
WebMarkupContainer(fieldContainer);
 // this indicates wicket to create an id for tag. Necesary to update by
ajax.
 fieldContainer.setOutputMarkupId(true);

 // textfield to show with isVisible redifined based on previous model
 final TextFieldString textField = new TextFieldString(text) {

@Override
 public boolean isVisible() {
return yesNoState.getObject();
 }
};
 fieldContainer.add(textField);

 // just a component to agrupate options
RadioGroupBoolean yesNoGroup = new RadioGroupBoolean(yesNoGroup,
yesNoState);
 yesNoGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {

 @Override
protected void onUpdate(AjaxRequestTarget target) {
 // this is to update container by ajax and consequently textField
visibility.
 target.addComponent(fieldContainer);
}
 });

 yesNoGroup.add(new RadioBoolean(yes, Model.of(Boolean.TRUE)), new
RadioBoolean(no, Model.of(Boolean.FALSE)));

add(fieldContainer);
 add(yesNoGroup);


I hope that helps you.

Bye

Norberto



2011/11/20 ridaa ridaa...@yahoo.com

 Hey thanx alot ...!!
 It would be really very helpful if i could get some explanation on above
 code.

 Regards.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Radio-button-selection-tp4085827p4088663.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: Creating Folder within the webapps folder.

2011-11-22 Thread Vytautas R.
Hi,

1. I guess you need to extend org.apache.wicket.request.resource.
DynamicImageResource.
(for example,
http://code.google.com/p/xaloon/source/browse/trunk/xaloon-wicket/xaloon-wicket-components/src/main/java/org/xaloon/wicket/component/resource/FileResource.java
)
Then you should be able to load images from any place you like.

2. Mount your Resource:
String resourceKey = your key here;
getSharedResources().add(resourceKey, new FileResource());
mountResource(resourceKey, new SharedResourceReference(resourceKey));

3. Generate link to your image using Image, or custom implementation
(for example,
http://code.google.com/p/xaloon/source/browse/trunk/xaloon-wicket/xaloon-wicket-components/src/main/java/org/xaloon/wicket/component/resource/ImageLink.java
)


On Tue, Nov 22, 2011 at 1:24 PM, crackAT manfred.kram...@everyone.atwrote:

 I did it outside.

 but the problem is, that wicket is using for every pic the
 resourcereference
 and not only for the application pics. The application pics will be loaded
 and i can see them but the userpics which are saved outside the webbapps
 folder won't be loaded.

 Wicket is writing src=resources/clazz/  pathToOutsideUserFolder in the
 source of the image but I told wicket this:

 add(new Image(wicket-id, pathToOutsideUserFolder)

 I didn't told wicket anything about the ResourceReference for this Pic.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Creating-Folder-within-the-webapps-folder-tp4094979p4095286.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Best regards,
Vytautas R.
---
www.xaloon.org
www.allcarindex.com


Re: AJAX update and file download on Wicket 1.5

2011-11-22 Thread Martin Grigorov
On Tue, Nov 22, 2011 at 1:13 PM, Jordi Deu-Pons jo...@jordeu.net wrote:
 Hi,

  I want to do an AJAX update and then start a file download.

  I've found this solution for Wicket 1.4.x
 https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html

  This is not working on Wicket 1.5 because this deprecated code:

 public void onRequest()
 {
        getComponent().getRequestCycle().setRequestTarget(
                new ResourceStreamRequestTarget(getResourceStream(), 
 getFileName()));

   getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(
                new ResourceStreamRequestHandler(getResourceStream(),
getFileName()));


 }


 Which is the best way to do this in 1.5 ?

 Thanks!.


 --
 a10! i fins aviat.
 J:-Deu




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

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



Re: AJAX update and file download on Wicket 1.5

2011-11-22 Thread Ernesto Reinaldo Barreiro
Jordi,

Can you please update the wiki page with Martins suggestion for 1.5.x?

Regards,

Ernesto

On Tue, Nov 22, 2011 at 1:11 PM, Martin Grigorov mgrigo...@apache.org wrote:
 On Tue, Nov 22, 2011 at 1:13 PM, Jordi Deu-Pons jo...@jordeu.net wrote:
 Hi,

  I want to do an AJAX update and then start a file download.

  I've found this solution for Wicket 1.4.x
 https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html

  This is not working on Wicket 1.5 because this deprecated code:

 public void onRequest()
 {
        getComponent().getRequestCycle().setRequestTarget(
                new ResourceStreamRequestTarget(getResourceStream(), 
 getFileName()));

    getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(
                 new ResourceStreamRequestHandler(getResourceStream(),
 getFileName()));


 }


 Which is the best way to do this in 1.5 ?

 Thanks!.


 --
 a10! i fins aviat.
 J:-Deu




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.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: AJAX update and file download on Wicket 1.5

2011-11-22 Thread Jordi Deu-Pons
Ok,

 I'll test this solution and update the wiki.

 Thanks.


On Tue, Nov 22, 2011 at 1:17 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Jordi,

 Can you please update the wiki page with Martins suggestion for 1.5.x?

 Regards,

 Ernesto

 On Tue, Nov 22, 2011 at 1:11 PM, Martin Grigorov mgrigo...@apache.org
 wrote:
  On Tue, Nov 22, 2011 at 1:13 PM, Jordi Deu-Pons jo...@jordeu.net
 wrote:
  Hi,
 
   I want to do an AJAX update and then start a file download.
 
   I've found this solution for Wicket 1.4.x
 
 https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
 
   This is not working on Wicket 1.5 because this deprecated code:
 
  public void onRequest()
  {
 getComponent().getRequestCycle().setRequestTarget(
 new ResourceStreamRequestTarget(getResourceStream(),
 getFileName()));
 
 getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(
  new ResourceStreamRequestHandler(getResourceStream(),
  getFileName()));
 
 
  }
 
 
  Which is the best way to do this in 1.5 ?
 
  Thanks!.
 
 
  --
  a10! i fins aviat.
  J:-Deu
 
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.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




-- 
a10! i fins aviat.
J:-Deu


Re: Can't Reset Form After DropDownChoice OnChange Handled

2011-11-22 Thread Richard W. Adams
Not sure what you mean, exactly. The only alternative I can see it to keep 
an original copy of the form model (assuming there IS a single) model, 
then add an onclick handler() to the reset button, then go back to the 
server, overwrite the current model with the original model, then add the 
form component to the AjaxRequestTarget so it's re-rendered. This could be 
ugly  error prone real fast, especially if all of the form fields weren't 
covered by a single model. \

Am I missing something here?




From:   Clint Checketts checke...@gmail.com
To: users@wicket.apache.org
Date:   11/21/2011 03:37 PM
Subject:Re: Can't Reset Form After DropDownChoice OnChange Handled



Yes, you can reset the form quite easily, with or without Ajax. I haven't
read the rest of the thread, but if you just reset the object that the 
form
is referencing all the fields would stay in sync and be 'reset'.

-Clint

On Mon, Nov 21, 2011 at 3:30 PM, Richard W. Adams rwada...@up.com wrote:

 I've been doing a lot of Googling on this topic  found this page, which
 seems to describe exactly the problem I'm having:

 http://www.jaxtut.com/Navigation.jsp

 It suggests calling resetFromSession(), though it doesn't give an
 implementation  this method doesn't seem to be part of Wicket.

 Has anyone found a way to reset the form after the model has changed  
the
 form re-rendered thru Ajax? If there isn't a way to do this in Wicket, 
is
 there a Wicket wish list to add it to?



 From:   Igor Vaynberg igor.vaynb...@gmail.com
 To: users@wicket.apache.org
 Date:   11/21/2011 02:18 PM
 Subject:Re: Can't Reset Form After DropDownChoice OnChange 
Handled



 I don't think the browser reset button supports ajax..

 -igor
 On Nov 21, 2011 5:08 AM, Richard W. Adams rwada...@up.com wrote:

  The form just has a standard HTML reset button:
 
  input wicket:id=reset-button  type=reset  value=Reset  /
 
  There's no special code associated with the button. Should there be? I
  looked at Wicket in Action, but it doesn't seem to address this 
issue.
 
  RAM /abr./: Rarely Adequate Memory.
 
 
 
  From:   Igor Vaynberg igor.vaynb...@gmail.com
  To: users@wicket.apache.org
  Date:   11/17/2011 03:42 PM
  Subject:Re: Can't Reset Form After DropDownChoice OnChange
 Handled
 
 
 
  what does your reset code look like?
 
  -igor
 
  On Thu, Nov 17, 2011 at 9:00 AM, aksarben rwada...@up.com wrote:
   I have a drop down choice component, and when the selection changes, 
I
  udpate
   various form fields by Ajax, in the form as follows:
  
   *public HistoryDropDown(final String id, final MapK, ? map, final
   Component dateField, final
  TrackDetailModel model, final TrackAttribute attribute) {
  
  super(id, map);
  final String originalValue = 
model.getOriginalValue(attribute);
  add(new AjaxFormComponentUpdatingBehavior(onchange) {
  private static final long serialVersionUID = -1;
  @Override
  protected void onUpdate(final AjaxRequestTarget 
target)
 {
   // When
   selection changes
  
  final String newValue =
  model.getAttributeValue(attribute); // What the
   new choice?
  if (newValue.equals(originalValue)) {
   // If back to original value
  dateField.setEnabled(false);
// Disable date field
  
   model.restoreOriginalDateAndUser(attribute);//
  Restore original data
  } else {
// If
  changing to new value
  dateField.setEnabled(true);
   // Enable date field
   model.setDefaultDateAndUser(attribute);
   // Effective date = today
  }
  //
  User = current user
  target.addComponent(dateField.getParent());
   // Re-render fields
  }
  });
   }
   *
   The updates work fine (the screen re-renders properly), but if I 
then
  click
   the form's Reset button, nothing happens. I saw some other posts 
that
  said I
   have to do a form.modelchanged(), but that didn't any effect.
  
   --
   View this message in context:
 
 

 
http://apache-wicket.1842946.n4.nabble.com/Can-t-Reset-Form-After-DropDownChoice-OnChange-Handled-tp4080685p4080685.html


 
   Sent from the Users forum mailing list archive at Nabble.com.
  
   
-
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, 

Re: Can't Reset Form After DropDownChoice OnChange Handled

2011-11-22 Thread Richard W. Adams
Unless I misunderstand, this would erase the entire form, rather than 
reset the form fields to their original values. ???




From:   Martin Grigorov mgrigo...@apache.org
To: users@wicket.apache.org
Date:   11/22/2011 01:15 AM
Subject:Re: Can't Reset Form After DropDownChoice OnChange Handled



On Mon, Nov 21, 2011 at 11:30 PM, Richard W. Adams rwada...@up.com 
wrote:
 I've been doing a lot of Googling on this topic  found this page, which
 seems to describe exactly the problem I'm having:

 http://www.jaxtut.com/Navigation.jsp

 It suggests calling resetFromSession(), though it doesn't give an
 implementation  this method doesn't seem to be part of Wicket.

 Has anyone found a way to reset the form after the model has changed  
the
 form re-rendered thru Ajax? If there isn't a way to do this in Wicket, 
is
 there a Wicket wish list to add it to?

All you need is an AjaxButton with .setDefaultFormProcessing(false)
and in its onClick(AjaxRequestTarget target) to do:
getForm().setModelObject(new MyEntity());
target.add(getForm());

i.e. set a new empty model object for the form and all its form 
components.




 From:   Igor Vaynberg igor.vaynb...@gmail.com
 To: users@wicket.apache.org
 Date:   11/21/2011 02:18 PM
 Subject:Re: Can't Reset Form After DropDownChoice OnChange 
Handled



 I don't think the browser reset button supports ajax..

 -igor
 On Nov 21, 2011 5:08 AM, Richard W. Adams rwada...@up.com wrote:

 The form just has a standard HTML reset button:

 input wicket:id=reset-button  type=reset  value=Reset  /

 There's no special code associated with the button. Should there be? I
 looked at Wicket in Action, but it doesn't seem to address this 
issue.

 RAM /abr./: Rarely Adequate Memory.



 From:   Igor Vaynberg igor.vaynb...@gmail.com
 To: users@wicket.apache.org
 Date:   11/17/2011 03:42 PM
 Subject:Re: Can't Reset Form After DropDownChoice OnChange
 Handled



 what does your reset code look like?

 -igor

 On Thu, Nov 17, 2011 at 9:00 AM, aksarben rwada...@up.com wrote:
  I have a drop down choice component, and when the selection changes, 
I
 udpate
  various form fields by Ajax, in the form as follows:
 
  *public HistoryDropDown(final String id, final MapK, ? map, final
  Component dateField, final
 TrackDetailModel model, final TrackAttribute attribute) {
 
 super(id, map);
 final String originalValue = 
model.getOriginalValue(attribute);
 add(new AjaxFormComponentUpdatingBehavior(onchange) {
 private static final long serialVersionUID = -1;
 @Override
 protected void onUpdate(final AjaxRequestTarget 
target)
 {
  // When
  selection changes
 
 final String newValue =
 model.getAttributeValue(attribute); // What the
  new choice?
 if (newValue.equals(originalValue)) {
  // If back to original value
 dateField.setEnabled(false);
   // Disable date field
 
  model.restoreOriginalDateAndUser(attribute);//
 Restore original data
 } else {
   // If
 changing to new value
 dateField.setEnabled(true);
  // Enable date field

 model.setDefaultDateAndUser(attribute);
  // Effective date = today
 }
  //
 User = current user
 target.addComponent(dateField.getParent());
  // Re-render fields
 }
 });
  }
  *
  The updates work fine (the screen re-renders properly), but if I then
 click
  the form's Reset button, nothing happens. I saw some other posts that
 said I
  have to do a form.modelchanged(), but that didn't any effect.
 
  --
  View this message in context:


 
http://apache-wicket.1842946.n4.nabble.com/Can-t-Reset-Form-After-DropDownChoice-OnChange-Handled-tp4080685p4080685.html



  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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




 **

 This email and any attachments may contain information that is
 confidential and/or privileged for the sole use of the intended
 recipient.
  Any use, review, disclosure, copying, distribution or reliance by
 others,
 and any forwarding of this email or its contents, without the express
 

Re: Can't Reset Form After DropDownChoice OnChange Handled

2011-11-22 Thread Martin Grigorov
On Tue, Nov 22, 2011 at 3:17 PM, Richard W. Adams rwada...@up.com wrote:
 Unless I misunderstand, this would erase the entire form, rather than
 reset the form fields to their original values. ???

Do whatever is the best for your logic.
If this is a create form then use empty Entity. Whatever 'empty'
means in your domain.
If this is an edit form then re-fetch the Entity from the DB by its
id and set it as model object.





 From:   Martin Grigorov mgrigo...@apache.org
 To:     users@wicket.apache.org
 Date:   11/22/2011 01:15 AM
 Subject:        Re: Can't Reset Form After DropDownChoice OnChange Handled



 On Mon, Nov 21, 2011 at 11:30 PM, Richard W. Adams rwada...@up.com
 wrote:
 I've been doing a lot of Googling on this topic  found this page, which
 seems to describe exactly the problem I'm having:

 http://www.jaxtut.com/Navigation.jsp

 It suggests calling resetFromSession(), though it doesn't give an
 implementation  this method doesn't seem to be part of Wicket.

 Has anyone found a way to reset the form after the model has changed 
 the
 form re-rendered thru Ajax? If there isn't a way to do this in Wicket,
 is
 there a Wicket wish list to add it to?

 All you need is an AjaxButton with .setDefaultFormProcessing(false)
 and in its onClick(AjaxRequestTarget target) to do:
 getForm().setModelObject(new MyEntity());
 target.add(getForm());

 i.e. set a new empty model object for the form and all its form
 components.




 From:   Igor Vaynberg igor.vaynb...@gmail.com
 To:     users@wicket.apache.org
 Date:   11/21/2011 02:18 PM
 Subject:        Re: Can't Reset Form After DropDownChoice OnChange
 Handled



 I don't think the browser reset button supports ajax..

 -igor
 On Nov 21, 2011 5:08 AM, Richard W. Adams rwada...@up.com wrote:

 The form just has a standard HTML reset button:

 input wicket:id=reset-button  type=reset  value=Reset  /

 There's no special code associated with the button. Should there be? I
 looked at Wicket in Action, but it doesn't seem to address this
 issue.

 RAM /abr./: Rarely Adequate Memory.



 From:   Igor Vaynberg igor.vaynb...@gmail.com
 To:     users@wicket.apache.org
 Date:   11/17/2011 03:42 PM
 Subject:        Re: Can't Reset Form After DropDownChoice OnChange
 Handled



 what does your reset code look like?

 -igor

 On Thu, Nov 17, 2011 at 9:00 AM, aksarben rwada...@up.com wrote:
  I have a drop down choice component, and when the selection changes,
 I
 udpate
  various form fields by Ajax, in the form as follows:
 
  *public HistoryDropDown(final String id, final MapK, ? map, final
  Component dateField, final
         TrackDetailModel model, final TrackAttribute attribute) {
 
         super(id, map);
         final String originalValue =
 model.getOriginalValue(attribute);
         add(new AjaxFormComponentUpdatingBehavior(onchange) {
                 private static final long serialVersionUID = -1;
                 @Override
                 protected void onUpdate(final AjaxRequestTarget
 target)
 {
              // When
  selection changes
 
                         final String newValue =
 model.getAttributeValue(attribute);     // What the
  new choice?
                         if (newValue.equals(originalValue)) {
                              // If back to original value
                                 dateField.setEnabled(false);
                                       // Disable date field
 
  model.restoreOriginalDateAndUser(attribute);                    //
 Restore original data
                         } else {
                                                               // If
 changing to new value
                                 dateField.setEnabled(true);
                                              // Enable date field
 
  model.setDefaultDateAndUser(attribute);
                              // Effective date = today
                         }
                                                                      //
 User = current user
                         target.addComponent(dateField.getParent());
                              // Re-render fields
         }
     });
  }
  *
  The updates work fine (the screen re-renders properly), but if I then
 click
  the form's Reset button, nothing happens. I saw some other posts that
 said I
  have to do a form.modelchanged(), but that didn't any effect.
 
  --
  View this message in context:



 http://apache-wicket.1842946.n4.nabble.com/Can-t-Reset-Form-After-DropDownChoice-OnChange-Handled-tp4080685p4080685.html



  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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




 **

 This 

London Apache Wicket Training, December 15-16

2011-11-22 Thread Cemal Bayramoglu
Our next scheduled/public London Apache Wicket Training [1] course is
scheduled for December 15-16, 2011.

Check availability and book online [2].

Regards - Cemal
jWeekend
Training, Consulting, Development
http://jWeekend.com

[1]   http://jweekend.com/dev/JW703
[2]   http://jweekend.com/dev/BookingPage

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



Putting together two seperate wicket projects into a multi-module maven project

2011-11-22 Thread Sameer Patil
Hi,
I have created 2 separate wicket web projects. Now i want put them together in  
multi-module maven project and put the dependency as required. 
Will it give problem when i have have 2 web-inf folders.
Example
Project A has web-inf and web.xml etc.
Project B also has web-inf and web.xml etc.

Now i put both Project A and B into a multi-module maven Project named C, 
and have the pom.xml of project B changed so it includes the dependency of A

Finally i want to deploy war of project B. 
Also should the project A be packaged as jar or war?
Thanks
Sameer

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



Re: Radio button selection

2011-11-22 Thread Alexander Morozov
Check quickstart app 
http://apache-wicket.1842946.n4.nabble.com/file/n4096248/myproject.zip
myproject.zip  Hope it helps :)


-
--
http://www.linkedin.com/in/amorozov
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Radio-button-selection-tp4085827p4096248.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: ValidationForm.addPropertyValidators sometimes looks for child properties in parent's model

2011-11-22 Thread Igor Vaynberg
its very hard to figure out problems like this without having running
code. you can either create a quickstart with a failing testcase, or
even better make a pull request on github that will add the failing
testcase directly into the codebase.

thanks,
-igor

On Mon, Nov 21, 2011 at 12:34 PM, Jablow, Eric R
eric.jab...@mantech.com wrote:

 Igorbut you can create a testcase, reproducing the bare bits of code in a
 testcase just like you did in the email below. the advantage would be
 that i would have something i can play with which makes it much easier
 to find the problem.

 I will work on a quick start tonight, when I'm not at work. But here's what 
 I'd like to do, possibly extending Metagen. I have a Report object which 
 includes an abstract Document object.  Document has 3 concrete subclasses, 
 Book, Article, and Monograph. I have FormComponentPanels for each, which I'd 
 like to swap in and out. I've used Metagen to create ReportMeta, 
 DocumentMeta, BookMeta, etc.  I'd like to extend Metagen so I can write code 
 like

 IModelBook bookModel = 
 MetaModel.of(report).get(ReportMeta.document).as(Book.class);

 and

 IModelString isbnModel = 
 MetaModel.of(report).get(ReportMeta.document).as(Book.class).get(BookMeta.isbn);

 Since I don't want to modify the MetaModel class on my own, I've written a 
 SubClassModel class like so:

        private static class SubClassModelT extends MetaModelT {
                private static final long serialVersionUID = 
 3511732306311269529L;

                public SubClassModel(MetaModel? super T superModel, ClassT 
 clazz) {
                        super(superModel);
                }

                @Override
                public T getObject() {
                        return (T) super.getObject();
                }
                @Override
                public void detach() {
                        super.detach();
                }

                public static T MetaModelT as(MetaModel? super T 
 superModel, ClassT clazz) {
                        return new SubClassModelT(superModel, clazz);
                }
        }
 }

 Unfortunately, when the validation system gets its hands on this, it throws a 
 NPE as it adds the property validators:

 Caused by: java.lang.NullPointerException
        at 
 net.ftlines.wicket.validation.bean.ReflectableProperty.init(ReflectableProperty.java:46)
        at 
 net.ftlines.wicket.validation.bean.ReflectableProperty.init(ReflectableProperty.java:98)
        at 
 net.ftlines.wicket.validation.bean.ModelPropertyResolver.resolve(ModelPropertyResolver.java:35)
        at 
 net.ftlines.wicket.validation.bean.ValidationContext.resolveProperty(ValidationContext.java:80)
        at 
 net.ftlines.wicket.validation.bean.ValidationForm$1.component(ValidationForm.java:170)
        at 
 net.ftlines.wicket.validation.bean.ValidationForm$1.component(ValidationForm.java:163)
        at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:143)
        at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:161)
        at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:122)
        at 
 org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:908)
        at 
 net.ftlines.wicket.validation.bean.ValidationForm.addPropertyValidators(ValidationForm.java:162)
        at 
 net.ftlines.wicket.validation.bean.ValidationForm.onBeforeRender(ValidationForm.java:155)
        at org.apache.wicket.Component.internalBeforeRender(Component.java:981)
        at org.apache.wicket.Component.beforeRender(Component.java:1015)
        at 
 org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1785)
        ... 52 more

 This happens when Model is that SubclassModelBook.

 How would you use Metagen for this case?  Is it worth extending it?

 Respectfully,
 Eric Jablow

 This communication, along with any attachments, is covered by federal and 
 state law governing electronic communications and may contain company 
 proprietary and legally privileged information.  If the reader of this 
 message is not the intended recipient, you are hereby notified that any 
 dissemination, distribution, use or copying of this message is strictly 
 prohibited.  If you have received this in error, please reply immediately to 
 the sender and delete this message.  Thank you.


 -
 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: Putting together two seperate wicket projects into a multi-module maven project

2011-11-22 Thread Sven Meier

You can use maven war overlays.

But it would be much easier if your two projects would be packaged as 
jar only. With Wicket there's hardly a reason to require project 
specific web.xml files in A and B.


Sven

Am 22.11.2011 16:52, schrieb Sameer Patil:

Hi,
I have created 2 separate wicket web projects. Now i want put them together in  
multi-module maven project and put the dependency as required.
Will it give problem when i have have 2 web-inf folders.
Example
Project A has web-inf and web.xml etc.
Project B also has web-inf and web.xml etc.

Now i put both Project A and B into a multi-module maven Project named C, and have the 
pom.xml of project B changed so it includes the dependency of A

Finally i want to deploy war of project B.
Also should the project A be packaged as jar or war?
Thanks
Sameer

-
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: Radio button selection

2011-11-22 Thread ridaa
Hey Alex Your sample app was quite helpful...Thanx alot

 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Radio-button-selection-tp4085827p4096389.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Radio button selection

2011-11-22 Thread ridaa
Tito,

Thank you for the clarification.It was a great help.

Regards.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Radio-button-selection-tp4085827p4096406.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: unable to open modal window

2011-11-22 Thread Igor Vaynberg
you have an error in some javascript you included...

-igor

On Tue, Nov 22, 2011 at 4:15 AM, sri357 s.srilat...@gmail.com wrote:
 When i click on a link ,it should open a modal window according to the code,
 but delegate cals are made and no modal window is getting opened.
 Following error is dispalyed

 Message: 'document.body' is null or not an object
 Line: 3238
 Char: 3
 Code: 0
 URI: http://xx.js

 Message: 'Ricola' is undefined
 Line: 10
 Char: 9
 Code: 0
 URI:
 http://localhost:8080/ojt/secure/jas/?wicket:interface=modal-default-pagemap:4

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/unable-to-open-modal-window-tp4095436p4095436.html
 Sent from the Users forum mailing list archive at Nabble.com.

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



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



Page serialization problem with wicket 1.5?

2011-11-22 Thread Gabriel Landon
Hi,

There seems to have page data that are not correctly unserialized with
wicket 1.5.x.

I have done a quickstart application to show you the problem with a
ModalWindow using a page (not a panel) :
http://apache-wicket.1842946.n4.nabble.com/file/n4097909/myproject.zip
myproject.zip 

How to reproduce the problem :
1- start the application (mvn jetty:run)
2- open your browser : http://localhost:8080/
3- Click on click me  a couple of time (optional!)
4- Enter the label field then submit. You should see submit ok in the
feedback panel.
5- Click the open modal link
6- Enter the description field and submit.
7- The model is serialized with all the data and next when the data are
unserialized, the description data is lost.

Here's the log :

using the click me link!
INFO  - HomePage - Serialized [Page class = com.mycompany.HomePage, id = 0,
render count = 1], bean = com.mycompany.bean.MyBean@6da05bdb - nbClick = 0 -
label null - desc null
INFO  - HomePage - Serialized [Page class = com.mycompany.HomePage, id = 0,
render count = 1], bean = com.mycompany.bean.MyBean@6da05bdb - nbClick = 1 -
label null - desc null
INFO  - HomePage   - Serialized [Page class = com.mycompany.HomePage, id =
0, render count = 1], bean = com.mycompany.bean.MyBean@6da05bdb - nbClick =
2 - label null - desc null

Submit form with the label field
INFO  - HomePage   - Serialized [Page class = com.mycompany.HomePage, id =
0, render count = 1], bean = com.mycompany.bean.MyBean@6da05bdb - nbClick =
2 - label ddd - desc null

 submit modal with the description field
INFO  - HomePage   - *Serialized *[Page class = com.mycompany.HomePage, id =
0, render count = 1], bean = com.mycompany.bean.MyBean@6da05bdb - nbClick =
2 - label ddd - *desc fdfdfd*
INFO  - HomePage   - *unSerialized *[Page class = com.mycompany.HomePage, id
= 0, render count = 1], bean = com.mycompany.bean.MyBean@7d98d9cf - nbClick
= 2 - label ddd - *desc null*
INFO  - HomePage - Serialized [Page class = com.mycompany.HomePage, id =
0, render count = 1], bean = com.mycompany.bean.MyBean@7d98d9cf - nbClick =
2 - label ddd - desc null
 desc has been set to null


With wicket 1.4.x it's working just fine (there's a pom.xml.wicket.1.4 in
the project if you want to try) : there is no page that is unserialized.

If I use a panel instead of a page in the modal window, it's working just
fine. So I guess it has something to do with multi-window/multi-page
handling...

Is there a new option to turn on with wicket 1.5 to have it works like in
wicket 1.4?

Regards,

Gabriel.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Page-serialization-problem-with-wicket-1-5-tp4097909p4097909.html
Sent from the Users forum mailing list archive at Nabble.com.

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



How to test just a panel using apache wicket?

2011-11-22 Thread sudeivas
Hello,
In our project, we have some panels and we embed those panels
dynamically to pages. 

public class DoublePanel extends Panel {
public DoublePanel(String id, Panel leftPanel, Panel rightPanel) {
 .
 }
}

I am not sure how to write unit test just for this class without a webpage.

public class DoublePanelTest {

private WicketTester tester;

@Before
public void init() {
tester = new WicketTester();
}

@Test
public void testDoublePanel() {
tester.startComponentInPage(new DoublePanel(double, leftPanel,
rightPanel));
}
}

I tried to run something like above. But got the below exception. I checked
some sample test case but in all, they have used tester.startPage(xxx.class)
and then used tester.startPanel(). Is it possible to test just the panel
without a webpage?

java.lang.NullPointerException
at org.apache.wicket.Page.isBookmarkable(Page.java:435)
at org.apache.wicket.Page.init(Page.java:734)
at org.apache.wicket.Page.init(Page.java:216)
at org.apache.wicket.Page.init(Page.java:170)
at org.apache.wicket.markup.html.WebPage.init(WebPage.java:74)
at
org.apache.wicket.util.tester.BaseWicketTester$StartComponentInPage.init(BaseWicketTester.java:1430)
at
org.apache.wicket.util.tester.BaseWicketTester.createPage(BaseWicketTester.java:1411)
at
org.apache.wicket.util.tester.BaseWicketTester.startComponentInPage(BaseWicketTester.java:1332)
at xxx.DoublePanelTest.testDoublePanel(DoublePanelTest.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Thanks,
Suresh


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-test-just-a-panel-using-apache-wicket-tp4097990p4097990.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to test just a panel using apache wicket?

2011-11-22 Thread sudeivas
Additional Information:

Using Apache-Wicket - 1.5.3

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-test-just-a-panel-using-apache-wicket-tp4097990p4097993.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to test just a panel using apache wicket?

2011-11-22 Thread Igor Vaynberg
create a simple page that acts as a wrapper for the panel (as an inner
class of the test perhaps) and use that to test

-igor


On Tue, Nov 22, 2011 at 4:11 PM, sudeivas sureshkumar@gmail.com wrote:
 Additional Information:

 Using Apache-Wicket - 1.5.3

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-test-just-a-panel-using-apache-wicket-tp4097990p4097993.html
 Sent from the Users forum mailing list archive at Nabble.com.

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



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



Re: How to test just a panel using apache wicket?

2011-11-22 Thread sudeivas
I did try something like this,

public class DoublePanelTest {
private WicketTester tester;

private class TestPage extends WebPage {
private static final long serialVersionUID = 1L;
public TestPage() {
super();
add(new DoublePanel(double, leftPanel, rightPanel));
}
}

@Before
public void init() {
tester = new WicketTester();
}

@Test
public void testDoublePanel() {
tester.startPage(new TestPage());
}
}

But still I am getting the same exception,

java.lang.NullPointerException
at org.apache.wicket.Page.isBookmarkable(Page.java:435)
at org.apache.wicket.Page.init(Page.java:734)
at org.apache.wicket.Page.init(Page.java:216)
at org.apache.wicket.Page.init(Page.java:170)
at org.apache.wicket.markup.html.WebPage.init(WebPage.java:74)
at xxx.DoublePanelTest$TestPage.init(DoublePanelTest.java:23)
at xxxDoublePanelTest.testDoublePanel(DoublePanelTest.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-test-just-a-panel-using-apache-wicket-tp4097990p4098066.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to test just a panel using apache wicket?

2011-11-22 Thread Igor Vaynberg
open a jira and attach the testcase..

-igor

On Tue, Nov 22, 2011 at 4:40 PM, sudeivas sureshkumar@gmail.com wrote:
 I did try something like this,

 public class DoublePanelTest {
    private WicketTester tester;

    private class TestPage extends WebPage {
        private static final long serialVersionUID = 1L;
        public TestPage() {
            super();
            add(new DoublePanel(double, leftPanel, rightPanel));
        }
    }

    @Before
    public void init() {
        tester = new WicketTester();
    }

    @Test
    public void testDoublePanel() {
        tester.startPage(new TestPage());
    }
 }

 But still I am getting the same exception,

 java.lang.NullPointerException
        at org.apache.wicket.Page.isBookmarkable(Page.java:435)
        at org.apache.wicket.Page.init(Page.java:734)
        at org.apache.wicket.Page.init(Page.java:216)
        at org.apache.wicket.Page.init(Page.java:170)
        at org.apache.wicket.markup.html.WebPage.init(WebPage.java:74)
        at xxx.DoublePanelTest$TestPage.init(DoublePanelTest.java:23)
        at xxxDoublePanelTest.testDoublePanel(DoublePanelTest.java:35)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
        at
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-test-just-a-panel-using-apache-wicket-tp4097990p4098066.html
 Sent from the Users forum mailing list archive at Nabble.com.

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



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