I am trying to use bootstrap tabs in order to navigate in a single page application. By clicking on a tab I want to change the view (switch to the selected tab) and save the data to the database.
I created the tabs as apex:commandLinks
and added them to my form and was able to save and navigate.
The problem occurred later when I navigated to a tab with apex:inputFile
attribute and got this error:
apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete attribute.
I decided to separate the tabs from the rest of the form so I created another form.
Now I have a page with two forms and the navigation works and also I don't get the error above anymore but, I'm unable to save anymore, no errors and no indication why.
I didn't manage to capture any error in the debug log nor in chrome debugger.
VF Page Snippet:
<div class="container-fluid">
<div class="row">
<apex:form id="headerForm"> <-----First Form
<div class="col-sm-12 text-center"><br></br>
<ul class="nav nav-tabs" id="sidebarUList">
<li class="active">
<apex:commandLink action="{!changePage}" reRender="secondform">tab 1
<apex:param value="1" assignTo="{!pageNumber}" />
</apex:commandLink>
</li>
<li>
<apex:commandLink action="{!changePage} reRender="secondform"">tab 2
<apex:param value="2" assignTo="{!pageNumber}" />
</apex:commandLink>
</li>
</ul>
</div>
</apex:form>
<div class="col-sm-12">
<apex:form id="secondform"> <-----Second Form
<apex:outputPanel rendered="{!sm.CurrentStep==1}">
<apex:inputField value="{!pa.Server_name__c}" />
<apex:outputField value="{!pa.Server_name__c}" />
</apex:outputPanel>
</apex:form>
</div>
</div>
</div>
Controller:
public void changePage() {
try {
sm.CurrentStep=pageNumber;
save();
} catch(Exception e) {}
}
public pageReference save() {
Savepoint sp = Database.setSavepoint();
try {
update pa;
} catch (Exception e) {
Database.rollback(sp);
return null;
}
return new pageReference('/apex/visualforceTes);
}