By Chan - 12/21/2008
Hi,
Just would like top share my experience which cause error in my application and spent me quite long time to troubleshoot it.
Make sure we are not using same property name in form to declare difference type of BO (even in difference webpage) because it would cause error "Unable to convert BOType1 to BOType2".
Scenario:
1. Declared property Leave for namespaceA.LeavesBO in FormA.
2. Declared property Leave for namespaceB.LeavesBO in FormB.
3. Run formA and then FormB. The error mentioned would occured.
It is because SF's webpage would use property name as key to store BO instance at session. When run FormB as scenario above, SF found "Leave" from session and use it directly. However, it is not actually the correct BO instance needed.
I am not sure it is by design or bug. However, would like to share with all.
Thank you
|
By Govinda Berrio - 12/22/2008
Yes, I notice this too when using the same property name for BOs in different ApplicationBasePages. I'm going to assume that this is by design, but it would be useful to configure that if we need it to be different from the default. So by default the session key would be the BO property name, but maybe they could add an Attribute (like [BOSessionKeyAttribute("Leave01")] ).
|
|