• @Suresh.ax1214
  • NEWBIE
  • -1 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies

 i must use the action and rerender properties in command link.

this is my code:

 

Apex Page:

 

<apex:page sidebar="false" standardStylesheets="false" controller="LinkController">

<apex:outputPanel styleClass="app-icon" layout="block" id="app">
   <apex:form >
    <apex:commandLink action="{!Save}" reRender="app" value="rediff">
    
</apex:commandLink>
    </apex:form>
</apex:outputPanel>

</apex:page>

 

public class LinkController {

   public PageReference Save()

    {

String newPageUrl = 'http://www.rediff.com/';

   PageReference newPage = new PageReference(newPageUrl);

   newPage.setRedirect(true);

   return newPage;

    }
}

 

Thanx in advance

 i must use the action and rerender properties in command link.

this is my code:

 

Apex Page:

 

<apex:page sidebar="false" standardStylesheets="false" controller="LinkController">

<apex:outputPanel styleClass="app-icon" layout="block" id="app">
   <apex:form >
    <apex:commandLink action="{!Save}" reRender="app" value="rediff">
    
</apex:commandLink>
    </apex:form>
</apex:outputPanel>

</apex:page>

 

public class LinkController {

   public PageReference Save()

    {

String newPageUrl = 'http://www.rediff.com/';

   PageReference newPage = new PageReference(newPageUrl);

   newPage.setRedirect(true);

   return newPage;

    }
}

 

Thanx in advance

I have created a Visualforce page with a pageblock table and a couple of columns. The first column contains a apex:commandlink element. 
I put this VF-page as an inline VF-element in a page layout. Clicking the link will open the page in the iframe. It doesn't matter what I put in the 'target' attribute (_top, _blank etc.).
If I create a HTML link above the table in the same VF-page the target attribute works, i.e. the new page opens in the whole window or a new window. 

So this code works:
<a href="http://www.salesforce.com" target="_top">test</a>

 

But this does not:
<apex:form >
<apex:outputPanel id="mainOppNotes">
<apex:pageBlock title="Notes" mode="maindetail">
<apex:pageBlockTable value="{!MainOppNotes}" var="n">
<apex:column headerValue="Action" width="5%">
<apex:commandLink action="{!viewNote}" id="viewNote" rerender="mainOppNotes" value="View" styleClass="actionLink" target="_blank">
<apex:param name="noteId" assignTo="{!noteId}" value="{!n.Id}" />
</apex:commandLink>
</apex:column>
<apex:column headerValue="Name" width="65%">{!n.Title}</apex:column> 
<apex:column headerValue="Last Modified" width="30%"><apex:outputtext value="{!n.LastModifiedByName}" />,&nbsp;<apex:outputtext value="{!n.LastModifiedDateStr}" /></apex:column>
</apex:pageBlockTable>
</apex:pageBlock> 
</apex:outputPanel>
</apex:form >
 
Can I affect this in any way? Why does it work like this?
// Niklas

Hi

 

I have a working search page on my system. It works great, but we often want to click on a number of entries to view data, and not have to click back and then click on another item. We can of course right click and open in a new tab, but not all my users are that technical. I want to edit the following code so that when you click on the field on the page it will open in a new tab.

 

<apex:column >               

<apex:facet name="header">                   

<apex:commandLink value="Name" action="{!toggleSort}" rerender="results,debug">                       

<apex:param name="sortField" value="name" assignTo="{!sortField}"/>                   

</apex:commandLink>               

</apex:facet>               

<apex:outputlink value="/{!counselling_practice.id}">                   

<apex:outputField value="{!counselling_practice.name}"/>               

</apex:outputlink>           

</apex:column>

 

Any thoughts?

 

Thanks

 

Justyn

  • September 12, 2011
  • Like
  • 0