- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
So, I know what is going on, but I'm not sure why. The issue is with the grey rectangles: if you comment out the presence toggling of the rectangles in both the if and else sections the checkbox actions work fine. I think the problem is with the order of event firing and layout actions on the form; the rectangle presence gets changed but it is not reflected on the screen layout. What I don't understand is why this affects the checkbox operation. I would expect the checkboxes to still toggle; the only issue I would think you would see is that the rectangles don't change properly.
One of the pros of using a dynamic form is that the presence can change based on events without the need to relayout the entire form. Maybe rectangles don't fit into this scheme.
Fortunately I have a better way to do this: instead of changing the presence of the rectangles, change the fill color. This does work well on a dynamic form. You're using a linear fill with a start color of gray and end color of white. To make the rectangle invisible, change the start color to white (color value of "255,255,255") and it will be entirely white. To make it visible change the start color back to gray (value "192, 192, 192" using the colors that you selected). To do this you use the following statement:
hcgray.value.rectangle.fill.color.value = color;
The script for the "Chambers" installed checkbox should now look like this:
if (this.rawValue == 0)
{
hc1.rawValue=0;
hc2.rawValue=0;
hc3.rawValue=0;
hcgray.value.rectangle.fill.color.value = "255,255,255"; // Set to white start color
sfrhc1.rawValue=1;
sfrhc2.rawValue=1;
sfrhc3.rawValue=1;
sfrhcgray.value.rectangle.fill.color.value = "192,192,192"; // Set to gray start color
}
else
{
hc1.rawValue=1;
hc2.rawValue=1;
hc3.rawValue=1;
hcgray.value.rectangle.fill.color.value = "192,192,192"; // Set to gray start color
sfrhc1.rawValue=0;
sfrhc2.rawValue=0;
sfrhc3.rawValue=0;
sfrhcgray.value.rectangle.fill.color.value = "255,255,255" // Set to white start color
}
You will need to do the same to the "Diverter" section.
Also, you are probably aware of this but you need to deal with the enabled state of the checkboxes within each section when the section is "Does Not Apply". If you gray out the Chambers section, the user can still check/uncheck the Yes/No/Corrected checkboxes.
HTH,
Kevin
Views
Replies
Total Likes