Hey Bin,
2008/10/11 Bin Tan <[EMAIL PROTECTED]>:
> It seems when javascript is disabled, the post action of forms uses
> relative urls rather than absolute ones.
>
> For example, if the following simple program is deployed at /cgi, the
> html will be is "<form method='post' action='cgi/clicked/?wtd=..."
> If you click repeatedly, the urls will become
> /cgi/clicked/?wtd=...
> /cgi/clicked/cgi/clicked/?wtd=...
> /cgi/clicked/cgi/clicked/cgi/clicked/?wtd=...
> /cgi/clicked/cgi/clicked/cgi/clicked/cgi/clicked/?wtd=...
True. I had not considered that. Fixed in CVS now.
> which doesn't seem right to me.
>
> #include <Wt/WApplication>
> #include <Wt/WPushButton>
> using namespace Wt;
>
> class Test: public WApplication{
> public:
> Test(const WEnvironment&);
> void OnClick();
> };
>
> Test::Test(const WEnvironment& env): WApplication(env){
> WPushButton *p = new WPushButton("click", root());
> p->clicked.connect(SLOT(this, Test::OnClick));
> }
>
> void Test::OnClick(){
> WApplication::instance()->setInternalPath("/clicked/");
Note that you are going to set the internal path one click "too late".
If you want to have the new path reflected at the moment you click,
you should use a WAnchor + setRefInternalPath().
We might one day avoid this problem by implementing the
Post/Redirect/Get idiom in which we redirect to the new internal path.
Regards,
koen
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest