VF Page:
<apex:page Controller="actionSupportController">
<apex:form >
<apex:pageBlock >
Household Name: <apex:inputText value="{!ID_c}"/>
</apex:pageBlock>
<apex:pageBlock title="Characteristics Information">
<apex:inputCheckbox value="{!sct.Active__c}" />Active<br/>
<apex:inputCheckbox value="{!sct.Good_with_Cats__c}" />Good with Cats<br/>
<apex:inputCheckbox value="{!sct.HighNeed__c}" />HighNeed<br/>
<apex:inputCheckbox value="{!sct.kid_friendly__c}" />Kid Friendly<br/>
<apex:inputCheckbox value="{!sct.Non_shedder__c}" />Non Shedder<br/>
<apex:inputCheckbox value="{!sct.Predatory_Tendencies__c}" />Prediator Tendency<br/>
<br/><apex:commandButton value="Search" action="{!dochar}" rerender="sblck"/>
</apex:pageBlock>
<apex:outputPanel id="sblck">
<apex:pageBlock title="Search Results">
<apex:pageBlockTable width="80%" value="{!selctchr}" var="eachpe">
<apex:column width="80%" value="{!eachpe.Name}"/>
<apex:column width="80%" value="{!eachpe.Pet_ID__r.Name__c}"/>
<apex:column width="80%" value="{!eachpe.Pet_ID__r.Gender__c}"/>
<apex:column width="80%" value="{!eachpe.Pet_ID__r.Height__c}"/>
<apex:column width="80%" value="{!eachpe.Pet_ID__r.pet__c}"/>
<apex:column width="80%" value="{!eachpe.Pet_ID__r.Pet_Photo__c}"/>
<apex:column width="80%" value="{!eachpe.Pet_ID__r.Status__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:outputPanel>
<apex:commandButton value="Request Adoption"/>
</apex:form>
</apex:page>
Controller
public class actionSupportController {
public List<PCS_Household__c> lstQuery{get;set;}
public List<PCS_Household__c> OnlstQuery{get;set;}
public List<Characteristics__c> selctchr{get;set;}
public Characteristics__c sct{get;set;}
public string ID_c{get;set;}
public string test{get;set;}
public List<Pets_Information__c> selctpet{get;set;}
Public Boolean Good{get;set;}
public void dochar(){
string query='';
query='SELECT Name,ID,Good_with_Cats__c,Pet_ID__r.Gender__c,Pet_ID__r.Height__c,Pet_ID__r.Name__c,Pet_ID__r.pet__c,Pet_ID__r.Pet_Photo__c,Pet_ID__r.Status__c FROM Characteristics__c where Good_with_Cats__c=:Good';
system.debug('==query=='+query);
selctchr=Database.query(query);
system.debug('==selctchr=='+selctchr);
}
public PageReference incrementCounter() {
string Query='';
Query='SELECT ID,Name,Household__c,Phone__c,of_Childrens__c,of_Exiting_Pets__c,Address__c,Previous_Dog__c FROM PCS_Household__c where ID=:test';
system.debug('==Query=='+Query);
OnlstQuery=Database.query(Query);
system.debug('==OnlstQuery=='+OnlstQuery);
return null;
}
public Void doSearch(){
string Query='';
Query='SELECT ID,Name,Household__c,Phone__c,of_Childrens__c,of_Exiting_Pets__c,Address__c,Previous_Dog__c FROM PCS_Household__c where Household__c LIKE \'%'+ID_c+'%\'';
system.debug('==Query=='+Query);
lstQuery=Database.query(Query);
system.debug('==lstQuery=='+lstQuery);
}
public void nullify(){
lstQuery.clear();
}
public PageReference nextpage() {
upsert OnlstQuery;
return Page.cc;
}
}
selctchr
list