How Should I Display a List of Items on My Model?

17 views
Skip to first unread message

Matt S.

unread,
Feb 11, 2013, 5:27:58 PM2/11/13
to fubumv...@googlegroups.com
So, I was browsing my page's source today, tracking down some other oddity, when I noticed that the properties I'm displaying in a list from my model are all wrapped with a span (cool), and all have an id attribute for the property's name (in this case, not cool). The issue is, it's a list of items, so there are multiple spans with the same ID. How should I be doing this? I see it's the default convention for DisplayFor.

Here is an example of my Spark view. Note, I'm using the overload of DisplayFor that accepts a model object to work on (not the view's model in this case).

<table id="products" class="data">
  <thead>
    <tr>
      <th>Name</th>
      <th>Price</th>
    </tr>
  </thead>
  <tbody>
    <tr each="var product in Model.Products">
      <td><Display model="product" property="Name" /></td>
      <td><Display model="product" property="Price" /></td>
    </tr>
  </tbody>
</table>

Should I be using something other than DisplayFor for this?

Joshua Arnold

unread,
Feb 11, 2013, 5:36:59 PM2/11/13
to fubumv...@googlegroups.com
Have you tried modifying the Display conventions?


--
You received this message because you are subscribed to the Google Groups "FubuMVC Development Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fubumvc-deve...@googlegroups.com.
To post to this group, send email to fubumv...@googlegroups.com.
Visit this group at http://groups.google.com/group/fubumvc-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Matt S.

unread,
Feb 11, 2013, 5:49:02 PM2/11/13
to fubumv...@googlegroups.com
No. I'm sure that would work though. I was just curious if I was using it in an unintended way from the norm.

Thanks, Josh!


-Matt
Reply all
Reply to author
Forward
0 new messages