Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: foreground color

  1. #1
    Senior Member
    Join Date
    Oct 2012
    Posts
    234

    foreground color

    what are formitem-> data-> Foreground color for? and how to set the color of the data programmatically? What is the name of the property?
    Name:  Képernyőkép – 2021-02-07 14-48-20.png
Views: 257
Size:  15.8 KB

  2. #2
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,150
    Hi Strato,

    Each of the attributes you see in the Attributes dialog, for all the UI elements and every UI object, has a corresponding "Name" which can be found on the related documentation page. For Fields, e.g., here is the page: https://www.lianja.com/doc/index.php/Field_Attributes

    Hank

  3. #3
    Senior Member
    Join Date
    Oct 2012
    Posts
    234
    thank You Hank!

  4. #4
    Senior Member
    Join Date
    Oct 2012
    Posts
    234
    I couldn't solve the problem ... I need a little help. How can I color the data part of objects?

    now this is how I try with appbuilder ...

    Name:  Képerny?kép – 2021-02-08 10-39-17.png
Views: 236
Size:  23.0 KBName:  Képerny?kép – 2021-02-08 10-38-31.png
Views: 228
Size:  25.3 KB

    ... and program

    Name:  Képerny?kép – 2021-02-08 11-04-28.png
Views: 230
Size:  1.4 KB
    Code:
    		Lianja.get("teszt_oldal.section1.field25").setattribute("backcolor",rgb(170,255,127))
    		Lianja.get("teszt_oldal.section1.field25").setattribute("forecolor",rgb(255,0,0))
    		Lianja.get("teszt_oldal.section1.field25").setattribute("databackcolor",rgb(255,255,127))
    		Lianja.get("teszt_oldal.section1.field25").setattribute("dataforecolor",rgb(255,0,255))

  5. #5
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,781
    Blog Entries
    18
    It’s a color string e.g. 'red' or '#FF0000' where #RRGGBB are hex values.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  6. #6
    Senior Member
    Join Date
    Oct 2012
    Posts
    234
    the situation is the same. Although the rgb colors and the HTML colors are slightly different, both solutions work (as described in doc). For Caption, both foreground and background coloring are fine, but data coloring fails. The data background color is displayed, but not in the expected area.
    Name:  Képernyőkép – 2021-02-08 16-34-30.png
Views: 226
Size:  18.0 KB
    Code:
    		Lianja.get("teszt_oldal.section1.field25").setattribute("backcolor",rgb(170,255,127))
    		Lianja.get("teszt_oldal.section1.field25").setattribute("forecolor",rgb(255,0,0))
    		Lianja.get("teszt_oldal.section1.field25").setattribute("databackcolor",rgb(255,255,127))
    		Lianja.get("teszt_oldal.section1.field25").setattribute("dataforecolor",rgb(255,0,255))
    
    		Lianja.get("teszt_oldal.section1.box").setattribute("backcolor","#AAFF0F")
    		Lianja.get("teszt_oldal.section1.box").setattribute("forecolor","#FF0000")
    		Lianja.get("teszt_oldal.section1.box").setattribute("databackcolor","#FFFF0F")
    		Lianja.get("teszt_oldal.section1.box").setattribute("dataforecolor","#FF00FF")

  7. #7
    Senior Member
    Join Date
    Jan 2014
    Posts
    371
    Hi guys

    Looking to change some of the colours on the web interface programatically. We want to change foreground and background in a field on a form section and button text on a canvas section but cannot seem to get the syntax right.

    For the button we have tried

    Lianja.get("pcust.welcome.cmdLogin").setattribute( "foreColor",rgb(255,0,0));

    Lianja.get("pcust.welcome.cmdLogin").setattribute( "foreColor",RGB(255,0,0));

    Lianja.get("pcust.welcome.cmdLogin").setattribute( "foreColor","red");

    Lianja.get("pcust.welcome.cmdLogin").foreColor = "red";

    Lianja.get("pcust.welcome.cmdLogin").foreColor = '#FF0000';


    *************************************

    On the field, we want the change to be permanent but every time we change it in App Builder it keeps changing back. Is this maybe a CSS issue?


    Thanks in advance



    Simon

  8. #8
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,150
    In a web app on a form section one can cheat <s>:

    cmdLogin.forecolor = "red"

    Otherwise, what works for me is:

    var loSection = Lianja.get("pcust.welcome");
    loSection.cmdLogin.forecolor = "red";

    Hank

  9. #9
    Senior Member
    Join Date
    Jan 2014
    Posts
    371
    Hi Hank

    Thank for the reply

    Have tried that but nothing happens on the browser and always get a browser error.

    Uncaught TypeError: Cannot set properties of undefined (setting 'forecolor')

    We have tried - forecolor, foreColor (as per docs), Forecolor, ForeColor just in case the case sensitivity is an issue but always the same browser error message.

    Any other thoughts?

    Thanks in advance


    Simon

  10. #10
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,150
    This is code from a working app:

    Code:
    btndetails.forecolor = "white";
    

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us