ServoyBrowser Bean problem and questions

Hello,
I’m Lavinia, I’m new to this forum. I came here hoping that maybe you can help me, or give me some ideas that could solve my problem.
I’m working on a project that involves google charts, technologies used for this project: servoy, postgresql, restful, php, javascript.
The browser bean is set to navigate to the page that renders/displays my chart. Everything works nice, with one exception. There is this control provided by google chart api (CategoryFilter) that filters the data that is displayed by the chart after a column of one’s choosing. Maybe you know that in order to create a google chart you need a DataTable (a two-dimensional, mutable table of values where each column as a data type, optional id and optional label).
The data that is used to populate the chart is a json object that looks somehow like this:
example:
{“cols”:[{“id”:“”, “label”:“Year”, “type”:“number”},
{“id”:“”, “label”:“Month”, “type”:“string”},
{“id”:“”, “pattern”:“”, “label”:“Internal Visit”, “type”:“number”},
{“id”:“”, “pattern”:“”, “label”:“External Visit”, “type”:“number”}],
“rows”: [{“c”:[{“v”:“2009”, “Ian”, “1”, “0”}],
{“c”:[{“v”:“2009”, “Feb”, “2”, “1”}],

]};
And I am using the column year, the first column (0) as a filter, in order to display data that belongs to a selected year, it’s a really nice filter but it won’t work properly in servoy. I’m not sure if it’s the browser bean or something else, but I’m inclining to think that there’s something with the browser bean.
So here it is what happens:
In Servoy 5.2 you can’t select something from the category filter by mouse only by keyboard (up and down arrows + enter), but sometimes it works to select something by mouse but only for a split of a second, so it’s quite impossible to reproduce that instance for debugging or anything of the sort, plus I noticed some really weird behavior, if by any chance I’m refreshing in the browser (any browser) the page I’m loading in the browser bean, and then select a random option and then I try to select again an option in the client using the mouse it will work but just for a second, then it stops working, I wish I had the chance to make a demo movie of that “phenomenon”, but it’s really difficult to make it happen again.

Then in Servoy 6, it’s the same story, you can’t select anything by mouse only by keyboard as mentioned above, but if I try to refresh the page in the browser and try to get the same phenomenon as I got in Servoy 5.2 by going back to the client and try to select something by mouse the select won’t even open unless I click anywhere inside the widget with the bean or anywhere on the client and then try to select again but still it won’t work by mouse.

At some point I was suggested to try an put all my javascript code in the header of my page, and so I did, but with no results, doing this didn’t influence how things work at all. So I am out of ideas.
I hope I have explained things clear enough. Sorry about the long post.

I have here a short movie of some behaviors in Servoy 6.
http://screencast.com/t/eVQmGCnH7x

And here is how it works in the browser:
http://screencast.com/t/xLDFrP7ME

this is the piece of javascript that creates the year picker
var yearPicker = new google.visualization.ControlWrapper({
‘controlType’: ‘CategoryFilter’,
‘containerId’: ‘control1’,
‘options’: {
‘filterColumnIndex’: 0,
‘ui’: {
‘labelStacking’: ‘vertical’,
‘allowTyping’: false,
‘allowMultiple’: false,
‘allowNone’: false,
‘label’: ‘Select year’
}
}
});

and here it is how it’s binded to the chart
dashboard = new google.visualization.Dashboard(document.getElementById(‘dashboard’));
dashboard.bind([yearPicker],[chart]);
dashboard.draw(json);
Does anyone have any idea what could cause this problem of not being able to select an option from this select/picker/filter using the mouse but only by keyboard?
Do you have any suggestions?
Am I missing something about the browser bean maybe an unchecked option?
I’d be really grateful for any information.
Thank you.

PS:
And there’s one other thing I noticed, there was this time when I had a console.log(json) line in my js file, I used that in order to see in the firebug how my json object looks like, and I kind of forgot to delete this line, and it caused some problems in servoy, because of that line nothing would show up in the bean (but a blank page) when it should have loaded the page with the chart, so I started to reopen my browser and see if everything works fine in firefox, and it worked, I opened chrome and it worked, I opened safari and it worked, I opened opera and it worked, I opened IE and it did not work, I got back to my js file and I commented most of the lines until I ran out of ideas and thought about commenting out the console.log line, then it worked both in IE and in the client(I kind of find it weird that a console.log line would cause a trouble like this and have a blank page displayed in my form).
So I thought that maybe the control that creates the select filter is also dependent on the browser so I tried to see if there is the same problem in IE and there was no such problem, I could select by mouse any option I wanted. IE is not my default browser, so then I don’t understand why the browser bean behaved and behaves as if IE was my default browser.

Hi Lavinia,

On Windows, the Native Browser used by the Browser Bean IS IE, whatever your default preferences are at the system level.
If you use Java 32-bit you can also use XULRunner, just make sure this is set in the server plugin properties (it should be by default) and that the bean property ‘forceNative’ is not checked, then you should be able to use XULRunner which is the engine Firefox is build on.
Beware that using XULRunner adds a big dependency, the engine itself will have to be installed on client’s computers and the size of it is between 13 and 22Mb (depending on the OS), also XULRunner doesn’t work with Java 64-bit.

So, if you keep using the default Native browser, and knowing that this default browser is IE, does your chart work in IE?
What version is this? If IE 8 or 9, have you tried also in compatibility mode?
I think that by default the BrowserBean will use the IE compatibility mode. You can force to use the installed IE, you can use the X-UA-Compatible trick, see http://msdn.microsoft.com/library/cc817574.aspx

If your page doesn’t work in compatibility mode, try to force IE8 or 9 by adding:

into the tag of your page.

Hope this helps,

Hello Patrick,

Thank you for the answer. I see, I was told that the browser bean should use the default browser but then I read the documentation and found out what I feared that it uses the native browser as you just mentioned.

So, if you keep using the default Native browser, and knowing that this default browser is IE, does your chart work in IE?

Yes my chart works perfectly in IE (even though there was that problem with the console.log line I mentioned in the ps part)
here: http://screencast.com/t/0KX1N4VxvZ
and this is in compatibility view:
http://screencast.com/t/I5wtuPhi
so the browser or the native browser is not the problem even though I thought that could be one at first.
My real problem is that in my servoy client in the browser bean, the controls do not work properly as shown here:
http://screencast.com/t/eVQmGCnH7x
it is not possible to select an option using the mouse, only with the up-down arrows + enter. any ideas what could cause this?

If you use Java 32-bit you can also use XULRunner, just make sure this is set in the server plugin properties (it should be by default) and that the bean property ‘forceNative’ is not checked, then you should be able to use XULRunner which is the engine Firefox is build on.
Beware that using XULRunner adds a big dependency, the engine itself will have to be installed on client’s computers and the size of it is between 13 and 22Mb (depending on the OS), also XULRunner doesn’t work with Java 64-bit.

about this, I’m afraid I haven’t used XULRunner so far, yet. and I could use some help, if you don’t mind. Would you be so kind and guide me?
Thank you

Have you tried putting or or meta http-equiv=“X-UA-Compatible” content=“IE=8” /> or ?

Also, it might well be that you are actually already using XULRunner.
You can easily know if this is the case by right clicking into the browser’s page, if the menu is the same one you have in IE, then you are using IE, otherwise this is XULRunner.

If you are using XULRunner, try forcing IE, by checking the ‘forceNative’ property (in the design properties of the bean). With forceNative checking you will be certain that the browser used will be IE, then you can try with the various X-UA-Compatible options, one of them should work.

Hope this helps,

Yes I have tried using the meta tags you mentioned.
But there is no problem of compatibility with the browser.
Maybe when I formulated my problem and my question I wasn’t clear enough.
The google charts together with the controls (which in this case is a select) work perfectly fine in any browser outside servoy and the browser bean.
In my project I have to show this charts in a servoy application. So for this I render the page with the charts in a servoy browser bean. And in this bean the control does not work when I try to select an option from it with the mouse, it only works if I use the up and down arrow from the keyboard + enter.
If you try for example to load this chart in a browser bean you’ll see the selects do not work if you try to select an option using your mouse, if you can please try it, I think it could give a better and clearer idea about what my problem is.
However there are google chart controls that work like this one (the range slider):
another chart
ps: in the last example you can find both controls (select + range slider)

I tested the first chart, in the browserbean, and the selects of the comoboboxes are working fine!
I don’t use Xulrunner, but just IE9, on Windows 7.

I just pasted this link intro the browserbean: http://savedbythegoog.appspot.com/retri … ample=true

That’s interesting for some reason, they don’t work for me …
I don’t use Xulrunner either and I have windows 7 too and IE9
I made a jing movie:
http://screencast.com/t/EMEPeox39P
in the first part I’m trying to show you that when I click any of the options it does not work
the other controller however works
and when I use the keyboard I can select option from the other controller
do you have any idea what could cause this?
it’s really weird that for me it’s not working and that it’s working for others

I really don’t know, I can select fine the options, in the combobox, and the chart IS changing, when I do that by mouse…
Are you using the latest browser suite?? (be aware, that if you install a new one, uninstall first!!)

I think I have an idea why this is happening now. I asked my colleagues to try the same link in the browser bean (I don’t know why I haven’t thought about this before) and it works for them too. Then we checked the java versions and they are using a different java version than me, I’m using version 7 update 2. They use version 6 update 27.
Can you please tell me what version of java you’re using?

ps: thank you all for your time :) and the answers

Java 1.6_30

as far as I know, is Servoy (and al his 3th-party plugins & beans) already certified for Java 1.7 ?? :)
Don’t think so…

