SkaiiNyght
SkaiiNyght

Reputation: 63

JSF DataTable will not display values

I have a <p:dataTable> in in an xhtml page. The table will not display the values for the backing bean. I have debugged to the point that I know that the getter for the bean is getting called, and I also know that there are items in this bean. Any ideas for why this is? Netbeans 7.3, JSF2.2, Tomcat 7, jdk1.7, primefaces 4.0.

Here is my table, this is inside of a form called 'mainForm'

<p:dataTable id="DTsamples" widgetVar="DTsamplesVw" var="sample" value="#{alterSampleController.samples}" 
                             filteredValue="#{alterSampleController.filteredSamples}" paginator="true" rows="20"
                             sortMode="multiple" scrollable="true" rowStyleClass="#{sample.rowColorByType}">

<p:column headerText="Lab Number" footerText="Lab Number" sortBy="labNumber" filterMatchMode="contains" filterBy="labNumber" filterMaxLength="20">  
                        #{sample.labNumber}                            
</p:column> 

<p:column headerText="Container ID" footerText="Container ID" sortBy="containerID" filterMatchMode="contains" filterBy="containerID" filterMaxLength="11">  
                        #{sample.containerID}                            
</p:column> 

<p:column headerText="Sample Type" footerText="Sample Type" sortBy="sampleType" filterMatchMode="contains" filterBy="sampleType" filterMaxLength="50">  
                        #{sample.sampleType}
</p:column> 

<p:column headerText="Field ID" footerText="Field ID" sortBy="fieldID" filterMatchMode="contains" filterBy="fieldID" filterMaxLength="150">  
                        #{sample.fieldID}
</p:column>

<p:column headerText="Sample ID" footerText="Sample ID" sortBy="sampleID" filterMatchMode="contains" filterBy="sampleID" filterMaxLength="150">  
                        #{sample.sampleID}
</p:column>

<p:column headerText="Grower" footerText="Grower" sortBy="grower" filterMatchMode="contains" filterBy="grower" filterMaxLength="50">  
                        #{sample.grower}
</p:column>

~~~A few other columns that don't contain data~~~~

</p:dataTable>

Here is a dialog that gets the results from a search

<h:form id="innerSearch"><p:dialog id="searchDialogID" widgetVar="searchDialog" header="Sample search" resizable="false" draggable="false" showEffect="puff"
                      hideEffect="puff" appendToBody="false" modal="true" rendered="#{alterSampleController.allowReading eq true}">

~~~Bunch of inputTexts and selectoneMenus to get search details                

<p:commandButton update=":mainForm" process="innerSearch" icon="ui-icon-search" value="Search" actionListener="#{alterSampleController.loadSearch}" oncomplete="searchDialog.hide()"/>

</p:dialog>
</h:form>

Relevant Backing Bean

@ManagedBean
@ViewScoped


public class AlterSampleController implements Serializable {    
private ArrayList<SampleAlter> _samples;
 private ArrayList<SampleAlter> _filteredSamples;

public void loadSearch() {
    UIComponent table = FacesContext.getCurrentInstance().getViewRoot().findComponent(":mainForm:DTsamples");
    table.setValueExpression("sortBy", null);
    if (_samples != null) {
        _samples.clear();
    }
    _samples = _saHelper.searchList(getSearch());


    }
    getAgronomers().clear();
    getGrowers().clear();
}
    public ArrayList<SampleAlter> getSamples() {
    return _samples;
}
    public ArrayList<SampleAlter> getFilteredSamples() {
    return _filteredSamples;
}


public void setFilteredSamples(ArrayList<SampleAlter> filteredSamples) {
    this._filteredSamples = filteredSamples;
}
}

Upvotes: 0

Views: 652

Answers (1)

SkaiiNyght
SkaiiNyght

Reputation: 63

I was using netbeans 7.3 and chose to update netbeans. I know normally this should not have any effect on the code whatsoever but it did; everything was working fine up until I updated. I had to do a complete uninstall and reinstall of netbeans. I wouldn't call this a solution, but if anyone else is running 7.3 did a recent update and everything stopped working try to do a complete uninstall and reinstall.

Upvotes: 0

Related Questions