In mendixmodelsdk, how to find a widget , use the common name?

Hello everyone, App is committed to the server. Use mendixmodelsdk, I want to bind a nanoflow to the textbox/button, which only knows its name. Any advice or suggestion would be nice. const pageinterface = this.workingCopy.model().allPages().filter(page => === "mypagename")[0]; const page = when.promise((resolve, reject) => loadable.load(resolve)); // I can find the widget like this:(It's so clumsy) const textbox = page.layoutCall.arguments[0].widgets[0].rows[0].columns[0].widgets[0].widgets.filter(widget => === "txtCtrlSystemId')[0]; const button = page.layoutCall.arguments[0].widgets[0].rows[0].columns[0].widgets[0].footerWidgets[0].rows[0].columns[1].widgets.filter(widget => === "btnSave")[0]; //Does modelSdk have methord like this: page.findElementByName("txtCtrlSystemId")??? Does modelSdk have methord like this: find...By...Name("txtCtrlSystemId")?
1 answers

You can use traverseFind on the page to search for elements. Since not all elements have a name, there is no default API for it.

It would look something like this:

const button = page.traverseFind(structure => structure instanceof pages.Widget && === "txtCtrlSystemId");

Good luck :).