Thanks replying.

This is my problem:
I have a menu with several items, one is Video, 
I added the Menu item like this:
mainMenu_ = new Wt::WMenu(contentsStack, contents);
mainMenu_->addItem(tr("video"), deferCreate(boost::bind(&Home::video,
this)));
in the video function:
Wt::WWidget *Home::video()
...
set the video up based on the path or combo boxes.
This is a modified wt-home example. 
where I have two WComboBox,Category and Video with a list of video's to
play, I change the WComboBox:
videoCombo->activated().connect(this, &Home::videoComboChanged);
where videoComboChanged has:
Wt::WApplication::instance()->setInternalPath("/video/" +
std::to_string(categoryCombo->currentIndex()) + "/" +
std::to_string(videoCombo->currentIndex()), true);
which sets the path to /video/1/2 for example, but the menu item /video
seems to be cached, since even clicking on a different menu item and
back on video does not make the page refresh, in fact the player is at
the same position, and continues to play even though I clicked on
another menu item, which is not what I want either, I want it to stop,
but that is another issue that needs to be addresses... How do I delete
the object if the menu changes? Maybe this is what the problem is, if I
delete the object, maybe it will recreate it, but I don't know the API
call to do that, and could not find it, or an example of how to do this,
you guys have a lot of examples, but they are far to simple, you need
real life examples so people like me have a chance at figuring things
like this out.

I don't see this cached feature in the API, but I can see why you would
want it for static content, but I need a way to override this behavior
for dynamic content, and that's where I am stuck, how do you do that?

my thought was that:
mainMenu_->addItem(tr("video"), deferCreate(boost::bind(&Home::video,
this)), WMenuItem::PreLoading);
that maybe it was the default of LazyLoading that was doing this, but
this did not work either, so I have no idea what this feature does
(Enumeration that determines when contents should be loaded. on first
use seems right, so this has nothing to do with my problem, but it seems
it needs more options, like to destroy the object on menu change),
calling the function directly is an ugly hack, but didn't work either.

Yes /video?v=1 is what I wanted, but what I go was duplicates
like /video?v=1&v=2&v=3, which is not what I wanted, but as you pointed
out /video/1 is a pretty URL, I do listen to InternalPathChange, but in
this case, I don't see how I can use it to override the cached behavior
of the Menu, without an ugly hack of logic, when I am sure there is a
way to override this behavior, I just don't see it in the API. 

I am very old school, still want to use queries to do things when I
don't need to, and still trying to learn this API, its like my problem
with the Popup menu, I don't see a way to handle a call back, and still
stuck on that problem.

Your example for the media http://www.webtoolkit.eu/widgets/media and
video http://www.webtoolkit.eu/widgets/media/wvideo player both keep
playing after a video is started, this is not good behavior, very bad in
fact, so maybe if you fix that example, you would see what I mean, you
need a call back to either delete the object or stop the video, in my
case deleting would be best, so at this point it looks like this is a
feature behavior that needs to be fixed.

Thanks

On Wed, 2014-02-26 at 10:36 +0400, Nagaev Boris wrote:

> Hello,
> 
> 1. "/video&v=1" looks incorrect URL. I think, you mean "/video?v=1"
> 
> 2. Using parameters in URL is not needed in Wt. It's better to use
> interla paths like "/video/1". If you want parameters, use WAnchor
> with WLink of type WLink::Url. To gat parameters values, use
> WEnvironment::getParameter. Remember parameters are not part of
> internal path, so you can not use them in setInternalPath.
> 
> 3. To change internap path, use app.setInternalPath. Pass
> emit_change=true to get signal internalPathChanged() signal fired.
> 
> 4. Listen signal internalPathChanged() with your custom function to
> react on internal path changes. By default, Wt application do nothin
> when internal path changes.
> 
> Regards,
> Boris Nagaev
> 
> 
> On Wed, Feb 26, 2014 at 7:10 AM, Jeffrey Scott Flesher Gmail
> <[email protected]> wrote:
> > Adding to my first question:
> > Further testing I see that the page is cached, so changing the internal path
> > did not cause the function to be called a second time, how do I change that
> > behavior?
> >
> > Since my page is based on the value of a combo box on that page, I need to
> > call the page again
> > http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WApplication.html#a2c1a10aadc0d7ed877b5715b42ca4911
> > says When emitChange is true, this signal is also emitted by setting the
> > path (but only if the path is actually changed).
> > but in my example below, the path would be changed, yet I also see that the
> > match much be exact "only an exact matching path is routed to the
> > application",
> > so this would not work.
> >
> > I did find ParameterMap, which lead me to this post
> > http://redmine.webtoolkit.eu/boards/2/topics/5836
> > which never got answered... but you say to use internal path, but I do not
> > understand how, in my example:
> > /video is the path to my function call,
> > v=1, or what ever value is stored in the combo box, would look like:
> > /video&v=1
> > what it sounds like you want is an internal path of:
> > /video/v/1
> > Is this Correct?
> > Because the documents state "only an exact matching path is routed to the
> > application"
> > Not sure why query is not preferred method, but there is no documentation
> > that I can find on how to use ParameterMap.
> >
> >
> >
> > ------------------------------------------------------------------------------
> > Flow-based real-time traffic analytics software. Cisco certified tool.
> > Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> > Customize your own dashboards, set traffic alerts and generate reports.
> > Network behavioral analysis & security monitoring. All-in-one tool.
> > http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
> > _______________________________________________
> > witty-interest mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/witty-interest
> >
> 
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to