HasColor flag on a Browse not Colored instead shows Color Numbers

I have a browse on invoices where I wanted to add conditional colors if the invoice is unpaid. I added HasColor flag but when I compiled the app my browse started displaying color number instead of field value in all columns. Went back to normal when I unticked ‘HasColor’. Any idea what could be causing this?

with has color enabled even if nothing is defined in Browse Box Behavior on Colors tab


with has color disabled

Clarion 11.1 build 13810

Color in a list control is drive by that “HasColor” option and 4 additional fields added to the list’s queue.

MyListQueue queue
CustomerName string(20)
CNameForeColor long
CNameBackColor long
CNameForeSelectColor long
CNameBackSelectColor long
CompanyName string(20)
CompanyForeColor long
CompanyBackColor long
CompanyForeSelectColor long
CompanyBackSelectColor long
end

If you list control is hand-coded, not created via a template, then you need to add and populate these “color” fields in the queue.
Default all the color fields to COLOR:None. This means use the default list control colors. Otherwise, populate the fields with the appropriate color equates or values.

From your description, the FORMAT string and/or QUEUE declaration must be corrected.

1 Like

In a reply paste your LIST code with FORMAT(), and the From QUEUE declaration. You can get this code in the Embeditor Source or Module. With that code we can work out what’s wrong.

Confirm you are using the Browse Template on a File? The “Has Color” flag is part of the List Box Formatter so could be used with any LIST control.

Yes, I’m using standard Browse template.

Interestingly, I exported the app to TXA and reimported and this works fine but the first column does not have HasColor checked

          LIST,AT(8,30,487,173),USE(?Browse:1),HVSCROLL,COLOR(00E1FFFEh),FORMAT('41R(2)|M~N' & |
            'r Członka~C(0)@n-14@102L(2)|M*~Imię~C(0)@s40@#2#96L(2)|M*~Nazwisko~C(0)@s4' & |
            '0@214L(2)|M*~Nazwa Firmy~C(0)@s160@64R(2)|M*~Nr Noty~C(0)@n-14@20L(2)|M*~R' & |
            'ok~@s4@80D(32)|M*~Skladka~C(0)@N-10_`2B@80L(2)|M*~Tytul~@s30@80R(2)|M*~Dat' & |
            'a Noty~C(0)@D17@40R(2)|M*~Zaplacone~C(0)@n3@80R(2)|M*~Data Zaplaty~C(0)@D1' & |
            '7@80L(2)|M*~Uwagi~@s255@'),FROM(Queue:Browse:1),IMM,MSG('Browsing the Noty' & |
            'Statutowe file'),#FIELDS(NST:NrCzlonka,Mem:Imie,Mem:Nazwisko,Mem:NazwaFirmy,NST:NrNoty, |
            NST:Rok,NST:Skladka,NST:Tytul,NST:DataNoty,NST:Zaplacone,NST:DataZaplaty,NST:Uwagi), |
            #ORIG(?List),#SEQ(1),#ORDINAL(1)

Looks like this (first column is not colored)

Then I ticked HasColor on the first column

			
          LIST,AT(8,30,487,173),USE(?Browse:1),HVSCROLL,COLOR(00E1FFFEh),FORMAT('41R(2)|M*~' & |
            'Nr Członka~C(0)@n-14@102L(2)|M*~Imię~C(0)@s40@#2#96L(2)|M*~Nazwisko~C(0)@s' & |
            '40@214L(2)|M*~Nazwa Firmy~C(0)@s160@64R(2)|M*~Nr Noty~C(0)@n-14@20L(2)|M*~' & |
            'Rok~@s4@80D(32)|M*~Skladka~C(0)@N-10_`2B@80L(2)|M*~Tytul~@s30@80R(2)|M*~Da' & |
            'ta Noty~C(0)@D17@40R(2)|M*~Zaplacone~C(0)@n3@80R(2)|M*~Data Zaplaty~C(0)@D' & |
            '17@80L(2)|M*~Uwagi~@s255@'),FROM(Queue:Browse:1),IMM,MSG('Browsing the Not' & |
            'yStatutowe file'),#FIELDS(NST:NrCzlonka,Mem:Imie,Mem:Nazwisko,Mem:NazwaFirmy, |
            NST:NrNoty,NST:Rok,NST:Skladka,NST:Tytul,NST:DataNoty,NST:Zaplacone,NST:DataZaplaty, |
            NST:Uwagi),#ORIG(?List),#SEQ(1),#ORDINAL(1)

And it looks like this

The #2# in the Format shows you Unchecked “Auto Field Number” on the “~Imie” column. You cannot do that in a Browse Template … without some careful work.

Check the “Auto Field Number” and it should work

image

 FORMAT( | 
  '41R(2)'  & '|M*' & '~Nr Czlonka~C(0)'   & '@n-14@'        &|
  '102L(2)' & '|M*' & '~Imie~C(0)'         & '@s40@'  & '#2#' &| !<== #2# :(
  '96L(2)'  & '|M*' & '~Nazwisko~C(0)'     & '@s40@'         &|
  '214L(2)' & '|M*' & '~Nazwa Firmy~C(0)'  & '@s160@'        &|
  '64R(2)'  & '|M*' & '~Nr Noty~C(0)'      & '@n-14@'        &|
  '20L(2)'  & '|M*' & '~Rok~'              & '@s4@'          &|
  '80D(32)' & '|M*' & '~Skladka~C(0)'      & '@N-10_`2B@'    &|
  '80L(2)'  & '|M*' & '~Tytul~'            & '@s30@'         &|
  '80R(2)'  & '|M*' & '~Data Noty~C(0)'    & '@D17@'         &|
  '40R(2)'  & '|M*' & '~Zaplacone~C(0)'    & '@n3@'          &|
  '80R(2)'  & '|M*' & '~Data Zaplaty~C(0)' & '@D17@'         &|
  '80L(2)'  & '|M*' & '~Uwagi~'            & '@s255@'        &|
  '' ), |

That Format() with Columns split into Lines is from my List Format Parser on GitHub. It makes it easier to understand what’s in the Format and see odd things and problems.

Above is an unreleased version in the Mark G format that has each Column split into parts as separate strings: 'Width' & 'Modifiers' & '~Heading~' & '@Picture@' & 'More'

Thanks Carl. That worked. However this procedure was simple and auto generated. I did not make any major changes to it, it didn’t even have any embed’s just a basic browse on two related tables. Maybe I clicked on something in the list box format unintentionally and did not notice.
I have noticed this checkbox unticked when analysing this issue but didn’t think it would cause an issue since FieldNumber was correct. Anyway kudos to you. Thanks again.

The #2# made the LIST jump to Queue Field 2 for Column 2.

When you added Color to Column 1 the Queue had 4 LONGs added after Q Field 1 (by the template). So those became Q Fields 2,3,4,5 and your Column 2 shows that LONG.

In summary LISTs have Column Numbers fed from a QUEUE that had Field Numbers. Those numbers are the same, unless you add modifiers like Color, Style, Icon … that require extra Queue fields.

It’s easy to do. The properties are in alphabetical order which has its negatives. The Auto Number check should be next to the Field number it enables. Those should be at the end of the section as less used. The same in the Heading with the Scroll check and it’s value.