title: How to use pagination with a controller in side show page of another controller?
body: <p>how can I use pagination with a controller in side show page of another controller 
  this is my code:</p>
  
  <pre><code>plan controller:
   def show = {
    if (!params.max) params.max = 4
    if (!params.offset) params.offset = 0
    def planInstance = Plan.get(params.id)
  
    def planVoiceServiceListCount  = PlanVoiceService.countByPlan(planInstance)
    def planVoiceServiceList = PlanVoiceService.findAllByPlan(planInstance, [max: params.max as Integer, offset: params.offset as Integer])
  
    if (!planInstance) {
     flash.message = "${message(code: 'default.not.found.message', args: [message(code: 'plan.label', default: 'Plan'), params.id])}"
     redirect(action: "list")
    }
    else {
  
     [planInstance: planInstance, 
      planVoiceServiceList: planVoiceServiceList, 
      planVoiceServiceListCount: planVoiceServiceListCount]
     }
   }
  </code></pre>
  
  <p>and plan\show.gsp:</p>
  
  <pre><code>&lt;div class="dialog"&gt;
    &lt;table align="left"&gt;
      &lt;thead&gt;
  
      &lt;tr&gt;      
        &lt;th&gt;${message(code:'plan.services.voice.label', default:'Voice Service Name') }&lt;/th&gt;
        &lt;th&gt;${message(code:'plan.services.voice.label', default:'Voice Service Description') }&lt;/th&gt;
        &lt;th&gt;${message(code:'plan.services.voice.maxsessions.label', default:'Max Simultaneous Calls') }&lt;/th&gt;
        &lt;th&gt;${message(code:'plan.services.voice.tariff.label', default:'Voice Tariff') }&lt;/th&gt;
        &lt;th&gt;${message(code:'plan.services.voice.services.label', default:'Calling Destination Group') }&lt;/th&gt;
        &lt;th&gt;${message(code:'plan.services.voice.services.label', default:'Plan Voice Service Minute') }&lt;/th&gt;
        &lt;th&gt;${message(code:'plan.services.voice.services.label', default:'Plan') }&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
      &lt;g:each in="${planVoiceServiceList}" status="i" var="planVoiceServiceInstance"&gt;
        &lt;tr class="${(i % 2) == 0 ? 'odd' : 'even'}"&gt;
          &lt;gsec:hasRole name='Administrator'&gt;  
          &lt;td&gt;&lt;gti:link controller = "planVoiceService" action="show" id="${planVoiceServiceInstance.id}"&gt;${fieldValue(bean: planVoiceServiceInstance, field: "voiceService.name")}&lt;/gti:link&gt;&lt;/td&gt;
          &lt;/gsec:hasRole&gt;
          &lt;gsec:hasRole name='Company'&gt;  
          &lt;td&gt;${fieldValue(bean: planVoiceServiceInstance, field: "voiceService.name")}&lt;/td&gt;
          &lt;/gsec:hasRole&gt;
           &lt;td&gt;${fieldValue(bean: planVoiceServiceInstance, field: "voiceService.description")}&lt;/td&gt;
          &lt;td&gt;${fieldValue(bean: planVoiceServiceInstance, field: "maxSessions")}&lt;/td&gt;
                  &lt;gsec:hasRole name='Administrator'&gt;         
          &lt;td&gt;&lt;g:link controller="voiceTariff" action="show" id="${planVoiceServiceInstance.voiceTariff.id}"&gt;${fieldValue(bean: planVoiceServiceInstance, field: "voiceTariff.description")}&lt;/g:link&gt;&lt;/td&gt;
    &lt;/gsec:hasRole&gt;
          &lt;gsec:hasRole name='Company'&gt;         
          &lt;td&gt;${fieldValue(bean: planVoiceServiceInstance, field: "voiceTariff.description")}&lt;/td&gt;
    &lt;/gsec:hasRole&gt;
          &lt;td&gt;${fieldValue(bean: planVoiceServiceInstance, field: "callingDestinationGroup.name")}&lt;/td&gt;
          &lt;td&gt;${fieldValue(bean: planVoiceServiceInstance, field: "planVoiceServiceMinute")}&lt;/td&gt;
  
  
          &lt;td&gt;${fieldValue(bean: planVoiceServiceInstance, field: "plan.description")}&lt;/td&gt;
  
  
        &lt;/tr&gt;
      &lt;/g:each&gt;
      &lt;/tbody&gt;
  
    &lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
    &lt;div  class="paginateButtons"&gt;
    &lt;g:paginate controller="plan" action="show" 
           total="${planVoiceServiceListCount}" 
           &gt;
    &lt;/g:paginate&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>what's error in my code?????? the data appers but when i click to go to second pagenation page null id error appears</p>