Lookup fields using Salesforce1 and Visualforce

I’m trying to create a VF page that will be used in Salesforce1 via a publisher action. One of the things I need to do is have the user choose an Account. However, there seems to be two problems with this.

  1. The lookup window results has the browser styling: browser styling
  2. Tapping on one of the accounts bounces me back to the main page where I called the publisher action and also freezes the app (the screenshot shows what it looks like in the sforce1 app in the browser, but when trying on my phone, it will freeze the app)

Is there some mobile specific way of rendering lookup fields in sf1 that I am missing here?

Here is a similar issue, but not quite the same.


Update 2/21/2014

Here is the code by popular request (simplified):

<apex:page standardController="Account" docType="html-5.0" showHeader="false" sidebar="false" standardStylesheets="true">
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.css" />
    <script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="//code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.js"></script>

    <apex:form >
        <div>
            <apex:inputField value="{!Account.ParentId}"/>
        </div>
    </apex:form>
</apex:page>

I apologize if I wasn’t clear up above, but the main question is: is there a built-in way of getting the lookup to have the sf1 styling and functionality? I.e., can I create the lookup to look like the below via VF, or do I have to create something like this manually?:
sf1 lookup control

Answer

Lookups are not currently supported with the same styling. You will need to reproduce the styling manually.

You can call the same lookup function to bring up the lookup dialog, but the styling of that window will still look like the one you posted.

Attribution
Source : Link , Question Author : willard , Answer Author : Kris Gray

Leave a Comment