I have a `p:datagrid` that contain some offers 

inside the `p:datagrid` there is a `p:commandLink` that will pass offer and redirect to onther page 

this is my xhtml 

```
<p:dataGrid lazy="true" var="offer" paginatorPosition="bottom" value="#{listCategoriesBean.OfferByCategory()}" columns="1"
        rows="5" paginator="true" id="OffersList" styleClass="listPage"
        paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  emptyMessage="#{msg['offersEmpty']}"    widgetVar="dtWv">

    <p:commandLink  styleClass="clickAll" action="#{navigationBean.ToMore()}"> 
        <f:setPropertyActionListener value="#{offer}" target="#{listCategoriesBean.offer}" />
        <i class="fa fa-plus"></i>
    </p:commandLink>
</p:dataGrid>

```

this is my bean

```
@SessionScoped
public class NavigationBean implements Serializable {
  public String ToMore() {
    return "/more.xhtml?faces-redirect=true";
  }
}

```

The problem is when click on the commandLink it only refresh the page
['https://Stackoverflow.com/questions/25834234', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3982495/']
(Copied from Answer, so (c) @naifsami)

I Solved the problem by workarround idea by using p:remotecommand outside the table and call the remotecommand from inside the table

```
<p:remoteCommand name="remoteCommandFunctionName"  action="#{listCategoriesBean.ToMore()}" />

    <p:dataGrid lazy="true" var="offer" paginatorPosition="bottom" value="#{listCategoriesBean.OfferByCategory()}" columns="1"
        rows="5" paginator="true" id="OffersList" styleClass="listPage"
        paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  emptyMessage="#{msg['offersEmpty']}"    >
 <p:commandLink  styleClass="clickAll"  type="button" onclick="remoteCommandFunctionName([{name:'n', value:'#{offer.id}'}])" > 
                            <i class="fa fa-plus"></i>
                        </p:commandLink>
</p:dataGrid>

```

my bean

```
public String ToMore() {
        String offerid="";
        FacesContext context = FacesContext.getCurrentInstance();
        Map map = context.getExternalContext().getRequestParameterMap();
        offerid=(String) map.get("n");
        offer1= newOfferServices.OfferByNumber(Integer.parseInt(offerid));
        setOffer(offer1);
        return "/more.xhtml?faces-redirect=true";
    }

```
You should get the desired result by navigating through the outcome attribute.

```html
<p:commandLink styleClass="clickAll" action="more.xhtml?faces-redirect=true">
  <f:setPropertyActionListener value="#{offer}" target="#{listCategoriesBean.offer}" />
  <i class="fa fa-plus"></i>
</p:commandLink>
```