You need to sign in to do that
Don't have an account?
pankaj tiwari 13
I have created a VF page where I am displaying two buttons - 'show all accounts', 'accounts with customer type direct'. And its working but now I need to use dropdown rather than buttons.
My controller is
public class c4
{
Account [] selectedacts;
public Account [] getselectedacts()
{
return selectedacts;
}
public PageReference showall()
{
selectedacts=[select Name, Type, Phone, Fax, Industry from Account];
return null;
}
public PageReference direct()
{
selectedacts=[select Name, Type, Phone, Fax, Industry from Account where Type='Customer - Direct'];
return null;
}
Public PageReference channel()
{
selectedacts=[select Name, Type, Phone, Fax, Industry from Account where Type='Customer - Channel'];
return null;
}
}
Thanks,
Gaurav
Skype: gaurav62990
Here is my VF page that I have used for buttons
<apex:page controller="c4">
<apex:form >
<apex:pageBlock title="List of Accounts">
<apex:commandButton value="Show All Accounts" action="{!showall}" reRender="mytable"/>
<apex:commandButton value="Show Direct Accounts" action="{!direct}" reRender="mytable"/>
<apex:commandButton value="Show Channel Accounts" action="{!channel}" reRender="mytable"/>
<apex:pageBlockTable value="{!selectedacts}" var="a" id="mytable">
<apex:column value="{!a.Name}"/>
<apex:column value="{!a.Type}"/>
<apex:column value="{!a.Phone}"/>
<apex:column value="{!a.Fax}"/>
<apex:column value="{!a.Industry}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
I have added my working code which matches your requirement.
Hope this helps..Let me know if you need further help
Thanks and Regards,
Shiva RV
Thanks, Shiva!
It works.