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

panel.comboCountry.selectedIndex 
    <- 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
(suspended)
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
link

answered 18.01.2012 at 10:06

Martin%20Steiger's gravatar image

Martin Steiger
(suspended)
accept rate: 50%

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×40
×5

Asked: 12.01.2012 at 11:22

Seen: 2,096 times

Last updated: 12.01.2012 at 11:22