• skiershorty
  • NEWBIE
  • 0 Points
  • Member since 2012

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

An org already has profiles assigned to specific users. The org installs a new application. The new application has profiles defined for users to interact with the new application. The new application also has permission sets with access similar to the profiles.

 

We have a custom object that has fields that should only be visible based on a custom select or a picklist. When the Custom Object fields are required or an inputField is marked as required the onchange event does not execute. Adding immediate="true" to the actionFunction also doesn't allow the onchange to execute.

 

Using the built in Account object also produces the same result. The desired result for this example is to hide the Billing City field when Web is selected from the picklist. This works until the accountName section, which contains a required field, is uncommented then the field is not hidden when Web is selected. Is there a missing attribute or additional setting required?

 

Thanks

 

Visualforce***************************************************

<apex:page controller="AccountTest">
  <apex:form >
      <apex:pageBlock >
            <apex:actionFunction action="{!getSelection}" rerender="accountName" name="callSelection"/>
            <apex:pageBlockSection title="Account Information" id="testing" Columns="1">                
                <apex:inputField id="accountSource" value="{!account.AccountSource}" onchange="callSelection(this.value);"/>
            </apex:pageBlockSection>
           <apex:pageBlockSection columns="1" id="accountName">
                <apex:inputField value="{!account.BillingCity}" rendered="{!isVisible}"/>
           </apex:pageBlockSection>
           <!--***Comment Out This Section***-->
           <!--
           <apex:pageBlockSection title="Account Name" id="accountName" columns="1" >
                <apex:inputField value="{!account.Name}" rendered="{!isVisible}"/>
           </apex:pageBlockSection>
           -->
           <!--***Comment Out This Section***-->
       </apex:pageBlock>
  </apex:form>
</apex:page>

 

Apex***********************************

public class AccountTest {
    public Account account {get;set;}
   
    public AccountTest(){
        this.account = new Account();
    }
   
    public boolean getIsVisible(){
        return Account.AccountSource != 'Web';
    }
   
    public PageReference getSelection()
    {
        system.debug('getSelection');
        Account.BillingCity =  Account.AccountSource;
        return null;
    }
}

When a Visualforce Page1 calls Visualforce Page2 and Visualforce Page2 has a extension to an Apex class with a constructor that contains the following line of code

 

"ApexPages.currentPage().getHeaders().get('Referer')"

 

How can the class be tested when being called by a Apex test class instead of a Visualforce page?

 

The result of "ApexPages.currentPage().getHeaders().get('Referer')" is setting a class property that is being used by other methods of the class.

 

//*****************************************************

public class Payment_Extension
{
    private Payment__c payment;
    private ApexPages.StandardSetController myController;
    private Payment currentPayment;
    private boolean isReceivable;    
    
    //********************************************************************************
    public Payment_Extension(ApexPages.StandardSetController stdController)
    {
        system.debug('PaymentReceivable_Extension');
        payment = (Payment__c)stdController.getRecord();
        myController = stdController;
        isReceivable = ApexPages.currentPage().getHeaders().get('Referer').contains('tabspayreceivable');     
    }
    
    //********************************************************************************
    public List<selectOption> getReceivableTypes()
    {
        if(isReceivable)
        {
            return currentPayment.ReceivableTypes();
        }
        else
        {
            return currentPayment.PayableTypes();
        }
    }
}

//*****************************************************

Hi,

 

I insert a <apex:detail /> tag into my visualforce page.  The color of the section headers are white and thus not visible.  Can somebody help with this?

 

Thanks!

Holger

Hello everyone,

 

I've been having an issue in the last weeks, it all started in sandbox and now I'm seeing the same behavior in production and that's why I need your help.

 

When using my VF pages in Customer Portal, the colors of sections and fonts (defined in the Customer Portal customization section) change completely when doing an AJAX call, this is very strange since it was working without any problems. I noticed this only happens in Customer Portal, any ideas?

 

Thanks in advance!

 

Message Edited by jonathan rico on 12-28-2009 08:12 PM