Defining module content with absolute css selector

19 views
Skip to first unread message

Lubomír Zrnečko

unread,
Apr 5, 2017, 6:16:53 AM4/5/17
to Geb User Mailing List
Hi,
I need to declare module content with absolute css selector, not within the module context. I know there's possibility to define module's base but that's not sufficient for my setup. Let me describe it:
  • I have a Page object and it has a grid represented by generic Grid Module
  • The Grid can have various column filters of various types: TextInput, calendar or dropdown select.
  • Dropdown select is represented by Module as well, so the composition is Page -> Grid Module -> Select Module
  • Because of the technology used (SmartGWT) the select item list is represented in the DOM by a table that's created dynamically by activating the control and it is located out of context of the Select HTML subtree.
Solutions I've considered:
  • Select Module content defined by absolute css selector in the Select module pointing to this table of select items
    • I don't know how to tell $() to operate on global context of the whole page
  • Another Module with base representing only the select item list, so the whole composition would be Page -> Grid Module -> Select Module -> Select Items List Module
    • The problem is that the base of a Module in a Module is not absolute but it is "contextualized" by higher level of Module composition
  • Work this around by declaring the select item list on the Page level and pass it through module constructor parameter down the hierarchy, which is neither elegant nor practical

I have a feeling that I'm missing something fundamental :-)
Anyone having any idea how to solve this issue?
Best regards
Lubomir

Marcin Erdmann

unread,
Apr 5, 2017, 7:17:36 AM4/5/17
to Geb User Mailing List
Hi Lubomir,

You can "escape" the context of module's base navigator by using methods like parent() or closest() which are described at http://www.gebish.org/manual/current/#traversing.

I hope that helps, let me know if you have additional questions.

Marcin

--
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 geb-user+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/bcb517c7-6fd8-4442-a980-90f50eb04f88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lubomír Zrnečko

unread,
Apr 5, 2017, 8:15:20 AM4/5/17
to Geb User Mailing List
Hi, Marcin,
I see now - so something like:

    static content = {

pickList { closest("body").find(".selectItemList")}
}


Thank you!
Lubomir

On Wednesday, April 5, 2017 at 1:17:36 PM UTC+2, Marcin Erdmann wrote:
Hi Lubomir,

You can "escape" the context of module's base navigator by using methods like parent() or closest() which are described at http://www.gebish.org/manual/current/#traversing.

I hope that helps, let me know if you have additional questions.

Marcin
On Wed, Apr 5, 2017 at 12:16 PM, Lubomír Zrnečko <lubomir...@gmail.com> wrote:
Hi,
I need to declare module content with absolute css selector, not within the module context. I know there's possibility to define module's base but that's not sufficient for my setup. Let me describe it:
  • I have a Page object and it has a grid represented by generic Grid Module
  • The Grid can have various column filters of various types: TextInput, calendar or dropdown select.
  • Dropdown select is represented by Module as well, so the composition is Page -> Grid Module -> Select Module
  • Because of the technology used (SmartGWT) the select item list is represented in the DOM by a table that's created dynamically by activating the control and it is located out of context of the Select HTML subtree.
Solutions I've considered:
  • Select Module content defined by absolute css selector in the Select module pointing to this table of select items
    • I don't know how to tell $() to operate on global context of the whole page
  • Another Module with base representing only the select item list, so the whole composition would be Page -> Grid Module -> Select Module -> Select Items List Module
    • The problem is that the base of a Module in a Module is not absolute but it is "contextualized" by higher level of Module composition
  • Work this around by declaring the select item list on the Page level and pass it through module constructor parameter down the hierarchy, which is neither elegant nor practical

I have a feeling that I'm missing something fundamental :-)
Anyone having any idea how to solve this issue?
Best regards
Lubomir

--
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 geb-user+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages