Constructor blows out my form

After watching the training vid on buttons, I tried the Constructor to build a 2nd set of radio buttons on my form. (The first set was a pair that I set up using the Object Library. They worked flawlessly.)

  1. Opened the Constructor but the field I needed wasn’t listed. Hit Reset. Ah, there it is!
  2. Cleared the unneeded fields, set the data variable and entered the tag info to create 4 radio buttons… across. At this point, I needed to resize the Constructor window. But resizing the window wiped out what I had just written - and returned me to the list of fields.
  3. Repeated what I had done (without resizing the Constructor window).
    CommissionRateradio:1,2,3,4
    Applied the code and bam! Buttons were created - but most of the form was vaporized. Thank JR for Revert!
  4. Made a duplicate of the Pan DB and tried it again. Bam! Form largely wiped out again.
    Screenshots available, if you need them, Jim.

This indicates to me that you had use the Constructor on this form before. We’ll return to this point in a moment.

I know about this issue. It happens with any Panorama dialog sheet that is resizable. It’s quite annoying, but I haven’t been able to figure out what the problem is. For now the only solution is to resize the dialog first, then edit the text.

Although I’ve known about this for a long time, I never entered it into the issue tracker, so now I’ve done that.

This is what I would expect if the objects already on the form were created with the Constructor. When objects are created with the Constructor, a special tag is applied to them. When you run the Constructor again, all objects with this tag are removed. This is why you can run the Constructor over and over again, varying the specifications each time.

I just verified that I am able to create objects manually, then run the Constructor, and the manually created objects aren’t disturbed.

There is one case where all objects are removed – if the first line of the template is the <zapform> tag. But I assume you would know if you had done that.


You have to read the documentation page closely, but it is mentioned. See Using Two Templates in a Single Form on the Automatic Form Construction page. The quick version is that you need to temporarily create a second form, create the second group of objects in that form, then copy the objects back to your original form.

You could also use the blueprint dialog to remove the tag that indicates that each object was created with the constructor, but since you’d have to do that individually for each object, that would be very tedious.

Yep, that’s exactly what should happen. The duplicate still contains objects with the tag indicating that the objects were created with the Constructor.

I will try building in a temp form and copying to my form, as you suggest.

However, I tried building (manually) a set of 5 radio buttons last night. All buttons perform the correct calculations and put the correct values in the appropriate fields. But - only the 1st radio button will highlight on the form. Any ideas as to why this would be?

The other pair of radio buttons on my form select/deselect without issue.

This is the documented behaviour for radio buttons. If you want to check several options, you should use check boxes.

Thanks, Kurt. I did consult the Help to learn about creating a radio button group in a form. (Oddly, searching Help for “radio” came up empty. Had to search “button”.)

For my application, radio buttons are the way to go. Only 1 choice can be valid. It sets a Rate (%) of sale for commission. Values = None, .01, .03, .05, .07

I’ve briefly looked at the docs link you provided and saw this:
A group of radio buttons is created by creating one button, then making copies.

Exactly what I did last night, but only the first button would highlight. Clicking the others place the correct values into my field and will deselect Button1 (None), but they themselves will not show selected.

When that didn’t work, I presumed making option-copies was a no-no with radio buttons, so I checked the Intensive video… which led me to try Constructor. But then that blew out my form, because as Jim pointed out, it had been previously used to lay out most of the form fields.

I’m going to try a couple of these approaches again, including Jim’s suggestion to use Constructor in a temp form and copy the objects to my main form. Thanks for all the input (everyone). It does help.

This raises a possible red flag for me. What kind of field is Values? Or is it a variable. The first value listed is text, the rest are numbers. An oddly formatted numbers as well, normally there would be a leading zero – 0.01, 0.03, 0.05, 0.07.

That’s it! The values needed leading zeroes. (Who knew?)

“Values” is a floating number data field. “None” was the label, but 0 was the assigned value.

Once I formatted the values with leading zeroes (all except for 0 itself - which did not work as “0.00”), the buttons functioned correctly!

SOLVED!

Data buttons don’t know about anything except text. So to determine what button to check, Panorama converts the floating point value to text, then compares that text with the button values. Floating point values converted to text will always have at least one digit in front of the decimal point.

If you ever have any question about this, I suggest creating a temporary text display object. That will show the correct format that you would need to use for each value.