• treecloud
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies

Hello,

 

Could use your help:

 

I'm trying to use JQuery Mobile within Salesforce. I've run into a problem where CommandButtons don't work. I've put together a basic example of this below. If you simply remove the jquery.mobile-1.3.2.min.js reference, it starts working properly again.

 

Has anyone resolved this issue, can anyone provide me an alternate solution for changing pages? Any recent JQuery library version has the same results.

 

FYI: Also I tried CommandLink, it also has issues where the first time you click it just refreshes the page.

 

CustomPage1:

<apex:page standardStylesheets="false" showHeader="false" sidebar="false" controller="CustomController1">
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <apex:stylesheet value="{!URLFOR($Resource.styles, 'bootstrap.css')}"/>
        <apex:stylesheet value="{!URLFOR($Resource.styles, 'jquery.mobile-1.3.2.min.css')}"/>
        <apex:includeScript value="{!URLFOR($Resource.styles, 'jquery-1.9.1.min.js')}" />
        <apex:includeScript value="{!URLFOR($Resource.styles, 'jquery.mobile-1.3.2.min.js')}" /> 
    </head>
    <body>
        <apex:form>
            <apex:commandButton styleClass="btn btn-success" action="{!next}" value="Next"/>
        </apex:form>
    </body>
</html>

 

 

 

CustomPage2:

<apex:page standardStylesheets="false" showHeader="false" sidebar="false" controller="CustomController1">
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <apex:stylesheet value="{!URLFOR($Resource.styles, 'bootstrap.css')}"/>
        <apex:stylesheet value="{!URLFOR($Resource.styles, 'jquery.mobile-1.3.2.min.css')}"/>
        <apex:includeScript value="{!URLFOR($Resource.styles, 'jquery-1.9.1.min.js')}" />
        <apex:includeScript value="{!URLFOR($Resource.styles, 'jquery.mobile-1.3.2.min.js')}" /> 
    </head>
    <body>
        <apex:form>
            <apex:commandButton styleClass="btn btn-success" action="{!previous}" value="Previous"/>
        </apex:form>
    </body>
</html>

 

CONTROLLER:

public class CustomController1 
{
    public PageReference next()
    {
        return Page.CustomPage2;
    }
    public PageReference previous()
    {
        return Page.CustomPage1;
    }
}

 

Thanks for your help with this.

I'm stuck and could use your help. I followed all of the 20 blogs/posts online like this one that explain how to do this but I can't seem to find the issue. I'm trying to build a custom webservice call from php to my salesforce apex webservice. The parameters I'm passing are coming up null on the other side. Any ideas?

APEX Webservice:

global class CreateCustomerPatient
{
    webservice static String createCustomerPatient(String testString)
    {
        return 'ERROR: testString - ' + testString;
    }
}


PHP:

function createSalesforcePatient($wsParams)
{
    require_once ('../sfdc/SforcePartnerClient.php');
    require_once ('../sfdc/SforceHeaderOptions.php');

    //LOGIN CODE REMOVED - WORKING CORRECTLY

    // setup the SOAP client modify the headers
    $parsedURL = parse_url($sfdc->getLocation());
    define ("_SFDC_SERVER_", substr($parsedURL['host'],0,strpos($parsedURL['host'], '.')));
    define ("_WS_NAME_", "CreateCustomerPatient");
    define ("_WS_WSDL_", "../sfdc/" . _WS_NAME_ . ".wsdl.xml");
    define ("_WS_ENDPOINT_", 'https://' . _SFDC_SERVER_ . '.salesforce.com/services/wsdl/class/' . _WS_NAME_);
    define ("_WS_NAMESPACE_", 'http://soap.sforce.com/schemas/class/' . _WS_NAME_);

    $client = new SoapClient(_WS_WSDL_);
    $sforce_header = new SoapHeader(_WS_NAMESPACE_, "SessionHeader", array("sessionId" => $sfdc->getSessionId()));
    $client->__setSoapHeaders(array($sforce_header));

    $response = $client->createCustomerPatient($wsParams);
    print_r($response);
}

$wsParams = array('testString' => 'test');
createSalesforcePatient($wsParams);

 

Response:

stdClass Object ( [result] => ERROR: testString - null )

 

The WSDL was generated from salesforce and placed at the location specified. It seems to be pulling it correctly. Inside the WSDL it contains the following as expected:

<xsd:element name="createCustomerPatient">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="testString" type="xsd:string" nillable="true"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:element>

 

Any ideas as to what I'm doing wrong? Thanks so much for your assistance, I really appreciate this.