+ Start a Discussion
Piyush PandyaPiyush Pandya 

Apex:commandButton AJAX call not honoring forceSSL

I haveVF Component, that has YUI modal window which contains following commandButton to log into sites.

 

<Apex:commandButton id="loginBtnId" styleClass="Button" value="{!$Label.site.login}" action="{!login}" reRender="login_error"/>

 

Template page that includes this VF component contains single form that has forceSSL="true".

 

I also have same commandButton on the VF Page that posts the request in SSL and user can log into sites.

 

However, when user tries to login using YUI Modal window, the AJAX request does not get posted over SSL and hence sites login fails.

 

I cannot use nested <Apex:form> tags as it forces viewstate to be loaded multiple times and page load takes longer on this heavy traffic site.

 

I currently have removed the reRender from above tag and that forces page to post the parent form without AJAX and it works but displaying error message to user in case of failed login becomes challenging when user is using modal window to log in.

 

So question is, is there a way to force AJAX request to be SSL without using <Apex:form>?