Wtx ~ Wt Extension Library
WtxLib
Public Member Functions | List of all members
Wtx::Dbo::TableView< C > Class Template Reference

Dbo Table View. More...

#include <TableView.h>

+ Inheritance diagram for Wtx::Dbo::TableView< C >:

Public Member Functions

 TableView (Wtx::Dbo::Session *s)
 
 TableView (const std::string &viewDefName, Wtx::Dbo::Session *s)
 
 TableView (const Wtx::TableViewDef::ViewDef &viewDef, Wtx::Dbo::Session *s)
 
 TableView (const std::string &viewDefName, const Wtx::TableViewDef::ViewDef &viewDef, Wtx::Dbo::Session *s)
 
bool loadLayout (const std::string &name)
 
void saveLayout (const std::string &name)
 
Wtx::Dbo::Sessionsession () const
 
const std::shared_ptr< Wtx::Dbo::QueryModel< Wt::Dbo::ptr< C > > > & model () const
 
virtual void showHeaderPopup (const Wt::WMouseEvent &event)
 
std::string layoutName (const std::string &name) const
 
void refresh ()
 
void refreshSelected ()
 
const std::string & filter () const
 
void setFilter ()
 
void setFilter (const std::string &filter)
 
void setSearch (const std::string &search)
 
void setSubFilter (const std::string &filter)
 
const std::string & queryValue () const
 
void setQuery (const std::string &search="")
 
void setupLayout ()
 
int queryRowCount () const
 
int totalRowCount ()
 
Wt::Dbo::ptr< C > item (Wt::WModelIndex index)
 
void selectItem (Wt::Dbo::ptr< C > item)
 
Wt::Dbo::ptr< C > selectedItem ()
 
- Public Member Functions inherited from Wtx::TableView
Wtx::TableViewDefviewDef ()
 

Detailed Description

template<class C>
class Wtx::Dbo::TableView< C >

Dbo Table View.

Definition at line 68 of file TableView.h.

Member Function Documentation

template<class C >
void Wtx::Dbo::TableView< C >::setQuery ( const std::string &  search = "")
Todo:
fix this

BUGBUG: this will replace a single-quote character with a double-single-quote character. This is bad because the search string can still produce a sql-injection issue.

Todo:
fix this

BUGBUG: need to audit the 'search' string to make sure there is no risk of SQL injection. Or, instead of trying to parse the sql string if we can figure out how to call upon query.where().bind() repeatedly in seperate calls

When assigning this search to the regular filter, make sure the regular filter is wrapped with parenthesis so the logic doesn't get blown if there's more than one clause in the regular filter. Ideally you'd expect the author of the base filter to already wrap things in parenthesis, but we can't rely on it.

Todo:
add function to probe field defs for searchable fields

Definition at line 328 of file TableView_imp.h.


The documentation for this class was generated from the following files: