You need to sign in to do that
Don't have an account?
vfDeveloper.ax341
Pass data between components
Hi,
Is that possible to pass data between components?
Thanks.
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
I supose both components could call the same controller, but i believe this would be two seperate instances.
one component controller could call the getter inside another component controller (after creating an instance), i think..
can you describe a simple use case?
the main page decides which component to render, then the controler has a getter/setter for the value it would like to pass on,
the compnent has an attribute with an assignTo= , which connects to a setter in the component controller, when that component is rendered, it should have the attribute value set, so that the componen can see and assign it to it's own setter.
not sure i'm communicating this clearly...
As to your second question w.r.t. event binding - are you looking for client side (in browser) or server side event handling or both?
For server side you can again use apex:attribute - this time using type="ApexPages.Action" as the type (NOTE: assignTo is not supported for this type yet) and then use the attribute inside your component to bind the passed in action method to any action attribute for any component used inside your component.
We currently do not have a client side event framework - it is something we're looking into - but you can leverage any javascript technology you choose inside VF pages and components. Ext.js and Dojo both have client side pub/sub event systems you could leverage for example.