Calling more than one function in oninit

Hi,

Is it possible to call more than one function in oninit?

I would like to call the setCustomStyle and normalize functions, but even though normalize works fine on it’s own, when I add setCustomStyle, neither of them work.

Here’s the code I’m trying to use i.e. the same I would normally use in an event handler:

oninit=“tbMain.setCustomStyle(“tabMain”, “#E00000”, “#E00000”); tbMain.normalize();”

tbMain is the name of the tabbar
tabMain is the name of the tab

Debbie

Hi,

the use double quotes for both oninit attribute value and inside this value and that causes an error. Try to use single quotes inside the setCustomStyle to solve the problem:

oninit=“tbMain.setCustomStyle(‘tabMain’, ‘#E00000’, ‘#E00000’); tbMain.normalize();”

Hi Alexandra,

My bad. I translated it from the js function that I ended up trying, which still doesn’t work.

I have actually tried it with single quotes directly on the div tag, but it doesn’t work that way either, which is why I thought that putting the statements into a js function and calling that from the oninit event might work.

I’m getting a bit desperate now, because I’ve run out of ideas. Any other suggestions you can give that I could try would be very welcome.

Debbie

Hi,

that works locally. We need a demo to reproduce the problem.

You may also do the following:

oninit=“doOnInit()”