You need to sign in to do that
Don't have an account?

How I can use 'if' statement ?
Hello, Sirs.
I need to display input button when 'numofrecords' have value > 0.
I tried to used that code:
But result of this code not a button, but only text - '<input type="button" onclick="action();" value="Do something" class="btn"/>'
How I can fix it ?
Thank you, Gentlemen.
I need to display input button when 'numofrecords' have value > 0.
I tried to used that code:
Code:
{!IF(numofrec > 0,'<input type="button" onclick="action();" value="Do something" class="btn"/>',"")}
But result of this code not a button, but only text - '<input type="button" onclick="action();" value="Do something" class="btn"/>'
How I can fix it ?
Thank you, Gentlemen.
Message Edited by Olbrest on 01-20-2009 01:29 PM
Hi...
This is alternate solution
Use rendered attribute with <apex:commandbutton value="Do something" action="{!action}"/>
Hi,
There are actually two ways to accomplish this.
First, using the rendered property of the command button. Since your action is a onclick javascript event, it could get messy trying to call the onclick without refreshing the page. You would have to do something like this:
<apex:outputPanel id="AJAXSection" />
<apex:commandButton value="Say hi..." onclick="alert('Hello world')" rerender="AJAXSection"
rendered="{!numRec>0}" />
your other option is to use the rerender method, but for an outputPanel...
You may also want to set the layout attribute to "none" for the outputPanel, if you find that the HTML span tags that it inserts by default interfere with your layout.
<apex:outputPanel rendered="{!5>0}" layout="none">
<input type="button" onclick="action();" value="Do something" class="btn"/>
</apex:outputPanel>