Re: decorating html with wicket

2012-05-29 Thread Thomas Götz
I'm not convinced yet that this is really a good idea (how to deal with 
constructor arguments for validators? What is the advantage of having all in 
html effectively?) but as a starting point you could look at 
AbstractMarkupFilter (e.g. see how WicketRemoveTagHandler and other 
implementations work).

To add your own MarkupFilter implementation, do the following:


public class MyMarkupFactory extends MarkupFactory {

@Override
public MarkupParser newMarkupParser(MarkupResourceStream resource) {
final MarkupParser markupParser = super.newMarkupParser(resource);
markupParser.add(new MyMarkupFilter());
return markupParser;
}

}

and register MyMarkupFactory in your Application class:

@Override
public void init() {
super.init();
getMarkupSettings().setMarkupFactory(new MyMarkupFactory());
}


Cheers,
   -Tom



On 28.05.2012, 21:25h Fernando Wermus wrote:

 Hi all,
 I was wondering if there is some solution already done like this:
 
 input type=text wicket:id=txtMyTextField  *
 wicket:fieldtype=java.lang.String*
 *wicket:validators=com.mycompany.MyValidator1,
 com.mycompany.MyValidator2* /
 
 The idea is that HTML is allright for rendering, but It lacks  some
 behaviors. Therefore , instead of making up another markup, there is the
 chance to decorate with wicket behaviors and validators.
 
 This is flexible enough to have differents specifications and
 implementation to rich HTML.
 
 The idea we have at my work is to allow junior programmers to design mockup
 pages for funcitonal analyst without adding a line of code. We were mocking
 up pages with Adobe Flex and would like to have this behaviour with wicket.
 
 thanks in advance
 
 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: onload event on img-tag

2012-05-29 Thread Pasithee Jupiter
Thanks a lot. That works like a charm.

cheers


On Mon, May 28, 2012 at 9:02 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 Do something like:
 img = new NonCachingImage(...);
 img.add(new AttributeModifier(onload, yourStuffHere));
 form.add(img);

 On Mon, May 28, 2012 at 1:21 AM, Pasithee Jupiter pasit...@gmail.com
 wrote:
  Hi all
 
 
  How can i add the onload attribute to an image? or is it possible to
  prevent wicket overwriting html attributes on the img-tag?
 
 
  In my HTML I have a form, and inside the form an img and several input
  fields and a button. Click on the button triggers an ajax request and
  returns new form values and a new NonCachingImage. So my goal is to run
  some javascript after the image is loaded means img ...
  onload=javascript:abc();. How can I do that with wicket?
 
 
  Thanks a lot



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




continueToOriginalDestination throws exception ReplaceHandlerException in wicket 1.5

2012-05-29 Thread pricarvalho
Estou utilizando páginas interceptadores. Comumente, estou redirecionando
para uma tela de login, caso o usuário não esteja logado no sistema. Após se
logar, o sistema deverá retornar para a página anterior. O método foi
implementado conforme documentação descrita do site da Apache Wicket
(https://cwiki.apache.org/WICKET/using-intercept-pages.html)

// This page will be redirect to a page intercepting 
public class Checkout extends WebPage { 
User loggedInUser = session.getLoggedInUser(); 
if (loggedInUser == null) { 
redirectToInterceptPage(new Login(params)); 
} 
} 

public class Login extends WebPage { 
// Method should return true and display the Checkout page 
if (!this.continueToOriginalDestination()) { 
setResponsePage(ShowCatalog.class); 
} 
} 

Results: The method does not return true or false and throws the exception
ReplaceHandlerException, not redirecting after login to the Checkout page. I
don't know how to deal it. How can I solve this problem?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-throws-exception-ReplaceHandlerException-in-wicket-1-5-tp4649529.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: Handling ReplaceHandlerException on continueToOriginalDestination in wicket 1.5

2012-05-29 Thread pricarvalho
Hi, Martin.

First, sorry for any mistakes, but I am Brazilian and my English is not
very good. :-)

I need your help. I found exactly the same problems you, as follows:

*
// This page will be redirect to a page intercepting
public class Checkout extends WebPage {
  User loggedInUser = session.getLoggedInUser();

   if (loggedInUser == null) {
redirectToInterceptPage(new Login(params));
}
}

public class Login extends WebPage {

// Method should return true and display the Checkout page
if (!this.continueToOriginalDestination()) {
setResponsePage(ShowCatalog.class);
}
}
*
Results: The method does not return true and throws the exception
ReplaceHandlerException, not redirecting after login to the Checkout page. I
don't know how to deal it. 

How did you solve this problem?


