You need to sign in to do that
Don't have an account?
lakshmi.sf9
How to pass controller value to copmonent
Hi,
In my controller i have one getter,setter variable.
public boolean test {get;set;}
public void next(){
test = true;
}
In page i have one button
<apex:commandbutton value="Next" action = "{!Next()}" />
This will call component alse
In component
<apex:attribute name="extrapoints" type="Boolean" description="extrapoints" assignTo="{!test}" />
<apex:outputText value ="{!test}"
If i debug the component i am getting false value.But i need here true.
Can any one help on this
Thanks,
In my controller i have one getter,setter variable.
public boolean test {get;set;}
public void next(){
test = true;
}
In page i have one button
<apex:commandbutton value="Next" action = "{!Next()}" />
This will call component alse
In component
<apex:attribute name="extrapoints" type="Boolean" description="extrapoints" assignTo="{!test}" />
<apex:outputText value ="{!test}"
If i debug the component i am getting false value.But i need here true.
Can any one help on this
Thanks,
Please find below example
###### Component Controller ######
###### Component ######
###### Page controller######
###### Page ######
Note : pageVariable value will assigned to componentVariable after initialization of CompController class. if you try to debug componentVariable value inside CompController contructor then it will always null.
Component and page is having same controller.Actually when I click on next button in the page ,it will call next() in the controller.Here based on my requirement I am making boolean value as true.That I want to use in component.
Plese give solution
Even if same controller used in component and page you have pass values in above mentioned proceedure as there will be two separate instance of class exists