Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public AccountTypeController()
- {
- filterAccount = new Account();
- recordList = new Account[0];
- }
- public List<Account> getAccs()
- {
- List<Account> results = Database.query(
- 'SELECT Name, Type, Website, BillingCity, BillingStreet, BillingState, BillingPostalcode, BillingCountry, Industry ' +
- 'FROM Account '
- );
- return results;
- }
- public List<SelectOption> Accounts()
- {
- List<SelectOption> AccountList = new List<SelectOption>();
- for(Account act: [SELECT Name, Type, Website, BillingAddress, Industry FROM Account])
- AccountList.add(new SelectOption(act.Name, act.Name));
- return AccountList;
- }
- public void updateRecordList()
- { //this i'm thinking needs to be a pageReference to list the updatedAccounts //but im not sure how to change this
- recordList=[Select Name, Type, Website From Account Where Type = :filterAccount.Type];
- }
- public pageReference edit()
- { //pretty sure this is incorrect
- String contactId = Apexpages.currentpage().getParameters().get('AccountId');
- pageReference pageRef = new pageReference(URL.getSalesforceBaseUrl().toExternalForm() + '/' + AccountId + '/e?retURL=' + account.id);
- return pageRef;
- }
- <apex:form >
- <apex:outputPanel styleClass="requiredInput" layout="block" id="pwPanel">
- <apex:pageBlock title="Filter Accounts" id="pb" mode="edit">
- <apex:pageBlockSection >
- <apex:inputfield value="{!filterAccount.Type}" label="Account Type">
- <apex:actionSupport event="onchange" action="{!updateRecordList}" rerender="pwPanel"/>
- </apex:inputfield>
- <!--<apex:commandButton action="{!edit}" value="Edit"/>
- <apex:commandButton action="{!save}" value="Save"/>-->
- </apex:pageBlockSection>
- </apex:pageBlock>
- </apex:outputPanel>
- </apex:form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement