Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

touchUi pathbrowser xtype to select commerce products

DhirajAg
Level 4
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
smacdonald2008
Level 10
Level 10

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

DhirajAg
Level 4
Level 4

Hi Scott,

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

DhirajAg
Level 4
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