Focal Point
[SOLVED] Button Color IE or Chrome

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3177077076

May 20, 2014, 03:05 PM
Jay Potter
[SOLVED] Button Color IE or Chrome
I presently have javascript executing a certain set of commands based on the color of the button. I am tryning to get this code to work for both IE and Chrome.

For IE I am using the following commands.

var b1 = IbComposer_getComponentById('button1');

if (b1 !== null && b2.style.color == "#9fff41") {
b1.onclick("left");
}

For Chrome I am using the following commands.

var b1 = IbComposer_getComponentById('button1');

if (b1 !== null && b1.style.color == 'rgb(159, 255, 65)' ) {
b1.onclick("left");
}

It appears that if I want to accommodate both at the same time, I would have to use the following.

var b1 = IbComposer_getComponentById('button1');

if (b1 !== null && (b1.style.color == 'rgb(159, 255, 65)' || b2.style.color == "#9fff41")) {
b1.onclick("left");
}

Is there a way to have both IE and Chrome pass the same value, so that I do not have to look for both?

This message has been edited. Last edited by: Jay Potter,


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
May 20, 2014, 06:20 PM
Francis Mariani
Jay, this is a browser idiosyncrasy.

Try this: using the text editor, add a valid HTML5 doctype to the top of the code, this seems to resolve the browser issue in IE 9.

<!DOCTYPE html>


Save the page.

The page can be opened in the HTML Composer GUI, but you will have to remember that after saving from the GUI, edit the page in the text editor and remove the first line which is a comment line that is added by the GUI, rendering the page non standard. This will have to be done every time you use the GUI to edit the page.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
May 21, 2014, 07:35 AM
Jay Potter
Thank You for the suggestion.

It does work, but I do not like playing the game of having to take something out evry time I add change to the form. Plus if I have a problem with the form, support will not help when making it non standard.


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
May 21, 2014, 08:51 AM
Tony A
Jay,

Checking on colours is always a dubious test - although I have encountered it in some Customer code.

I would rather see a test on a class inclusion than for a specific colour - primarily for the problem that you are relating. It's safer and means that you shouldn't need to keep changing code outside of the GUI.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
May 21, 2014, 09:53 AM
Jay Potter
I will look into that concept,

Thank you for that suggestion.


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
May 21, 2014, 10:57 AM
Francis Mariani
I'll stop changing the code outside the GUI once IBI truly creates HTML 5 compliant code. As far as I know, WebFOCUS 8.0.0.7 Composer does not do this yet.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
May 21, 2014, 12:51 PM
Jay Potter
Unfortunately you are correct!!!!


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster