Project

General

Profile

Problem with using WComboBox and Binding WAudio

Added by Jeff Flesher about 8 years ago

My problem is that no matter how I bind the audio player, it causes the combobox to not work,

basically I have a page with a lot of Audio sources, and some text and images and I want a combobox menu system,

I have tried several different ways to do the same thing, and it fails every time, I am running the code on:

http://wittywizard.org/

You can see that the first time it works fine, but if you try to change the combobox, it fails, if I do not bind the tags it works fine,

the WidgetFunction does not really matter, I have tired many other ways to bind it, all fail.

Here is the source code, I made it minimal

http://wittywizard.org/resources/Audio.zip

I also attached file,

I made lots of comments to try to explain the problems,

in the function AudioManImpl::CreateAudio

I have a matrix that describes the problem

* useTemplate | useTemplateData | useWidgetFun | useWraper | Pass | Description
*     T       |        0        |    0         |    F      |  F   | Template - tag      - registerType & addFunction external
*     T       |        0        |    0         |    T      |  F   | Template - tag      - Wraper - registerType & addFunction external - Note: theme for Flash is not working
*     T       |        0        |    1         |    F      |  F   | Template - tag      - setTemplate (no type registered: audio)
*     T       |        0        |    2         |    F      |  T   | Template - tag      - WText (${widget:audio id='audio0' class='wtaudio' type='audio/mpeg' width='580' height='33' src='/resources/LaSera-NeverComeAround.mp3' altsrc='/resources/LaSera-NeverComeAround.mp3' title='La Sera - Never Come Around'})
*     T       |        1        |    2         |    F      |  T   | Template - HTML5    - WText
*     T       |        2        |    0         |    F      |  F   | Template - Full tag - registerType & addFunction external
*     T       |        2        |    0         |    T      |  F   | Template - Full tag - Wraper - registerType & addFunction external  - Note: theme for Flash is not working
*     F       |       NA        |    NA        |    NA     |  T   | Use Audio player directly
Audio.zip (14.9 KB) Audio.zip

Replies (6)

RE: Problem with using WComboBox and Binding WAudio - Added by Alex V almost 8 years ago

I have not run any of your code but I had a bit of a look through it.

For anyone to help more you need to give more details.

'It fails' is not a good enough explanation of what your problem is.

What I've written below is based on guesses.

From viewing your example site it appears that the program is crashing somewhere. If that is the case, then it should be straight forward to work out where the problem is by debugging it. or printing out messages and selectively disabling sections of code.

start by looking through

Wt::WWidget* AudioManImpl::GetTemplate()

We can help you more if you provide more information on what is actually the issue.

RE: Problem with using WComboBox and Binding WAudio - Added by Jeff Flesher almost 8 years ago

By failing I mean the Combobox does not work, which is obvious at the web site I posted this to, you can change it, but it does not change, nor does the program crash, so there is no messages to trace to a failure, it has something to do with the output of code to the browser, which is javascript, I am sure this is were I need to start, but my point is that this seems to be a bug in Wt, and not the code, since I have tried binding this in many different ways and all of them fail, the code also uses a line editor, which works fine, but switch it to an audio widget and it fails, and as I said, the code has a lot of remarks to prove my point, I do not have a Lack of information as you stated, I gave a lot of details and code to verify this, so what other information you need you will have to explain, because I thought I was being very specific, the combobox fails to work only when binding to an audio player, not a line editor or any other widget.

Thanks

RE: Problem with using WComboBox and Binding WAudio - Added by Alex V almost 8 years ago

Ok,

but what is actually happening is that the session is crashing.

I've gone through your code and what happens is that the session crashes returning this error:

"Wt: error during event handling: WAbstractMedia: error parsing: undefined"

I looked through the code in detail and have found that it appears to be some sort of bug with

Wt::WAudio::setId()

in combination with event handling.

I have created a minimal example of the problem.

to reproduce the problem run the code and change the combobox more than once.

if you avoid using Wt::WAudio::setId() the problem will go away in your code.

Kind regards,

Alex

RE: Problem with using WComboBox and Binding WAudio - Added by Jeff Flesher almost 8 years ago

Yes you are right, that is a bug and it could also cause the problems I am seeing, so I will address it first, thanks.

I do see that error, but after commenting out the setId, I still have the same problem, see here:

http://wittywizard.org/ww/audio/usetemplate/t/usetemplatedata/0/usewidgetfun/0/useWraper/f

Note I changed code so you can adjust the variables

I should also point out that in my code, you can use the option in the matrix to use the Audio Player Directly

Thanks

RE: Problem with using WComboBox and Binding WAudio - Added by Alex V almost 8 years ago

I compiled it after removing the calls to setId() in WidgetFunction::createAudio() and it worked for me.

I'm not sure if you intended to but you do have two references to setId() in that function.

L:186 if(!tagId.empty()) { audio->setId(tagId); }

L:214 if(!tagTitle.empty()) { audio->setId(tagTitle); }

I've also created a new Issue for the bug

http://redmine.webtoolkit.eu/issues/3531

I am using wt version 3.3.3

what version are you using?

RE: Problem with using WComboBox and Binding WAudio - Added by Jeff Flesher almost 8 years ago

Wt 3.3.3

I did not catch my mistake with Title, it was a cut and paste error, WAudio has no Title, I create that for the flash fall back support, now it works, I am getting new glasses soon.

Thanks.

    (1-6/6)