Checking for or removing Null

Discussions about the LSPS expression language.
Forum rules
Make sure every topic contains information about your LSPS version and if relevant also your server OS, client OS, database name and version, and application server name and version.
eric.graham
 
Posts: 58
Joined: Tue May 13, 2014 12:20 pm

Checking for or removing Null

Wed Apr 15, 2015 3:41 pm

Hello – I have an instance where I need to populate a combo box from data that a user enters into text boxes. The Text boxes are in a grid. The combo box runs a collect to get the data from the text boxes. (the idea in my case, is to run a collect and sort out the numbers that where entered into the text boxes…and remove any multiple numbers in the text box). Here is what I have:
def Set<String> uniqueLineNumbers := collect(select(affectedUnits, { au:AffectedUnit -> au?.rebillLineNumber != null}), { au:AffectedUnit -> au?.rebillLineNumber });

def List<String> sortedUniqueLineNumbers := sort(toList(uniqueLineNumbers), { a:String, b:String -> toInteger(a) <=> toInteger(b) });
collect(sortedUniqueLineNumbers, { s:String -> new Option(value -> s, label -> s) })
When I click into the rebillLineNumber text box to enter a value, I get the following error:

Caused by: com.whitestein.lsps.common.ErrorException: Mandatory parameter 'string' has null value

How would I go about checking for null values, or even removing null values in this case? (it seems to be happening in the sort() )

eric.graham
 
Posts: 58
Joined: Tue May 13, 2014 12:20 pm

Re: Checking for or removing Null

Wed Apr 15, 2015 3:54 pm

this is solved. Thanks for the responses in advance!

Return to Expression language

Who is online

Users browsing this forum: No registered users and 1 guest