Hi,

I did what I want using Javascript, But I wished if I could do it using 
Wt. I called the following method at appliction start

     this->addAutoJavaScript(
                 "$('input[type=text]').keydown(function(e){ "
                     "var next_idx = $('input[type=text]').index(this) + 
1; "
                     "var tot_idx = 
$('body').find('input[type=text]').length; "
                     "if(e.keyCode == 13){ "
                         "if(tot_idx == next_idx) "
                             "$('input[type=text]:eq(0)').focus(); "
                         " else "
                             "$('input[type=text]:eq(' + next_idx + 
')').focus(); "
                     "} "
                 "}); ");

Reference:
http://snipplr.com/view/53099/

Thanks,
Nasser

On 22 نوف, 2013 ص 02:38, Muhammad Nasser Al-Noimi wrote:
> Thanks you for reply, I did  this but it is not effective way I want
 > something more general.
 >
 > On 22 نوف, 2013 ص 01:18, Nagaev Boris wrote:
 >> Hello!
 >>
 >> You can connect each widget's enterPressed to setFocus of next
 >> widget manually.
 >>
 >> #include <Wt/WApplication> #include <Wt/WLineEdit> #include
 >> <Wt/WContainerWidget>
 >>
 >> using namespace Wt;
 >>
 >> class App : public WApplication { public: App(const WEnvironment&
 >> env): WApplication(env) { WLineEdit* le_1 = new WLineEdit(root());
 >> WLineEdit* le_2 = new WLineEdit(root());
 >> le_1->enterPressed().connect(le_2, &WFormWidget::setFocus); } };
 >>
 >> WApplication* createApp(const WEnvironment& env) { return new
 >> App(env); }
 >>
 >> int main(int argc, char** argv) { return WRun(argc, argv,
 >> &createApp); }
 >>
 >> Regards, Boris Nagaev
 >>
 >> On Fri, Nov 22, 2013 at 2:57 AM, Muhammad Nasser Al-Noimi
 >> <mnno...@gmail.com> wrote:
 >>> Hi,
 >>>
 >>> Is there any way to set Enter Key as Tab to Move Focus to next
 >>> Control? I tried to use globalEnterPressedbut I couldn't get next
 >>> control to make it focus.
 >>>
 >>> Thanks, Nasser
 >>>
 >>> 
------------------------------------------------------------------------------
 >>>
 >>>
Shape the Mobile Experience: Free Subscription
>>> Software experts and  developers: Be at the forefront of tech
 >>> innovation. Intel(R) Software Adrenaline delivers strategic
 >>> insight and game-changing conversations that shape the rapidly
 >>> evolving mobile landscape. Sign up now.
 >>> 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
 >>>
 >>>
_______________________________________________
>>> witty-interest mailing  list witty-interest@lists.sourceforge.net
 >>> https://lists.sourceforge.net/lists/listinfo/witty-interest
 >> 
------------------------------------------------------------------------------
 >>
 >>
Shape the Mobile Experience: Free Subscription
>> Software experts and  developers: Be at the forefront of tech
 >> innovation. Intel(R) Software Adrenaline delivers strategic insight
 >> and game-changing conversations that shape the rapidly evolving
 >> mobile landscape. Sign up now.
 >> 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
 >>
 >>
_______________________________________________
>> witty-interest mailing list  witty-interest@lists.sourceforge.net
 >> https://lists.sourceforge.net/lists/listinfo/witty-interest
 >>
 >



------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to