Hi. In-case someone else stumbles onto such a case, here's a workaround
that I think will work to resolve the a/m use-case:
class Foo extends Module {
static content = {
button { label ->
if (label instanceof List) label.collect {$('a', text: it)}.find
{ it }
else $('a', text: label)
}
submit { button (['Yes, 'Save']) }
}
}
HTH
On Monday, October 30, 2017 at 9:34:18 AM UTC+11, Samuel Rossinovic 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/bd6c3f96-614a-48af-afa0-c29e4fb0e0c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.