Page 1 of 1

Warning "The name ... is not a valid indentifier for ..."

PostPosted: Tue Sep 08, 2020 2:20 pm
by rph
Hi

Since we upgrade our solution with the Servoy-Framework from Servoy 2019.09 to 2020.03.1 we have hundreds of warnings in our log like:

The name '5907EB62-14B3-4835-BACC-35948D8C91EA' is not a valid indentifier for a component/form, please change this (avoid - or other invalid chars, replace those with _).

We figured out, that the problem is when it initializes the toolbars with the following Servoy-Framework-Code:
draw_item.png
draw_item.png (47.45 KiB) Viewed 1531 times


Obviously the rules for "Identifiers" has changed (or at least will now be proofed), so they must start now with a letter (not numbers like in the example) and must not have special characters like "-".

How could we suppress these warnings, so it will not fill our logs anymore.

Thanks in advance.

Best
Roland

Re: Warning "The name ... is not a valid indentifier for ...

PostPosted: Wed Sep 09, 2020 3:49 pm
by Joas
I think the best solution is to make sure that valid identifiers are used, so change that line for example to:
Code: Select all
jsLabel.name = "lbl_" + item.toolbar_item_id.replace(/\-/g, "_");

Re: Warning "The name ... is not a valid indentifier for ...

PostPosted: Wed Sep 09, 2020 4:49 pm
by rph
Hi Joas

Thanks for your reply. I'm not sure, if you or Sanneke created the code above ;-)

We've already tried that. And it works, at least as long as it is used for "normal" Toolbar-Items. But the problem starts, when the item is used to open a "Submenu"-Item. Then the Framework references the items of the submenu in the database with that key. So then we have to revert the identifier everywhere in the Framework where it is used as search-key. So maybe this is really the only solution to this problem.

Best
Roland