Hello @ all,
i'm trying to get all elements in the domnode that matches a string in the name tag.
So in xml i can do this with like this:
XPath = //*[contains(@name, 'page_tab_')]
It selects all nodes that have the string page_tab_ inside the name
But when i try this at the function selectbypath of a domnode this doesn't work.
Here is my Code
DEFINE vlname STRING,
domtree om.domnode,
dmfieldlist om.nodelist,
uiwin ui.Window
LET uiWin = ui.WINDOW.getCurrent()
LET domtree = uiWin.getNode()
LET dmfieldlist = domtree.selectByPath("//*[contains(\"@name\", \"page_tab\")]")
RETURN dmfieldlist
Hope someone can help me thanks a lot
Martin Stigmond
Hi Martin,
The om.DomNode.selectByPath has a limited syntax so as to support its intended use for finding nodes in the DOM tree. So as per the documentation ... http://4js.com/online_documentation/fjs-fgl-manual-html/#c_fgl_ClassDomNode_selectByPath.html ...and the example ... http://4js.com/online_documentation/fjs-fgl-manual-html/#c_fgl_ClassNodeList_example_2.html you just need to modify your clause to match what is given there.
Something like (hopefully the slashes and quotes make it through to what you read)
domtree.selectByPath("//*[@name=\"page_tab\"]")
Historically I've wrapped it in a library function so I don't have to deal with the slashes and quotes each time when I call it!
Reuben