v8.1.0
I have a script that is creating the instances
array of a flex repeater, but for god knows why, it executes fully in the Designer but not in the client…
def refreshOptions(self):
"""
Custom method that can be invoked directly on this component.
Arguments:
self: A reference to the component that is invoking this function.
"""
self.props.instances = []
self.props.instances = [{'optionLabel':1}]
options_raw = self.custom.options_raw
self.props.instances = [{'optionLabel':'2a'}] # <-- here
options_raw = system.dataset.toPyDataSet(options_raw)
options = []
self.props.instances = [{'optionLabel':3}]
## blah blah
## ....
for i, option_raw in enumerate(options_raw):
option = {'optionValue': option_raw['Value'],
'optionLabel': option_raw['Label'],
'selectTagPath': self.view.params.selectTagPath}
# this uses the "Available" field in the available dataset passed in
if hasAvail:
avail = option_raw['Available']
option['available'] = avail
option['availableBit'] = ''
option['availableTagPath'] = ''
# this uses the Available Bit
elif hasAvailBit:
avail = option_raw['AvailableBit'] if hasAvailBit else 1
option['available'] = ''
option['availableBit'] = avail
option['availableTagPath'] = self.view.params.availableTagPath
options.append(option)
self.props.instances = [{'optionLabel':8}]
system.perspective.print(options)
self.props.instances = options
self.props.instances = [{'optionLabel':'DONE'}]
I trigger this manually at the moment, and in the Designer I see the ‘DONE’ appear in my flex repeater, but I see ‘2a’ appear in the client, indicating that it’s only getting to line 4 before giving up??
Any ideas? I’ve spent far too long on this…
This is my dataset options_raw
:
"#NAMES"
"Value","Label","Available"
"#TYPES"
"I","str","B"
"#ROWS","20"
"4179","FS4179","true"
"4180","FS4180","true"
"4181","FS4181","true"
"4182","FS4182","true"
"4183","FS4183","true"
"4184","FS4184","true"
"4185","FS4185","true"
"4186","FS4186","true"
"4187","FS4187","true"
"4188","FS4188","true"
"4189","FS4189","true"
"4190","FS4190","true"
"4191","FS4191","true"
"4192","FS4192","true"
"4193","FS4193","true"
"4194","FS4194","true"
"4195","FS4195","true"
"4196","FS4196","true"
"4197","FS4197","true"
"4198","FS4198","true"