Focal Point
[Case Opened] Maintain Winform losing control bindings

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2497043776

July 20, 2015, 10:42 AM
Deana
[Case Opened] Maintain Winform losing control bindings
Hello,
In 7.7.03, I have been having problems with my control bindings disappearing on maintain winforms.

On April 23, 2015, John_Edwards responded to a post from Neelima (More than 15 datasource can be use in Maintain): 'Granted, occasionally 7.7 Maintain Development Environment will open a maintain file and drop ALL bindings, but you can just reopen it and they're all there again. I've never seen it drop a binding in the middle of editing though, if it opens correctly you're good to go in my experience.' Unfortunately, this is not the case. Each time this happens, I have to manually add the bindings back. Some forms have over 100 controls. It seems to consistently happen when I add, modify, or delete a datasource - even when the changes are made to a datasource that is not bound to any controls or try to compile the app when there is a syntax error.

Yesterday for example, I replaced 2 datasources with a new datasource which I put into StackNew. There were no controls on any of the forms bound to the 2 datasources I replaced. In the code, I loop through StackNew, to determine what the value of StackOld1.ExistingField1 should be. Previously, I looped through StkOldDatasource1 to populate StkOldDatasource2 and then looped through StkOldDatasource2 to populate StkOld1.ExistingField1. Not only did I lose the bindings to every control using fields from StackOld1, but I also lost bindings to all controls using fields defined within the maintain code, and and StackOld2-StackOld4. Luckily, I have separate applications set up for development and production. I was able to open the production and manually review the bindings for every control the 3 out 7 forms for this 1 maintain that lost their bindings. (Yes, I understand that this is a lot of forms for 1 maintain, but it is how the application was built almost 20 years ago and I inherited the app about 4 years ago). I tried copying the .wfm from production to development, but the bindings were still lost.

Recently, I had the same problem when I typed 'WINFORM SET ClassListForm.btnDetail.Enabled EQ 0' instead of WINFORM SET 'ClassListForm.btnDetail.Enabled TO 0'. In this scenario, I had added new controls to the form so copying the production .wfm was not an option without losing work.

Does any one any way to dynamically bind the controls instead of using the wizard or how to prevent this from happening?

Thank you,
Deana

This message has been edited. Last edited by: Deana,


WebFOCUS 7.6.8 and 7.7.03; Windows Server 2003 R2 and Windows Server 2008 R2, respectively; Development environments - Windows Server 2003 R2 and Windows 7 Professional, respectively;
excel, html, pdf
July 20, 2015, 11:22 AM
Maintain Wizard
Deana
Please open a case with Support. If the steps are reproducible that will be very helpful for us to research the issue.

The only time I have seen this happen is when a syntax error occurs in the code above the stack creation code. Then when the form opens, if the stack is not created, the bindings could be lost. I have not been able to consistently reproduce this.

Please open a case and upload the files.

Thank you!
Mark Derwin
July 20, 2015, 02:02 PM
Deana
Mark,
I did open a case. I would like to clarify my use of the word consistently. I meant, when it happens, I have either changed datasources or had a syntax error. It does not happen every time I change datasources or have a syntax error. Thus, reproducing is still likely to be hit and miss.

This message has been edited. Last edited by: Deana,


WebFOCUS 7.6.8 and 7.7.03; Windows Server 2003 R2 and Windows Server 2008 R2, respectively; Development environments - Windows Server 2003 R2 and Windows 7 Professional, respectively;
excel, html, pdf
July 20, 2015, 03:01 PM
Maintain Wizard
Thanks Deana... Maybe we'll get lucky. Understand though, that if you do change the data source or the stacks that populate the controls, there is a good chance that the stacks won't be properly created and we may lose the bindings. I highly recommend, that if you have to change the master, do it outside of the MDE. When I have to do it I:
1) Back up the MNT file
2) Open the file in WordPad
3) Do a Global replace on the file name
4) Save and make sure I can still open it in the MDE.

Mark
July 20, 2015, 03:07 PM
Deana
Thanks Mark... I do understand changing a datasource the control is bound to can and often does cause the control to lose the binding. I will try your suggestion next time.


WebFOCUS 7.6.8 and 7.7.03; Windows Server 2003 R2 and Windows Server 2008 R2, respectively; Development environments - Windows Server 2003 R2 and Windows 7 Professional, respectively;
excel, html, pdf