I wouldn't say that the behaviour you're seeing is intended in a way that
it was foreseen, but yes, this is how it works, you will need to mark all
such templates with `required: false` no to get
RequiredPageContentNotPresent exceptions.

Marcin

On Sun, Oct 29, 2017 at 10:34 PM, Samuel Rossinovic <
[email protected]> wrote:

> I have a confirmation dialog where I wish to allow for buttons labeled
> either ‘ok’ or ‘yes’.
>
> class Foo extends Module {
>     static content = {
>         button { $("a", text: it) }
>
>         yes(required: false) {button "Yes" }
>         ok(required: false) {button "OK" }
>         no { button "No" }
>     }
>
>     def confirm() { (yes ?: ok).click() }
> }
>
> Yet calling confirm() yields a RequiredPageContentNotPresent when the
> button is labeled ‘ok’. Only when I set require: false on button, does it
> play well.
>
> Is that intended, that enabling optional content would require marking all
> inherited templates as require:false?
> Thanks
> ​
>
> --
> You received this message because you are subscribed to the Google Groups
> "Geb User Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/geb-user/aa7231f1-d6ca-4409-9ab9-474214b2a4a1%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/aa7231f1-d6ca-4409-9ab9-474214b2a4a1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Geb 
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/CA%2B52dQTHFnbdpvTtwJBczp%3D%3DH-qQE%2BL0_fh0Bjb5A53AwgDu8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to