function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Andries.NeyensAndries.Neyens 

outputlink and Salesforce1

Seems that the outputlink has a strange behavior in Salesforce1,

given the following scenario:

<apex:page controller="Salesforce1Bug" showChat="false" applyHtmlTag="false" applyBodyTag="false" sidebar="false" showHeader="false" title="Is this by design?" docType="html-5.0" standardStylesheets="false" >
    <html>                
        <head>
            <title>Is this by design?</title>
        </head>
        <body>
       
         Parameter: <apex:outputtext value="{!Param}"/>
         <br/>
            <apex:outputLink value="/apex/Salesforce1Bug?parameter=something%20something">This is a working link
               
            </apex:outputLink>
        <br/>
            <apex:outputLink value="/apex/Salesforce1Bug">This is not a working link
                <apex:param name="parameter" value="the dark side" />
            </apex:outputLink>
            <br/>
        </body>
    </html>
</apex:page>


and

public with sharing class Salesforce1Bug {
   public String getParam()
   {
     return ApexPages.currentPage().getParameters().get('parameter');
   }
}


This works perfectly in the browser, but if you access this page in Salesforce1 you will see that the second link will not work and the encoding is a bit dodgy?

Anyone an idea what the difference is?
Andries.NeyensAndries.Neyens
I solved the linking problem as followed:

<script type="text/javascript">
function sForce1Navigate(url) {
  if( (typeof sforce != 'undefined') && (sforce != null) ) {
   sforce.one.navigateToURL(url);
  }
  return false;
}
</script>


<apex:outputLink onclick="sForce1Navigate('/apex/Salesforce1Bug?parameter=something%20something');" value="/apex/Salesforce1Bug?parameter=something%20something">This is a working link now</apex:outputLink>

this link will work in the browser and in Salesforce1,

Only thing remaining is the space that is converted to a +-sign