You need to sign in to do that
Don't have an account?
krishna casukhela 7
How to disable apex command button in vf page
Hello
I need to disable the command button in the visual force page.
I have a piece of logic which fetch data into an custom object called subscription__c.
The subscription object has a field called Mailing_List_Name__c.
IN the URL I will append a value , based on this it fetches the data.
If the Mailing_List_Name__c is empty then I want to disable the command button in visual force page.
Thanks
krishna
I need to disable the command button in the visual force page.
I have a piece of logic which fetch data into an custom object called subscription__c.
The subscription object has a field called Mailing_List_Name__c.
IN the URL I will append a value , based on this it fetches the data.
If the Mailing_List_Name__c is empty then I want to disable the command button in visual force page.
public List<Subscription__c> subs; public BusinessObjects__c tlBU; public void loadSubscriptions() { subs = [SELECT Id, Name, Active__c, Mailing_List_ID__c, Mailing_List_Name__c, Fan_ID__c, Promo_ID__c, Mailing_List_ID__r.TLA_ID__c, Mailing_List_ID__r.Territory__c FROM Subscription__c WHERE Fan_Id__c =:fan.Id]; //---------**** Territory Id & Territory Name of the Business Unit ****----------- try { tlBU=[select ID,Name from BusinessObjects__c where MID__c=:ApexPages.currentpage().getparameters().get('mid')]; TerritoryCheck=tlBU.Name; } vf page <label><apex:inputCheckbox value="{!s.selection}"/></label> <apex:commandButton value="SAVE CHANGES" action="{!btn_subscription_saveChanges}" reRender="outPanelSub"/>Please let me know how to achieve this.
Thanks
krishna
The browser URL is like this : https://sony--fullcopysb--c.cs88.visual.force.com/apex/Pref6?id=Y4IrnfVyr9sTRtE2lz57cA&mid=6393793
so the mailing list name is always present in sub object but also subject to the MID of the BusinessObjects__c
for the above URL Mailing_List_Name__c is present in subscription object and also MID=6393793 condition is satisfied.
But if MID is say 6393790 and subscription__c object may have subscriptions but they may not be connected to the MID.
Now as per ur current code when I use the above URL the button is disabled even though mailing_list_name__c is present and also the MID is connected .
can u pls help me with this
thanks
krishna