Hi DAW

We need some attention to these properties documentation. I spent more than 3h trying to find out how to get psImage property working for psWebMenuItem objects in a Mobile Webapp.

1. looking at psImage doc, there is no reference that this property only works if some parent container has pbShowIcons set to true.

So, you set it, based on weborder sample (that just set's it ) and you get nothing... so you start getting worried if you have permission issues to the image files, etc, etc, etc...

2. after searching the help a LOT, I accidentally found this small tip..
https://docs.dataaccess.com/dataflex...ebMenuList.htm

By default, pbShowIcons is set to False in this class. If you want to display icons in menu items (cWebMenuItem) in this class, set pbShowIcons to True.
hum.... pbShowIcons, looks promising


3. Wait.. this is for a cWebMenuList object.. I dont have that in a regular mobile WebApp.
Ok, maybe some similar class provides the same property, lets look the classes where this property is impelmented..

Help, Index, pbShowIcons (Enter), results in:
Code:
cWebMenuList 
cWebToolBar
cWebTreeView
they are also not used... in a standard mobile webapp.

4. After more minutes thinking and searching.. I started the reverse engineering approach.. Ok, some parent object of my menu itens should have a similar property for this..
Ok...

WebApp
|-> HeaderPanel (cwebPanel)
|-> MenuPanel (cWebPanel)
|-> oMenuButton (cWebMenuButton)
|-> finally my menu itens..

Started to look on each of these classes.. property by property.. one by one.. after some time..

5. pbMenuShowIcons

Holly, noting documented.. But let's try it.. I tried several other things already, why not this one more...

BINGO ! That was it.. after setting this to true on oMenuButton parent object of the menu itens.. the image/icon worked..

-------------
Two major points:

  • Lack of cross reference linking those properties and how they MUST be used together.. otherwise.. you get nothing.
  • Lack of consistency in the property name.. if you pay attention, this class implemented pbMenuShowIcons, while the other classes, its just pbShowIcons. If the name were consistent, I would have find it on step 3 on this odyssey.


psImage should reference the pbShowIcons and now this new one pbMenuShowIcons property of the possible parent objects containers of the menu itens.

The opposite is also true.. pbShowIcons and pbMenuShowIcons page shoud reference psImage of possible child classes..

--------
Finally, I hope this helps someone else overthere lost in the forest..


Bonus question.:
I am still not clear how this works in webOrder (desktop) sample..
Code:
                    Object oSameWindowMenuItem is a cWebMenuItem
                        Set psCaption to "Order.html (Same window)"
                        Set psImage to "Images/Order.png"
the psImage is set and it's shown properly, but the parent object of the menu itens is from cWebMenuBar class, and this one has neither of these two properties, or something with similar (and different) naming. I am still puzzled on that one.