Q:

Create picklist in visualforce from method return

How to create a picklist with the return from the following method in visualforce, currently receiving the following error: Unknown property AccountCreation.AccountNames
@RemoteAction
    public static List<selectOption> getAccountNames(string categorySelected){
    List<selectOption> accByCategory = new List<selectOption>();

    for(Account acc :[SELECT Id,Name FROM Account WHERE Category_Name__c = :categorySelected]){
            accByCategory.add(new selectOption(acc.Name,acc.Name));
        }

    return accByCategory ;  

    }

Visualforce:
    <apex:selectList multiselect="false" size="1">
        <apex:selectOptions value="{!AccountNames}">
        </apex:selectOptions>
    </apex:selectList>

A:

Your method needs to not have any parameters to be a valid getter:
public string categorySelected { get; set; }
public List<selectOption> getAccountNames(){
List<selectOption> accByCategory = new List<selectOption>();

for(Account acc :[SELECT Id,Name FROM Account WHERE Category_Name__c = :categorySelected]){
        accByCategory.add(new selectOption(acc.Name,acc.Name));
    }

return accByCategory ;  
}

