You need to sign in to do that
Don't have an account?
h8r41d
When are component attributes sent to the controller?
My Visualforce test page:
<apex:page sidebar="false" showHeader="false"> <c:ideas_email_digest email="{!$CurrentPage.parameters.email}" mode="Weekly"/> </apex:page>
The Visualforce component:
<apex:component controller="ideas_digest_component_controller" access="global"> <apex:attribute type="String" name="email" assignTo="{!context_user}" description="email address for context" /> <apex:attribute type="String" name="mode" assignTo="{!digest_mode}" description="Digest type can be Weekly or Monthly"/> {!context_user} <-- Loads {!mode} <-- Loads //.... rest of page </apex:component>
Component controller:
public class ideas_digest_component_controller { // stuff for the visualforce page public string context_user {get; set;} public string digest_mode { get; set; } // Constructor public ideas_digest_component_controller() { if(context_user==null) { system.assert(false); // <-- Always get here } } ///... rest of code irrelevant }
My question is, on the VF test page, the class properties are set and will display on the page. However, in the class constructor, the property values are still null.
At what point are these values populated? Why are they null in the controller? They are used to load dynamic data for the vforce page.
Anybody know an answer to this one?
Hi,
Same problem, I'have seen other topics on this subject but I didn't found a solution...
I just moved my code and avoided using the component parameters in the constructor.
Use them in your get functions, they'll be set by then.
Yes but it doesn't work for my use:
For example:
Page:
Component ( "TestComponent" ):
Component controller:
And the result is:
The problem is that I can't retrieve my value "val" into my dynamic component...
Any idea?
Did you ever solve this?