On Fri, May 30, 2008 at 4:54 AM, Timo Rantalaiho <[EMAIL PROTECTED]> wrote:
> On Thu, 29 May 2008, Daniele Dellafiore wrote:
>> umm, but in example above, what column and row number are grabbed?
>>
>> there is a way to show the complete graph of a wicket page hierarchy?
>
> Yes there is, WicketTester.debugComponentTrees() and I
> think some other way as well.
>
> However, to get to your checkboxes inside the repeater, I
> recommend using a visitor
>
>    wicketTester.getLastRenderedPage().visitChildren(CheckBox.class, new
>    IVisitor() {
>        ...
>    });
>
> instead of relying on the component path, which is very
> fragile. (Direct component path changes when the component
> hierarchy changes, for example if you need to make some div
> of the hierarchy a Wicket component. Repeaters might have
> different number of items, the sorting may change etc.)
>
> jdave-wicket has the visitor stuff built-in, and you can
> also select the component based on its model object
>
> CheckBox windShieldSelection = 
> selectFirst(CheckBox.class).which(is(windShield)).from(context);
> wicketTester.executeAjaxEvent(windShieldSelection, "onclick");
>
> or
>
> List<CheckBox> allCheckBoxes = selectAll(CheckBox.class).from(context);

these seem great, a way to write code I like: intentional :)

thanks, i will try jdave and friends.

-- 
Daniele Dellafiore
http://blog.ildella.net/

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

Reply via email to