Python isVisible on ValueInput affects "name" (prompt) but not the control

Python isVisible on ValueInput affects "name" (prompt) but not the control

tim.collins29V9X
Enthusiast Enthusiast
372 Views
1 Reply
Message 1 of 2

Python isVisible on ValueInput affects "name" (prompt) but not the control

tim.collins29V9X
Enthusiast
Enthusiast

I toggle isVisible on a NameValue in response to a checkbox to make the NameValue disapper or re-appear (I can't detect a disable feature in the ref doc nor in the limited API I can see) but only the prompt (termed "name" in the API) will appear and disappear.

Is this a bug?

Is there a problem with keeping and later referring to the control returned from xxx.addValueInput()?  Was I supposed to use xxx.inputs.itemById()?  The reason I ask is that I did try comparing the control with the one I saved for "equilateral" and it did not work, so I resorted to an "id" compare instead. Is there something going on with all the calls to .cast() and such?  Is is just me or is the documentation more than simply terse?

   def notifyInputChanged(self, inputChangedEvent: InputChangedEventArgs):
        """
        The super().notifyInputChanged() method will update the model object. Add code here before or after
        if needed to provide any required computation or error checking.
        """
        super().notifyInputChanged(inputChangedEvent)

        if inputChangedEvent.input.id == self.equilateralInput.id:
            self.heightInput.isVisible = not self.equilateralInput.value

 

0 Likes
Accepted solutions (1)
373 Views
1 Reply
Reply (1)
Message 2 of 2

tim.collins29V9X
Enthusiast
Enthusiast
Accepted solution

I hate it when this happens, but the entire widget will now appear and disappear properly, not just the name. I have no idea why, but I no longer reproduce my own issue.

 

0 Likes