Use $currentObject in XPath constraints on grids - Mendix Forum

Use $currentObject in XPath constraints on grids


When using XPath constraints on a nested grid you often want to constrain by the context object.

Currently you have to rely on the '[%CurrentObject%]' token. Maybe it's just me, but I always have to concentrate on how to note these down (was it the "%" that comes first or the "[" ... ).

In microflows we're accustomed to using $variable and nowadays with all the client improvements (validation rules, conditional visibility) it is also quite common to use $currentObject when creating pages. It would make it easier and more consistent if we could use $currentObject in an XPath constraint too.

And on top of that it would be great if we could even use $currentObject/Attribute in a constraint - that would be a completely new feature!

3 answers

Hi Fabian, with the new fuzzy-complete in Studio Pro, you can start typing curr and then hit ctrl+space and the correct token should be displayed there.


I would really like to see $CurrentObject/Attribute 


I am bringin this up again. Using $CurrentObject/Attribute would be great. We can use it in visibility constraints, why can’t we use it in xpath? Seems to be a bit inconsistent.