You need to sign in to do that
Don't have an account?

Accessing Wrapper Class instance as an Attribute to custom components
Hi,
I am trying to pass wrapper class instance as an attribute to my custom component but it is not allowing me to do so as the "type" attribute in <apex:attribute> tag is expecting sObject/Class/primitive type.
Can anyone help me on this?
I am trying to pass wrapper class instance as an attribute to my custom component but it is not allowing me to do so as the "type" attribute in <apex:attribute> tag is expecting sObject/Class/primitive type.
Can anyone help me on this?
You can re-build your data inside your component controller.
PROS: Super easy to do (most of the time) based on parameters such as Id
CONS: Increased SOQL queries can make it easy to run afoul of the governor limits
JSON serialize your data, pass it in as a string, deserialize the data in the controller
PROS: Your data stays intact and it's pretty fast (faster than doing SOQL)
CONS: Can make view state issues if the data is large. Some of the data cannot be correctly serialized/deserialized depending on the object type/structure.
Static variable to store the data on the component
PROD: Even faster then serialization
CONS: Data can get stale easy and it requires that you populate it before you use your component.
And then in your component: