You need to sign in to do that
Don't have an account?
priya bhawna shetty
visulaforce page related:want to open opportunity page in new window
“hi guys
please help me out with this requiment
1.i displayed list of opportunity names&related stagenames in visualforce development mode,so now i want to navigate to detail page of that particular opportunity name ,when i clicked on it i want it to open in new tab.
heres my code.
please tell me how do i do this by using javascript or by command link:
PAGE:
<apex:page controller="opportunitydisplaycon9" id="thePage">
<apex:form >
<script>
function functioncall(){
window.open("");
actionfuncall();
</script>
<apex:dataTable value="{!opportunity}" var="opp" id="theTable" styleClass="tableClass">
<apex:facet name="caption">opportunity Details</apex:facet>
<apex:column id="columnid">
<apex:facet name="header">opportunity Name</apex:facet>
<a href="javascript:functioncall()">{!opp.name}</a>
<apex:actionFunction name="actionfuncall" action="{!actionfuncall1}" reRender="columnid"/>
</apex:column>
<apex:column >
<apex:facet name="header">opportunity stage</apex:facet>
<apex:outputText value="{!opp.stagename}"/>
</apex:column>
</apex:dataTable>
</apex:form>
</apex:page>
CONTROLLER;
public class opportunitydisplaycon9 {
public String getOpp() {
return null;
}
public pagereference actionfuncall1(){
return null;
}
public List<opportunity> opportunity;
public PageReference hitme() {
update opportunity;
return null;
}
public List<opportunity> getopportunity()
{
opportunity = [select name,stagename from opportunity limit 10];
return opportunity;
}
}
please help me out with this requiment
1.i displayed list of opportunity names&related stagenames in visualforce development mode,so now i want to navigate to detail page of that particular opportunity name ,when i clicked on it i want it to open in new tab.
heres my code.
please tell me how do i do this by using javascript or by command link:
PAGE:
<apex:page controller="opportunitydisplaycon9" id="thePage">
<apex:form >
<script>
function functioncall(){
window.open("");
actionfuncall();
</script>
<apex:dataTable value="{!opportunity}" var="opp" id="theTable" styleClass="tableClass">
<apex:facet name="caption">opportunity Details</apex:facet>
<apex:column id="columnid">
<apex:facet name="header">opportunity Name</apex:facet>
<a href="javascript:functioncall()">{!opp.name}</a>
<apex:actionFunction name="actionfuncall" action="{!actionfuncall1}" reRender="columnid"/>
</apex:column>
<apex:column >
<apex:facet name="header">opportunity stage</apex:facet>
<apex:outputText value="{!opp.stagename}"/>
</apex:column>
</apex:dataTable>
</apex:form>
</apex:page>
CONTROLLER;
public class opportunitydisplaycon9 {
public String getOpp() {
return null;
}
public pagereference actionfuncall1(){
return null;
}
public List<opportunity> opportunity;
public PageReference hitme() {
update opportunity;
return null;
}
public List<opportunity> getopportunity()
{
opportunity = [select name,stagename from opportunity limit 10];
return opportunity;
}
}
You can try to use ' _blank' to open a page in a new tab. For this you can use function as below: OpenInNewTab(url )
{
var win=window.open(url, '_blank');
win.focus();
}
Thanks
Vikash