0

I've created a custom Visualforce landing page for my account tab and now when i want to make some edits i am not able to click on the fields like they are not editable. Also when I try to save the record, it doesn't want to get saved.

Here is how my code looks like.

<apex:page standardController="Account" showHeader="true" wizard="false" readOnly="false" rendered="true" showChat="true" standardStylesheets="false"
      tabStyle="account"  >
   <style>
      .activeTab {background-color: #236FBD; color:white; width: 170px; height: 20px; padding-top: 6px; font-size: 12px; font-style: bold; border-top: none;
         background-image:none;}
      .inactiveTab { background-color: lightgrey; color:black; width: 170px; height: 20px; padding-top: 6px; font-size: 12px; font-style: bold; border: none;
         background-image: none}
   </style>

<apex:pageBlock id="block1" >
    <apex:pageBlockSection id="section2" columns="2" collapsible="true" title="Important Information!">
        <apex:outputfield value="{!Account.Publisher_Username__c}"/>
        <apex:outputfield value="{!Account.Contacted_by__c}"/>
        <apex:outputfield value="{!Account.Publisher_ID__c}"/>


    </apex:pageBlockSection>
    <script>
        twistSection(document.getElementById('{!$Component.block1.section1}').getElementsByTagName('img')[0])
    </script>

</apex:pageBlock>
   <apex:tabPanel switchType="client" selectedTab="tabdetails" 
                  id="AccountTabPanel" tabClass="activeTab" 
                  inactiveTabClass="inactiveTab"  >   
      <apex:tab label="Details" name="AccDetails" id="tabdetails" style="background-color: white;">
         <apex:detail relatedList="false" title="true" inlineEdit="true"/>
      </apex:tab>
      <apex:tab label="Contacts" name="Contacts" id="tabContact" >
         <apex:relatedList subject="{!account}" list="contacts"  />
      </apex:tab>
      <apex:tab label="Opportunities" name="Opportunities" 
                id="tabOpp">
         <apex:relatedList subject="{!account}" 
                           list="opportunities" />
      </apex:tab>
      <apex:tab label="Open Activities" name="OpenActivities" 
                id="tabOpenAct">
         <apex:relatedList subject="{!account}" 
                           list="OpenActivities" />
      </apex:tab>
      <apex:tab label="Activity History" name="ActivityHistory" id="tabActHist">
          <apex:relatedList subject="{!account}" list="ActivityHistories" />
      </apex:tab>
      <apex:tab label="Notes & Attachments" 
                name="NotesAndAttachments" id="tabNoteAtt" >
         <apex:relatedList subject="{!account}" 
                           list="CombinedAttachments" />
      </apex:tab>
   </apex:tabPanel>

</apex:page>

Please advise,

Darko

1

Did you try apex:inlineEditSupport ? If not, you may try something like this:

<apex:outputField value="{!Account.Name}" >
<apex:inlineEditSupport event="ondblClick" showOnEdit="svbtn" /> 
</apex:outputField>
<apex:commandButton action="{!save}"  id="svbtn"/>

  • thank you for your input but inline edit support works only for forms. In my code i tried everything but it doesn't seem to work. – Darko Todorovski Jan 21 '15 at 8:23
  • In order to save the record to the database, you have to use form tag if I am not wrong. – Shailesh Patil Jan 21 '15 at 8:39
0

Solution to my problem. Since I disabled standardStylesheets="false". The code confuses with the existing code and because of that i am not able to save my record or view initial date as a calendar field.

So to fix this, problem i need the style sheet to be set to true.

standardStylesheets="true"

Problem solved.

Cheers,

Darko

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.