Re: What's the difference between Check and CheckBox

2008-10-24 Thread Minto van der Sluis

Hi igor,

that's exactly where I discovered the existence of Check ;-)

Being an almost complete newby I was surprised by the existence of 2 Classes
so closely related. That is functionally related, since as far as I can tell
from the javadoc they are not related in any way.

regards,

Minto


igor.vaynberg wrote:
 
 javadoc is your friend
 
 -igor
 
 On Wed, Oct 22, 2008 at 11:48 PM, Minto van der Sluis
 [EMAIL PROTECTED] wrote:

 Messing around with unittesting a CheckBox, I discovered Check as well:

org.apache.wicket.markup.html.form.Check;
org.apache.wicket.markup.html.form.CheckBox;

 To me it's not very clean what the difference is, since they are both
 attached to the same markup:

input type=checkbox ... 

 Can anyone enlighten me ?

 regards,

 Minto van der Sluis
 --
 View this message in context:
 http://www.nabble.com/What%27s-the-difference-between-Check-and-CheckBox-tp20125256p20125256.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/What%27s-the-difference-between-Check-and-CheckBox-tp20125256p20144821.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to unittest a checkbox

2008-10-24 Thread Minto van der Sluis

Added  https://issues.apache.org/jira/browse/WICKET-1893 WICKET-1893 


jwcarman wrote:
 
 Since this is not so obvious, we should probably file a request in
 JIRA to add a checkbox-specific method to FormTester.  Care to take
 care of that, since you found the issue?
 
 On Thu, Oct 23, 2008 at 9:15 AM, Minto van der Sluis
 [EMAIL PROTECTED] wrote:

 Thx that did the trick :-)

 For those who that come after me

 formTester.setValue( getCheckboxPath(), on ); // check
 formTester.setValue( getCheckboxPath(), off ); // uncheck

 regards,

 Minto

 --
 View this message in context:
 http://www.nabble.com/how-to-unittest-a-checkbox-tp20106917p20130698.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/how-to-unittest-a-checkbox-tp20106917p20145430.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: What's the difference between Check and CheckBox

2008-10-24 Thread Minto van der Sluis

Thanx for clearing that up :-)

Minto


igor.vaynberg wrote:
 
 ...
 CheckBox only works with a imodelboolean
 
 while CheckGroup/Check can be used to populate a collection with
 arbitrary items. eg Check uses IModelT while CheckGroup uses
 IModelCollectionT
 ...
 

-- 
View this message in context: 
http://www.nabble.com/What%27s-the-difference-between-Check-and-CheckBox-tp20125256p20150569.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to unittest a checkbox

2008-10-23 Thread Minto van der Sluis

thx for your reply.

Yes I already tried used FormTester, but I can't find any method to change
the value of a CheckBox besides the select method. But my checkbox is a
stand-alone one and not part of a group. Using the select method did not
results in the outcome I was looking for. :-(

1) Should I use a checkgroup with just one checkbox ? 
2) Have I overlooked some other way to change the value of a CheckBox from
inside a unittest?

In regard to option 1, it feels incorrect to change working code just to
facilitate unittesting? If that's what it takes I will change my code. It's
just that I wonder if I missed something.

regards,

Minto van der Sluis


jwcarman wrote:
 
 Have you tried using FormTester?
 
 On Wed, Oct 22, 2008 at 5:20 AM, Minto van der Sluis
 [EMAIL PROTECTED] wrote:

 Hi folks,

 Creating unittests for my pages I managed to read the value a checkbox of
 a
 rendered page. I used:

tester.assertModelValue( form:myCheckBox, true );

 However I failed to change that value in my unittest prior to submitting
 the
 form.

 Can anyone point in the right direction?

 Kind regards,

 Minto van der Sluis

 --
 View this message in context:
 http://www.nabble.com/how-to-unittest-a-checkbox-tp20106917p20106917.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/how-to-unittest-a-checkbox-tp20106917p20125169.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



What's the difference between Check and CheckBox

2008-10-23 Thread Minto van der Sluis

Messing around with unittesting a CheckBox, I discovered Check as well:

org.apache.wicket.markup.html.form.Check;
org.apache.wicket.markup.html.form.CheckBox;

To me it's not very clean what the difference is, since they are both
attached to the same markup:

input type=checkbox ... 

Can anyone enlighten me ?

regards,

Minto van der Sluis
-- 
View this message in context: 
http://www.nabble.com/What%27s-the-difference-between-Check-and-CheckBox-tp20125256p20125256.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to unittest a checkbox

2008-10-23 Thread Minto van der Sluis

Thx that did the trick :-)

For those who that come after me

formTester.setValue( getCheckboxPath(), on ); // check
formTester.setValue( getCheckboxPath(), off ); // uncheck

regards,

Minto

-- 
View this message in context: 
http://www.nabble.com/how-to-unittest-a-checkbox-tp20106917p20130698.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



how to unittest a checkbox

2008-10-22 Thread Minto van der Sluis

Hi folks,

Creating unittests for my pages I managed to read the value a checkbox of a
rendered page. I used:

tester.assertModelValue( form:myCheckBox, true );

However I failed to change that value in my unittest prior to submitting the
form.

Can anyone point in the right direction?

Kind regards,

Minto van der Sluis

-- 
View this message in context: 
http://www.nabble.com/how-to-unittest-a-checkbox-tp20106917p20106917.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Wrong page is rendered

2008-05-14 Thread Minto van der Sluis

Hi folks,

Being in the process of adding a wicket based administration console to an
existing struts based application, I have been able to set up some simple
pages. Unittesting these pages works fines. Also using 'mvn jetty:run'
starts the wicket based part just fine. I can click through the application
and everything works as expected.

However when I integrate (using mvn war overlay) the wicket part inside the
existing struts application something weird is happening. I can bring up de
first page (homepage) in the wicket based administration console.
Unfortunately the links to other wicket based pages only result in a refresh
of the homepage.

I wonder if this behaviour has something to do with how I added the
administration console to the existing web application. Here are the
snippets of what I have added to my web.xml.

  ... snip ...
  
filter
filter-namewicket.bvh-console/filter-name

filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
init-param
param-nameapplicationClassName/param-name

param-valuenl.politie.bvh.console.WicketApplication/param-value
/init-param
/filter

filter-mapping
filter-namewicket.bvh-console/filter-name
url-pattern/console/*/url-pattern
/filter-mapping

  ... snap ...

On the initially rendered homepage a link to other pages look like this.

  ...
  li
button type=submit wicket:id=email onclick=var win =
this.ownerDocument.defaultView || this.ownerDocument.parentWindow; if (win
== window) {
window.location.href='?wicket:bookmarkablePage=%3Anl.politie.bvh.console.koppelingen.EmailPage';
} ;return false
  Email host
/button
  /li
  ...

So in short using 'mvn jetty:run' and trying the following link gives me the
expected results.

 
http://localhost:8080/bvh-console/?wicket:bookmarkablePage=%3Anl.politie.bvh.console.koppelingen.EmailPage
  
When locally deploying my app I expected the following link to work as well.
Unfortunately I ended up with the configured homepage, which is a different
page.

 
http://localhost:/avi/console/?wicket:bookmarkablePage=%3Anl.politie.bvh.console.koppelingen.EmailPage

To me it seems like I missed something, but I can't figure out what. Any
help is greatly appreciated.

I am btw using wicket version 1.3.1

Kind regards,

Minto van der Sluis

-- 
View this message in context: 
http://www.nabble.com/Wrong-page-is-rendered-tp17233259p17233259.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]