You need to sign in to do that
Don't have an account?
Vigneshwaran Loganathan
Need help
public class good
{
Public string logid;
public good(ApexPages.StandardController controller)
{
system.debug('********'+logid) // After submitting I need the same value Yes here, But it Shows NULL
}
Public page reference submit() //
{
Logid = 'Yes';
}
}
My problem is when i press submit button, Logid variable is assigned to Yes. But when it goes to Constructor it is Changed to Null, which affect my further codes.
How to get the same value in constructor? am i wrong anywhere?
{
Public string logid;
public good(ApexPages.StandardController controller)
{
system.debug('********'+logid) // After submitting I need the same value Yes here, But it Shows NULL
}
Public page reference submit() //
{
Logid = 'Yes';
}
}
My problem is when i press submit button, Logid variable is assigned to Yes. But when it goes to Constructor it is Changed to Null, which affect my further codes.
How to get the same value in constructor? am i wrong anywhere?
Constructor runs only on the page load.
As per your code it will print null only. coz, while page loading contructor will get invoked and the value will be null. because u r assiging in one method. so after calling that method if use that variable in other method method means value will be ther in that string variable.
public class good
{
Public string logid;
public good(ApexPages.StandardController controller)
{
system.debug('********'+logid) // After submitting I need the same value Yes here, But it Shows NULL
}
Public page reference submit() //
{
Logid = 'Yes';
system.debug('********'+logid) // Now the value will not be NULL
}
Public page reference submit1() //
{
system.debug('********'+logid) // Now the value will not be NULL
}
}
Thanks.