I try to select an entry in a combo depending on a value in a record set like that:

    <- Integer.parseInt(in.EmployeeList.getField(in.RowId,"country").toString())-1

This works properly, but if NULL is stored in the recordset, then Ivy throws a NullPointerException.

How can I circumvent this?

asked 12.01.2012 at 11:22

Yves%20Jarczyk's gravatar image

Yves Jarczyk
accept rate: 0%

Use the unary ? : operator on the right side of the data binding:

in.EmployeeList.getField(in.RowId,"country") is initialized 
    ? Integer.parseInt(in.EmployeeList.getField(in.RowId,"country").toString())-1
    : null

answered 18.01.2012 at 10:06

Martin%20Steiger's gravatar image

Martin Steiger
accept rate: 50%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 12.01.2012 at 11:22

Seen: 1,266 times

Last updated: 12.01.2012 at 11:22