Hi,
I would like to display on a web page vector-data of a single record
as in the C++ example below, and when the user pushes Next button
display the next record and when he pushes Prev button display
the previous record.
So this means IMHO dynamically generating the web page, isn't it?
Can this be done in tntnet?
I would very much appreciate it if someone could guide me
how to do that in tntnet, if possible w/o any other language like javascript
etc.
Thx in advance.
BTW, the records are not that much similar to each other as in
this example (in reality the records have differing number of fields),
ie. I think one cannot use a fixed template with some fixed fields;
I guess one has to create the web page anew for each record (?)...
//---- sample data to display on web page (1 record per page) -----
#include <vector>
#include <string>
#include <cstdio>
using namespace std;
struct SItem
{
string sTitle;
string sText;
SItem() { }
};
class CItems
{
public:
vector<SItem> vItem;
CItems()
{
// fill vector with test data:
for (int i = 0; i < 100; ++i)
{
SItem S;
char szTmp[256];
sprintf(szTmp, "Title %d", i), S.sTitle = szTmp;
sprintf(szTmp, "Text %d", i), S.sText = szTmp;
vItem.push_back(S);
}
}
};
CItems gC;
//--------
------------------------------------------------------------------------------
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general