Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring MVC moving to next record in list
    primarykey
    data
    text
    <p>I would like to move to the next record in a List that i am returning to a View. Under is an example of what i am trying to achieve i would like to return the second and third record in this list however i would like to return one record at a time from the list:</p> <p>This returns the last record in the List to the view:</p> <pre><code> model.addAllAttributes(citizenManager.getListOfCitizens(citizen)); </code></pre> <p>Using the under code does not compile: I get the following message 'The method addAllAttributes(Collection) in the type Model is not applicable for the arguments (Citizens)'</p> <pre><code>model.addAllAttributes(citizenManager.getListOfCitizens(citizen).get(2)); </code></pre> <p><strong>Jsp</strong> - just an example of the items on the form </p> <pre><code>&lt;form:form id="citizenRegistration" name ="citizenRegistration" method="POST" commandName="citizens" action="citizen_registration.htm"&gt; &lt;li&gt;&lt;form:label for="weight" path="weight"&gt;Enter Weight &lt;i&gt;(lbs)&lt;/i&gt;&lt;/form:label&gt; &lt;form:input path="weight" id="weight" title="Enter Weight"/&gt;&lt;form:errors path="weight" class="errors"/&gt; &lt;/li&gt; &lt;li&gt;&lt;form:label for="height" path="height"&gt;Enter Height &lt;i&gt;(feet)&lt;/i&gt;&lt;/form:label&gt; &lt;form:input path="height" id="height" title="Enter Height"/&gt;&lt;form:errors path="height" class="errors"/&gt; &lt;/li&gt; &lt;li&gt; &lt;form:label for="skinColorId" path="skinColorId"&gt;Select Skin Color&lt;/form:label&gt; &lt;form:select path="skinColorId" id="skinColorId" title="Select Skin Color"&gt; &lt;form:options items = "${skinColor.skinColorList}" itemValue="colorCode" itemLabel="colorDesc"/&gt; &lt;/form:select&gt; &lt;form:errors path="skinColorId" class="errors"/&gt;&lt;label class="colorPreviewer" id="skinColorPreviewer"&gt;color previewer&lt;/label&gt; &lt;/li&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload