You need to sign in to do that
Don't have an account?

Error when saving VF page: Unsupported attribute action in <apex:outputLink>
Hi,
I'm trying to pass a picklist value into a url, whcih then links to a report which is filtered based on that value. However, I'm getting an error when trying to save the VF page, which says Error: Unsupported attribute action in <apex:outputLink> in Special_Reports at line 10 column 75
VF Page Code:
<apex:page controller="dynamicpicklist" >
<apex:form >
<apex:sectionHeader title="Dynamic Picklist" subtitle="Reusable code"/>
<apex:pageblock >
<apex:pageBlockSection title="Dynamic picklist" columns="1">
<apex:outputlabel value="Pollinator" for="values" />
<apex:selectList value="{!pollinator}" size="1" id="values">
<apex:selectOptions value="{!pollinatornames}"/>
</apex:selectList>
<apex:outputLink id="link" action="{!processLinkClick}">Process Report</apex:outputLink>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
Class:
public class dynamicpicklist
{
public String pollinator{get; set;}
public List<SelectOption> getpollinatornames()
{
List<SelectOption> options = new List<SelectOption>();
List<User> pollinatorlist = new List<User>();
pollinatorlist = [Select Id, Name FROM User ];
options.add(new SelectOption('--None--','--None--'));
for (User users : [SELECT Id, Name FROM User WHERE Profile.Name = 'Pollinators' AND IsActive = TRUE ORDER BY Name ASC])
{
options.add(new selectOption(users.Id, users.Name));
}
return options;
}
public string pollinatorurl{get;set;}
public PageReference processLinkClick() {
return new PageReference('/00O90000005uwmQ?pv1='+pollinatorurl);
}
}
I'm trying to pass a picklist value into a url, whcih then links to a report which is filtered based on that value. However, I'm getting an error when trying to save the VF page, which says Error: Unsupported attribute action in <apex:outputLink> in Special_Reports at line 10 column 75
VF Page Code:
<apex:page controller="dynamicpicklist" >
<apex:form >
<apex:sectionHeader title="Dynamic Picklist" subtitle="Reusable code"/>
<apex:pageblock >
<apex:pageBlockSection title="Dynamic picklist" columns="1">
<apex:outputlabel value="Pollinator" for="values" />
<apex:selectList value="{!pollinator}" size="1" id="values">
<apex:selectOptions value="{!pollinatornames}"/>
</apex:selectList>
<apex:outputLink id="link" action="{!processLinkClick}">Process Report</apex:outputLink>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
Class:
public class dynamicpicklist
{
public String pollinator{get; set;}
public List<SelectOption> getpollinatornames()
{
List<SelectOption> options = new List<SelectOption>();
List<User> pollinatorlist = new List<User>();
pollinatorlist = [Select Id, Name FROM User ];
options.add(new SelectOption('--None--','--None--'));
for (User users : [SELECT Id, Name FROM User WHERE Profile.Name = 'Pollinators' AND IsActive = TRUE ORDER BY Name ASC])
{
options.add(new selectOption(users.Id, users.Name));
}
return options;
}
public string pollinatorurl{get;set;}
public PageReference processLinkClick() {
return new PageReference('/00O90000005uwmQ?pv1='+pollinatorurl);
}
}
this is not a supportted attribute of outputlink, please use onclick to call javascript method.
I'm having a lot of trouble with this. Can you provide an example of the how the link and class would look for this?
Thanks
<script>
function processLinkClick()
{
window.location="/00O90000005uwmQ?pv1="+"{!pollinatorurl}";
}
</script>