0

can anyone help me solve this error?

the error message : Unsupported attribute disabled in in Pre_process at line 22 column 101

<apex:page controller="preProcessController">
<apex:form >
    <apex:pageBlock id="PreProcessPayroll" title="Pre Process Payroll" >
        <apex:pageBlockSection columns="1" showHeader="false" >

             <apex:pageblocksectionItem >
                <apex:outputLabel value="Payroll Period" for="listPeriod"/>
                <apex:selectList id="listPeriod" size="1" multiselect="false" value="{!selectedPeriod}" style="width:150px"> 
                    <apex:selectOptions value="{!Period}"/> 
                    <apex:actionSupport event="onchange" reRender="listEmployee"/>
                </apex:selectList>   
            </apex:pageblocksectionItem>

            <apex:pageblocksectionItem >
                <apex:outputLabel value="All Employee" />
                <apex:inputCheckbox id="ProcessAll">
                    <apex:actionSupport event="onclick" reRender="listEmployee" />
                </apex:inputCheckbox>
            </apex:pageblocksectionItem>

            <apex:panelGroup id="listEmployee">
                <c:MultiselectPicklist leftLabel="Available Employee" leftOptions="{!allEmployee}" disabled ="TRUE" rendered="{!ProcessAll != TRUE}"
                                       rightLabel="Selected Employee" rightOptions="{!selectedEmployee}" 
                                       size="14" width="475px"/>
            </apex:panelGroup>               
        </apex:pageBlockSection>

            <apex:pageBlockButtons >
            <apex:commandButton id="RunPreProcess" value="Run Pre Process" action="{!RunPreprocess}"/>           
            </apex:pageBlockButtons>

    </apex:pageBlock>
</apex:form>

  • MultiselectPicklist in this component do your have attribute name Disabled. Other wise remove it from VF page – Tushar Sharma Sep 22 '16 at 8:09
  • disabled isn't a fucntion? all i want is disabled my MuliselectPicklist based on my checkbox @TusharSharma – Vikolai Sep 22 '16 at 8:14
  • You can't directly disbled it. You can use rendered attribute or you need to write custom JS to disable it – Tushar Sharma Sep 22 '16 at 8:23
  • rendered attribute? or js? can gv reference/example about that? @TusharSharma – Vikolai Sep 22 '16 at 8:25
  • Use rendered="false" instead of disabled. Also when you want to display use rendered="true" – Tushar Sharma Sep 22 '16 at 8:26
1
<apex:pageblocksectionItem >
                <apex:outputLabel value="All Employee" />
                <apex:inputCheckbox id="ProcessAll" value="{!ProcessAll}">
                    <apex:actionSupport event="onclick" reRender="listEmployee" />
                </apex:inputCheckbox>
            </apex:pageblocksectionItem>

            <apex:panelGroup id="listEmployee">
                <c:MultiselectPicklist leftLabel="Available Employee" leftOptions="{!allEmployee}" rendered="{! !ProcessAll}"
                                       rightLabel="Selected Employee" rightOptions="{!selectedEmployee}" 
                                       size="14" width="475px"/>
            </apex:panelGroup>

Check this code this will hide when checkbox is false and display when it checked. To disable the complete component its not a easy task and we need your component code as well.

| improve this answer | |
  • it not work, first : Unknown property 'preProcessController.ProcessAll' , and second error : Unsupported attribute disabled in <c:MultiselectPicklist> in Pre_process at line 22 column 101 @Tushar Sharma – Vikolai Sep 22 '16 at 8:47
  • @Vikolai ProcessAll is a boolean property with get set – Tushar Sharma Sep 22 '16 at 8:51
  • ok i already define my public boolean ProcessAll{get; set;}, but still error Unsupported attribute disabled in <c:MultiselectPicklist> in Pre_process at line 22 column 101 @Tushar Sharma – Vikolai Sep 22 '16 at 8:58
  • @Vikolai check my code I have removed it. – Tushar Sharma Sep 22 '16 at 9:27
  • oke it work sir, but it was reverse than what i want haha, now, it was : when checkbox untick(not ticked) my multiselectpicklist hidden, when ticked multiselectpicklist show up. And what i want is when the checkbox ticked, the ListEmployee is hidden, when it unticked(not ticked) the ListEmployee multiselectPicklist show up @Tushar Sharma hehe, i jsut dont understand how to reverse this – Vikolai Sep 22 '16 at 9:55

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.