Calculate property value on form submission

2011-01-26 Thread Xavier López
Hi,

I've got a form with some fields, backed by an entity with a cpm. I've got
one property on the entity which value is calculated in terms of one of the
input fields in the form. It's important to have this field calculated up to
date at form validation time.
I tipically approached this issue by using an
ajaxformcomponentupdatingbehavior to update the entity's calculated field on
every change. Now i'm allowing non-js users into the site, and have mimed
this action with a submit button. But, of course, the user might not press
the button and go straight away without pre-calculating the value
server-side.
I've been thinking about binding a propertymodel to that calculated
property, and somehow make it work like a model, so that its getObject will
calculate the value, and thus have the value calculated before executing the
form validator.
Could you please provide any hint on how tho achieve this, if it is
possible?

Thank you very much!
Xavier


Re: How to remove all previous pages from pagemap

2011-01-26 Thread Matthias Keller

On 2011-01-25 18:20, Jeremy Thomerson wrote:

On Tue, Jan 25, 2011 at 11:14 AM, Matthias Keller wrote

Hi List

We've got the following scenario:
After a user hopped through a wizard, he'll reach a confirmation page in
our workflow. Now the session still needs to remain active but I want to
prohibit going back into the wizard and resend it again.
I experimented with  Session.clear()  and  Session.getPageMaps() and
calling pageMap.remove() on each instance returned, to no avail - after
clicking back, the user may still access the wizard again.

