Hi, This is my page <apex:page controller="Myctrl"> <apex:form id="formid"> <script> function MyFunction(iserror){ alert(iserror); if(iserror == true) { alert('Hello');
} } function MyFunction1(iserror,id,cid){ alert(iserror); if(iserror == true) { alert('Hello');
} window.open('/apex/RecordDetailPage?RecId=' + id + '&ConId=' + cid); } </script>
NOTE:Here isNewUser(cid, ipAddress); is related to "CurrentUserIp" class.Using this class Every time i will check My Field Ipaddress(This field is there in my contact object) and Current system ipaddress.
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_commandLink.htm
Hi Prem,
using <apex:outputlink> pagereference working. But When isErro is true how to call below i extended class method like doback()
String ipAddress = ApexPages.currentPage().getHeaders().get('X-Salesforce-SIP');
isError = isNewUser(cid, ipAddress); //CurrentUserIp Method
Hi,
This is my page
<apex:page controller="Myctrl">
<apex:form id="formid">
<script>
function MyFunction(iserror){
alert(iserror);
if(iserror == true)
{
alert('Hello');
}
}
function MyFunction1(iserror,id,cid){
alert(iserror);
if(iserror == true)
{
alert('Hello');
}
window.open('/apex/RecordDetailPage?RecId=' + id + '&ConId=' + cid);
}
</script>
<apex:commandButton value="Back" action="{!doBack}" oncomplete="MyFunction({!isError})" rerender="formid"/>
<apex:repeat value="{!listRecords}" var="UR">
<tr>
<td>
<apex:outputLink onclick="MyFunction1({!isError},{!UR.Id},{!cid})">{!UR.Number__c}</apex:outputLink>
</td>
</tr>
</apex:repeat>
</apex:form>
</apex:page>
Controller:
=========
public class Myctrl extends CurrentUserIp {
public DropSave__c pdfObject{get; set;}
public Boolean isError{get; set;}
public ApexPages.StandardSetController con {
get {
if(con == null) {
con = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT Id,Name,Number__c FROM DropSave__c ]));
}
return con;
}
set;
}
public Myctrl()
{
String ipAddress = ApexPages.currentPage().getHeaders().get('X-Salesforce-SIP');
isError = isNewUser(cid, ipAddress);
cid = ApexPages.currentPage().getParameters().get('conid');
}
public PageReference doBack()
{
String ipAddress = ApexPages.currentPage().getHeaders().get('X-Salesforce-SIP');
isError = isNewUser(cid, ipAddress);
if(isError == false){ PageReference ref=new PageReference('/apexBackpage');
return ref.setRedirect(true);}return null;
}
}
NOTE:Here isNewUser(cid, ipAddress); is related to "CurrentUserIp" class.Using this class Every time i will check My Field Ipaddress(This field is there in my contact object) and Current system ipaddress.
please help me............
<apex: commnad link action="{!methodname}"/>
thanks,
http://www.forcexplore.com/2014/08/visualforce-and-apex-tutorial-for-beginners.html
http://forcexplore.blogspot.com/2014/08/visualforce-and-apex-tutorial-for-beginners.html
Thanks.