# onRender Event usage

**URL:** <https://forum.servoy.com/t/onrender-event-usage/13979>\
**Category:** Classic Servoy\
**Created:** [May 13, 2011, 4:09pm UTC](https://forum.servoy.com/t/onrender-event-usage/13979 "2011-05-13T16:09:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![monetteboy](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@monetteboy](https://forum.servoy.com/u/monetteboy)\
**Post date:** [May 13, 2011, 4:09pm UTC](https://forum.servoy.com/t/onrender-event-usage/13979/1 "2011-05-13T16:09:09Z")

</div>

I’m trying to play around with the onRender event and am having some issues.

I followed this thread  
[http://www.servoy.com/forum/viewtopic.php?f=1&t=15873&p=85598&hilit=onrender+example#p85598](http://www.servoy.com/forum/viewtopic.php?f=1&t=15873&p=85598&hilit=onrender+example#p85598)

I assume some usage must have changed as when I copied this over into 6 Beta 1 it told me some of the functions were depreciated.

I also noticed in the example that it called fields directly by using

```auto
var _rec = event.getRecord();
var _isSelected = (_rec.selection_calc == 1);

```

When I try to use the “\_rec.MYFIELDNAME” it doesn’t work.

What I am trying to do is I have a table view with several records. I want to change the border of a field if another field in the record is empty.

Thanks

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [May 16, 2011, 9:19am UTC](https://forum.servoy.com/t/onrender-event-usage/13979/2 "2011-05-16T09:19:14Z")

</div>

you can test for data dynamically:

```auto
var _rec = event.getRecord();
if (_rec['columnname'] != null) return xxxx
else return yyyy

```

or you could cast the record to it real db type:

```auto
/** @type {JSRecord<db:/servername/tablename>} */
var _rec = event.getRecord();
if (_rec.columnname != null) return xxxx
else return yyyy

```

---

<div class="post-metadata">

**Author:** ![monetteboy](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@monetteboy](https://forum.servoy.com/u/monetteboy)\
**Post date:** [May 16, 2011, 3:26pm UTC](https://forum.servoy.com/t/onrender-event-usage/13979/3 "2011-05-16T15:26:39Z")

</div>

Thank you!

I tried the first method and it worked fine.

I will post back if I run into any more issues.

-Bryant
