3

I can't change controller variables (myNumber) within the component, that are assigned to apex:attributes.

<apex:component controller="MyCtrl"> 
    <apex:attribute name="number" type="Integer" assignTo="{!myNumber}" description="" />

    <apex:outputPanel id="panel">

        {!myNumber}

        <apex:commandLink value="Increase" rerender="panel">
            <apex:param name="number" assignTo="{!myNumber}" value="{!myNumber + 1}" />
       </apex:commandLink>
    </apex:outputPanel>
</apex:component>

The value does not increase by clicking the link. But as soon as I remove the apex:attribute tag, I can change the displayed value. Any idea why? Any work around?

| improve this question | | | | |
  • You could certainly fire some sort of event from the child in a change listener. – Adrian Larson May 15 '18 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.