Hi,
We were experiencing incredibly unstable behaviour in a DymanicForm, when we realized that it was almost certainly related to the warning message below:
FormItems cannot be re-used with different DynamicForms
The post in the smartclient forum described this issue for us well. (http://forums.smartclient.com/showthread.php?p=46822)
So, we now need to implement the suggestion stated in the above forum thread by one SmartGWT developers (who I don't think works for Isomorphic). His comment is reprinted below:
"Create a helper method that returns new instances of the same FormItem definitions instead."
However, we did search to see if there were some easy "clone" method for a FormItem, but there doesn't seem to be one.
So, we're about to write a routine which checks what type of FormItem an object is (e.g, is it a textitem etc.), then try to copy all the attributes using the "getAttributesAsMap" method, and then re-add any handlers (eg., blurhandlers etc). etc.
However, this seems like extra error-prone code. Is there an easier/better SmartGWT way to "clone" a FormItem? ie some sort of "clone" / deepcopy procedure? (The other reason creating our own method is arguably not ideal is that a SmartGWT developer doesn't necessarily know all the private FormItem properties that ought to be copied over and may therefore introduce very unstable/unexpected behaviour.)
Thanks in advance for your thoughts.
Further operational details are below:
========
OS: Windows XP Pro
IDE: MyEclipse 9.0 with Google Plugin for Eclipse (2.3.1)
SmartGWT EE 2.4
Browwer: Mozilla Firefox 4.0.1
GWT SDK: 2.2
Sun JDK 1.6.0_13
We were experiencing incredibly unstable behaviour in a DymanicForm, when we realized that it was almost certainly related to the warning message below:
FormItems cannot be re-used with different DynamicForms
The post in the smartclient forum described this issue for us well. (http://forums.smartclient.com/showthread.php?p=46822)
So, we now need to implement the suggestion stated in the above forum thread by one SmartGWT developers (who I don't think works for Isomorphic). His comment is reprinted below:
"Create a helper method that returns new instances of the same FormItem definitions instead."
However, we did search to see if there were some easy "clone" method for a FormItem, but there doesn't seem to be one.
So, we're about to write a routine which checks what type of FormItem an object is (e.g, is it a textitem etc.), then try to copy all the attributes using the "getAttributesAsMap" method, and then re-add any handlers (eg., blurhandlers etc). etc.
However, this seems like extra error-prone code. Is there an easier/better SmartGWT way to "clone" a FormItem? ie some sort of "clone" / deepcopy procedure? (The other reason creating our own method is arguably not ideal is that a SmartGWT developer doesn't necessarily know all the private FormItem properties that ought to be copied over and may therefore introduce very unstable/unexpected behaviour.)
Thanks in advance for your thoughts.
Further operational details are below:
========
OS: Windows XP Pro
IDE: MyEclipse 9.0 with Google Plugin for Eclipse (2.3.1)
SmartGWT EE 2.4
Browwer: Mozilla Firefox 4.0.1
GWT SDK: 2.2
Sun JDK 1.6.0_13
Comment