function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
neeedhelpneeedhelp 

Disabling Command button

Hi their,

 

my code

 

<Apex:pageblockbuttons >
<Apex:commandButton value="Process" action="{!Submit}" rerender="SeeResult,SeeXml" onclick="if(!Submit()){return false;}" disabled="{!error}" oncomplete="processing();" />
</Apex:pageblockbuttons>

 

public void Submit()

{

 error = true;

 

}

 

 I would disable the button after the first click, but I cannot figure out how to do that.  I need the button disabled as soon as the user clicks the button.

 

But its not working......Help pls

vishal@forcevishal@force

<Apex:pageblockbuttons id="pbb">
<Apex:commandButton value="Process" action="{!Submit}" rerender="SeeResult,SeeXml, pbb"  disabled="{!error}" oncomplete="processing();" />
</Apex:pageblockbuttons>

 

I don't see anything else that's missing here. You were not rerendering the buttons I guess. Please try the code above.

 

 

neeedhelpneeedhelp

Can I get through javascript or else......

Parth_SevakParth_Sevak

You can use of <apex : facet > tag. It's quite straight-forward.

 

<apex:facet name="start">
<apex:outputPanel >
<apex:commandButton value="Process" disabled="true" />
</apex:outputPanel>
</apex:facet>
<apex:facet name="stop">
<apex:outputPanel >
<apex:commandButton action="{!Submit}" value="Process"
 immediate="true"  reRender="form">
</apex:commandButton>

</apex:facet>