peakmop wrote
 
 To follow up, and to put this issue at rest, here's the explanation
 (thanks to the wicket authentication examples):
 The ReplaceHandlerException will get thrown if there is an active request
 handler on the stack to stop its execution and start executing the new
 request handler (usually RedirectRequestHandler) if the original request
 was for some bookmarkable page. The exception eventually will get
 intercepted in the request handler code and the new request handler will
 get executed, and the requested page will eventually be rendered. Since
 before WICKET-4269 addressed the return values of
 continueToOriginalDestination(), that method return values were used to
 determine whether a redirect to the default (usually home page) or a
 redirect to the requested page is to take place. I was catching an
 Exception in the login page which also intercepted the
 ReplaceHandlerException which prevented the replacement request handler
 from being successfully executed down the road. I didn't realize this
 until I attached a debugger to the authentication examples.
 Developers can correct me if I'm off in my explanation here.
 
 -Martin-
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Handling-ReplaceHandlerException-on-continueToOriginalDestination-in-wicket-1-5-tp4101981p4649528.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: decorating html with wicket

2012-05-29 Thread Fernando Wermus
Tom,
 Thanks you for the review.

The idea is that some pages are not implemented, tough they are declared by
some one who do not know how to program. A page implemented by us read the
form  and instance all the components. We have wizards and they can show
the mock up to third workers. When they are accepted, the programmers
finish the work.


Fernando Wermus.

www.linkedin.com/in/fernandowermus



On Tue, May 29, 2012 at 4:01 AM, Thomas Götz t...@decoded.de wrote:

 I'm not convinced yet that this is really a good idea (how to deal with
 constructor arguments for validators? What is the advantage of having all
 in html effectively?) but as a starting point you could look at
 AbstractMarkupFilter (e.g. see how WicketRemoveTagHandler and other
 implementations work).

 To add your own MarkupFilter implementation, do the following:


 public class MyMarkupFactory extends MarkupFactory {

@Override
public MarkupParser newMarkupParser(MarkupResourceStream resource) {
final MarkupParser markupParser = super.newMarkupParser(resource);
markupParser.add(new MyMarkupFilter());
return markupParser;
}

 }

 and register MyMarkupFactory in your Application class:

 @Override
 public void init() {
super.init();
getMarkupSettings().setMarkupFactory(new MyMarkupFactory());
 }


 Cheers,
   -Tom



 On 28.05.2012, 21:25h Fernando Wermus wrote:

  Hi all,
  I was wondering if there is some solution already done like this:
 
  input type=text wicket:id=txtMyTextField  *
  wicket:fieldtype=java.lang.String*
  *wicket:validators=com.mycompany.MyValidator1,
  com.mycompany.MyValidator2* /
 
  The idea is that HTML is allright for rendering, but It lacks  some
  behaviors. Therefore , instead of making up another markup, there is the
  chance to decorate with wicket behaviors and validators.
 
  This is flexible enough to have differents specifications and
  implementation to rich HTML.
 
  The idea we have at my work is to allow junior programmers to design
 mockup
  pages for funcitonal analyst without adding a line of code. We were
 mocking
  up pages with Adobe Flex and would like to have this behaviour with
 wicket.
 
  thanks in advance
 
  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: decorating html with wicket

2012-05-29 Thread Fernando Wermus
Tom,
Something else. I experienced the advantages to have mock up pages
working in another company with Adobe Flex. These pages are added to the
analysis and the clients could have in advance a vivid experience.


Fernando Wermus.

www.linkedin.com/in/fernandowermus



