TWebRatingPanel issue

Hi there ~

Stupid question again. I am trying to use TWebRatingPanel and when I bind it to a Html element, I get this error:

Uncaught TypeError: Cannot read properties of null (reading 'style') | TypeError: Cannot read properties of null (reading 'style') at Object.UpdateElement

I've tried binding it to P,DIV,IMG,A elements with a id="my_rating", but I always get this error. I am not using the Boottrap CSS library.

What am I doing wrong?

Regards
ViV

To what exact HTML element do you bind it?

@brunofierens ~

I tried using <div id="my_rating"></div> ... or <p id="my_rating"></p> or <img id="my_rating">

Is there a specific tag I should use?

Regards
ViV

@brunofierens ~

When I don't bind it (aka add a tag with id="viv_rate") to the HTML, the rate panel shows on the page at the top of the display, but as soon as I add any tag like"<div id="viv_rate"></div>" to the page, it gives the error.

Regards
ViV

rate1


@brunofierens ~

here is a small example:

HTML File:

<html>
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <title>TMS Web Project</title>
    <style>
    </style>
  </head>
  <body>
  <h1>Hello world ...</h1>
  <div id="test"></div>
  </body>
</html>

The moment I bind the WebRatingPanel1 the tag "test", I get:

rtl.js:254 
        
    Uncaught TypeError: Cannot read properties of null (reading 'style')
    at Object.UpdateElement (WEBLib.Rating.pas:321)
    at Object.EndUpdate (WEBLib.Controls.pas:2792)
    at Object.EndUpdate (WEBLib.Controls.pas:5392)
    at Object.AfterLoadDFMValues (classes.pas:5350)
    at Object.LoadDFMValues (Unit1.pas:52)
    at Object.DoCreate (WEBLib.Forms.pas:2443)
    at Object.Create$5 (WEBLib.Forms.pas:2593)
    at Object.c.$create (rtl.js:323)
    at DoStatusCreate (WEBLib.Forms.pas:2795)
    at XMLHttpRequest.cb (rtl.js:251)

Regards
ViV

We applied a fix for this which will be included in v1.9.1.0

Verified and working in v1.9.1.0...

Thank you @brunofierens ...

Regards
ViV

1 Like