I see now, thank you, that is the reason why it’s not working because my bean is not certified for the version of java I have currently installed on my computer.
Problem solved then :)
If there wasn’t someone to tell me that the charts actually work for them I wouldn’t have thought about this possibility.
Thanks, again.

I have yet another problem, the previous problem is solved now, I downgraded from java 7 to java 6 update 29
but now I have this:
http://screencast.com/t/u4UnYS7X
As you can see for some reason when I try to download the csv file the save dialog appears about 3 times even though I clearly clicked the save button
Then there’s another problem that’s not so obvious in this video and which I haven’t presented in it.
I’ll try to explain it. In my first download attempt I get a csv file with the data that is used for rendering the chart and so on for almost my every attempt. Yet, it happens most of the times that after I downloaded a csv file and I try to download another (from another page let’s say in the first case I downloaded the csv file for the members by year chart and the second one from the members by month chart) the file that gets downloaded is the one that was previously downloaded for some reason I don’t understand, I suppose it’s something related to cache, otherwise I have no idea what could it be (because the csv file gets rewritten each time a new chart is loaded).
The download works perfectly fine in any other browser but IE and the browser bean.
And one more thing: if I want to open the file and not save it, nothing happens and some times openoffice will give me an error message in a dialog that asks me if I want to submit the problem I encountered to oracle (this happens both in IE and browser bean).
I tried using XULRunner (I set it to true in servoy-admin) and yet the browser bean does not make use of it.

