You need to sign in to do that
Don't have an account?
jedi_101
Display query value
Hi,
I have a controller class called myController with a variable defined as integer and a method doCount which captures the count of records in the variable t3. How do I display this t3 value in my page editor? I have a submit button in the page which calls for the doCount method. But I dont know how to display the value in the page. Could someone help.
public class myController {
Integer t3;
public Integer getCountLeads() { return t3; }
public integer doCount() {
t3= [select count() from lead ];
return t3;
}
}
Page editor code
<apex:form>
<apex:commandButton value="Submit" action="{!doCount}"></apex:commandButton>
</apex:form>
I have a controller class called myController with a variable defined as integer and a method doCount which captures the count of records in the variable t3. How do I display this t3 value in my page editor? I have a submit button in the page which calls for the doCount method. But I dont know how to display the value in the page. Could someone help.
public class myController {
Integer t3;
public Integer getCountLeads() { return t3; }
public integer doCount() {
t3= [select count() from lead ];
return t3;
}
}
Page editor code
<apex:form>
<apex:commandButton value="Submit" action="{!doCount}"></apex:commandButton>
</apex:form>
By using rerender something like this:
<apex:form>
<apex:commandButton value="Submit" action="{!doCount}" rerender="resultsOut"></apex:commandButton>
<apex:outputText id="resultsOut" value="{!countLeads}"/>
</apex:form>