Hi Miyako,
Sorry this is the first opportunity I’ve had to followup on this conversation.
I’ve tried different approaches and none work for row and cell coloring.
Per a documentation example for entity selection list boxes:
In the form method, write the following code:
//form method
Case of
:(Form event=On Load <https://doc.4d.com/4Dv17/index.en.html>)
Form <https://doc.4d.com/4Dv17/4D/17/Form.301-3730839.en.html>.meta:=New
object <https://doc.4d.com/4Dv17/4D/17.5/New-object.301-5256690.en.html>
End case
In the Color method, write the following code:
//Color method
//Sets font color for certain rows and the background color for a specific
column:
C_OBJECT($0)
If(This <https://doc.4d.com/4Dv17/4D/17.5/This.301-5255880.en.html>.ID>5) //ID
is an attribute of collection objects/entities
Form
<https://doc.4d.com/4Dv17/4D/17/Form.301-3730839.en.html>.meta.stroke:="purple"
Form
<https://doc.4d.com/4Dv17/4D/17/Form.301-3730839.en.html>.meta.cell:=New object
<https://doc.4d.com/4Dv17/4D/17.5/New-object.301-5256690.en.html>("Column2";New
object
<https://doc.4d.com/4Dv17/4D/17.5/New-object.301-5256690.en.html>("fill";"black"))
Else
Form
<https://doc.4d.com/4Dv17/4D/17/Form.301-3730839.en.html>.meta.stroke:="orange"
End if
$0:=Form <https://doc.4d.com/4Dv17/4D/17/Form.301-3730839.en.html>.meta
I set Form.meta as the meta info expression in the listbox. I activated on
display detail. On display detail I called my color method which returns an
object to the on display event.
Form.meta.stroke sets the font color for all columns and rows to purple.
Form <https://doc.4d.com/4Dv17/4D/17/Form.301-3730839.en.html>.meta.cell:=New
object
<https://doc.4d.com/4Dv17/4D/17.5/New-object.301-5256690.en.html>("Column2";New
object
<https://doc.4d.com/4Dv17/4D/17.5/New-object.301-5256690.en.html>("fill";"black”))
does nothing.
If I set the meta info expression as my color method, it does the same thing.
For some reason I am unable to get it to address a particular column, row or
cell.
Michael
> On Aug 6, 2021, at 9:23 AM, Keisuke Miyako via 4D_Tech <[email protected]>
> wrote:
>
> the meta expression is evaluated during the On Display Detail event.
>
> that would be all the rows visible on screen, plus a cache of rows prefetched
> for vertical scroll.
>
> typically that would be the same number as the rows visible on screen.
>
> how to bind:
>
> you create a project method, then enter that method name in the property list.
>
>> Thank you Miyako. That was helpful. However the documentation does not
>> illustrate the context in which the row coloring method is called. Would the
>> method be added to the column expression? Otherwise, I don’t see a way to
>> “bind” it to the listbox or a listbox column.
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> New Forum: https://discuss.4D.com
> Archive: http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub: mailto:[email protected]
> **********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************