Is there a way to get the web browser name and version that the client is using?
Might it work to code custom html incorporating a javascript in an html area field, such as can be found at http://www.echoecho.com/jsbrowserdetection01.htm … this tutorial may well be way beneath your skill level, Westy – no insult intended, it actually represents my own continuing self-education on js and the possiblities of interplay between custom js code and the web client. Concept untested!
kazar
Yes, it appears that their browser detection code along with their if-statement examples will allow redirection to alternative urls based on the browser that is being used. The url can then open webclient and execute a method that places the appropriate browser information into a login table. That should work as long as the user does not have script blocking turned on. Thank you for bringing this example to my attention.
Dean
A problem you might run into, Westy, is that - at least in the limited understanding of js I’ve gained thus far - a browser-detection script must be in the .
After taking an only semi-educated peek at the html generated by web client, it looks to me like anything in the head is purely Servoy-generated and anything you put on the Servoy form is in the . So you may need to manually add an include tag in the and do the browser-detection code as a text doc in the web directory … or simply paste the whole script manually into the , and you’ll have to do this (again, as I understand it) each time you might revise the form in question in Servoy (since Servoy will then overwrite the html page with the new version, thereby removing any of your custom mods), rather than inside an html area field.
Perhaps a very nice addition to Web Client Future would be the ability to add custom code to all the DOM objects.
kazar
In our situation I do not think what you describe will be a problem because we can just create a regular html page that gathers the needed information and then calls webclient via a url.
I’m really curious to know how the values that are gathered in a non-WebClient html window are then passed to Servoy? I’m attempting to get up to speed on what the possibilities are for integrating Web Client with larger sites (i.e., involving pages not generated by WC). If you set a cookie can a WC form/page read it? Or do you use php to send a value to the back end, then have Servoy read it?
I’m having trouble (obviously!) envisioning how this would be accomplished.
kazar
Using the conditional statement from the example from the URL that you provided above, you could redirect to URL A if Internet Explorer or URL B if Firefox.
URLs A and B would each be a link to webclient that includes a call that executes a method. So if the conditional redirects to URL A, then the method executed by that URL would place some words like “Internet Explorer” into a login table column (or where ever you want it). If it redirects to URL B, then the method executed by calling that URL would place a word like “Firefox” into the appropriate login table column.
The following is an example of a webclient URL that executes a method named ‘do_it’:
http://ipaddress:8080/servoy-webclient/solutions/solution/solutionnamehere/method/do_it
There are probably also other ways to do this.
Dean
Thanks, Dean, I understand the theory of it now. The piece that’s still missing in my brain is how you would execute a method via code submitted from an html page, in a Servoy solution that requires log-in, before the user is logged in. If there is no Servoy session yet for that user I’m surprised that a method could be executed (seems like a security hole if it can). Well, I’m sure there is some complexity in the set-up that is just beyond my current level of deployment experience.
thanks again,
kazar
Depends on whether Servoy’s security is being used or if you are rolling your own security.
Ahhh. Well, I guess this scenario, then, is one instance in which the ability to specify a log-in form which a user cannot “get past” until properly logged in would NOT be usable. Unless we could add code to the object. Maybe I’ll stop jabbering and just post the suggestion in the right place!
kazar
There is a pretty thorough article on browser detection, including how to get all kinds of specs about the user’s machine (screen res, cookies enabled, is Java enabled) at http://www-128.ibm.com/developerworks/w … index.html