Background-color bound field not working.

Use this board to ask questions or have discussions with other Rich Displays users.
bluttman
Profound User
Posts: 35
Joined: Mon Feb 20, 2012 6:45 pm
First Name: Brian
Last Name: Luttman
Company Name: BEPCO, Inc.
Contact:

Background-color bound field not working.

Post by bluttman »

Trying to change the background color of a textbox field using a bound variable on the background-color attribute. I've done it elsewhere in other programs but can not get it to work on any fields in a new program.

Has anybody had an issue like this?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Background-color bound field not working.

Post by Scott Klement »

By default, a textbox is given a CSS class of 'input' (see the CSS class property of the textbox widget.) This default CSS class applies a background-image to the textbox, which takes precedence over the "background color". That's why you don't see the color.

A simple solution is to set the 'background image' property of your textbox to "none". (This will take precedence over the 'input' class, and therefore will not show the image, and your color will be visible instead.)

Or, an alternate solution is to create your own CSS class to use instead of the default 'input' class.
bluttman
Profound User
Posts: 35
Joined: Mon Feb 20, 2012 6:45 pm
First Name: Brian
Last Name: Luttman
Company Name: BEPCO, Inc.
Contact:

Re: Background-color bound field not working.

Post by bluttman »

I had already removed the css class. But I just tried setting the background-image: none. Still not working. The odd things is the "background-color" attribute is not even being applied when the field is viewed via F12 Developer tools in IE. Odder still is that I'm doing the same technique in other programs...
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Background-color bound field not working.

Post by Scott Klement »

Could it be something as simple as having another copy of the display file that's taking precedence in your library list?
bluttman
Profound User
Posts: 35
Joined: Mon Feb 20, 2012 6:45 pm
First Name: Brian
Last Name: Luttman
Company Name: BEPCO, Inc.
Contact:

Re: Background-color bound field not working.

Post by bluttman »

No, double-checked just to be sure. Actually, neither the background-color or Tool Tip bound attributes are being applied.

Image
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Background-color bound field not working.

Post by Scott Klement »

The screenshot you've provided shows your file in the Visual Designer. I hope you understand that when you bind a background color to a variable, it will not show in the Visual Designer. It should show at run-time -- but not in the designer because your RPG program has to provide it with a color value, and the Visual Designer doesn't run your RPG program.

Assuming you have the same problem at run-time, could you please press Ctrl-F9 to create a JSON screen dump? This is much more useful to me than a picture of the screen, because it lets me "replay" the screen on my computer, and then I can look at the actual code running and see what's happening.

So, at run-time, please press Ctrl-F9 and post the resulting file ('json.txt') here. Thanks!
bluttman
Profound User
Posts: 35
Joined: Mon Feb 20, 2012 6:45 pm
First Name: Brian
Last Name: Luttman
Company Name: BEPCO, Inc.
Contact:

Re: Background-color bound field not working.

Post by bluttman »

Not sure how to attach the json file but here goes...

Code: Select all

{"success":true,"version":"4.8.0","psid":"6AD1D353D7EF19D8ACA18A012FA31A60367DFAE88285B6428E9219FB65FFA2A3","appJob":{"auth":"6AD1D353D7EF19D8ACA18A012FA31A60367DFAE88285B6428E9219FB65FFA2A3","user":"BLUTTMAN","sysTime":1411420150,"decimalFormat":" ","curSym":"$","dateSeparator":"/","timeSeparator":":","dateFormat":"*MDY","secLevel":0,"sysName":"S108F764"},"layers":[{"formats":[{"name":"CTL2","file":"IMFT51D","library":"IMSOBJECT","fileId":1,"active":true,"errors":[{"msg":"Please enter a batch name.                                                      \r\nPlease enter a batch description.                                               \r\n"}],"ref":{},"data":{"BTNACCEPT":"1","BTNEXIT":"0","CLRSFL21":"0","DSPCTL2":"1","DSPSFL21":"1","SFL21RRN":"4","VDERRMSG":"","VDERROR":"","VDMEMBR":"","VDMEMBR_E":"","VDMEMBR_T":"","VDTEXXT":"","VDTEXXT_C":"","VDTEXXT_T":""},"subfiles":{"SFL21":{"ref":{},"field names":["S21COND","S21DESCRP","S21INVCOD","S21JOINTS","S21MCFILM","S21PRPDES","S21SERIAL","S21TINKEY","S21UNITS"],"data":[["A","2.375 4.70 J55 EUE IPC GENERIC","20230025","-1","242","KEYSTONE HOLT UNIT            |0816202","","1001","-32.00"],["A","2.375 4.70 J55 EUE IPC GENERIC","20230025","1","242","KERMIT YARD, WTD              |KT","","2001","32.00"],["E","2.375 4.70 J55 EUE IPC GENERIC","20230025","-4","242","KEYSTONE HOLT UNIT            |0816202","","1002","-126.00"],["E","2.375 4.70 J55 EUE IPC GENERIC","20230025","4","242","KERMIT YARD, WTD              |KT","","2002","126.00"]]}},"metaData":{"screen":{"record format name":"CTL2","external javascript":"/profoundui/userdata/bassjs/bopco/imft51.js","disable enter key":"true","error message":{"fieldName":"VDERRMSG","dataLength":"800","trimLeading":"false","trimTrailing":"true","blankFill":"false","rjZeroFill":"false","dataType":"char","formatting":"Text","textTransform":"none"},"error condition":{"fieldName":"VDERROR","customTrue":"","customFalse":"","dataType":"indicator","formatting":"Indicator","indFormat":"1 / 0"},"error enhanced mode":"0","error messages":"1 message","external css":"/profoundui/userdata/basscss/bopco/ims.css","id":"Label3"},"items":[{"id":"screen","field type":"layout","left":"0px","top":"0px","template":"simple container","height":"100%","width":"100%","overflow x":"auto","overflow y":"auto"},{"id":"header","field type":"layout","left":"1%","top":"1%","template":"css panel","body theme":"C - Gray","height":"98%","width":"98%","z index":"8","has header":"false","straight edge":"all","min height":"700px","min width":"1300px","layout":"screen","container":"1"},{"id":"logo_copy","field type":"image","image source":"/profoundui/userdata/images/logos/Field-Trans Logo.png","left":"5px","top":"5px","height":"55px","width":"55px","layout":"header","container":"1"},{"id":"Label3_copy","field type":"output field","value":"Create Transfer Batch","color":"#0500ff","font size":"50px","font style":"italic","text align":"left","left":"60px","top":"5px","height":"55px","width":"665px","layout":"header","container":"1"},{"id":"btnAdd","field type":"graphic button","value":"Accept","top":"5px","width":"122px","image source":"/profoundui/proddata/images/icons/add.png","color":"#70b859","font weight":"bold","response":{"fieldName":"btnAccept","customTrue":"","customFalse":"","dataType":"indicator","formatting":"Indicator","indFormat":"1 / 0"},"right":"50px","layout":"header","container":"1"},{"id":"btnExit","field type":"image","top":"5px","image source":"/profoundui/proddata/images/buttons/close/x5.png","click image source":"/profoundui/proddata/images/buttons/close/x5_click.png","cursor":"pointer","bypass validation":"true","response":{"fieldName":"btnExit","customTrue":"","customFalse":"","dataType":"indicator","formatting":"Indicator","indFormat":"1 / 0"},"right":"5px","min height":"25px","min width":"25px","layout":"header","container":"1"},{"id":"navbar","field type":"layout","top":"75px","height":"75px","width":"98%","template":"css panel","left":"1%","has header":"false","body theme":"B - Blue","straight edge":"all","layout":"header","container":"1"},{"id":"body","field type":"layout","left":"1%","top":"150px","template":"css panel","body theme":"B - Blue","height":"calc(98% - 150px)","width":"98%","z index":"8","has header":"false","straight edge":"all","layout":"header","container":"1"},{"id":"subfile","field type":"layout","top":"1%","height":"98%","width":"98%","template":"css panel","left":"1%","has header":"false","body theme":"C - Gray","straight edge":"all","layout":"body","container":"1"},{"id":"Label1","field type":"output field","css class":"label","value":"Batch Name:","left":"145px","top":"25px","width":"150px","layout":"navbar","container":"1"},{"id":"VDMEMBR","field type":"textbox","value":{"fieldName":"VDMEMBR","dataLength":"8","trimLeading":"false","trimTrailing":"true","blankFill":"false","rjZeroFill":"false","dataType":"char","formatting":"Text","textTransform":"none","designValue":"[VDMEMBR]"},"left":"300px","top":"25px","text transform":"uppercase","background color":{"fieldName":"VDMEMBR_E","dataLength":"10","trimLeading":"false","trimTrailing":"true","blankFill":"false","rjZeroFill":"false","dataType":"char","formatting":"Text","textTransform":"none"},"tool tip":{"fieldName":"VDMEMBR_T","dataLength":"80","trimLeading":"false","trimTrailing":"true","blankFill":"false","rjZeroFill":"false","dataType":"char","formatting":"Text","textTransform":"none","designValue":"[VDMEMBR_T]"},"width":"150px","layout":"navbar","container":"1","background image":"none","z index":"22"},{"id":"Label2","field type":"output field","css class":"label","value":"Description:","left":"480px","top":"25px","width":"105px","layout":"navbar","container":"1"},{"id":"VDTEXXT","field type":"textbox","value":{"fieldName":"VDTEXXT","dataLength":"30","trimLeading":"false","trimTrailing":"true","blankFill":"false","rjZeroFill":"false","dataType":"char","formatting":"Text","textTransform":"none","designValue":"[VDTEXXT]"},"left":"590px","top":"25px","text transform":"uppercase","background color":{"fieldName":"VDTEXXT_C","dataLength":"10","trimLeading":"false","trimTrailing":"true","blankFill":"false","rjZeroFill":"false","dataType":"char","formatting":"Text","textTransform":"none"},"tool tip":{"fieldName":"VDTEXXT_T","dataLength":"80","trimLeading":"false","trimTrailing":"true","blankFill":"false","rjZeroFill":"false","dataType":"char","formatting":"Text","textTransform":"none","designValue":"[VDTEXXT_T]"},"width":"300px","layout":"navbar","container":"1","background image":"none","z index":"21"},{"id":"SFL21","field type":"grid","css class":"crystal-grid","left":"0px","top":"0px","number of rows":"28","number of columns":"9","column widths":"78,71,368,96,269,88,88,102,145","column headings":"IMS ID,Seq,Property,Stock Item#,Description,Condition,Joints,Quantity,Serial#","header height":"26","row height":"20","height":"566px","width":"1306px","record format name":"SFL21","expand to layout":"true","text align":"center,center,left,left,left,center,right,right,left","header text align":"center","layout":"subfile","container":"1","display subfile":{"fieldName":"DSPSFL21","customTrue":"","customFalse":"","dataType":"indicator","formatting":"Indicator","indFormat":"true / false"},"display control record":{"fieldName":"DSPCTL2","customTrue":"","customFalse":"","dataType":"indicator","formatting":"Indicator","indFormat":"true / false"},"clear subfile":{"fieldName":"CLRSFL21","customTrue":"","customFalse":"","dataType":"indicator","formatting":"Indicator","indFormat":"true / false"},"subfile record number":{"fieldName":"SFL21RRN","dataLength":"5","decPos":"0","numSep":"false","zeroBalance":"false","numBlankFill":"false","zeroFill":"false","curSym":"","dataType":"zoned","formatting":"Number","negNum":"-999.00","units":""},"has header":"true","sortable columns":"true","resizable columns":"true","movable columns":"true"},{"id":"S21MCFILM","field type":"output field","css class":"gridoutput","value":{"fieldName":"S21MCFILM","dataLength":"11","decPos":"0","numSep":"false","zeroBalance":"false","numBlankFill":"false","zeroFill":"false","curSym":"","dataType":"zoned","formatting":"Number","negNum":"-999.00","units":"","designValue":"[S21MCFILM]"},"grid":"SFL21","column":"0"},{"id":"S21TINKEY","field type":"output field","css class":"gridoutput","value":{"fieldName":"S21TINKEY","dataLength":"5","decPos":"0","numSep":"false","zeroBalance":"false","numBlankFill":"false","zeroFill":"false","curSym":"","dataType":"zoned","formatting":"Number","negNum":"-999.00","units":"","designValue":"[S21TINKEY]"},"grid":"SFL21","column":"1"},{"id":"S21PRPDES","field type":"output field","css class":"gridoutput","value":{"fieldName":"S21PRPDES","dataLength":"40","trimLeading":"false","trimTrailing":"true","blankFill":"false","rjZeroFill":"false","dataType":"char","formatting":"Text","textTransform":"none","designValue":"[S21PRPDES]"},"grid":"SFL21","column":"2"},{"id":"S21INVCOD","field type":"output field","css class":"gridoutput","value":{"fieldName":"S21INVCOD","dataLength":"8","decPos":"0","numSep":"false","zeroBalance":"false","numBlankFill":"false","zeroFill":"false","curSym":"","dataType":"zoned","formatting":"Number","negNum":"-999.00","units":"","designValue":"[S21INVCOD]"},"grid":"SFL21","column":"3"},{"id":"S21DESCRP","field type":"output field","css class":"gridoutput","value":{"fieldName":"S21DESCRP","dataLength":"30","trimLeading":"false","trimTrailing":"true","blankFill":"false","rjZeroFill":"false","dataType":"char","formatting":"Text","textTransform":"none","designValue":"[S21DESCRP]"},"grid":"SFL21","column":"4"},{"id":"S21COND","field type":"output field","css class":"gridoutput","value":{"fieldName":"S21COND","dataLength":"1","trimLeading":"false","trimTrailing":"true","blankFill":"false","rjZeroFill":"false","dataType":"char","formatting":"Text","textTransform":"none","designValue":"[S21COND]"},"grid":"SFL21","column":"5"},{"id":"S21JOINTS","field type":"output field","css class":"gridoutput","value":{"fieldName":"S21JOINTS","dataLength":"4","decPos":"0","numSep":"false","zeroBalance":"false","numBlankFill":"false","zeroFill":"false","curSym":"","dataType":"zoned","formatting":"Number","negNum":"-999.00","units":"","designValue":"[S21JOINTS]"},"grid":"SFL21","column":"6"},{"id":"S21UNITS","field type":"output field","css class":"gridoutput","value":{"fieldName":"S21UNITS","dataLength":"15","decPos":"2","numSep":"false","zeroBalance":"false","numBlankFill":"false","zeroFill":"false","curSym":"","dataType":"zoned","formatting":"Number","negNum":"-999.00","units":"","designValue":"[S21UNITS]"},"grid":"SFL21","column":"7"},{"id":"S21SERIAL","field type":"output field","css class":"gridoutput","value":{"fieldName":"S21SERIAL","dataLength":"25","trimLeading":"false","trimTrailing":"true","blankFill":"false","rjZeroFill":"false","dataType":"char","formatting":"Text","textTransform":"none","designValue":"[S21SERIAL]"},"grid":"SFL21","column":"8"}]}}]}],"translations":{}}
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Background-color bound field not working.

Post by Scott Klement »

For some reason, the OA handler is sending a blank value for the VDMEMBR_E variable (which is bound to the background color of the VDMEMBR field). Are you putting a value in this field in your program?
bluttman
Profound User
Posts: 35
Joined: Mon Feb 20, 2012 6:45 pm
First Name: Brian
Last Name: Luttman
Company Name: BEPCO, Inc.
Contact:

Re: Background-color bound field not working.

Post by bluttman »

Yes.

VDMEMBR_E = ' ';
if VDMEMBR = *blanks;
$$ERRMSG = 'Please enter a batch name.';
VDERROR = *ON;
VDMEMBR_E = 'yellow ';
VDMEMBR_T = $$ERRMSG;
VDERRMSG = %trim(VDERRMSG) +
$$ERRMSG +
CRLF;
endif;
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Background-color bound field not working.

Post by Scott Klement »

Is this variable defined in multiple scopes? For example, defined both globally and in a subprocedure, where you might be setting the wrong copy? Or in mutiple data structures where you might be setting the wrong copy?

For some reason, a blank value is being sent. If I manually change it to send the word "yellow", it works fine, so we need to figure out why the display file is getting a blank value.
yellow.png
yellow.png (15.49 KiB) Viewed 510 times
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests