Hi, I am using Vaadin 14.4.4, there is a exception in the UI when I use the

Hi, I am using Vaadin 14.4.4, there is a exception in the UI when I use the superDecimalField which is “TypeError: $0.setcallingserver is not a function”. The error messages are different if I use different field from SuperFields. I cannot reproduce this error in a Vaadin starter project. I tired deleted all the generated file but the error is still showing. Could you point out why my project would cause this error based on your experience?

Thank you

Hi Nicholas, thanks for using my components!

I updated demo app locally to 14.4.4 and it seems to be working fine (tested with latest Firefox). setCallingServer is a method in SuperTextField (JS class in super-text-field.js), which is used by all number fields as well. That code in turn is called from Java through TextSelectionDelegate#informClientAboutSendingEvents - which in turn gets called for example onAttach.

It seems that that code in that class is not executed properly. Few things to consider:

  • is the component visible and placed inside a visible layout? there has been issues with various components when the components are sent to the client side, but then hidden
  • is it in a Grid, or some other component that magically does things differently?
  • is there some custom JS that affects how web components are initialised? server seems to be calling the client, but the method is not there because likely the JS code has not been loaded

All the above is based on the fact you are using latest Firefox, Chrome or Edge. I have no idea how the components behave in other browsers.

Finally, if you could provide some code that reproduces the issue, I can take a look when I have some spare time (though I no promises on a concrete date because of Christmas ;)

Hi Miki, thank you for your reply.

Point 1 and 2 is not valid for our case, we looked deeper into point 3. We have our own theme, but I commented it out which not even let it import those JS files. It went back to default Vaadin Lumo theme but it still threw the exception.

We also tried to add the Uses annotations but no luck:
@Uses(NumberField.class)
@Uses(TextField.class)
@Uses(BigDecimalField.class)

This is the exception in console log:
TypeError: $0.setCallingServer is not a function at Object.eval (eval at cu (client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:1017), :3:11)

Is there any clue from the log?

Unfortunately, I cannot reproduce it in a small Vaadin starter project. It only happened in our project.

Thank you
Nick

Hi again (and sorry for the delay),

Unfortunately there is no way to figure out what is wrong with the code just by looking at the logs.

Few other ideas to try out:

  • are you running it in production mode, or dev mode?
  • is there any custom component on the way “up” from the field to the ui (your own layouts, 3rd party containers, etc.)?
  • is there any JS addon that affects the order of loading components?

Anyway, most likely I would need to look at the code itself, or at least at a minimum setup that reproduces it (github project is fine). If you do not want to share code publicly, you could also send it to me (miki[at] beanbakers.fi) - I promise to take a look at it when I have time.

Best regards,
Miki.