On Thu, Dec 31, 2009 at 1:51 AM, Koen Deforche <[email protected]> wrote:
> Hey,
>
> 2009/12/31 OvermindDL1 <[email protected]>:
>> I am attempting to change location when a certain even happens, it
>> should change to a different menu item.  As testing I have it go to:
>> /user/members
>>
>> When the event happens (in this case they click on a button), I call
>> setInternalPath("/user/members", true), with true to propagate it,
>> however this does nothing to the browser window, nothing changes.  I
>> then tried to redirect() to it using a bookmarkurl from that location,
>> that just causes the session to reset.
>
> That should work indeed.
>
> I cannot reproduce your problem with a test on the homepage (see patch
> in attachment) to switch from the Download to the Documentation using
> a push button ?

I apparently had some bad ordering through a signals callback, I
thought it called things in the order that they were registered, my
fault, inverting the order fixed that.  What I was actually doing is
that if you go to a subset of that site (for example, goto
http://overminddl1.no-ip.info:8030/#/user/members ) it will fail
because since you are not logged in yet, the menu does not exist, so I
store the path:
        const std::string path = internalPath();
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...

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?

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).

------------------------------------------------------------------------------
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

Reply via email to