+ Start a Discussion
sivaextsivaext 

How to disable salesforce1 navigation bar on initial load?

Hi,

We have created VF page and set us default landing page in place of chatter. Once user login , it is mandatory to read content in VF page and agree on that.

User able to click navigation bar and clicking another tab without accepting terms & conditions?

Thanks & Regards
Siva.
Sai Ram ASai Ram A
Hi Siva

Suggetion: Show as Popup
User-added image
 
<apex:page controller="Landingpage_Customized">
    
      
      <apex:form >
        <apex:outputPanel id="tstpopup" styleClass="parentDisable"><br/><br/><br/>
            <apex:outputPanel styleClass="popupBackground" layout="block"/>
            <apex:outputPanel styleClass="custPopup" layout="block">
               <apex:outputLabel > 
               Accept Terms &amp; Conditions
                </apex:outputLabel> <br/><br/><br/>
                   <apex:commandButton value="Accepted" action="{!Approve}" style="background: Orange;background-image:none;"/>
                   <apex:commandButton value="Reject" action="{!Reject}" style="background: Orange;background-image:none;"/>
            </apex:outputPanel>
        </apex:outputPanel>
    </apex:form>
    
    <style> 
    .parentDisable{
                position:fixed;
                top:0;
                left:0;
                background:#000;
                opacity:0.8;
                z-index:998;
                height:100%;
                width:100%;}
       
        .custPopup{
            background-color: white;
            border-width: 2px;
            border-style: solid;
            z-index: 9999;
            left: 50%;
            padding:10px;
            position: absolute;
            width: 500px;
            margin-left: -250px;
            top:20px;
        }
        .popupBackground{
            background-color:black;
            opacity: 0.20;
            filter: alpha(opacity = 20);
            position: relative;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            z-index: 9998;
        }
      </style>
</apex:page>
 
//Headsup, if you want to track the users have accepted or rejected create a Custom Object and field for tracking purpose
public class Landingpage_Customized {
    //Approve method
    public pageReference Approve()
    {    
        
        /*Your_Custom_Object__c auditA = new Your_Custom_Object__c();
        auditA.User__c = userinfo.getUserId();
        auditA.Action__c = 'Approved';
        
        insert auditA;
        system.debug('*********Record ID'+auditA.Id);*/
         // Send the user to the Home page after approve
        PageReference nextPage = new PageReference('/home/home.jsp');
        nextpage.setRedirect(true); 
        return nextPage;
    }
    
    //Reject method
    public pageReference Reject()
    {
        /*Your_Custom_Object__c auditR = new Your_Custom_Object__c();
        auditR.User__c = userinfo.getUserId();
        auditR.Action__c = 'Reject';
        
        insert auditR;
        system.debug('*********Record ID'+auditR.Id);*/
         // Send the user to the logout page after Reject
        PageReference nextPage = new PageReference('/secur/logout.jsp');
        nextpage.setRedirect(true); 
        return nextPage;
    }
}

P.S.  If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.

Thank you
BLearn - Sai
sivaextsivaext
Thanks Sai Ram for replying, 

I want display popup when user logins thorugh SF1 app, pop up is coming but user can click on other tabs without accepting terms & condtions. Can we control salesforce1 navigation bar using code?

Thanks & Regards
Siva.

 
sivaextsivaext
User-added image