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
aNsagaNsag 

apex:commadbutton action is not working with disabled attributes

Currently I am facing problem within my apex compnent while adding disable attribute its irregular behaviour.

 

<apex:pageBlock rendered="{!page1visible}">

 

<apex:column >

<apex:outputLabel value="Product Name: "></apex:outputLabel>

<apex:selectList title="Product Name" multiselect="false" size="1" value="{!lst.Names}" disabled="{!page1disable}">

<apex:selectOptions value="{!lsttickets}"></apex:selectOptions>

</apex:selectList>

</apex:column>
<apex:commandButton value="Add More" action="{!addRows}" disabled="{!page1disable}"/>

<apex:commandButton value="Save and Next" action="{!groupsalesp1}" disabled="{!page1disable}"/> 

 

</apex:pageBlock>

 

<apex:pageBlock rendered="{!page2visible}">

 

<apex:column >

<apex:outputLabel value="Product Name: "></apex:outputLabel>

<apex:selectList title="Product Name" multiselect="false" size="1" value="{!lst.Names}" disabled="{!page2disable}">

<apex:selectOptions value="{!lstpark}"></apex:selectOptions>

</apex:selectList>

</apex:column>
<apex:commandButton value="Add More" action="{!addrows}" disabled="{!page2disable}"/>

<apex:commandButton value="Save and Next" action="{!salesp2}" disabled="{!page2disable}"/> 

 

</apex:pageBlock>

 

its working fine with first pageblock and disabling fields for correctly after that in next Apex:pageblock its not even able to call action functions in apex:commandbutton 

 

What I actually want is that I need to make first pageblock readonly while clicking on Save and Next button on first pageblock and then second page block and so on while moving to next pageblock it should make first one as readonly 

 

Any sugguestions and different approach ?

Tejas KardileTejas Kardile

Hi,

 

you can use salesfoce tab for your requirement. In tab functionality you create 2 tab and over their you can easily found the readonly attribute.

 

Or 

 

you can create two panel, one panel contain the all in input data and other panel will contain output data and based on flag you can control their re-rendering.

 

Hope this above two approaches will help you out.