Hi Pooja,

Why do you need to make your row module parameterized? Aren't indexes fixed
in it anyway? Isn't the name column always the first column, quantity the
second and price third? Am I missing something here?

What are you expecting (and why?) to be passed as `it` to your closure that
you use with `moduleList()`? That method doesn't pass anything to your
closure.

Marcin

P.s. Please ask similar questions on the user mailing list (CCed) in the
future as this list is about development of Geb and not its use.

On Tue, 21 Feb 2017 at 14:59, Pooja Kurbetti <[email protected]>
wrote:

> Hello,
> Just wanted to check the way i am call the module is correct or incorrect
>
> If below is the code snippet
>
> class ParameterizedCartRow extends Module {
>     def nameIndex
>     def quantityIndex
>     def priceIndex
>
>     static content = {
>         cell { $("td", it) }
>         productName { cell(nameIndex).text() }
>         quantity { cell(quantityIndex).text().toInteger() }
>         price { cell(priceIndex).text().toBigDecimal() }
>     }}
> class CheckoutPageWithParametrizedCart extends Page {
>     static content = {
>         cartItems {
>             $("table tr").tail().moduleList {
>                 new ParameterizedCartRow(nameIndex: it, quantityIndex: it+1, 
> priceIndex: it+2)
>
>             }
>         }
>     }}
>
> Can i call this as
>
> cartItems[0].productName.displayed
>
> When i tried to call the parameterized moduleList
>
> I got an error stating :
>
> Condition not satisfied:
>
> null+1
>
> --
> You received this message because you are subscribed to the Google Groups
> "Geb Development 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-dev/0c41a5d9-8ced-4a1e-a30d-4d711d5dfd0f%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-dev/0c41a5d9-8ced-4a1e-a30d-4d711d5dfd0f%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%2B52dQTgS_jQ8%2B%3DBYyNyS5x7HLLgy9QrkPZ3krfS9noB5NwnSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to