Hello, I'm not sure if this is a bug or a setting. But I have a working form with subforms, if I copy a subform which already has controls on it and is functioning correctly and paste it (or duplicate it for that matter), when I preview it, those pasted controls are all read only and not able to type into them.
Anyone have any ideas why that would happen?
Thanks
Joe
*update* I just uploaded the above image of the subforms, the top one correct, the bottom one after copy and pasting the top one and renaming it, it has now become read-only
Solved! Go to Solution.
Views
Replies
Total Likes
Ah..I just caught this error and found your script on the sub-form calculate.
if (GenericNetworkInformation.ddlNumberofServers >= "1") then
sfServer1.presence = "visible" else
sfServer1.presence = "hidden"
endif
The attached form is updated.
Steve
Views
Replies
Total Likes
Joe,
If you can you post a form extract with the two subforms, I can take look.
Steve
Views
Replies
Total Likes
Here's a copy of the form with the two subforms. Thanks for your help.
Joe
Views
Replies
Total Likes
Joe,
I am not sure, but perhaps some script got removed when you cut-and-paste your extract because I did not see any script on the drop-down object or any data binding to the drop-down value. More importantly, I am not sure why the drop-down worked at all.
I removed the drop-down and added a button to call the InstanceManager to generate new instances of sub-form 'sfServer1'. The new sub-forms behave correctly.
Steve
Views
Replies
Total Likes
Ah..I just caught this error and found your script on the sub-form calculate.
if (GenericNetworkInformation.ddlNumberofServers >= "1") then
sfServer1.presence = "visible" else
sfServer1.presence = "hidden"
endif
The attached form is updated.
Steve
Views
Replies
Total Likes
Hey Steve,
That worked perfect. I didnt' realize you could do add a second instance of subform using that command.
Is there anyway to get that to work via a drop down box instead of a button? Thanks
Joe
Views
Replies
Total Likes
Hi Joe,
No you cannot. The addInstance method does not take an integer argument. The method as commonly coded below can be misleading. The argument is a boolean 'true' and not an indication of the number of instances to add.
form1.Servers.Servers.sfServer1.instanceManager.addInstance(1);
Steve
Views
Replies
Total Likes
Hey Steve,
Thanks a lot for the information. It's nice to have a resource like you to help people like me.
Last question about this topic. Is there a way then to count the amount of instances of a subform?
Thanks
Joe
Views
Replies
Total Likes
You're welcome Joe. There are a lot of people who contribute to the forum to make it a useful resource.
I want to clarify my response about adding subforms using a drop-down. There is an instanceManager method called 'setInstances' that creates a specific number of subform instances. You could use a drop-down in the following manner.
// form1.Servers.GenericNetworkInformation.addServerDropDown::exit - (JavaScript, client)
form1.Servers.server.instanceManager.setInstances(this.rawValue);
Regarding getting the subform count, there is an instanceManger property called 'count'.
I added a drop-down and a button to get the count in the attached form.
Steve
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies