I have been trying to figure out why the Multivalue boxes in my tool don't respond with the "Select All" and "Unselect All" buttons. They also don't stay unchecked (they are default checked) when I click other buttons.
Here is my validation code (the commented out part at the bottom was my attempt but I get errors):
import arcpy
import os
class ToolValidator(object):
"""Class for validating a tool's parameter values and controlling
the behavior of the tool's dialog."""
def __init__(self):
"""Setup arcpy and the list of tool parameters."""
self.params = arcpy.GetParameterInfo()
def initializeParameters(self):
"""Refine the properties of a tool's parameters. This method is
called when the tool is opened."""
return
def updateParameters(self):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
if self.params[1].value:
if self.params[1].valueAsText.find(";") > -1:
fclist = self.params[1].valueAsText.split(";")
layerList = []
for each in fclist:
# source = arcpy.Describe(each).catalogPath
# desc = arcpy.Describe(each)
# layersource = desc.catalogPath
layerList.append(each)
print layerList
else:
layerList = []
# desc = arcpy.Describe(self.params[0].value)
# layersource = desc.catalogPath
# layerList.append(layersource)
layerList = [self.params[1].valueAsText]
print layerList
fieldlist = []
for each in layerList:
#fieldnames = [f.name for f in arcpy.Describe(each).fields]
fieldnames = arcpy.Describe(each).fields
for fields in fieldnames:
if fields not in fieldlist:
#fieldlist.append(fields)
fieldlist.append(fields.baseName.upper())
self.params[2].value = fieldlist
print fieldlist
# if self.params[1].hasBeenValidated:
# for checked in self.params[2].valueAsText.split(';'):
# if checked not in self.params[2].filter.list:
# self.params[2].value = self.params[2].filter.list[2]
return
def updateMessages(self):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return

Any help would be appreciated. Thank you!