Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

touchUi pathbrowser xtype to select commerce products

Avatar

Level 4

I am trying to create a touchUi dialog where I would like to select the commerce products. I thought of using the pathbrowser xtype (granite/ui/components/foundation/form/pathbrowser) but this does not allow me to select a commerce product (sling:resourceType : commerce/components/product). I can only select a tree or a page using pathbrowser. Is it possible to configure the pathbrowser xtype so that it can allow selection of commerce products? If not is there any other touchUi widget that can help achieve this?

3 Replies

Avatar

Level 10

IN your dialog - are you using XTYPE pathfield - not a granite data type right? 

Avatar

Level 4

Hi Scott,

In my dialog I am setting the sling:resourceType to granite/ui/components/foundation/form/pathbrowser 

Avatar

Level 4

I modified line 32 of /libs/granite/ui/components/foundation/form/pathbrowser/render.jsp 

FROM String predicate = cfg.get("predicate", "hierarchyNotFile"); // 'folder', 'hierarchy', 'hierarchyNotFile' or 'nosystem'

TO String predicate = cfg.get("predicate", "nosystem"); // 'folder', 'hierarchy', 'hierarchyNotFile' or 'nosystem'

Using this I was able to select a commerce product. Is this change the correct way of handling this or is there a better way? Please suggest