[Cppcms-users] Using nested structures in views
Brought to you by:
artyom-beilis
|
From: Ronnie C. <ron...@db...> - 2013-07-09 10:25:49
|
Hi
I'm trying to use a nested structure in a view for a table
struct dbaxtrade : public cppcms::base_content {
struct data {
std::string name;
double vega;
};
std::string id;
std::string dbax_str;
std::list<data> components;
};
And in my template
<% view dbaxview uses VegaData::dbaxtrade %>
...
<% foreach component in components %>
<tr>
<% item %>
<td><%= name &></td>
<td><%= vega %></td>
<% end %>
</tr>
<% end foreach %>
<tr>
<%= dbax_str %>
</tr>
<% end foreach %>
But this does not seem to compile with an error 'vega' is not a member of
dbaxtrade. That make sense, but I can't seem to include multiple structues
in the 'uses' statement.
What's the approach to this?
|