0

I am newbie.

I have a Primefaces tab (1. Summary 2. Detail).

I am allowing user to search for the list of items and then in 1st tab, the primefaces datatable shows the results. Along with the table there is an extra column on which user clicks then it should retrieve the corresponding record detail line and also switch to the 2nd tab.

I am able to click on the extra column using Action and log the selected line and it also moves to the second tab. However it is not showing my primefaces datatable on the 2nd tab.

However, when I click on the 2nd tab manually, I can see the datatable and all the correct data.

<p:column width="30">  
<p:commandButton id="selectDetailCb" 
                     title="View detail"
                     oncomplete="tabViewV.select(2)"
         action="#itunesAnalysisToolMb.retrieveProductDetailRpt(itunesAnalysisToolSummaryV)}"
   icon="ui-icon-search" 
                                                     update=":itunesAnalysisToolForm:tabView:itunesAnalysisToolDetailDt">
                                    </p:commandButton>      
                                </p:column> 

/*
 * Retrieve the iTunes Analysis Tool detail for the selected product and for the selected time frame.
 */
public void retrieveProductDetailRpt(ItunesAnalysisToolSummary selectedProduct){

    log.debug(selectedProduct.getRank());
    log.debug(selectedProduct.getArtist());
    log.debug(selectedProduct.getTitle());
    log.debug(this.startReportDate);
    log.debug(this.endReportDate);
    log.debug(this.itunesProductTypeCode);

    //return "goToDetail";
}

In the background I am getting this message.

Mar 29, 2013 1:02:04 PM com.warnermusic.wis.util.JsfPhaseListener beforePhase INFO: RENDER_RESPONSE 6 Mar 29, 2013 1:02:04 PM com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback visit SEVERE: java.lang.NullPointerException Mar 29, 2013 1:02:04 PM com.warnermusic.wis.util.JsfPhaseListener afterPhase INFO: RENDER_RESPONSE 6

but no other errors.

Can you please help me and advise why I am not able to see the dataTable on the 2nd tab while clicking the commandbutton, but I can see when I actually move to the next tab manually.

Raidri
  • 17,258
  • 9
  • 62
  • 65
Chirag Jhaveri
  • 135
  • 2
  • 14
  • I don't see opening { in your script after #: action="#itunesAnalysisToolMb.retrieveProductDetailRpt(itunesAnalysisToolSummaryV)}" – Darka Mar 29 '13 at 08:16
  • There is an {. It's just I accidentally deleted while pasting code here. But in the actual code it is there. – Chirag Jhaveri Mar 31 '13 at 23:10
  • Not sure what is causing the issue. Can anyone please advise? How to refresh a dataTable on the second tab while clicking the command button on the first tab. – Chirag Jhaveri Mar 31 '13 at 23:11
  • another thing. I use action to go to another page. Maybe try actionListiner. Or maybe wrong update. – Darka Apr 02 '13 at 05:02

1 Answers1

0

The tabs are usually indexed from 0 to max-1. From the code you have posted seems that you are trying to access to the second tab but you shoud do oncomplete="tabViewV.select(1)".

If there is no more tabs, this exception is usually thrown.