inline,

On Thu, Nov 17, 2011 at 4:05 PM, Jablow, Eric R <[email protected]> wrote:
> I have some model classes with JSR 303 validation annotations, and I have 
> some FormComponentPanels for each. Some of these will be nested. To test that 
> the Wicket validation is correct, I'm creating a ValidationForm, which 
> contains one of my panels, which contains another of my panels, and I am 
> tying my form to a local minimal test object without the other fields I will 
> be using later. I am using a CompoundPropertyModel. When I have the 
> WicketTester initialize the ValidationForm, it looks for the 'parent' field 
> in the minimal test object, which does exist.  Then, I get at line 302 of 
> AbstractPropertyModel,
>
>      return PropertyResolver.getPropertyGetter(expression, target);
>
> I get a call with expression being "child", and target being the local test 
> object.  Were expression "parent.child", this would succeed, as it would call 
> getParent().getChild(). However, I'm not sure whether this is my bug or the 
> wicket-validation-bean library's.

this is probably a misuse of the compound property model, which is
evil anyways. you have to create your components with ids that match
the path from the root object, so if you want to access person.address
property you cant put a text field with id "address" into a
webmarkupcontainer of id "person", you have to add a text field with
component id "person.address"

>
> Incidentally, I'm getting an interesting misfeature from the validation; the 
> order in which the validations are > performed seems to be nondeterministic.

i dont think the spec defines order


> This means that the test below fails sometimes.
>
>                tester.assertFeedback("path:to:panel", new String[] {messageA, 
> messageB});
>
> Often, when I reverse the order of messageA and messageB, the next test fails 
> too! Perhaps Wicket 1.5.3 can have WicketTester.assertFeedback(String path, 
> Set<String> messages).

maybe you can attach a patch to our jira

> Finally, I might need to avoid FormComponentPanels in the future, as some of 
> the inner ones will be swapped in and out of the page depending on the user's 
> choices.  I realize that the only panels that will be instrumented are the 
> ones in the Form when it is originally configured.

thats not the case. components under the validationform are
instrumented before every render so its safe to swap things in and
out.

-igor


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to