Hello All
I have used the search query in database, Its working fine It show the
value from database.

void WtApplication::search()
{
 root()->addWidget(new  WText("Search"));
 nameEdit_ = new WLineEdit(root());
 WPushButton *b = new WPushButton("Find", root());
 b->setMargin(10, Left);
 b->clicked().connect(this, &WtApplication::find);
}
void WtApplication::find() {

               try {

              Transaction tt(session_);

colform collect = session_.find<form>("where dat like
?").bind("%"+nameEdit_->text()+"%").orderBy("dat");

                       for (colform::const_iterator i =
collect.begin(); i != collect.end(); ++i)

                      msg((*i)->store);
                       tt.commit();
                     } catch (...) {}
}

But my problem is that, when I click number of time on "find" button
Results  repeat  itself. I want to result show only one time. so
Please tell me how to reset the initial position or null value , Means
button are clicked number of times, but value are shown only one time,
Not repetition of same value.

I click two time hit button, It show the value two time.
Please see the screenshot on following link.

http://202.164.53.122/Screenshot.png

Here is my complete code

http://paste.ubuntu.com/732818/

Please help me.


-- 
Parvinder Rajput
website:- www.parvinder.co.in

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to