You need to sign in to do that
Don't have an account?
Hari nadh babu Eluru
Getting Error in Min Max Age result showing in another page
Vf code page 1
Apex code Page 1
Vf code page 2
Apex code page 2
The above image was getting error in codes
<apex:page controller="age"> <apex:form > <apex:outputLabel >Enter Min Age</apex:outputLabel> <apex:inputText value="{!p}"/> <apex:commandButton value="Click me" action="{!ageBut}"/> </apex:form> </apex:page>
Apex code Page 1
public class age { public PageReference ageBut() { PageReference pr = new PageReference ('https://93com4-dev-ed--c.visualforce.com/apex/Max_Age?abc='+p); return pr; } public String p { get; set; } }
Vf code page 2
<apex:page controller="Max_Age"> <apex:form > {!z.name} {!z.Age__c} </apex:form> </apex:page>
Apex code page 2
public class Max_Age { public Student__c z { set; get; } public Max_Age(){ string k = ApexPages.currentPage().getParameters().get('abc'); z = [SELECT Name, Student_Id__c, Age__c FROM Student__c WHERE Student_Id__c=:k]; } }
The above image was getting error in codes
Hi Hari,
Please try the below code:
public class Max_Age {
public Student__c z { set; get; }
public Max_Age()
{
string k = ApexPages.currentPage().getParameters().get('abc');
if(k){
Student__c studentobj = new Student__c();
studentobj = [SELECT Name, Student_Id__c, Age__c FROM Student__c WHERE Student_Id__c=:k];
if(studentobj!= null){
z = studentobj;
}
}
}
}
VF PAge:
<apex:page controller="Max_Age">
<apex:form >
<apex:outputPanel rendered="{!NOT(ISNULL(z))}">
{!z.name} {!z.Age__c}
</apex:outputPanel>
</apex:form>
</apex:page>
if you need any assistance, please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Suraj Tripathi
All Answers
Please try the below code:
Thanks,
Maharajan.C
https://www.printervela.com/best-sublimation-printer-for-beginners/
Hi Hari,
Please try the below code:
public class Max_Age {
public Student__c z { set; get; }
public Max_Age()
{
string k = ApexPages.currentPage().getParameters().get('abc');
if(k){
Student__c studentobj = new Student__c();
studentobj = [SELECT Name, Student_Id__c, Age__c FROM Student__c WHERE Student_Id__c=:k];
if(studentobj!= null){
z = studentobj;
}
}
}
}
VF PAge:
<apex:page controller="Max_Age">
<apex:form >
<apex:outputPanel rendered="{!NOT(ISNULL(z))}">
{!z.name} {!z.Age__c}
</apex:outputPanel>
</apex:form>
</apex:page>
if you need any assistance, please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Suraj Tripathi