So I have built an apex page as follows...
<apex:pageBlockSection >
<apex:inputField value="{!Tree__c.Tree_Type__c}" />
<apex:inputField value="{!Tree__c.Diseases__c}" />
</apex:pageBlockSection>
<apex:outputPanel >
<apex:commandButton value="Search" action="{!doSearch2}"
reRender="block" status="status" />
</apex:outputPanel>
And I have built a controller as follows (I am trying to get a few fields working to start with, hence the code comments...
soql = 'Select Tree_Type__c, Tree_Surgeon__c, Diseases__c, Status__c, Date_of_Planting__c, Native_breed__c from Tree__c WHERE';
if (!varTreeType.equals(''))
soql += ' Tree_Type__c LIKE "+varTreeType+"';
// if (!lastName.equals(''))
// soql += ' and lastname LIKE "+lastName+"';
// if (!accountName.equals(''))
// soql += ' and account.name LIKE "+accountName+"';
// if (!technology.equals(''))
// soql += ' and interested_technologies__c includes ("+technology+")';
How do I get the values of the VisualForce form fields, and use them within the query?