What's the correct way to 'expire' *all* previous pages so that going back
using the back-button is not possible anymore? And, where do I need to put
that specific code (at the end of the wizard after calling
setResponsePage(), in the onInitialize() of the confirmation page, ... ?


  Have you looked at IPageMap#clear()?  I'm not 100% sure where you are able
to put it.  I think you could put it just before calling setResponsePage.
  Not after, though (since setResponsePage throws an exception that stops
processing, your code wouldn't get called after it.)
Session.clear() does just this, it visits all pagemaps and calls clear() 
on them. Though this seems to clear up some things (when I get all 
pagemaps afterwards programmatically, they're gone), I can still go back 
with the back button and reload the pages as often as I like.
BTW, setResponsePage() does not throw any exceptions (at least not for 
1.4.X), it just stores the nexxt page somewhere in the RequestCycle for 
later usage.


It would be great if someone with deeper pagemaps-knowledge could chime 
in to find out the right place and way to clear all old pages...



Is there some cool debugging feature or call I'd could do to see all the

pages in the pagemaps with their versions et al in order to find out what to
call to clear that...

Add a dependency to wicket-devutils and then in your base page (hopefully
you have a base page for all your pages), add a DebugBar.  That will have
some links to the inspector, etc...

Thanks, I'll give it a shot this afternoon

Matt



smime.p7s
Description: S/MIME Cryptographic Signature


RadioChoice keeps null rawInput after required validation?

2011-01-26 Thread Xavier López
Hi,

I've got a form with a required radiochoice to select among some options.
I've also got a yes/no radiochoice that selects a given option on rc1 and
disables it when 'yes' is selected. When 'no' is selected, rc1 is set to
enabled and its model object is cleared.

The enabling/disabling of rc1 and its modelobject set is done in the
onUpdate() method of an AjaxFormChoiceComponentUpdatingBehavior on the
yes/no radiochoice.

It's working fine, except in the following situation: 'no' is selected and
rc1 has no value set. Then the required validation prevents the form
submission. After that, if I select 'yes' on the yes/no radiochoice, it
enables rc1 and sets its model object successfully, but, to my surprise, the
input type=radio has no value selected when rendering the HTML.

After debbuging through rc1#onComponentTagBody(), I've found that getValue()
returns null, because rawInput is null (and not NO_RAW_INPUT), that's why
there's no radio selected. I suspect rawInput is null because of last
submitting rc1 with no value selected (when the required validation fails).
I managed to get around this by calling rc1.clearInput() on the ajax
behavior.

Just want to know if i'm right about these thoughts, because I feel
something wrong here, and if calling clearInput() is a good way of dealing
with this.

Thank you for your feedback!
Xavier


Re: How to remove all previous pages from pagemap

2011-01-26 Thread Martijn Dashorst
Unless you completely invalidated the browser/client side cache of
markup, people can still use the back button and will be presented
with the markup as it was rendered at that time. It is not until the
user performs an action at that page when wicket will try to retrieve
the page from the page store. And only then will it see that the page
is no longer available (provided the page was stateful, and the action
URL is not targetting a stateless action) and present the user with
page expired (or whatever you configured as the page expired page).

Martijn

On Wed, Jan 26, 2011 at 11:17 AM, Matthias Keller
matthias.kel...@ergon.ch wrote:
 On 2011-01-25 18:20, Jeremy Thomerson wrote:

 On Tue, Jan 25, 2011 at 11:14 AM, Matthias Keller wrote

 Hi List

 We've got the following scenario:
 After a user hopped through a wizard, he'll reach a confirmation page in
 our workflow. Now the session still needs to remain active but I want to
 prohibit going back into the wizard and resend it again.
 I experimented with  Session.clear()  and  Session.getPageMaps() and
 calling pageMap.remove() on each instance returned, to no avail - after
 clicking back, the user may still access the wizard again.

 What's the correct way to 'expire' *all* previous pages so that going
 back
 using the back-button is not possible anymore? And, where do I need to
 put
 that specific code (at the end of the wizard after calling
 setResponsePage(), in the onInitialize() of the confirmation page, ... ?

  Have you looked at IPageMap#clear()?  I'm not 100% sure where you are
 able
 to put it.  I think you could put it just before calling setResponsePage.
  Not after, though (since setResponsePage throws an exception that stops
 processing, your code wouldn't get called after it.)

 Session.clear() does just this, it visits all pagemaps and calls clear() on
 them. Though this seems to clear up some things (when I get all pagemaps
 afterwards programmatically, they're gone), I can still go back with the
 back button and reload the pages as often as I like.
 BTW, setResponsePage() does not throw any exceptions (at least not for
 1.4.X), it just stores the nexxt page somewhere in the RequestCycle for
 later usage.

 It would be great if someone with deeper pagemaps-knowledge could chime in
 to find out the right place and way to clear all old pages...

 Is there some cool debugging feature or call I'd could do to see all the

 pages in the pagemaps with their versions et al in order to find out what
 to
 call to clear that...

 Add a dependency to wicket-devutils and then in your base page (hopefully
 you have a base page for all your pages), add a DebugBar.  That will have
 some links to the inspector, etc...

 Thanks, I'll give it a shot this afternoon

 Matt





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



Re: How to remove all previous pages from pagemap

2011-01-26 Thread Matthias Keller

Hi Martijn

Yes I know that, but as I stated, it's still possible to reload that 
page and perform actions on it (they are *all* stateful pages) - I must 
know how I can suppress that. I don't care if the user goes back and 
sees the page from the cache but he mustn't be able to perform any 
actions on it which I could not avoid yet, my knowledge of the page 
store implementation is too shallow; I don't know why the user may still 
access the previous page even thought I issued a Session.clear() which 
will call IPageMap.clear() on all pagemaps... Maybe because it's the 
previous page and it cannot really be removed .. ?


Thanks for your input

Matt

On 2011-01-26 12:10, Martijn Dashorst wrote:

Unless you completely invalidated the browser/client side cache of
markup, people can still use the back button and will be presented
with the markup as it was rendered at that time. It is not until the
user performs an action at that page when wicket will try to retrieve
the page from the page store. And only then will it see that the page
is no longer available (provided the page was stateful, and the action
URL is not targetting a stateless action) and present the user with
page expired (or whatever you configured as the page expired page).

Martijn

On Wed, Jan 26, 2011 at 11:17 AM, Matthias Keller
matthias.kel...@ergon.ch  wrote:

On 2011-01-25 18:20, Jeremy Thomerson wrote:

On Tue, Jan 25, 2011 at 11:14 AM, Matthias Keller wrote

Hi List

We've got the following scenario:
After a user hopped through a wizard, he'll reach a confirmation page in
our workflow. Now the session still needs to remain active but I want to
prohibit going back into the wizard and resend it again.
I experimented with  Session.clear()  and  Session.getPageMaps() and
calling pageMap.remove() on each instance returned, to no avail - after
clicking back, the user may still access the wizard again.

What's the correct way to 'expire' *all* previous pages so that going
back
using the back-button is not possible anymore? And, where do I need to
put
that specific code (at the end of the wizard after calling
setResponsePage(), in the onInitialize() of the confirmation page, ... ?


  Have you looked at IPageMap#clear()?  I'm not 100% sure where you are
able
to put it.  I think you could put it just before calling setResponsePage.
  Not after, though (since setResponsePage throws an exception that stops
processing, your code wouldn't get called after it.)

Session.clear() does just this, it visits all pagemaps and calls clear() on
them. Though this seems to clear up some things (when I get all pagemaps
afterwards programmatically, they're gone), I can still go back with the
back button and reload the pages as often as I like.
BTW, setResponsePage() does not throw any exceptions (at least not for
1.4.X), it just stores the nexxt page somewhere in the RequestCycle for
later usage.

It would be great if someone with deeper pagemaps-knowledge could chime in
to find out the right place and way to clear all old pages...


Is there some cool debugging feature or call I'd could do to see all the

pages in the pagemaps with their versions et al in order to find out what
to
call to clear that...

Add a dependency to wicket-devutils and then in your base page (hopefully
you have a base page for all your pages), add a DebugBar.  That will have
some links to the inspector, etc...

Thanks, I'll give it a shot this afternoon

Matt










smime.p7s
Description: S/MIME Cryptographic Signature


Re: How to remove all previous pages from pagemap

2011-01-26 Thread Matthias Keller

I now found one way to clear all previous pages.
I guess the reason is the REDIRECT_TO_BUFFER strategy (or however it's 
called) which both processes a button's onClick() event AND the next 
page's full initialization+rendering in one request. Thus the previous 
page (where the button was) is marked as 'touched' in the Session as 
well - no matter when I clear all the pagemaps, the previous page will 
just be re-added at the end of the request.
My current solution which solves this problem (although ugly) is the 
following code in the onClick:


// Make sure this page does NOT get stored at the end of the 
request

getSession().untouch(getPage());
// Clear all previous stored pages
getSession().clear();

// display the confirmation page
setResponsePage(new ConfirmationPage(...));

I still hope there's a better solution but this works for now


Does anyone know if there's the possibility to override the 
REDIRECT_TO_BUFFER strategy for a certain redirect? This would also 
solve this problem as then the Session.clear() would be executed in the 
next request after the onClick()


thanks

Matt

On 2011-01-25 18:14, Matthias Keller wrote:

Hi List

We've got the following scenario:
After a user hopped through a wizard, he'll reach a confirmation page 
in our workflow. Now the session still needs to remain active but I 
want to prohibit going back into the wizard and resend it again.
I experimented with  Session.clear()  and  Session.getPageMaps() and 
calling pageMap.remove() on each instance returned, to no avail - 
after clicking back, the user may still access the wizard again.


What's the correct way to 'expire' *all* previous pages so that going 
back using the back-button is not possible anymore? And, where do I 
need to put that specific code (at the end of the wizard after calling 
setResponsePage(), in the onInitialize() of the confirmation page, ... ?


Is there some cool debugging feature or call I'd could do to see all 
the pages in the pagemaps with their versions et al in order to find 
out what to call to clear that...?


Thank you very much

Matt





smime.p7s
Description: S/MIME Cryptographic Signature


How to deal with vertical tabs?

2011-01-26 Thread Carsten Luckmann
Hello,

I have a problem with a Wicket Ajax response not being processed. Here the
details:

I have a link which is supposed to open a ModalWindow. The Ajax request is
sent to the server, processed by the server, and the response is sent to the
client. The client receives the response, including the HTML code for the
ModalWindow and the JavaScript to open it. Nevertheless, the
Wicket.Window.create call is never executed. After having investigated the
problem, I have found out that this strange behaviour is triggered by a
vertical tab character, which is an illegal XML character and causes the XML
parser in Firefox and Chrome to exit (IE works though). This vertical tab
character entered the markup from the application's data store and was part
of the content of a data field.

Until now, I came up with the following strategies:

1. One possible solution would be inhibition of illegal XML characters in
the data. Besides the question, if this is semantically acceptable, it is
difficult and sometimes not possible to intercept and clean all data
entering the data store.

2. Another solution would be a Servlet filter, filtering all illegal
characters. The problem I see with this solution is varying character
encoding of the response, which makes it difficult to recognize the illegal
characters in all circumstances.

3. My favourite solution would be some kind of mechanism in Wicket, which
allows for filtering or modifying the data before the markup is rendered. I
just do not know whether there is a way to do this in wicket and how to
perform this task.

Maybe you can help me and point me into the right direction. Other
suggestions are welcome, too.

Yours,
Carsten

-- 
Dr. rer. nat. Carsten Luckmann
Dipl.-Phys.

freiheit.com technologies gmbh
Straßenbahnring 22 / 20251 Hamburg, Germany
fon   +49 (0)40 / 890584-0
fax   +49 (0)40 / 890584-20
HRB Hamburg 70814

E5FA C55C A15B 27CB 0EEE  D4F5 F8DE 4DBD 524A F375
Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof


Re: How to remove all previous pages from pagemap

2011-01-26 Thread Martijn Dashorst
On Wed, Jan 26, 2011 at 3:23 PM, Matthias Keller
matthias.kel...@ergon.ch wrote:
 My current solution which solves this problem (although ugly) is the
 following code in the onClick:

You could try to see if setRedirect(true); works for you, and not
perform a setResponsePage( new Page()), but rather do a
setResponsePage(Page.class). However, that would make the confirmation
page bookmarkable, something you probably don't want :)

Ugly use case sometimes requires ugly code :-).. I don't think this is
ugly, it performs each step you need explicitly. The use case to
remove pages from the page map is not that common, so the story for
doing that is not as nice.

Perhaps something like a @DontStoreInPageMap annotation could be
used. This would put the page in the session, ensuring you still have
the stateful programming model and are able to work with the page as
if it were a normal wicket page. But the page would not be put in the
pagestore. I guess this would still work across clusters to support
failover: the current page would still be stored in the session,
making it available on all buddy nodes.

Martijn

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



1.5-RC1 maven source, javadoc, and tests

2011-01-26 Thread Steve Lowery
Looks like the source, javadoc and test artifacts for 1.5-RC1 published to
the maven repo are empty.  Can this be fixed please?

Thanks,
Steve


Re: How to remove all previous pages from pagemap

2011-01-26 Thread Matthias Keller

On 2011-01-26 15:49, Martijn Dashorst wrote:

On Wed, Jan 26, 2011 at 3:23 PM, Matthias Keller
matthias.kel...@ergon.ch  wrote:

My current solution which solves this problem (although ugly) is the
following code in the onClick:

You could try to see if setRedirect(true); works for you, and not
perform a setResponsePage( new Page()), but rather do a
setResponsePage(Page.class). However, that would make the confirmation
page bookmarkable, something you probably don't want :)

Ugly use case sometimes requires ugly code :-).. I don't think this is
ugly, it performs each step you need explicitly. The use case to
remove pages from the page map is not that common, so the story for
doing that is not as nice.

Perhaps something like a @DontStoreInPageMap annotation could be
used. This would put the page in the session, ensuring you still have
the stateful programming model and are able to work with the page as
if it were a normal wicket page. But the page would not be put in the
pagestore. I guess this would still work across clusters to support
failover: the current page would still be stored in the session,
making it available on all buddy nodes.

Martijn

Hi Marijn

Thanks for your reply

Well, if the code's ugly or not is one side - the time required to get 
to that point is the other side - I spent hours trying to figure out why 
Session.clear() apparently does not work. To understand that, a lot of 
insight into Request Cycles, PageMaps and Render Strategies is necessary.
I'd very much welcome a hook to alter the render strategy just for the 
next page. setRedirect(true) does not change the strategy and is the 
default in the (default) REDIRECT_TO_BUFFER strategy: In this case the 
next page is rendered and stored, then the user is redirected to a new 
url (to solve the Reload-after-POST problem) - the new url only serves 
the previously cached HTML code and does not call any hooks on the page 
itself (because it doesn't even know about it, I guess).
So what I'd need would be a kind of setRedirect() which switches to 
REDIRECT_TO_RENDER.


Matt




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Use Byte for CheckBox instead of Boolean

2011-01-26 Thread rolandpeng

Hi, this is YesNoCheckBox referred from previous posts. You can modify to fit
your need.

Roland.

--
public class YesNoCheckBox extends CheckBox {

public YesNoCheckBox(String id) {
super(id);
}

@Override
protected IModel initModel() {
return new CheckBoxYesNoModel(super.initModel());
}

private class CheckBoxYesNoModel implements IModel {
final IModel model;

public CheckBoxYesNoModel(IModel model) {
this.model = model;
}

public void detach() {
model.detach();
}

public Object getObject() {
return convertToComponent(model.getObject());
}

public void setObject(Object object) {
model.setObject(convertFromComponent(object));
}

protected Object convertToComponent(Object o) {
if (o.toString().equalsIgnoreCase(y))
return true;
else
return false;
}

protected Object convertFromComponent(Object o) {
if (((Boolean) o) == true)
return y;
else
return n;
}
}
}
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Use-Byte-for-CheckBox-instead-of-Boolean-tp3236065p3238209.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: 1.5-RC1 maven source, javadoc, and tests

2011-01-26 Thread Igor Vaynberg
see this thread: [discuss] How to resolve wicket aggregate classes /
sources jar issues

-igor

On Wed, Jan 26, 2011 at 6:54 AM, Steve Lowery
slow...@gatessolutions.com wrote:
 Looks like the source, javadoc and test artifacts for 1.5-RC1 published to
 the maven repo are empty.  Can this be fixed please?

 Thanks,
 Steve


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



Re: Calculate property value on form submission

2011-01-26 Thread Igor Vaynberg
dont use a cpm, write a model that chains the entity model and does
the right thing in get/set.

-igor

On Wed, Jan 26, 2011 at 1:25 AM, Xavier López xavil...@gmail.com wrote:
 Hi,

 I've got a form with some fields, backed by an entity with a cpm. I've got
 one property on the entity which value is calculated in terms of one of the
 input fields in the form. It's important to have this field calculated up to
 date at form validation time.
 I tipically approached this issue by using an
 ajaxformcomponentupdatingbehavior to update the entity's calculated field on
 every change. Now i'm allowing non-js users into the site, and have mimed
 this action with a submit button. But, of course, the user might not press
 the button and go straight away without pre-calculating the value
 server-side.
 I've been thinking about binding a propertymodel to that calculated
 property, and somehow make it work like a model, so that its getObject will
 calculate the value, and thus have the value calculated before executing the
 form validator.
 Could you please provide any hint on how tho achieve this, if it is
 possible?

 Thank you very much!
 Xavier


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



Re: RadioChoice keeps null rawInput after required validation?

2011-01-26 Thread Igor Vaynberg
clearinput() is a good way to deal with it, but the component should
still set no_raw_input if it is submitted in a disabled state. please
file a jira issue, preferably with a quickstart.

-igor

On Wed, Jan 26, 2011 at 3:05 AM, Xavier López xavil...@gmail.com wrote:
 Hi,

 I've got a form with a required radiochoice to select among some options.
 I've also got a yes/no radiochoice that selects a given option on rc1 and
 disables it when 'yes' is selected. When 'no' is selected, rc1 is set to
 enabled and its model object is cleared.

 The enabling/disabling of rc1 and its modelobject set is done in the
 onUpdate() method of an AjaxFormChoiceComponentUpdatingBehavior on the
 yes/no radiochoice.

 It's working fine, except in the following situation: 'no' is selected and
 rc1 has no value set. Then the required validation prevents the form
 submission. After that, if I select 'yes' on the yes/no radiochoice, it
 enables rc1 and sets its model object successfully, but, to my surprise, the
 input type=radio has no value selected when rendering the HTML.

 After debbuging through rc1#onComponentTagBody(), I've found that getValue()
 returns null, because rawInput is null (and not NO_RAW_INPUT), that's why
 there's no radio selected. I suspect rawInput is null because of last
 submitting rc1 with no value selected (when the required validation fails).
 I managed to get around this by calling rc1.clearInput() on the ajax
 behavior.

 Just want to know if i'm right about these thoughts, because I feel
 something wrong here, and if calling clearInput() is a good way of dealing
 with this.

 Thank you for your feedback!
 Xavier


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



Re: How to deal with vertical tabs?

2011-01-26 Thread Igor Vaynberg
wicket should already be escaping such characters in markup. please
file a jira with a quickstart.

-igor

On Wed, Jan 26, 2011 at 6:36 AM, Carsten Luckmann
carsten.luckm...@freiheit.com wrote:
 Hello,

 I have a problem with a Wicket Ajax response not being processed. Here the
 details:

 I have a link which is supposed to open a ModalWindow. The Ajax request is
 sent to the server, processed by the server, and the response is sent to the
 client. The client receives the response, including the HTML code for the
 ModalWindow and the JavaScript to open it. Nevertheless, the
 Wicket.Window.create call is never executed. After having investigated the
 problem, I have found out that this strange behaviour is triggered by a
 vertical tab character, which is an illegal XML character and causes the XML
 parser in Firefox and Chrome to exit (IE works though). This vertical tab
 character entered the markup from the application's data store and was part
 of the content of a data field.

 Until now, I came up with the following strategies:

 1. One possible solution would be inhibition of illegal XML characters in
 the data. Besides the question, if this is semantically acceptable, it is
 difficult and sometimes not possible to intercept and clean all data
 entering the data store.

 2. Another solution would be a Servlet filter, filtering all illegal
 characters. The problem I see with this solution is varying character
 encoding of the response, which makes it difficult to recognize the illegal
 characters in all circumstances.

 3. My favourite solution would be some kind of mechanism in Wicket, which
 allows for filtering or modifying the data before the markup is rendered. I
 just do not know whether there is a way to do this in wicket and how to
 perform this task.

 Maybe you can help me and point me into the right direction. Other
 suggestions are welcome, too.

 Yours,
 Carsten

 --
 Dr. rer. nat. Carsten Luckmann
 Dipl.-Phys.

 freiheit.com technologies gmbh
 Straßenbahnring 22 / 20251 Hamburg, Germany
 fon   +49 (0)40 / 890584-0
 fax   +49 (0)40 / 890584-20
 HRB Hamburg 70814

 E5FA C55C A15B 27CB 0EEE  D4F5 F8DE 4DBD 524A F375
 Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof


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



FormComponentPanel and invalid child FormComponents question

2011-01-26 Thread Sam Zilverberg
I have a FormComponentPanel that represents a Time object - not
java.sql.Time but my own Time object.
This Time object has 2 fields - hours and minutes.
The panel has textfields for the hours and minutes that are defined as class
type Integer.

I have a behavior on the panel that whenever it has error feedback messages
it is added a css class that show a red border around it.
This works when I explicitly call panel.error(some error). I do this when
the hour field is empty and the minutes field has a value.
But when I put an illegal Integer into the one of the textfields the
feedback error message is registered with the textfield so the
invalid-css-behavior doesn't trigger.

Is there a simple way to tell a form component to register all of it's
messages with some other form component -  in this case the panel?
Are there any other suggestion to get this desired behavior?

Thanks
-Sam


Re: FormComponentPanel and invalid child FormComponents question

2011-01-26 Thread Igor Vaynberg
your form component panel should check if any of its children have
error messages as well. use a visitor.

-igor


On Wed, Jan 26, 2011 at 8:32 AM, Sam Zilverberg samzilverb...@gmail.com wrote:
 I have a FormComponentPanel that represents a Time object - not
 java.sql.Time but my own Time object.
 This Time object has 2 fields - hours and minutes.
 The panel has textfields for the hours and minutes that are defined as class
 type Integer.

 I have a behavior on the panel that whenever it has error feedback messages
 it is added a css class that show a red border around it.
 This works when I explicitly call panel.error(some error). I do this when
 the hour field is empty and the minutes field has a value.
 But when I put an illegal Integer into the one of the textfields the
 feedback error message is registered with the textfield so the
 invalid-css-behavior doesn't trigger.

 Is there a simple way to tell a form component to register all of it's
 messages with some other form component -  in this case the panel?
 Are there any other suggestion to get this desired behavior?

 Thanks
 -Sam


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



Re: FormComponentPanel and invalid child FormComponents question

2011-01-26 Thread Sam Zilverberg
That is an excellent idea.
However I don't want to just set the panel to be invalid when one of it's
children is invalid.
I'd like to also steal its' feedback message.
I want this to happen because I have a feedback panel next to the form
component that shows feedback messages registered to it.

Is there a simple way to achieve this?

On Wed, Jan 26, 2011 at 6:39 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 your form component panel should check if any of its children have
 error messages as well. use a visitor.

 -igor




Class-only inheritance

2011-01-26 Thread DCarr

Hi,

Is it possible to have class inheritance without markup inheritance?

I would like a wicket-aware base class (with an associated markup 
file) with derived classes supplying data (e.g.. BaseClass with an 
'abstract protected String getName()') and no markup files (or XML 
files).  I know how to do that if the derived classes have markup and  
the base class markup has wicket:child, but cannot not figure out if 
it can be done without the child markup.


So:

BaseClass.java (with abstract protected String getName(), and 
add(new Label(name, getName()));)

BaseClass.html (with a span wicket:id=name/span)
BaseClass.xml

and the derived classes which extend BaseClass:

DerivedClass1.java (with protected String getName() { return 
Class1;})
DerivedClass2.java (with protected String getName() { return 
Class2;})


Currently, Wicket is trying to apply markup inheritance, but since 
I don't have the markup for the derived classes I get:


org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html' 
for component 'com.x.DerivedClass1' not found. Enable debug messages 
for org.apache.wicket.util.resource to get a list of all filenames tried:


and

Caused by: org.apache.wicket.WicketRuntimeException: Expected to find 
wicket:child/ in base markup


As a work around I can create a data supplier interface, implement 
the equivalent of the two derived classes and pass those in to my 
BaseClass, but the derived classes are simpler.


Thanks,
DC

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



Re: FormComponentPanel and invalid child FormComponents question

2011-01-26 Thread Igor Vaynberg
give the panel containerfeedbackmessagefilter which will filter on the
specified component and any of its children.

-igor

On Wed, Jan 26, 2011 at 9:03 AM, Sam Zilverberg samzilverb...@gmail.com wrote:
 That is an excellent idea.
 However I don't want to just set the panel to be invalid when one of it's
 children is invalid.
 I'd like to also steal its' feedback message.
 I want this to happen because I have a feedback panel next to the form
 component that shows feedback messages registered to it.

 Is there a simple way to achieve this?

 On Wed, Jan 26, 2011 at 6:39 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 your form component panel should check if any of its children have
 error messages as well. use a visitor.

 -igor




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



Re: Class-only inheritance

2011-01-26 Thread Igor Vaynberg
if your DerivedClass1.java does not have markup and your
BaseClass.html does not have a wicket:child tag then DerivedClass1
will use BaseClass' markup. so it should already work as you want,
just remove wicket:child tag.

-igor


On Wed, Jan 26, 2011 at 9:13 AM, DCarr listobser...@gmail.com wrote:
 Hi,

    Is it possible to have class inheritance without markup inheritance?

    I would like a wicket-aware base class (with an associated markup file)
 with derived classes supplying data (e.g.. BaseClass with an 'abstract
 protected String getName()') and no markup files (or XML files).  I know how
 to do that if the derived classes have markup and  the base class markup has
 wicket:child, but cannot not figure out if it can be done without the
 child markup.

    So:

        BaseClass.java (with abstract protected String getName(), and add(new
 Label(name, getName()));)
        BaseClass.html (with a span wicket:id=name/span)
        BaseClass.xml

    and the derived classes which extend BaseClass:

        DerivedClass1.java (with protected String getName() { return
 Class1;})
        DerivedClass2.java (with protected String getName() { return
 Class2;})

    Currently, Wicket is trying to apply markup inheritance, but since I
 don't have the markup for the derived classes I get:

 org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html' for
 component 'com.x.DerivedClass1' not found. Enable debug messages for
 org.apache.wicket.util.resource to get a list of all filenames tried:

 and

 Caused by: org.apache.wicket.WicketRuntimeException: Expected to find
 wicket:child/ in base markup

    As a work around I can create a data supplier interface, implement the
 equivalent of the two derived classes and pass those in to my BaseClass, but
 the derived classes are simpler.

 Thanks,
 DC

 -
 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: FormComponentPanel and invalid child FormComponents question

2011-01-26 Thread Pedro Santos
Hi Sam, you can change the feedback panel to show not only messages
registered for the panel, but also for the inner components. The Wicket
feedback panel uses the IFeedbackMessageFilter to filter what messages to
display. You can provide one that test if the reporter is an panel children.
See ContainerFeedbackMessageFilter

On Wed, Jan 26, 2011 at 3:03 PM, Sam Zilverberg samzilverb...@gmail.comwrote:

 That is an excellent idea.
 However I don't want to just set the panel to be invalid when one of it's
 children is invalid.
 I'd like to also steal its' feedback message.
 I want this to happen because I have a feedback panel next to the form
 component that shows feedback messages registered to it.

 Is there a simple way to achieve this?

 On Wed, Jan 26, 2011 at 6:39 PM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:

  your form component panel should check if any of its children have
  error messages as well. use a visitor.
 
  -igor
 
 




-- 
Pedro Henrique Oliveira dos Santos


Re: Class-only inheritance

2011-01-26 Thread DCarr

Hm - I'm doing something wrong, then.  The BaseClass.html does not have a
wicket:child in it, and I do get that second error message:

Caused by: org.apache.wicket.WicketRuntimeException: Expected to find
wicket:child/ in base markup 

This is wicket 1.4.6.

If I turn on debug, I do get this just before the MarkupNotFoundException
exception:

-DEBUG::26 Jan 2011 08:46:58.964::org.apache.wicket.markup.MergedMarkup:
Merge markup: derived markup: DerivedClass1.html; base markup:
BaseClass.html

but never get the list of all filenames tried.

I'll try a simple test case and see if I can spot anything.

Thanks for the speedy reply,
DC.


Igor Vaynberg-2 wrote:
 
 if your DerivedClass1.java does not have markup and your
 BaseClass.html does not have a wicket:child tag then DerivedClass1
 will use BaseClass' markup. so it should already work as you want,
 just remove wicket:child tag.
 
 -igor
 
 
 On Wed, Jan 26, 2011 at 9:13 AM, DCarr listobser...@gmail.com wrote:
 Hi,

    Is it possible to have class inheritance without markup inheritance?

    I would like a wicket-aware base class (with an associated markup
 file)
 with derived classes supplying data (e.g.. BaseClass with an 'abstract
 protected String getName()') and no markup files (or XML files).  I know
 how
 to do that if the derived classes have markup and  the base class markup
 has
 wicket:child, but cannot not figure out if it can be done without the
 child markup.

    So:

        BaseClass.java (with abstract protected String getName(), and
 add(new
 Label(name, getName()));)
        BaseClass.html (with a )
        BaseClass.xml

    and the derived classes which extend BaseClass:

        DerivedClass1.java (with protected String getName() { return
 Class1;})
        DerivedClass2.java (with protected String getName() { return
 Class2;})

    Currently, Wicket is trying to apply markup inheritance, but since I
 don't have the markup for the derived classes I get:

 org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html'
 for
 component 'com.x.DerivedClass1' not found. Enable debug messages for
 org.apache.wicket.util.resource to get a list of all filenames tried:

 and

 Caused by: org.apache.wicket.WicketRuntimeException: Expected to find
 wicket:child/ in base markup

    As a work around I can create a data supplier interface, implement the
 equivalent of the two derived classes and pass those in to my BaseClass,
 but
 the derived classes are simpler.

 Thanks,
 DC

 -
 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
 
 
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Re-Class-only-inheritance-tp3238455p3238625.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



http 500 status on GitHub

2011-01-26 Thread Martin Funk
Hi,

anyone experiencing something similar, as I described here?

http://support.github.com/discussions/site/2640-wiki-git-access-leads-to-500

mf

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



Re: How to deal with vertical tabs?

2011-01-26 Thread Martin Grigorov
This is fixed in 1.5 only.

https://issues.apache.org/jira/browse/WICKET-2264
https://issues.apache.org/jira/browse/WICKET-3330

On Wed, Jan 26, 2011 at 5:10 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 wicket should already be escaping such characters in markup. please
 file a jira with a quickstart.

 -igor

 On Wed, Jan 26, 2011 at 6:36 AM, Carsten Luckmann
 carsten.luckm...@freiheit.com wrote:
  Hello,
 
  I have a problem with a Wicket Ajax response not being processed. Here
 the
  details:
 
  I have a link which is supposed to open a ModalWindow. The Ajax request
 is
  sent to the server, processed by the server, and the response is sent to
 the
  client. The client receives the response, including the HTML code for the
  ModalWindow and the JavaScript to open it. Nevertheless, the
  Wicket.Window.create call is never executed. After having investigated
 the
  problem, I have found out that this strange behaviour is triggered by a
  vertical tab character, which is an illegal XML character and causes the
 XML
  parser in Firefox and Chrome to exit (IE works though). This vertical tab
  character entered the markup from the application's data store and was
 part
  of the content of a data field.
 
  Until now, I came up with the following strategies:
 
  1. One possible solution would be inhibition of illegal XML characters in
  the data. Besides the question, if this is semantically acceptable, it is
  difficult and sometimes not possible to intercept and clean all data
  entering the data store.
 
  2. Another solution would be a Servlet filter, filtering all illegal
  characters. The problem I see with this solution is varying character
  encoding of the response, which makes it difficult to recognize the
 illegal
  characters in all circumstances.
 
  3. My favourite solution would be some kind of mechanism in Wicket, which
  allows for filtering or modifying the data before the markup is rendered.
 I
  just do not know whether there is a way to do this in wicket and how to
  perform this task.
 
  Maybe you can help me and point me into the right direction. Other
  suggestions are welcome, too.
 
  Yours,
  Carsten
 
  --
  Dr. rer. nat. Carsten Luckmann
  Dipl.-Phys.
 
  freiheit.com technologies gmbh
  Straßenbahnring 22 / 20251 Hamburg, Germany
  fon   +49 (0)40 / 890584-0
  fax   +49 (0)40 / 890584-20
  HRB Hamburg 70814
 
  E5FA C55C A15B 27CB 0EEE  D4F5 F8DE 4DBD 524A F375
  Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof
 

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




Re: http 500 status on GitHub

2011-01-26 Thread Igor Vaynberg
works for me :/

-igor

On Wed, Jan 26, 2011 at 11:42 AM, Martin Funk mafulaf...@googlemail.com wrote:
 Hi,

 anyone experiencing something similar, as I described here?

 http://support.github.com/discussions/site/2640-wiki-git-access-leads-to-500

 mf

 -
 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



setOutputMarkupId(true) on org.apache.wicket.markup.html.panel.Panel

2011-01-26 Thread agilbert

I'm trying to understand what it means to output a markup ID on a reusable
wicket panel.  If I understand correctly, the wicket:panel element is
removed from production markup and can contain elements that aren't
necessarily wrapped in a single element (e.g. a div).  So, what does
Wicket do when you call setOutputMarkupId(true) on a Panel?  Does it assume
that you actually want to output markup IDs for all direct children of the
wicket:panel element?

This question came to light when I recently upgraded to Wicket 1.4.15. 
Since then, I've been getting the following warning messages:

[org.apache.wicket.Component] Markup id set on a component that is usually
not rendered into markup.

Turns out I have some Panels that contain, among other things, a few
wicket:container elements, which I use to output plain text via Labels (if
there's a better way to do this, I'm all ears).  Anyway, in my code, I'm not
explicitly instructing the Labels to output markup IDs, but I am telling the
Panel to.  When I disable the call to setOutputMarkupId for the panel, the
warning messages disappear, which leads me to believe that Panels actually
set markup IDs for their direct descendants.  However, looking through the
Wicket source, I can't find any code to back up my assumption.

Thanks in advance for any imparted Wicket wisdom!
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setOutputMarkupId-true-on-org-apache-wicket-markup-html-panel-Panel-tp3238774p3238774.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: setOutputMarkupId(true) on org.apache.wicket.markup.html.panel.Panel

2011-01-26 Thread Igor Vaynberg
calling setoutputmarkupid on a panel will output an id to the tag to
which the panel is attached, eg

add(new mypanel(foo))

div wicket:id=foo -- the tag that will have markup id output

since you attach a panel to wicket:container tag and call
setoutputmarkupid(true) on it, the id will never be rendered because
wicket:container tag to which the panel is attached will not be
rendered.

-igor

On Wed, Jan 26, 2011 at 12:50 PM, agilbert allen.gilb...@doane.edu wrote:

 I'm trying to understand what it means to output a markup ID on a reusable
 wicket panel.  If I understand correctly, the wicket:panel element is
 removed from production markup and can contain elements that aren't
 necessarily wrapped in a single element (e.g. a div).  So, what does
 Wicket do when you call setOutputMarkupId(true) on a Panel?  Does it assume
 that you actually want to output markup IDs for all direct children of the
 wicket:panel element?

 This question came to light when I recently upgraded to Wicket 1.4.15.
 Since then, I've been getting the following warning messages:

 [org.apache.wicket.Component] Markup id set on a component that is usually
 not rendered into markup.

 Turns out I have some Panels that contain, among other things, a few
 wicket:container elements, which I use to output plain text via Labels (if
 there's a better way to do this, I'm all ears).  Anyway, in my code, I'm not
 explicitly instructing the Labels to output markup IDs, but I am telling the
 Panel to.  When I disable the call to setOutputMarkupId for the panel, the
 warning messages disappear, which leads me to believe that Panels actually
 set markup IDs for their direct descendants.  However, looking through the
 Wicket source, I can't find any code to back up my assumption.

 Thanks in advance for any imparted Wicket wisdom!
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/setOutputMarkupId-true-on-org-apache-wicket-markup-html-panel-Panel-tp3238774p3238774.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



Modify element attribute, preserve content

2011-01-26 Thread Alexandros Karypidis
Hello,

I have the following case which I do not know how to handle with Wicket:

I have an element (specifically it is an a href=.../a link) for which I 
need to generate an attribute's value dynamically (specifically, I need to set 
the href attribute at runtime), but I need to preserve the static content of 
the page.

For example, my HTML file is:

a wicket:id=myTargetspan class=x/spansome static text/a

What do I have to do to produce:

a href=dynamically generated targetspan class=x/spansome static 
text/a

So far, I've always replaced the entire content of an element with that 
generated by some wicket component, but this is the first time I've needed to 
filter part of the DOM and target something very specific in the middle of 
the 
tree, without affecting the rest of the tree...




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



Re: setOutputMarkupId(true) on org.apache.wicket.markup.html.panel.Panel

2011-01-26 Thread Allen

Igor,

Thanks for the explanation...I was indeed attaching my Panel to a
wicket:container tag.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setOutputMarkupId-true-on-org-apache-wicket-markup-html-panel-Panel-tp3238774p3238938.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: Modify element attribute, preserve content

2011-01-26 Thread Bas Gooren
Use a WebMarkupContainer and add a SimpleAttributeModifier behavior to 
it. It will not touch the contents of the tag it's attached to, leaving 
your own html as it is.


Bas

Op 26-1-2011 22:38, Alexandros Karypidis schreef:

Hello,

I have the following case which I do not know how to handle with Wicket:

I have an element (specifically it is ana href=.../a  link) for which I
need to generate an attribute's value dynamically (specifically, I need to set
the href attribute at runtime), but I need to preserve the static content of
the page.

For example, my HTML file is:

a wicket:id=myTargetspan class=x/spansome static text/a

What do I have to do to produce:

a href=dynamically generated targetspan class=x/spansome static
text/a

So far, I've always replaced the entire content of an element with that
generated by some wicket component, but this is the first time I've needed to
filter part of the DOM and target something very specific in the middle of the
tree, without affecting the rest of the tree...




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



Re: Modify element attribute, preserve content

2011-01-26 Thread Bas Gooren
Or, come to think of it, since you want to generate a href yourself on a 
link tag, use ExternalLink 
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup/html/link/ExternalLink.html. 
Since it's a WebMarkupContainer underneath it will leave whatever is 
inside your a-tag intact.


Bas

Op 26-1-2011 22:38, Alexandros Karypidis schreef:

Hello,

I have the following case which I do not know how to handle with Wicket:

I have an element (specifically it is ana href=.../a  link) for which I
need to generate an attribute's value dynamically (specifically, I need to set
the href attribute at runtime), but I need to preserve the static content of
the page.

For example, my HTML file is:

a wicket:id=myTargetspan class=x/spansome static text/a

What do I have to do to produce:

a href=dynamically generated targetspan class=x/spansome static
text/a

So far, I've always replaced the entire content of an element with that
generated by some wicket component, but this is the first time I've needed to
filter part of the DOM and target something very specific in the middle of the
tree, without affecting the rest of the tree...




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



Re: IndexedSharedResourceCodingStrategy.encode not being called

2011-01-26 Thread Markus Schmalhofer

I faced the same the problem and found this solution.
You must use org.apache.wicket.Application/name of shared ressource as
your resource key.

In your example:
Instead of writing mount(new IndexedSharedResourceCodingStrategy(photo,
photo) ); 
you must use: 
mount(new IndexedSharedResourceCodingStrategy(photo,
org.apache.wicket.Application/photo) );  
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IndexedSharedResourceCodingStrategy-encode-not-being-called-tp3074859p3239006.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: Class-only inheritance

2011-01-26 Thread DCarr

May have been due to some stale built files or a misconfiguration someplace. 
Restarted from scratch in a new project and now works as desired.

Thanks,
DC


DCarr wrote:
 
 Hm - I'm doing something wrong, then.  The BaseClass.html does not have a
 wicket:child in it, and I do get that second error message:
 
 Caused by: org.apache.wicket.WicketRuntimeException: Expected to find
 wicket:child/ in base markup 
 
 This is wicket 1.4.6.
 
 If I turn on debug, I do get this just before the MarkupNotFoundException
 exception:
 
 -DEBUG::26 Jan 2011 08:46:58.964::org.apache.wicket.markup.MergedMarkup:
 Merge markup: derived markup: DerivedClass1.html; base markup:
 BaseClass.html
 
 but never get the list of all filenames tried.
 
 I'll try a simple test case and see if I can spot anything.
 
 Thanks for the speedy reply,
 DC.
 
 
 Igor Vaynberg-2 wrote:
 
 if your DerivedClass1.java does not have markup and your
 BaseClass.html does not have a wicket:child tag then DerivedClass1
 will use BaseClass' markup. so it should already work as you want,
 just remove wicket:child tag.
 
 -igor
 
 
 On Wed, Jan 26, 2011 at 9:13 AM, DCarr listobser...@gmail.com wrote:
 Hi,

    Is it possible to have class inheritance without markup inheritance?

    I would like a wicket-aware base class (with an associated markup
 file)
 with derived classes supplying data (e.g.. BaseClass with an 'abstract
 protected String getName()') and no markup files (or XML files).  I know
 how
 to do that if the derived classes have markup and  the base class markup
 has
 wicket:child, but cannot not figure out if it can be done without the
 child markup.

    So:

        BaseClass.java (with abstract protected String getName(), and
 add(new
 Label(name, getName()));)
        BaseClass.html (with a )
        BaseClass.xml

    and the derived classes which extend BaseClass:

        DerivedClass1.java (with protected String getName() { return
 Class1;})
        DerivedClass2.java (with protected String getName() { return
 Class2;})

    Currently, Wicket is trying to apply markup inheritance, but since I
 don't have the markup for the derived classes I get:

 org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html'
 for
 component 'com.x.DerivedClass1' not found. Enable debug messages for
 org.apache.wicket.util.resource to get a list of all filenames tried:

 and

 Caused by: org.apache.wicket.WicketRuntimeException: Expected to find
 wicket:child/ in base markup

    As a work around I can create a data supplier interface, implement
 the
 equivalent of the two derived classes and pass those in to my BaseClass,
 but
 the derived classes are simpler.

 Thanks,
 DC

 -
 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
 
 
 
 
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Re-Class-only-inheritance-tp3238455p3239026.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



Access to HttpServletResponse gone in 1.5?

2011-01-26 Thread Todd Wolff
Hi,

 

After migrating from 1.4.x to 1.5 RCI, I encountered only one breaking
change.  I used to be able to access the servlet response object via:

 

getWebRequestCycle().getWebResponse().getHttpServletResponse();

 

But now, expected to be able to use:

 

((ServletWebResponse)getResponse()).getHttpServletResponse();

 

But I get  a ClassCastException because ServletWebResponse is wrapped a
couple of times, i.e. by BufferedWebResponse and then again by
HeaderBufferingWebResponse.  And ... these wrapper classes do not
provide an API to access the original wrapped response.  

 

How can I access HttpServletResponse?  I am using a third party library
that requires the Java Servlet API request and response object.  Thanks.

 

 



Re: Access to HttpServletResponse gone in 1.5?

2011-01-26 Thread François Meillet
with the 1.5 API you get

 WebResponse response = (WebResponse) getRequestCycle().getResponse();

François



Le 27 janv. 2011 à 01:15, Todd Wolff a écrit :

 Hi,
 
 
 
 After migrating from 1.4.x to 1.5 RCI, I encountered only one breaking
 change.  I used to be able to access the servlet response object via:
 
 
 
 getWebRequestCycle().getWebResponse().getHttpServletResponse();
 
 
 
 But now, expected to be able to use:
 
 
 
 ((ServletWebResponse)getResponse()).getHttpServletResponse();
 
 
 
 But I get  a ClassCastException because ServletWebResponse is wrapped a
 couple of times, i.e. by BufferedWebResponse and then again by
 HeaderBufferingWebResponse.  And ... these wrapper classes do not
 provide an API to access the original wrapped response.  
 
 
 
 How can I access HttpServletResponse?  I am using a third party library
 that requires the Java Servlet API request and response object.  Thanks.
 
 
 
 
 

 




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