here is my code for a output field. when the field is empty the button is rendered, when the field has value the clear button will show up and allow me to empty the field and render the button again. but I can’t manage it to render the button again once the field is is cleared, can anybody suggest a fix?
<apex:pageBlockSectionItem >
<apex:outputLabel value="Order:" for="callerorder"/>
<apex:outputPanel id="callerorder">
<apex:outputField value="{!newPhoneCallRecord.Order__c}" />
<apex:commandButton value="x" rendered="{!!ISBLANK(newPhoneCallRecord.Order__c)}" rerender="phoneRecordSection">
<apex:param name="orderRMV" value="" assignTo="{!newPhoneCallRecord.Order__c}"/>
</apex:commandButton>
</apex:outputPanel>
Lee,
Given that you want this to be dynamic you should probably enable/disable the button with javascript. By leveraging the
onChangeevent you could toggle visibility of the button as required.That said, assigning an empty value using an
<apex:param>seems to be a somewhat left-field take on the situation. The more standard way to clear this field via the controller would be to implement a clear method on the controller like so:And then to call this method from the command button: