On Mon, Jan 4, 2010 at 5:41 AM, Koen Deforche <[email protected]> wrote: > Hey, > > 2009/12/31 OvermindDL1 <[email protected]>: >> At that point path contains "/user/members". Then when you log in I call: >> setInternalPath("/not_exist", false); >> setInternalPath(path, true); >> The server is running again though if you want to see, just go to >> http://overminddl1.no-ip.info:8030/#/user/members and login with >> tester/tester and it will then change you to the member list >> immediately. However, if you change to the registration page first >> then back it changes so I cannot change it. I notice that the >> internalPath always seems to return "/" in the applications >> constructor, regardless of what is on the url, therefore I can only >> catch it in a callback later on it seems, such as when login occurs, >> but since by then it might have changed... > > When using the progressive bootstrap, then you will not see the anchor > (it is not sent to the server) until ajax is enabled. In that case it > does propagate the new path using an internal path change (are you not > seeing this behavior?). Otherwise, internalPath() should really return > the startup path by the time the application constructor is called. > >> So now I guess there is a new problem, how can I get the /user/members >> in the application constructor so that I can re-direct to that address >> when the user logs in later, even if they change paths before they log >> in? > > Disabling progressive bootstrap (if enabled?) should always result in > what you want. > >> And, how can I get whether setInternalPath was successful? I would >> prefer to know if it was or not so that if the path was still invalid >> then I can redirect to a different path that I know exists? It would >> be nice if it returned a bool indicating whether the path was >> successfully changed, or whether it fails (so that if you goto >> http://overminddl1.no-ip.info:8030/#/test and just like how the >> console log prints: >> [error] "WMenu: unknown path: 'test'" >> then I would like a return value from setInternalPath telling me that >> it failed so that I can display a related page instead). > > I have been thinking about how to implement something like this. > Unfortunately this does not fit very well with the distributed path > handling concept of Wt (where a widget may claim to process particular > paths), which is being propagated using the signals. > > The most straight forward method would be to add a > setInternalPathValid() method which may be used by a method handling > an internal path change that considers the path valid, which is then > checked after the internalPathChanged signal has been emitted. Then we > could add another signal (e.g. invalidInternalPath) which is emitted > when setInternlPathValid() was not called during an internal path > change. But still that seems quite complicated ? > > Alternatively, we would need some result propagating during our > signal/slot handling...
Boost::Signals supports returning values just fine, and can set it to stop execution of callbacks if one returns a specific value, and so forth, so you could have the callbacks for internal path return true if they handle it, or false if they do not. I have a few classes that handle the path themselves in their area (as my member list and profile display does so far). ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
