You need to sign in to do that
Don't have an account?
Chamil Madusanka
OutputLink with action method
Hi All,
I want to create a output link with some value and it needs to have an action method to control that link. That mean, according to the return value of action method, output link will be populate. How can I do this?
Thanks in Advance!!
I didn't get your question properly. How do you want that Link to be controlled. I mean which componet will render that Link.
This is something that I interpreted from the question. I might be wrong in this. If possible please reply.
Scenario : The button is used to render the Link i.e. to generete the content for the Link. I have used a random number to show that we can get any desired text.
APEX CLASS
public class atest{
public Boolean flag {get;set;}
public String random {get;set;}
public void populateLink(){
flag = true;
random = String.valueOf(math.random());
}
}
VF PAGE
<apex:page controller="atest">
<apex:form >
<apex:commandButton value="Populate" action="{!populateLink}" reRender="link"/>
</apex:form>
<apex:form id="link">
<apex:commandLink rendered="{!flag}" value="{!random}"/>
</apex:form>
</apex:page>
Hi Darshan,
Nice Example.
Thanks.