On Tue, May 29, 2012 at 10:00 AM, Fernando Wermus fernando.wer...@gmail.com
 wrote:

 Tom,
  Thanks you for the review.

 The idea is that some pages are not implemented, tough they are declared
 by some one who do not know how to program. A page implemented by us read
 the form  and instance all the components. We have wizards and they can
 show the mock up to third workers. When they are accepted, the programmers
 finish the work.


 Fernando Wermus.

 www.linkedin.com/in/fernandowermus




 On Tue, May 29, 2012 at 4:01 AM, Thomas Götz t...@decoded.de wrote:

 I'm not convinced yet that this is really a good idea (how to deal with
 constructor arguments for validators? What is the advantage of having all
 in html effectively?) but as a starting point you could look at
 AbstractMarkupFilter (e.g. see how WicketRemoveTagHandler and other
 implementations work).

 To add your own MarkupFilter implementation, do the following:


 public class MyMarkupFactory extends MarkupFactory {

@Override
public MarkupParser newMarkupParser(MarkupResourceStream resource) {
final MarkupParser markupParser = super.newMarkupParser(resource);
markupParser.add(new MyMarkupFilter());
return markupParser;
}

 }

 and register MyMarkupFactory in your Application class:

 @Override
 public void init() {
super.init();
getMarkupSettings().setMarkupFactory(new MyMarkupFactory());
 }


 Cheers,
   -Tom



 On 28.05.2012, 21:25h Fernando Wermus wrote:

  Hi all,
  I was wondering if there is some solution already done like this:
 
  input type=text wicket:id=txtMyTextField  *
  wicket:fieldtype=java.lang.String*
  *wicket:validators=com.mycompany.MyValidator1,
  com.mycompany.MyValidator2* /
 
  The idea is that HTML is allright for rendering, but It lacks  some
  behaviors. Therefore , instead of making up another markup, there is the
  chance to decorate with wicket behaviors and validators.
 
  This is flexible enough to have differents specifications and
  implementation to rich HTML.
 
  The idea we have at my work is to allow junior programmers to design
 mockup
  pages for funcitonal analyst without adding a line of code. We were
 mocking
  up pages with Adobe Flex and would like to have this behaviour with
 wicket.
 
  thanks in advance
 
  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: decorating html with wicket

2012-05-29 Thread Thomas Götz
If I understand you correctly, your aim is to be able to rapidly prototype 
processes to be reviewed by customers/POs etc. Wouldn't a tool like Balsamiq 
Mockups or some other wireframing tool be more suitable for that purpose?

You also mentioned that the prototype should be created by some one who do not 
know how to program, with your solution this person at least needs to have 
knowledge about Wicket Validators (including der Java package + class name + 
parameters).

In my experience it is best to create a throw-away wireframe Mockup, and after 
the customer agreed to it, you start coding this in HTML/JS/Java. I don't like 
the idea too much to introduce additional complex logic into Wicket just fore 
wireframing/mockup purposes (as mentioned, a person without Wicket knowledge 
can't use this anyway).

Just my $0.02,
   -Tom


On 29.05.2012, 15:03h Fernando Wermus wrote:

 Tom,
Something else. I experienced the advantages to have mock up pages
 working in another company with Adobe Flex. These pages are added to the
 analysis and the clients could have in advance a vivid experience.
 
 
 Fernando Wermus.
 
 www.linkedin.com/in/fernandowermus
 
 
 
 On Tue, May 29, 2012 at 10:00 AM, Fernando Wermus fernando.wer...@gmail.com
 wrote:
 
 Tom,
 Thanks you for the review.
 
 The idea is that some pages are not implemented, tough they are declared
 by some one who do not know how to program. A page implemented by us read
 the form  and instance all the components. We have wizards and they can
 show the mock up to third workers. When they are accepted, the programmers
 finish the work.
 
 
 Fernando Wermus.
 
 www.linkedin.com/in/fernandowermus
 
 
 
 
 On Tue, May 29, 2012 at 4:01 AM, Thomas Götz t...@decoded.de wrote:
 
 I'm not convinced yet that this is really a good idea (how to deal with
 constructor arguments for validators? What is the advantage of having all
 in html effectively?) but as a starting point you could look at
 AbstractMarkupFilter (e.g. see how WicketRemoveTagHandler and other
 implementations work).
 
 To add your own MarkupFilter implementation, do the following:
 
 
 public class MyMarkupFactory extends MarkupFactory {
 
   @Override
   public MarkupParser newMarkupParser(MarkupResourceStream resource) {
   final MarkupParser markupParser = super.newMarkupParser(resource);
   markupParser.add(new MyMarkupFilter());
   return markupParser;
   }
 
 }
 
 and register MyMarkupFactory in your Application class:
 
 @Override
 public void init() {
   super.init();
   getMarkupSettings().setMarkupFactory(new MyMarkupFactory());
 }
 
 
 Cheers,
  -Tom
 
 
 
 On 28.05.2012, 21:25h Fernando Wermus wrote:
 
 Hi all,
I was wondering if there is some solution already done like this:
 
 input type=text wicket:id=txtMyTextField  *
 wicket:fieldtype=java.lang.String*
 *wicket:validators=com.mycompany.MyValidator1,
 com.mycompany.MyValidator2* /
 
 The idea is that HTML is allright for rendering, but It lacks  some
 behaviors. Therefore , instead of making up another markup, there is the
 chance to decorate with wicket behaviors and validators.
 
 This is flexible enough to have differents specifications and
 implementation to rich HTML.
 
 The idea we have at my work is to allow junior programmers to design
 mockup
 pages for funcitonal analyst without adding a line of code. We were
 mocking
 up pages with Adobe Flex and would like to have this behaviour with
 wicket.
 
 thanks in advance
 
 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
 
 
 


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



Re: Getting more stale page exception in wicket 1.5.6

2012-05-29 Thread sudeivas
With the above code changes, I made a simple test case,

1. Ajax Button which will throw StalePageException.
Result: The page reloaded itself without going to the error page.

2. Ajax Button which will throw PageExpiredException.
Result: Error page

3. Ajax Button which will throw ComponentNotFoundException.
Result: Error page

I believe for all the above use cases, the page should reload instead of
going to the error page. 

Please let me know if I missing something.

Thanks,
Suresh

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Getting-more-stale-page-exception-in-wicket-1-5-6-tp4649492p4649550.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: Getting more stale page exception in wicket 1.5.6

2012-05-29 Thread Martin Grigorov
Hi,

It is a bit more complicated.

On Tue, May 29, 2012 at 7:00 PM, sudeivas sureshkumar@gmail.com wrote:
 With the above code changes, I made a simple test case,

 1. Ajax Button which will throw StalePageException.
 Result: The page reloaded itself without going to the error page.

 2. Ajax Button which will throw PageExpiredException.
 Result: Error page

This is correct.
Only MountedMapper can revive a page if
org.apache.wicket.settings.IPageSettings#setRecreateMountedPagesAfterExpiry()
is true.
This is because MountedMapper knows the Page's class and is able to
create a new instance.
If only the page id is available then we do not know which page class to use.


 3. Ajax Button which will throw ComponentNotFoundException.
 Result: Error page

See the inline comments in
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler#respond
for more info about this.


 I believe for all the above use cases, the page should reload instead of
 going to the error page.

 Please let me know if I missing something.

Advice: Avoid handling Wicket's internals in your code unless really necessary.


 Thanks,
 Suresh

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Getting-more-stale-page-exception-in-wicket-1-5-6-tp4649492p4649550.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




-- 
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: Pretty URLs for AjaxLazyLoadPanel

2012-05-29 Thread kevjay
Thanks for the reply Martin.  Basically, my use case is to provide a pretty
URL that will have the non-default tab already selected.  The desired tab is
selected if I provide a URL like
http://localhost:/?1-1.ILinkListener-tabs-tabs~container-tabs-2-link,
but I was hoping to be able to control what these URLs looked like.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Pretty-URLs-for-AjaxLazyLoadPanel-tp4649499p4649552.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: Pretty URLs for AjaxLazyLoadPanel

2012-05-29 Thread kevjay
Thanks for the explanation.  This is what I was looking for.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Pretty-URLs-for-AjaxLazyLoadPanel-tp4649499p4649555.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: Pretty URLs for AjaxLazyLoadPanel

2012-05-29 Thread Martin Grigorov
You can also use url like: path/to/page/tab2
where 'tab2' is an indexed parameter. In this case you will have its
value in the page's constructor and you can load the page with 'tab2'
pre-selected.

On Tue, May 29, 2012 at 9:51 PM, kevjay kev...@gmail.com wrote:
 Thanks for the explanation.  This is what I was looking for.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Pretty-URLs-for-AjaxLazyLoadPanel-tp4649499p4649555.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




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



BigDecimal field automatic validation

2012-05-29 Thread meduolis
Hello,

I am using CompoundPropertyModel with some text fields. One of them is:


Later, when I try to enter invalid value for that field like qwerty (not
decimal type), I got validation message that wrong value entered. Even if I
have not added type validator.

But today, after I try to enter non-decimal value, it does not validates
this value and throws exception:


Any ideas, why this automatic validation for text field with generics does
not work anymore?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/BigDecimal-field-automatic-validation-tp4649560.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



BigDecimal field automatic validation

2012-05-29 Thread meduolis
Hello,

I am using CompoundPropertyModel with some text fields. One of them is:


Later, when I try to enter invalid value for that field like qwerty (not
decimal type), I got validation message that wrong value entered. Even if I
have not added type validator.

But today, after I try to enter non-decimal value, it does not validates
this value and throws exception:


Any ideas, why this automatic validation for text field with generics does
not work anymore?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/BigDecimal-field-automatic-validation-tp4649561.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



BigDecimal field automatic validation

2012-05-29 Thread meduolis
Hello,

I am using CompoundPropertyModel with some text fields. One of them is:


Later, when I try to enter invalid value for that field like qwerty (not
decimal type), I got validation message that wrong value entered. Even if I
have not added type validator.

But today, after I try to enter non-decimal value, it does not validates
this value and throws exception:


Any ideas, why this automatic validation for text field with generics does
not work anymore?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/BigDecimal-field-automatic-validation-tp4649562.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



BigDecimal field automatic validation

2012-05-29 Thread meduolis
Hello,

I am using CompoundPropertyModel with some text fields. One of them is:


Later, when I try to enter invalid value for that field like qwerty (not
decimal type), I got validation message that wrong value entered. Even if I
have not added type validator.

But today, after I try to enter non-decimal value, it does not validates
this value and throws exception:


Any ideas, why this automatic validation for text field with generics does
not work anymore?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/BigDecimal-field-automatic-validation-tp4649563.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



Specified expiration page not being shown

2012-05-29 Thread Dale Ogilvie
Hi,

This is for wicket 1.4.20.

In our WebApplication subclass we have used:

getApplicationSettings().setPageExpiredErrorPage(MyExpiredPage.class);

However after session has expired on one of our pages, if I submit the
(fairly complex) form, the form error message is shown. By this I mean
that page component validation fires and validation of an object from
session (now defunct) fails and the page is redrawn with an error
message in the feedback panel. The expired page IS displayed if an ajax
backed combo is used on the same form, only form submission avoids the
expiry page.

Why might it be that our MyExpiredPage is not being shown in the form
submission case? We want our expired page to be displayed consistently. 

Thanks for any suggestions as to where to look for the issue.

Dale



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



Re: Getting more stale page exception in wicket 1.5.6

2012-05-29 Thread sudeivas
I believe
org.apache.wicket.settings.IPageSettings#setRecreateMountedPagesAfterExpiry()
is default to true. So I didn't set anything in my application. I mounted
all the pages. I am handling only couple of exceptions on my application and
for others I just return 'null' in onException() method. Hope I am not doing
anything wrong here. 

-Suresh

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Getting-more-stale-page-exception-in-wicket-1-5-6-tp4649492p4649567.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: Getting more stale page exception in wicket 1.5.6

2012-05-29 Thread sudeivas
But according the below link,
https://issues.apache.org/jira/browse/WICKET-4454

The page should be repainted instead of showing ComponentNotFoundException.
I am using wicket 1.5.6. Why am I seeing ComponentNotFoundException? Anyway
to fix this?

-Suresh

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Getting-more-stale-page-exception-in-wicket-1-5-6-tp4649492p4649568.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: Specified expiration page not being shown

2012-05-29 Thread Dale Ogilvie
I have narrowed the behaviour that prevents our MyExpiredPage appearing
to this code below, specifically the StringEqualsValidator.

captchaToken = new
RequiredTextFieldString(captchaToken, 
new PropertyModelString(this,
captchaEntered))
{
@Override
protected final void onComponentTag(final
ComponentTag tag)
{

super.onComponentTag(tag);
// clear the field after each render
if ( captchaToken.hasErrorMessage() ) {
tag.put(value, );
}
}
};
 captchaToken.add(new StringEqualsValidator(
captcha.getAnswer() ));


public class StringEqualsValidator implements IValidatorString {
 
private final String toCompare;

public StringEqualsValidator(String str) {
toCompare = str;
}
 
@Override
public void validate(IValidatableString validatable) {
final String input = validatable.getValue();

if (StringUtils.equals(input, toCompare) == false) {
error(validatable, notequal);
}
}
 
private void error(IValidatableString validatable, String
errorKey) {
ValidationError error = new ValidationError();
error.addMessageKey(getClass().getSimpleName() + . +
errorKey);
validatable.error(error);
}
 
}

 -Original Message-
 From: Dale Ogilvie [mailto:dale_ogil...@trimble.com]
 Sent: Wednesday, 30 May 2012 9:52 a.m.
 To: users@wicket.apache.org
 Subject: Specified expiration page not being shown
 
 Hi,
 
 This is for wicket 1.4.20.
 
 In our WebApplication subclass we have used:
 
 getApplicationSettings().setPageExpiredErrorPage(MyExpiredPage.class);
 
 However after session has expired on one of our pages, if I submit the
(fairly
 complex) form, the form error message is shown. By this I mean that
page
 component validation fires and validation of an object from session
(now
 defunct) fails and the page is redrawn with an error message in the
feedback
 panel. The expired page IS displayed if an ajax backed combo is used
on the
 same form, only form submission avoids the expiry page.
 
 Why might it be that our MyExpiredPage is not being shown in the form
 submission case? We want our expired page to be displayed
consistently.
 
 Thanks for any suggestions as to where to look for the issue.
 
 Dale
 
 
 
 -
 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