ps: I solved the problem with the cache by using these headers
header(“Pragma: public”);
header(“Expires: 0”);
header(“Cache-Control: must-revalidate, post-check=0, pre-check=0”);
header(“Cache-Control: private”, false);
header(“Content-Type: application/octet-stream”);
header(“Content-Disposition: attachment; filename="chart.csv";”);
header(“Content-Transfer-Encoding: binary”);

for some reason the problem with open file when nothing happened and openoffice crashed was also related to cache

the remaining problem is with the open/save dialog,
http://screencast.com/t/BU4sjMnG6Yu
as you can see you have to click open or save several times (I don’t think that’s ok, it can even be annoying)
maybe you could try it too and tell me how it works for your here: chart

anyone any ideas?
Thank you

To use XULRunner: Are you sure you installed the BrowserSuite with XULRunner (there is an option in the installer to not install it).
Also, when you do your tests, do you use java 64-bit? Because in 64-bit XULRunner will never be used…
And finally make sure the ‘forceNative’ flag is not checked in the design properties of the Browser Bean.

Thank you for your reply
Yes I am sure XULRunner is installed … to be sure I checked the faq documentation and it says

The XULRunner engine for all clients are installed in
Servoy/application_server/server/webapps/ROOT/browser_suite/xul/:
windows/
xulrunner.jar

so I checked this directory and it is there
I’ve also enabled XULRunner in servoy-admin>server plugins I set browsersuite.useXULRunner: to true, and just to be more than sure I also set browsersuite.silentXULInstall: to true (if it’s not install it should install it, though as I previously mentioned I had found the file mentioned in the faq)
I’m running java 32-bit, just checked it, I thought java was at fault again
And the “forceNative” flag is unchecked
And I’m out of ideas
I’m not sure which is better the xulrunner or using native browser, all I know is that the behavior I described in my previous post is annoying
I know that when I used servoy 5 nothing like that happened and the download manager was not alike IE’s it was using the firefox’s one, and I’m not sure what to do to make it work the same way in servoy 6

XULRunner is installed in the server, yet, but for client you should have a look in your user.home folder (c:/Users/YOURNAME/) and see if there is a .XULRunner_1.9.1.7 folder in there.

Yes it is there