0

I want to render/enable a command button based on a rollupsummary field value. If a rollupsummary field evalues to 0 enable it else keep it disabled.

Following is the code i am trying to achieve this functionality

enter image description here

public with sharing class test 
{ 
    public Account acc{get;set;}

    public test(){
       acc = [SELECT No_of_App__c   FROM Account];
    }
}

No able to render/enable diable the button

2

Your code should work properly. You are missing "" in rendered tag.

Try this code once

rendered="{!If(acc.No_Of_App__C = 0 ,True,False)}"

0

A couple of points, rendered is whether or not the component is visible, which is different from it appearing as a disabled button.

You can add an element to the page to help you debug

<apex:outputText>{!acc.no_of_app__c}</apex:outputText>

Also you shouldn't call your controller Test! See the tip at the bottom of this page http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_error_handling.htm

  • Thanks for your suggestion. I have just created a test class as to post in forum.. as i wanted to work on only part of my whole code – TestNS Sep 24 '13 at 12:54

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.