0

I would like to display a Text Field when clicking Command Link ( Title:Add Filter Logic ). After the clicking of command link, the link title should be renamed to Clear Filter Logic. It would be great, if anyone let me know, how to do this.enter image description here

2
  • 1
    What did you tried for this. becasue it is a very easy thing Nov 30, 2015 at 5:29
  • Hi Tushar, I am not sure, how to give the condition in Render part of the InputText component. <apex:inputText id ="logic" disable ="false" rendered="{()}" > . It would be greatt, if you provide some sample code. Thanks Nov 30, 2015 at 6:35

1 Answer 1

1

Well, this is pure Apex & Visualforce trick.

Have 2 properties in your apex controller.

public String buttonText{get;set;}
public Boolean showInput{get;set;}

In your VF page, your commandLink-

<apex:commandLink action="{!doStuff}" reRender="theInputSection">{!buttonText}</apex:commandLink>

Your input field section

   <apex:form>
    <apex:outputPanel id="theInputSection">
    <apex:inputText name="Input" value="{!SomeVariableName}" rendered="{!showInput}"/>
    </apex:outputPanel>
    </apex:form>

Now in your Apex controller, define the doStuff method & constructor

public MyController()
{
showInput = false;
buttonText = 'Add Filter Logic';
}

public PageReference doStuff(){
showInput = true;
buttonText = 'Clear Filter Logic';
return null;
}
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .