Search code examples
javajmesa

jmesa: row unique property value is null


I am trying out jmesa.

In jmesa, I am creating a worksheet. However, I am getting this error which isn't telling me much.

java.lang.IllegalStateException: The row unique property value is null! You need to specify the uniqueProperty on the row.

Here's my code.

 <jmesa:tableModel
                id="tag"
                items="${people}"
                var="bean"
                editable="true"
                >
                <%--editable="true"--%>
            <jmesa:htmlTable caption="People you may know" width="900px" >

                    <jmesa:htmlRow>

                        <jmesa:htmlColumn property="selected" editable="true"
                                          worksheetEditor="org.jmesa.worksheet.editor.CheckboxWorksheetEditor" title="selected" filterable="false" sortable="false"/>

                        <jmesa:htmlColumn property="firstName" editable="false"/>
                        <jmesa:htmlColumn property="lastName" title="Last Name" editable="false"/>
                        <jmesa:htmlColumn property="phone" title="Phone Number" editable="false"/>
                        <jmesa:htmlColumn property="address" title="Address" sortable="false" style="address" />

                    </jmesa:htmlRow>
            </jmesa:htmlTable>
        </jmesa:tableModel>
    </form>

Solution

  • This solution involved 3 parts. I needed to:

    • Add this property to the <jmesa:htmlRow> tag: uniqueProperty="id",
    • Add a property called "id" to the Person class, which is a unique identifier for that class.
    • Add the WorksheetServlet to my web.xml file, per the tutorial's instructions.