Skip to Content
0

Multiple search by ID. Search not knowing full ID. Sapui5

Feb 28, 2017 at 09:53 AM

30

avatar image
Former Member

Hi,

I was wondering if there was any option to search an element by its id but not knowing the full ID, only part of it. So I could find an element without knowing its full ID or find multiple elements with similar IDs.

For example if I knew I had 3 objects with the followings ID:

"objectID1" "objectID2" and "objectID3".

Could I something like:

getElementByID("objectID*")?

I have tried it in JavaScript using:

"input[id*='PART_OF_ID_I_KNOW']" But it returns an HTML object and I need it for SAPUI5. Could I use something like: var myControl = sap.ui.getCore().byId('myId'); but not having to match the full ID (myID)? Thanks.

10 |10000 characters needed characters left characters exceeded

In UI5 I'm not able to identify a scenario where this is required(even in jQuery I cant make a use case out of this).

Let us know the scenario you are trying to solve so that anyone in the forum can provide a better alternative.

0
* Please Login or Register to Answer, Follow or Comment.

0 Answers