FYI: I got my code working. I just had to use the magic number for zero in this
line:
setDisplayFieldValue("*CboAlloc", new CSpString("0.0")
NOTE: it must be 0.0.
Not 0, nor 0.00. And be sure to set the "value list" value for the "0" entry in
the Combo to "0.0" as well.
Janet
(Embedded
image moved [EMAIL PROTECTED]
to file: 07/29/99 04:41 PM
pic25215.pcx)
To: [EMAIL PROTECTED]
cc: (bcc: Janet Traub/IS/SSC/THD)
Subject: [ND] ComboBox won't Use Specified Value = 0
I have a Repeated that contains a database column defined as a Decimal datatype.
The user is only allowed to enter one of the following values for the column:
1
.5
0
So I made this columns display type a ComboBox, and in the wizard I told it to
populate the Combo by "Use specified values".
That's works fine as long as I set the corresponding values in the "value list"
to:
1.00
0.5
for the 1 and the .5.
It's the zero value that's giving me problems. I tried setting its "value list"
value = 0.00, or 0.0 or 0. But none of them work. Arghh!
So then I added code to "force" the ComboBox to display the "0" when applicable.
That didn't work either but most likely my coding approach is wrong. Below is my
code.
Thanks ahead for any advice on how to get this zero working!
Janet
//[[SPIDER_EVENT<Repeated1_onBeforeRowDisplayEvent>
public int Repeated1_onBeforeRowDisplayEvent(CSpDataDrivenVisualEvent event)
{
double dAlloc = 0;
int i = event.getRowIndex();
CSpSelect doSelect = (CSpSelect)CSpider.getDataObject("theDO");
dAlloc = doSelect.getValue(i, "theColumn").doubleValue();
if(dAlloc == 0){
setDisplayFieldValue("*CboAlloc", new CSpString("0"));
}
return (PROCEED);
}
//]]SPIDER_EVENT<Repeated1_onBeforeRowDisplayEvent>
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]
pic25215.pcx