You need to sign in to do that
Don't have an account?
Hemant Thakkar
Pass Variable to Output link
Here is my code, What i am doing..i want to pass selected lookup REcord id to outout link. I got id in the javascript and allocated it to the controller variable. But i am unale to use that variable with the updated value in the output link.
Plz help me
Bold Part is my Output link. Output link name is test link . you can find out
<apex:page standardController="Sales_Exception__c" id="SalesExceptionPage" extensions="DineshTestController" showheader="true" action="{!pageredirect}">
<!-- <script>
function checkID(param){
alert('Entering');
alert(param);
QuoteIDValue = param;
var reasonEle=document.getElementById('{!$Component.SalesExceptionPage:theScriptException:pb:blockB:pbs:pgblock:0:testid:0:rpt:0:theLink1}'); // blockB:pbs:pgblock:testid:rpt:theLink1
alert(reasonEle);
}
</script>-->
<apex:form id="theScriptException">
<apex:pageMessages >
</apex:pageMessages>
<script>
function openpopupWindowDeal(){
<!-- win1=window.open('/apex/DealEdit?retURL=/apex/PERScriptQ','Search','scrollbars=1,width=900,height=500'); -->
win1=window.open('/apex/DealEdit?','Search','scrollbars=1,width=900,height=500');
win1.focus();
win1=true;
//return false;
}
function openpopupWindowMA(){
win1=window.open('/apex/detailPage?','Search','scrollbars=1,width=900,height=900');
// win1.focus();
win1=true;
//return false;
}
</script>
<b>Note: </b><br/>
<b>- Prototype - Work in Progress.</b><br/>
<b>- Questions and Answers will become visible only when a Customer Transaction is created/linked</b>
<br/><br/>
<apex:pageblock rendered="{!legacyRecord}">
<font color="red" size="3px">
<apex:outputText >
Sorry, you cannot create a product pricing exception(legacy) record type.
</apex:outputText>
</font>
<apex:pageBlockButtons location="Bottom" >
<apex:commandButton action="{!cancel}" value="Back" id="thecancelbtn" />
</apex:pageblockButtons>
</apex:pageblock>
<apex:actionFunction name="preSend" reRender="thePanelWrapper,blockA,blockB,blockc,blockd" oncomplete="checkID('{!Sales_Exception__c.Quote_Proposal__c}')" /> <!-- {!Sales_Exception__c.Quote_Proposal__c} -->
<apex:inputfield value="{!Sales_Exception__c.Quote_Proposal__c}" id="d1" onchange="preSend()" >
<apex:outputLink id="theLink1" onclick="window.open('/apex/ManualAllocation?id={!QuoteIDValue}','_blank','width=810,height=310,toolbar=0,status=1,scrollbars=1,resizable=yes',!1);return false;" >Test Link
<script>
function checkID(param){
alert('Entering');
alert(param);
QuoteIDValue = param;
var reasonEle=document.getElementById('{!$Component.theLink1}').value; // blockB:pbs:pgblock:testid:rpt:theLink1
alert(reasonEle);
}
</script>
</apex:outputLink>
<!-- onclick="javascript:openpopupWindowDeal();"target="_blank" window.open('/apex/ManualAllocation','_blank','width=810,height=310,toolbar=0,status=1,scrollbars=1,resizable=yes',!1); rendered="{!if(cmap.Question_Type__c == 'Link',true,false)}"-->
</apex:repeat>
</apex:column>
</apex:datatable>
Plz help me
Bold Part is my Output link. Output link name is test link . you can find out
<apex:page standardController="Sales_Exception__c" id="SalesExceptionPage" extensions="DineshTestController" showheader="true" action="{!pageredirect}">
<!-- <script>
function checkID(param){
alert('Entering');
alert(param);
QuoteIDValue = param;
var reasonEle=document.getElementById('{!$Component.SalesExceptionPage:theScriptException:pb:blockB:pbs:pgblock:0:testid:0:rpt:0:theLink1}'); // blockB:pbs:pgblock:testid:rpt:theLink1
alert(reasonEle);
}
</script>-->
<apex:form id="theScriptException">
<apex:pageMessages >
</apex:pageMessages>
<script>
function openpopupWindowDeal(){
<!-- win1=window.open('/apex/DealEdit?retURL=/apex/PERScriptQ','Search','scrollbars=1,width=900,height=500'); -->
win1=window.open('/apex/DealEdit?','Search','scrollbars=1,width=900,height=500');
win1.focus();
win1=true;
//return false;
}
function openpopupWindowMA(){
win1=window.open('/apex/detailPage?','Search','scrollbars=1,width=900,height=900');
// win1.focus();
win1=true;
//return false;
}
</script>
<b>Note: </b><br/>
<b>- Prototype - Work in Progress.</b><br/>
<b>- Questions and Answers will become visible only when a Customer Transaction is created/linked</b>
<br/><br/>
<apex:pageblock rendered="{!legacyRecord}">
<font color="red" size="3px">
<apex:outputText >
Sorry, you cannot create a product pricing exception(legacy) record type.
</apex:outputText>
</font>
<apex:pageBlockButtons location="Bottom" >
<apex:commandButton action="{!cancel}" value="Back" id="thecancelbtn" />
</apex:pageblockButtons>
</apex:pageblock>
<apex:actionFunction name="preSend" reRender="thePanelWrapper,blockA,blockB,blockc,blockd" oncomplete="checkID('{!Sales_Exception__c.Quote_Proposal__c}')" /> <!-- {!Sales_Exception__c.Quote_Proposal__c} -->
<apex:inputfield value="{!Sales_Exception__c.Quote_Proposal__c}" id="d1" onchange="preSend()" >
<apex:outputLink id="theLink1" onclick="window.open('/apex/ManualAllocation?id={!QuoteIDValue}','_blank','width=810,height=310,toolbar=0,status=1,scrollbars=1,resizable=yes',!1);return false;" >Test Link
<script>
function checkID(param){
alert('Entering');
alert(param);
QuoteIDValue = param;
var reasonEle=document.getElementById('{!$Component.theLink1}').value; // blockB:pbs:pgblock:testid:rpt:theLink1
alert(reasonEle);
}
</script>
</apex:outputLink>
<!-- onclick="javascript:openpopupWindowDeal();"target="_blank" window.open('/apex/ManualAllocation','_blank','width=810,height=310,toolbar=0,status=1,scrollbars=1,resizable=yes',!1); rendered="{!if(cmap.Question_Type__c == 'Link',true,false)}"-->
</apex:repeat>
</apex:column>
</apex:datatable>
Ex:
url myurl = '/'+recordid
<apex:outputLink value="{!myurl}" id="theLink">www.salesforce.com</apex:outputLink>
this should solve your pblm.
thanks,
http://www.forcexplore.com/2014/07/wrapper-class-in-salesforce.html