I have a request form with up to 10 picklist fields to pick from. The
picklists are enabled linearly depending on how many selections are
needed. This means only the first is enabled, but once a value is
selected the 2nd is enabled/shown, and so on.

My issue is that when the other picklists are enabled, but no value is
selected, what value is set to that variable? I'm using a script to
only display the values that had a selection, by comparing it to null
and an empty string. However, both fail and say there is a value
associated with it when there shouldn't be. Here is my conditional:

form.select("fvApplicationName2");
if(field.getValue() == null || field.getValue().toString().length < 1)
form.showMsg("fvApplicationName2 is null");
else
form.showMsg("fvApplicationName2 is not null");

I only entered a value for fvApplicationName1 and fvRoleName1, but for
some reason it's saying I entered something for the second entry, which
is wrong. What is it setting fvApplication2 to? Here is a trace from
my UserApp when it is populating the approval form:

2008-11-12 12:23:54,148 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource]
evaluating source expression: recipient
2008-11-12 12:23:54,151 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : recipient
2008-11-12 12:23:54,151 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource] result:
cn=admin,o=NCI
2008-11-12 12:23:54,154 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource]
evaluating source expression: initiator
2008-11-12 12:23:54,155 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : initiator
2008-11-12 12:23:54,155 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource] result:
cn=admin,o=NCI
2008-11-12 12:23:54,157 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource]
evaluating source expression: process.getTimestamp()
2008-11-12 12:23:54,158 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : process.getTimestamp()
2008-11-12 12:23:54,159 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource] result:
2008-11-12 12:23:49.425
2008-11-12 12:23:54,162 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource]
evaluating source expression: flowdata.get('reason')
2008-11-12 12:23:54,164 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : flowdata.get('reason')
2008-11-12 12:23:54,167 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : wi.XPath("flow-data/reason")
2008-11-12 12:23:54,167 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource] result:
heyo
2008-11-12 12:23:54,171 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource]
evaluating source expression: flowdata.get('ApplicationName1')
2008-11-12 12:23:54,173 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : flowdata.get('ApplicationName1')
2008-11-12 12:23:54,176 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : wi.XPath("flow-data/ApplicationName1")
2008-11-12 12:23:54,180 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource] result:
ou=app4,OU=Apps,O=NCI
2008-11-12 12:23:54,182 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource]
evaluating source expression: flowdata.get('ApplicationName1')
2008-11-12 12:23:54,183 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : flowdata.get('ApplicationName1')
2008-11-12 12:23:54,190 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : wi.XPath("flow-data/ApplicationName1")
2008-11-12 12:23:54,193 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource] result:
ou=app4,OU=Apps,O=NCI
2008-11-12 12:23:54,194 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource]
evaluating source expression: flowdata.getObject('RoleName1')
2008-11-12 12:23:54,196 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : flowdata.getObject('RoleName1')
2008-11-12 12:23:54,198 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : wi.XPath("flow-data/RoleName1")
2008-11-12 12:23:54,201 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource] result:
[[RoleName1: null]]
2008-11-12 12:23:54,202 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource]
evaluating source expression: flowdata.get('ApplicationName2')
2008-11-12 12:23:54,204 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : flowdata.get('ApplicationName2')
2008-11-12 12:23:54,206 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : wi.XPath("flow-data/ApplicationName2")
2008-11-12 12:23:54,208 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource] result:
2008-11-12 12:23:54,209 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource]
evaluating source expression: flowdata.getObject('RoleName2')
2008-11-12 12:23:54,211 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : flowdata.getObject('RoleName2')
2008-11-12 12:23:54,213 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : wi.XPath("flow-data/RoleName2")
2008-11-12 12:23:54,216 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource] result:
[[RoleName2: null]]
2008-11-12 12:23:54,217 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource]
evaluating source expression: flowdata.get('ApplicationName3')
2008-11-12 12:23:54,218 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : flowdata.get('ApplicationName3')
2008-11-12 12:23:54,220 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : wi.XPath("flow-data/ApplicationName3")
2008-11-12 12:23:54,221 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource] result:
2008-11-12 12:23:54,222 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource]
evaluating source expression: flowdata.getObject('RoleName3')
2008-11-12 12:23:54,224 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : flowdata.getObject('RoleName3')
2008-11-12 12:23:54,224 DEBUG
[com.novell.soa.script.impl.lang.es.impl.EcmaScript Engine:executeExpression]
Evaluating the script : wi.XPath("flow-data/RoleName3")
2008-11-12 12:23:54,227 DEBUG
[com.novell.soa.af.impl.core.DataItemEvaluator:eval uateSource] result:
[[RoleName3: null]]

Notice how RoleNames are set to null but the fvApplicationName2 and 3
are just set to an empty string. I have also tested the case for "".


--
mlee22
------------------------------------------------------------------------
mlee22's Profile: http://forums.novell.com/member.php?userid=25018
View this thread: http://forums.novell.com/showthread.php?t=350654