You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by David Slotemaker de Bruine <ds...@vicensvives.com> on 2021/03/23 07:31:30 UTC

Generic DataGrid Renderers

Hi All,

I would like to create a generic Datagrid renderer for some of my VOs. I have followed the example for TDJ but it's not going me any output or error message. My code is the following:
<?xml version="1.0" encoding="utf-8"?>
<j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:j="library://ns.apache.org/royale/jewel" 
    xmlns:js="library://ns.apache.org/royale/basic" 
    >
    <fx:Script>
        <![CDATA[
	    [Bindable("dataChange")]
            public function get stringValue():String
            {
                return data[dataField] as String;
            }							            
]]>
    </fx:Script>
    <j:beads>
        <j:HorizontalCenteredLayout/>
        <js:ItemRendererDataBinding />
    </j:beads>
    <j:Label text="{stringValue}"/>
</j:DataGridItemRenderer>

Is it because I am using "data[dataField]"? If so what is the best way to do this without having t create a specific Renderer for each column.

Cheers,

David

Re: Generic DataGrid Renderers

Posted by David Slotemaker de Bruine <ds...@vicensvives.com>.
OK!

Thats the ticket! It looks like that the *dataField *value for the mxml
renderer:

 <j:DataGridColumn label="Cargo"
*dataField*="cargoContacto"itemRenderer="utils.renderers.CargoDataGridItemRenderer"
 />

maps to the *labelField *in the DataGridItemRenderer class, not to be
mistaken for the label field of the dataGrid Column.

a little confusing but glad to know whaich is the right one now!

Cheers,

David



On Tue, 23 Mar 2021 at 14:39, Piotr Zarzycki <pi...@gmail.com>
wrote:

> David,
>
> Please check if you have labelField available and it's not null.
>
> Thanks,
> Piotr
>
> wt., 23 mar 2021 o 13:47 David Slotemaker de Bruine <
> dslotemaker@vicensvives.com> napisał(a):
>
>> I have tried that too. If I change:
>>
>> this.text = value[datasField];
>> to
>> this.text = value["propertyThatIWant"];
>>
>> to works fine. For some reason "dataField" is not being filled in
>> Javascript.
>>
>> D
>>
>>
>> On Tue, 23 Mar 2021 at 13:29, Piotr Zarzycki <pi...@gmail.com>
>> wrote:
>>
>>> Can you try to create this renderer in MXML as you did before and use
>>> it?
>>>
>>> wt., 23 mar 2021 o 13:08 David Slotemaker de Bruine <
>>> dslotemaker@vicensvives.com> napisał(a):
>>>
>>>> Yes, it works if I Cast the Object, but I don't want to cast it, I want
>>>> a generic Renderer that uses the "dataField" to get the value.
>>>>
>>>> On Tue, 23 Mar 2021 at 13:00, Maria Jose Esteve <mj...@iest.com>
>>>> wrote:
>>>>
>>>>> @David, Have you tried bindar only instead of override?
>>>>>
>>>>>
>>>>>
>>>>> I have not worked with DataGrid but with the itemrenderers for List I
>>>>> do this:
>>>>>
>>>>>
>>>>>
>>>>>                                [Bindable("dataChange")]
>>>>>
>>>>>                                public function get
>>>>> getReg():CTypeRegAvisosNet
>>>>>
>>>>>                                {
>>>>>
>>>>>                                if(!data)
>>>>>
>>>>>                                     return new CTypeRegAvisosNet;
>>>>>
>>>>>                                else{
>>>>>
>>>>>                                     return data as CTypeRegAvisosNet;
>>>>>
>>>>>                                }
>>>>>
>>>>>                                }
>>>>>
>>>>>
>>>>>
>>>>> (In my case I use a class type, but I imagine that with Object it will
>>>>> be the same)
>>>>>
>>>>>
>>>>>
>>>>> Hiedra
>>>>>
>>>>>
>>>>>
>>>>> *De:* David Slotemaker de Bruine <ds...@vicensvives.com>
>>>>> *Enviado el:* martes, 23 de marzo de 2021 12:39
>>>>> *Para:* users@royale.apache.org
>>>>> *Asunto:* Re: Generic DataGrid Renderers
>>>>>
>>>>>
>>>>>
>>>>> Yes:
>>>>>
>>>>>
>>>>>
>>>>> <j:DataGridColumn label="Ciclo" dataField="ciclo" columnWidth="80"
>>>>> itemRenderer="utils.renderers.StringDataGridItemRenderer"/>
>>>>>
>>>>>
>>>>>
>>>>> StringValue is a [Bindable] String var. that should hold the value of
>>>>> the property "dataField" of the data Object. But as  dataField evaluates de
>>>>> undefiend it get set to "".
>>>>>
>>>>>
>>>>>
>>>>> On Tue, 23 Mar 2021 at 12:26, Piotr Zarzycki <
>>>>> piotrzarzycki21@gmail.com> wrote:
>>>>>
>>>>> Do you setup dateField in your DataGrid Column? ;)
>>>>>
>>>>>
>>>>>
>>>>> What is the stringValue ?
>>>>>
>>>>>
>>>>>
>>>>> On Tue, 23 Mar 2021 at 12:17, David Slotemaker de Bruine <
>>>>> dslotemaker@vicensvives.com> wrote:
>>>>>
>>>>> Hi Piotr,
>>>>>
>>>>>
>>>>>
>>>>> I have tried overriding the set data method. The problem is that
>>>>> "dataField" is undefined.
>>>>>
>>>>>
>>>>>
>>>>> public override function set data(value:Object):void
>>>>> {
>>>>> super.data = value;
>>>>> stringValue = value[dataField];
>>>>> this.text = stringValue;
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>> stringValue is cast to "".
>>>>>
>>>>>
>>>>>
>>>>> Any thoughts?
>>>>>
>>>>>
>>>>>
>>>>> On Tue, 23 Mar 2021 at 09:03, Piotr Zarzycki <
>>>>> piotrzarzycki21@gmail.com> wrote:
>>>>>
>>>>> If that's the case I would remove everything in that item renderer,
>>>>> override property data and there filter:
>>>>>
>>>>>
>>>>>
>>>>> super.data = value;
>>>>>
>>>>> if (!data) {
>>>>>
>>>>>     this.text = "";
>>>>>
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>> wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <
>>>>> dslotemaker@vicensvives.com> napisał(a):
>>>>>
>>>>> Yes! but I wanted to show that the basic version is not working!
>>>>>
>>>>>
>>>>>
>>>>> My backend returns string constants for null objects and null numbers,
>>>>> I need to filter these out in the renderer.
>>>>>
>>>>>
>>>>>
>>>>> On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <
>>>>> piotrzarzycki21@gmail.com> wrote:
>>>>>
>>>>> Hi David,
>>>>>
>>>>>
>>>>>
>>>>> It looks like your DataGridItemRenderer is do same thing as the
>>>>> default one, what's the point of creating this one ? Are you going to
>>>>> expand it's functionality ?
>>>>>
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Piotr
>>>>>
>>>>>
>>>>>
>>>>> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
>>>>> dslotemaker@vicensvives.com> napisał(a):
>>>>>
>>>>> Hi All,
>>>>>
>>>>> I would like to create a generic Datagrid renderer for some of my VOs.
>>>>> I have followed the example for TDJ but it's not going me any output or
>>>>> error message. My code is the following:
>>>>> <?xml version="1.0" encoding="utf-8"?>
>>>>> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>>>>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>>>>     xmlns:js="library://ns.apache.org/royale/basic"
>>>>>     >
>>>>>     <fx:Script>
>>>>>         <![CDATA[
>>>>>             [Bindable("dataChange")]
>>>>>             public function get stringValue():String
>>>>>             {
>>>>>                 return data[dataField] as String;
>>>>>             }
>>>>>
>>>>> ]]>
>>>>>     </fx:Script>
>>>>>     <j:beads>
>>>>>         <j:HorizontalCenteredLayout/>
>>>>>         <js:ItemRendererDataBinding />
>>>>>     </j:beads>
>>>>>     <j:Label text="{stringValue}"/>
>>>>> </j:DataGridItemRenderer>
>>>>>
>>>>> Is it because I am using "data[dataField]"? If so what is the best way
>>>>> to do this without having t create a specific Renderer for each column.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> David
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *Piotr Zarzycki *
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *David Slotemaker de Bruïne*
>>>>> *Head of Educational Robotics*
>>>>>
>>>>>
>>>>>
>>>>> Av. Sarriá, 130 - 08017 Barcelona
>>>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>>>
>>>>>
>>>>> T. +34 932 523 729 ext. 135
>>>>>
>>>>> dslotemaker@vicensvives.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *Piotr Zarzycki *
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *David Slotemaker de Bruïne*
>>>>> *Head of Educational Robotics*
>>>>>
>>>>>
>>>>>
>>>>> Av. Sarriá, 130 - 08017 Barcelona
>>>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>>>
>>>>>
>>>>> T. +34 932 523 729 ext. 135
>>>>>
>>>>> dslotemaker@vicensvives.com
>>>>>
>>>>> --
>>>>>
>>>>> *Piotr Zarzycki *
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *David Slotemaker de Bruïne*
>>>>> *Head of Educational Robotics*
>>>>>
>>>>>
>>>>>
>>>>> Av. Sarriá, 130 - 08017 Barcelona
>>>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>>>
>>>>>
>>>>> T. +34 932 523 729 ext. 135
>>>>>
>>>>> dslotemaker@vicensvives.com
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *David Slotemaker de Bruïne*
>>>> *Head of Educational Robotics*
>>>>
>>>>
>>>>
>>>> Av. Sarriá, 130 - 08017 Barcelona
>>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>>
>>>>
>>>> T. +34 932 523 729 ext. 135
>>>>
>>>> dslotemaker@vicensvives.com
>>>>
>>>
>>>
>>> --
>>>
>>> Piotr Zarzycki
>>>
>>
>>
>> --
>>
>> *David Slotemaker de Bruïne*
>> *Head of Educational Robotics*
>>
>>
>>
>> Av. Sarriá, 130 - 08017 Barcelona
>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>
>>
>> T. +34 932 523 729 ext. 135
>>
>> dslotemaker@vicensvives.com
>>
>
>
> --
>
> Piotr Zarzycki
>


-- 

*David Slotemaker de Bruïne*
*Head of Educational Robotics*



Av. Sarriá, 130 - 08017 Barcelona
<https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>


T. +34 932 523 729 ext. 135

dslotemaker@vicensvives.com

Re: Generic DataGrid Renderers

Posted by Piotr Zarzycki <pi...@gmail.com>.
David,

Please check if you have labelField available and it's not null.

Thanks,
Piotr

wt., 23 mar 2021 o 13:47 David Slotemaker de Bruine <
dslotemaker@vicensvives.com> napisał(a):

> I have tried that too. If I change:
>
> this.text = value[datasField];
> to
> this.text = value["propertyThatIWant"];
>
> to works fine. For some reason "dataField" is not being filled in
> Javascript.
>
> D
>
>
> On Tue, 23 Mar 2021 at 13:29, Piotr Zarzycki <pi...@gmail.com>
> wrote:
>
>> Can you try to create this renderer in MXML as you did before and use it?
>>
>> wt., 23 mar 2021 o 13:08 David Slotemaker de Bruine <
>> dslotemaker@vicensvives.com> napisał(a):
>>
>>> Yes, it works if I Cast the Object, but I don't want to cast it, I want
>>> a generic Renderer that uses the "dataField" to get the value.
>>>
>>> On Tue, 23 Mar 2021 at 13:00, Maria Jose Esteve <mj...@iest.com>
>>> wrote:
>>>
>>>> @David, Have you tried bindar only instead of override?
>>>>
>>>>
>>>>
>>>> I have not worked with DataGrid but with the itemrenderers for List I
>>>> do this:
>>>>
>>>>
>>>>
>>>>                                [Bindable("dataChange")]
>>>>
>>>>                                public function get
>>>> getReg():CTypeRegAvisosNet
>>>>
>>>>                                {
>>>>
>>>>                                if(!data)
>>>>
>>>>                                     return new CTypeRegAvisosNet;
>>>>
>>>>                                else{
>>>>
>>>>                                     return data as CTypeRegAvisosNet;
>>>>
>>>>                                }
>>>>
>>>>                                }
>>>>
>>>>
>>>>
>>>> (In my case I use a class type, but I imagine that with Object it will
>>>> be the same)
>>>>
>>>>
>>>>
>>>> Hiedra
>>>>
>>>>
>>>>
>>>> *De:* David Slotemaker de Bruine <ds...@vicensvives.com>
>>>> *Enviado el:* martes, 23 de marzo de 2021 12:39
>>>> *Para:* users@royale.apache.org
>>>> *Asunto:* Re: Generic DataGrid Renderers
>>>>
>>>>
>>>>
>>>> Yes:
>>>>
>>>>
>>>>
>>>> <j:DataGridColumn label="Ciclo" dataField="ciclo" columnWidth="80"
>>>> itemRenderer="utils.renderers.StringDataGridItemRenderer"/>
>>>>
>>>>
>>>>
>>>> StringValue is a [Bindable] String var. that should hold the value of
>>>> the property "dataField" of the data Object. But as  dataField evaluates de
>>>> undefiend it get set to "".
>>>>
>>>>
>>>>
>>>> On Tue, 23 Mar 2021 at 12:26, Piotr Zarzycki <pi...@gmail.com>
>>>> wrote:
>>>>
>>>> Do you setup dateField in your DataGrid Column? ;)
>>>>
>>>>
>>>>
>>>> What is the stringValue ?
>>>>
>>>>
>>>>
>>>> On Tue, 23 Mar 2021 at 12:17, David Slotemaker de Bruine <
>>>> dslotemaker@vicensvives.com> wrote:
>>>>
>>>> Hi Piotr,
>>>>
>>>>
>>>>
>>>> I have tried overriding the set data method. The problem is that
>>>> "dataField" is undefined.
>>>>
>>>>
>>>>
>>>> public override function set data(value:Object):void
>>>> {
>>>> super.data = value;
>>>> stringValue = value[dataField];
>>>> this.text = stringValue;
>>>> }
>>>>
>>>>
>>>>
>>>> stringValue is cast to "".
>>>>
>>>>
>>>>
>>>> Any thoughts?
>>>>
>>>>
>>>>
>>>> On Tue, 23 Mar 2021 at 09:03, Piotr Zarzycki <pi...@gmail.com>
>>>> wrote:
>>>>
>>>> If that's the case I would remove everything in that item renderer,
>>>> override property data and there filter:
>>>>
>>>>
>>>>
>>>> super.data = value;
>>>>
>>>> if (!data) {
>>>>
>>>>     this.text = "";
>>>>
>>>> }
>>>>
>>>>
>>>>
>>>> wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <
>>>> dslotemaker@vicensvives.com> napisał(a):
>>>>
>>>> Yes! but I wanted to show that the basic version is not working!
>>>>
>>>>
>>>>
>>>> My backend returns string constants for null objects and null numbers,
>>>> I need to filter these out in the renderer.
>>>>
>>>>
>>>>
>>>> On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <pi...@gmail.com>
>>>> wrote:
>>>>
>>>> Hi David,
>>>>
>>>>
>>>>
>>>> It looks like your DataGridItemRenderer is do same thing as the default
>>>> one, what's the point of creating this one ? Are you going to expand it's
>>>> functionality ?
>>>>
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Piotr
>>>>
>>>>
>>>>
>>>> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
>>>> dslotemaker@vicensvives.com> napisał(a):
>>>>
>>>> Hi All,
>>>>
>>>> I would like to create a generic Datagrid renderer for some of my VOs.
>>>> I have followed the example for TDJ but it's not going me any output or
>>>> error message. My code is the following:
>>>> <?xml version="1.0" encoding="utf-8"?>
>>>> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>>>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>>>     xmlns:js="library://ns.apache.org/royale/basic"
>>>>     >
>>>>     <fx:Script>
>>>>         <![CDATA[
>>>>             [Bindable("dataChange")]
>>>>             public function get stringValue():String
>>>>             {
>>>>                 return data[dataField] as String;
>>>>             }
>>>>
>>>> ]]>
>>>>     </fx:Script>
>>>>     <j:beads>
>>>>         <j:HorizontalCenteredLayout/>
>>>>         <js:ItemRendererDataBinding />
>>>>     </j:beads>
>>>>     <j:Label text="{stringValue}"/>
>>>> </j:DataGridItemRenderer>
>>>>
>>>> Is it because I am using "data[dataField]"? If so what is the best way
>>>> to do this without having t create a specific Renderer for each column.
>>>>
>>>> Cheers,
>>>>
>>>> David
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *Piotr Zarzycki *
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *David Slotemaker de Bruïne*
>>>> *Head of Educational Robotics*
>>>>
>>>>
>>>>
>>>> Av. Sarriá, 130 - 08017 Barcelona
>>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>>
>>>>
>>>> T. +34 932 523 729 ext. 135
>>>>
>>>> dslotemaker@vicensvives.com
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *Piotr Zarzycki *
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *David Slotemaker de Bruïne*
>>>> *Head of Educational Robotics*
>>>>
>>>>
>>>>
>>>> Av. Sarriá, 130 - 08017 Barcelona
>>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>>
>>>>
>>>> T. +34 932 523 729 ext. 135
>>>>
>>>> dslotemaker@vicensvives.com
>>>>
>>>> --
>>>>
>>>> *Piotr Zarzycki *
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *David Slotemaker de Bruïne*
>>>> *Head of Educational Robotics*
>>>>
>>>>
>>>>
>>>> Av. Sarriá, 130 - 08017 Barcelona
>>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>>
>>>>
>>>> T. +34 932 523 729 ext. 135
>>>>
>>>> dslotemaker@vicensvives.com
>>>>
>>>
>>>
>>> --
>>>
>>> *David Slotemaker de Bruïne*
>>> *Head of Educational Robotics*
>>>
>>>
>>>
>>> Av. Sarriá, 130 - 08017 Barcelona
>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>
>>>
>>> T. +34 932 523 729 ext. 135
>>>
>>> dslotemaker@vicensvives.com
>>>
>>
>>
>> --
>>
>> Piotr Zarzycki
>>
>
>
> --
>
> *David Slotemaker de Bruïne*
> *Head of Educational Robotics*
>
>
>
> Av. Sarriá, 130 - 08017 Barcelona
> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>
>
> T. +34 932 523 729 ext. 135
>
> dslotemaker@vicensvives.com
>


-- 

Piotr Zarzycki

Re: Generic DataGrid Renderers

Posted by David Slotemaker de Bruine <ds...@vicensvives.com>.
I have tried that too. If I change:

this.text = value[datasField];
to
this.text = value["propertyThatIWant"];

to works fine. For some reason "dataField" is not being filled in
Javascript.

D


On Tue, 23 Mar 2021 at 13:29, Piotr Zarzycki <pi...@gmail.com>
wrote:

> Can you try to create this renderer in MXML as you did before and use it?
>
> wt., 23 mar 2021 o 13:08 David Slotemaker de Bruine <
> dslotemaker@vicensvives.com> napisał(a):
>
>> Yes, it works if I Cast the Object, but I don't want to cast it, I want a
>> generic Renderer that uses the "dataField" to get the value.
>>
>> On Tue, 23 Mar 2021 at 13:00, Maria Jose Esteve <mj...@iest.com>
>> wrote:
>>
>>> @David, Have you tried bindar only instead of override?
>>>
>>>
>>>
>>> I have not worked with DataGrid but with the itemrenderers for List I do
>>> this:
>>>
>>>
>>>
>>>                                [Bindable("dataChange")]
>>>
>>>                                public function get
>>> getReg():CTypeRegAvisosNet
>>>
>>>                                {
>>>
>>>                                if(!data)
>>>
>>>                                     return new CTypeRegAvisosNet;
>>>
>>>                                else{
>>>
>>>                                     return data as CTypeRegAvisosNet;
>>>
>>>                                }
>>>
>>>                                }
>>>
>>>
>>>
>>> (In my case I use a class type, but I imagine that with Object it will
>>> be the same)
>>>
>>>
>>>
>>> Hiedra
>>>
>>>
>>>
>>> *De:* David Slotemaker de Bruine <ds...@vicensvives.com>
>>> *Enviado el:* martes, 23 de marzo de 2021 12:39
>>> *Para:* users@royale.apache.org
>>> *Asunto:* Re: Generic DataGrid Renderers
>>>
>>>
>>>
>>> Yes:
>>>
>>>
>>>
>>> <j:DataGridColumn label="Ciclo" dataField="ciclo" columnWidth="80"
>>> itemRenderer="utils.renderers.StringDataGridItemRenderer"/>
>>>
>>>
>>>
>>> StringValue is a [Bindable] String var. that should hold the value of
>>> the property "dataField" of the data Object. But as  dataField evaluates de
>>> undefiend it get set to "".
>>>
>>>
>>>
>>> On Tue, 23 Mar 2021 at 12:26, Piotr Zarzycki <pi...@gmail.com>
>>> wrote:
>>>
>>> Do you setup dateField in your DataGrid Column? ;)
>>>
>>>
>>>
>>> What is the stringValue ?
>>>
>>>
>>>
>>> On Tue, 23 Mar 2021 at 12:17, David Slotemaker de Bruine <
>>> dslotemaker@vicensvives.com> wrote:
>>>
>>> Hi Piotr,
>>>
>>>
>>>
>>> I have tried overriding the set data method. The problem is that
>>> "dataField" is undefined.
>>>
>>>
>>>
>>> public override function set data(value:Object):void
>>> {
>>> super.data = value;
>>> stringValue = value[dataField];
>>> this.text = stringValue;
>>> }
>>>
>>>
>>>
>>> stringValue is cast to "".
>>>
>>>
>>>
>>> Any thoughts?
>>>
>>>
>>>
>>> On Tue, 23 Mar 2021 at 09:03, Piotr Zarzycki <pi...@gmail.com>
>>> wrote:
>>>
>>> If that's the case I would remove everything in that item renderer,
>>> override property data and there filter:
>>>
>>>
>>>
>>> super.data = value;
>>>
>>> if (!data) {
>>>
>>>     this.text = "";
>>>
>>> }
>>>
>>>
>>>
>>> wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <
>>> dslotemaker@vicensvives.com> napisał(a):
>>>
>>> Yes! but I wanted to show that the basic version is not working!
>>>
>>>
>>>
>>> My backend returns string constants for null objects and null numbers, I
>>> need to filter these out in the renderer.
>>>
>>>
>>>
>>> On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <pi...@gmail.com>
>>> wrote:
>>>
>>> Hi David,
>>>
>>>
>>>
>>> It looks like your DataGridItemRenderer is do same thing as the default
>>> one, what's the point of creating this one ? Are you going to expand it's
>>> functionality ?
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Piotr
>>>
>>>
>>>
>>> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
>>> dslotemaker@vicensvives.com> napisał(a):
>>>
>>> Hi All,
>>>
>>> I would like to create a generic Datagrid renderer for some of my VOs. I
>>> have followed the example for TDJ but it's not going me any output or error
>>> message. My code is the following:
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>>     xmlns:js="library://ns.apache.org/royale/basic"
>>>     >
>>>     <fx:Script>
>>>         <![CDATA[
>>>             [Bindable("dataChange")]
>>>             public function get stringValue():String
>>>             {
>>>                 return data[dataField] as String;
>>>             }
>>>
>>> ]]>
>>>     </fx:Script>
>>>     <j:beads>
>>>         <j:HorizontalCenteredLayout/>
>>>         <js:ItemRendererDataBinding />
>>>     </j:beads>
>>>     <j:Label text="{stringValue}"/>
>>> </j:DataGridItemRenderer>
>>>
>>> Is it because I am using "data[dataField]"? If so what is the best way
>>> to do this without having t create a specific Renderer for each column.
>>>
>>> Cheers,
>>>
>>> David
>>>
>>>
>>>
>>>
>>> --
>>>
>>> *Piotr Zarzycki *
>>>
>>>
>>>
>>>
>>> --
>>>
>>> *David Slotemaker de Bruïne*
>>> *Head of Educational Robotics*
>>>
>>>
>>>
>>> Av. Sarriá, 130 - 08017 Barcelona
>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>
>>>
>>> T. +34 932 523 729 ext. 135
>>>
>>> dslotemaker@vicensvives.com
>>>
>>>
>>>
>>>
>>> --
>>>
>>> *Piotr Zarzycki *
>>>
>>>
>>>
>>>
>>> --
>>>
>>> *David Slotemaker de Bruïne*
>>> *Head of Educational Robotics*
>>>
>>>
>>>
>>> Av. Sarriá, 130 - 08017 Barcelona
>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>
>>>
>>> T. +34 932 523 729 ext. 135
>>>
>>> dslotemaker@vicensvives.com
>>>
>>> --
>>>
>>> *Piotr Zarzycki *
>>>
>>>
>>>
>>>
>>> --
>>>
>>> *David Slotemaker de Bruïne*
>>> *Head of Educational Robotics*
>>>
>>>
>>>
>>> Av. Sarriá, 130 - 08017 Barcelona
>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>
>>>
>>> T. +34 932 523 729 ext. 135
>>>
>>> dslotemaker@vicensvives.com
>>>
>>
>>
>> --
>>
>> *David Slotemaker de Bruïne*
>> *Head of Educational Robotics*
>>
>>
>>
>> Av. Sarriá, 130 - 08017 Barcelona
>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>
>>
>> T. +34 932 523 729 ext. 135
>>
>> dslotemaker@vicensvives.com
>>
>
>
> --
>
> Piotr Zarzycki
>


-- 

*David Slotemaker de Bruïne*
*Head of Educational Robotics*



Av. Sarriá, 130 - 08017 Barcelona
<https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>


T. +34 932 523 729 ext. 135

dslotemaker@vicensvives.com

Re: Generic DataGrid Renderers

Posted by Piotr Zarzycki <pi...@gmail.com>.
Can you try to create this renderer in MXML as you did before and use it?

wt., 23 mar 2021 o 13:08 David Slotemaker de Bruine <
dslotemaker@vicensvives.com> napisał(a):

> Yes, it works if I Cast the Object, but I don't want to cast it, I want a
> generic Renderer that uses the "dataField" to get the value.
>
> On Tue, 23 Mar 2021 at 13:00, Maria Jose Esteve <mj...@iest.com> wrote:
>
>> @David, Have you tried bindar only instead of override?
>>
>>
>>
>> I have not worked with DataGrid but with the itemrenderers for List I do
>> this:
>>
>>
>>
>>                                [Bindable("dataChange")]
>>
>>                                public function get
>> getReg():CTypeRegAvisosNet
>>
>>                                {
>>
>>                                if(!data)
>>
>>                                     return new CTypeRegAvisosNet;
>>
>>                                else{
>>
>>                                     return data as CTypeRegAvisosNet;
>>
>>                                }
>>
>>                                }
>>
>>
>>
>> (In my case I use a class type, but I imagine that with Object it will be
>> the same)
>>
>>
>>
>> Hiedra
>>
>>
>>
>> *De:* David Slotemaker de Bruine <ds...@vicensvives.com>
>> *Enviado el:* martes, 23 de marzo de 2021 12:39
>> *Para:* users@royale.apache.org
>> *Asunto:* Re: Generic DataGrid Renderers
>>
>>
>>
>> Yes:
>>
>>
>>
>> <j:DataGridColumn label="Ciclo" dataField="ciclo" columnWidth="80"
>> itemRenderer="utils.renderers.StringDataGridItemRenderer"/>
>>
>>
>>
>> StringValue is a [Bindable] String var. that should hold the value of the
>> property "dataField" of the data Object. But as  dataField evaluates de
>> undefiend it get set to "".
>>
>>
>>
>> On Tue, 23 Mar 2021 at 12:26, Piotr Zarzycki <pi...@gmail.com>
>> wrote:
>>
>> Do you setup dateField in your DataGrid Column? ;)
>>
>>
>>
>> What is the stringValue ?
>>
>>
>>
>> On Tue, 23 Mar 2021 at 12:17, David Slotemaker de Bruine <
>> dslotemaker@vicensvives.com> wrote:
>>
>> Hi Piotr,
>>
>>
>>
>> I have tried overriding the set data method. The problem is that
>> "dataField" is undefined.
>>
>>
>>
>> public override function set data(value:Object):void
>> {
>> super.data = value;
>> stringValue = value[dataField];
>> this.text = stringValue;
>> }
>>
>>
>>
>> stringValue is cast to "".
>>
>>
>>
>> Any thoughts?
>>
>>
>>
>> On Tue, 23 Mar 2021 at 09:03, Piotr Zarzycki <pi...@gmail.com>
>> wrote:
>>
>> If that's the case I would remove everything in that item renderer,
>> override property data and there filter:
>>
>>
>>
>> super.data = value;
>>
>> if (!data) {
>>
>>     this.text = "";
>>
>> }
>>
>>
>>
>> wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <
>> dslotemaker@vicensvives.com> napisał(a):
>>
>> Yes! but I wanted to show that the basic version is not working!
>>
>>
>>
>> My backend returns string constants for null objects and null numbers, I
>> need to filter these out in the renderer.
>>
>>
>>
>> On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <pi...@gmail.com>
>> wrote:
>>
>> Hi David,
>>
>>
>>
>> It looks like your DataGridItemRenderer is do same thing as the default
>> one, what's the point of creating this one ? Are you going to expand it's
>> functionality ?
>>
>>
>>
>> Thanks,
>>
>> Piotr
>>
>>
>>
>> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
>> dslotemaker@vicensvives.com> napisał(a):
>>
>> Hi All,
>>
>> I would like to create a generic Datagrid renderer for some of my VOs. I
>> have followed the example for TDJ but it's not going me any output or error
>> message. My code is the following:
>> <?xml version="1.0" encoding="utf-8"?>
>> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>     xmlns:js="library://ns.apache.org/royale/basic"
>>     >
>>     <fx:Script>
>>         <![CDATA[
>>             [Bindable("dataChange")]
>>             public function get stringValue():String
>>             {
>>                 return data[dataField] as String;
>>             }
>>
>> ]]>
>>     </fx:Script>
>>     <j:beads>
>>         <j:HorizontalCenteredLayout/>
>>         <js:ItemRendererDataBinding />
>>     </j:beads>
>>     <j:Label text="{stringValue}"/>
>> </j:DataGridItemRenderer>
>>
>> Is it because I am using "data[dataField]"? If so what is the best way to
>> do this without having t create a specific Renderer for each column.
>>
>> Cheers,
>>
>> David
>>
>>
>>
>>
>> --
>>
>> *Piotr Zarzycki *
>>
>>
>>
>>
>> --
>>
>> *David Slotemaker de Bruïne*
>> *Head of Educational Robotics*
>>
>>
>>
>> Av. Sarriá, 130 - 08017 Barcelona
>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>
>>
>> T. +34 932 523 729 ext. 135
>>
>> dslotemaker@vicensvives.com
>>
>>
>>
>>
>> --
>>
>> *Piotr Zarzycki *
>>
>>
>>
>>
>> --
>>
>> *David Slotemaker de Bruïne*
>> *Head of Educational Robotics*
>>
>>
>>
>> Av. Sarriá, 130 - 08017 Barcelona
>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>
>>
>> T. +34 932 523 729 ext. 135
>>
>> dslotemaker@vicensvives.com
>>
>> --
>>
>> *Piotr Zarzycki *
>>
>>
>>
>>
>> --
>>
>> *David Slotemaker de Bruïne*
>> *Head of Educational Robotics*
>>
>>
>>
>> Av. Sarriá, 130 - 08017 Barcelona
>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>
>>
>> T. +34 932 523 729 ext. 135
>>
>> dslotemaker@vicensvives.com
>>
>
>
> --
>
> *David Slotemaker de Bruïne*
> *Head of Educational Robotics*
>
>
>
> Av. Sarriá, 130 - 08017 Barcelona
> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>
>
> T. +34 932 523 729 ext. 135
>
> dslotemaker@vicensvives.com
>


-- 

Piotr Zarzycki

Re: Generic DataGrid Renderers

Posted by David Slotemaker de Bruine <ds...@vicensvives.com>.
Yes, it works if I Cast the Object, but I don't want to cast it, I want a
generic Renderer that uses the "dataField" to get the value.

On Tue, 23 Mar 2021 at 13:00, Maria Jose Esteve <mj...@iest.com> wrote:

> @David, Have you tried bindar only instead of override?
>
>
>
> I have not worked with DataGrid but with the itemrenderers for List I do
> this:
>
>
>
>                                [Bindable("dataChange")]
>
>                                public function get
> getReg():CTypeRegAvisosNet
>
>                                {
>
>                                if(!data)
>
>                                     return new CTypeRegAvisosNet;
>
>                                else{
>
>                                     return data as CTypeRegAvisosNet;
>
>                                }
>
>                                }
>
>
>
> (In my case I use a class type, but I imagine that with Object it will be
> the same)
>
>
>
> Hiedra
>
>
>
> *De:* David Slotemaker de Bruine <ds...@vicensvives.com>
> *Enviado el:* martes, 23 de marzo de 2021 12:39
> *Para:* users@royale.apache.org
> *Asunto:* Re: Generic DataGrid Renderers
>
>
>
> Yes:
>
>
>
> <j:DataGridColumn label="Ciclo" dataField="ciclo" columnWidth="80"
> itemRenderer="utils.renderers.StringDataGridItemRenderer"/>
>
>
>
> StringValue is a [Bindable] String var. that should hold the value of the
> property "dataField" of the data Object. But as  dataField evaluates de
> undefiend it get set to "".
>
>
>
> On Tue, 23 Mar 2021 at 12:26, Piotr Zarzycki <pi...@gmail.com>
> wrote:
>
> Do you setup dateField in your DataGrid Column? ;)
>
>
>
> What is the stringValue ?
>
>
>
> On Tue, 23 Mar 2021 at 12:17, David Slotemaker de Bruine <
> dslotemaker@vicensvives.com> wrote:
>
> Hi Piotr,
>
>
>
> I have tried overriding the set data method. The problem is that
> "dataField" is undefined.
>
>
>
> public override function set data(value:Object):void
> {
> super.data = value;
> stringValue = value[dataField];
> this.text = stringValue;
> }
>
>
>
> stringValue is cast to "".
>
>
>
> Any thoughts?
>
>
>
> On Tue, 23 Mar 2021 at 09:03, Piotr Zarzycki <pi...@gmail.com>
> wrote:
>
> If that's the case I would remove everything in that item renderer,
> override property data and there filter:
>
>
>
> super.data = value;
>
> if (!data) {
>
>     this.text = "";
>
> }
>
>
>
> wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <
> dslotemaker@vicensvives.com> napisał(a):
>
> Yes! but I wanted to show that the basic version is not working!
>
>
>
> My backend returns string constants for null objects and null numbers, I
> need to filter these out in the renderer.
>
>
>
> On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <pi...@gmail.com>
> wrote:
>
> Hi David,
>
>
>
> It looks like your DataGridItemRenderer is do same thing as the default
> one, what's the point of creating this one ? Are you going to expand it's
> functionality ?
>
>
>
> Thanks,
>
> Piotr
>
>
>
> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
> dslotemaker@vicensvives.com> napisał(a):
>
> Hi All,
>
> I would like to create a generic Datagrid renderer for some of my VOs. I
> have followed the example for TDJ but it's not going me any output or error
> message. My code is the following:
> <?xml version="1.0" encoding="utf-8"?>
> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>     xmlns:j="library://ns.apache.org/royale/jewel"
>     xmlns:js="library://ns.apache.org/royale/basic"
>     >
>     <fx:Script>
>         <![CDATA[
>             [Bindable("dataChange")]
>             public function get stringValue():String
>             {
>                 return data[dataField] as String;
>             }
>
> ]]>
>     </fx:Script>
>     <j:beads>
>         <j:HorizontalCenteredLayout/>
>         <js:ItemRendererDataBinding />
>     </j:beads>
>     <j:Label text="{stringValue}"/>
> </j:DataGridItemRenderer>
>
> Is it because I am using "data[dataField]"? If so what is the best way to
> do this without having t create a specific Renderer for each column.
>
> Cheers,
>
> David
>
>
>
>
> --
>
> *Piotr Zarzycki *
>
>
>
>
> --
>
> *David Slotemaker de Bruïne*
> *Head of Educational Robotics*
>
>
>
> Av. Sarriá, 130 - 08017 Barcelona
> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>
>
> T. +34 932 523 729 ext. 135
>
> dslotemaker@vicensvives.com
>
>
>
>
> --
>
> *Piotr Zarzycki *
>
>
>
>
> --
>
> *David Slotemaker de Bruïne*
> *Head of Educational Robotics*
>
>
>
> Av. Sarriá, 130 - 08017 Barcelona
> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>
>
> T. +34 932 523 729 ext. 135
>
> dslotemaker@vicensvives.com
>
> --
>
> *Piotr Zarzycki *
>
>
>
>
> --
>
> *David Slotemaker de Bruïne*
> *Head of Educational Robotics*
>
>
>
> Av. Sarriá, 130 - 08017 Barcelona
> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>
>
> T. +34 932 523 729 ext. 135
>
> dslotemaker@vicensvives.com
>


-- 

*David Slotemaker de Bruïne*
*Head of Educational Robotics*



Av. Sarriá, 130 - 08017 Barcelona
<https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>


T. +34 932 523 729 ext. 135

dslotemaker@vicensvives.com

RE: Generic DataGrid Renderers

Posted by Maria Jose Esteve <mj...@iest.com>.
@David, Have you tried bindar only instead of override?

I have not worked with DataGrid but with the itemrenderers for List I do this:

                               [Bindable("dataChange")]
                               public function get getReg():CTypeRegAvisosNet
                               {
                               if(!data)
                                    return new CTypeRegAvisosNet;
                               else{
                                    return data as CTypeRegAvisosNet;
                               }
                               }

(In my case I use a class type, but I imagine that with Object it will be the same)

Hiedra

De: David Slotemaker de Bruine <ds...@vicensvives.com>
Enviado el: martes, 23 de marzo de 2021 12:39
Para: users@royale.apache.org
Asunto: Re: Generic DataGrid Renderers

Yes:

<j:DataGridColumn label="Ciclo" dataField="ciclo" columnWidth="80" itemRenderer="utils.renderers.StringDataGridItemRenderer"/>

StringValue is a [Bindable] String var. that should hold the value of the property "dataField" of the data Object. But as  dataField evaluates de undefiend it get set to "".

On Tue, 23 Mar 2021 at 12:26, Piotr Zarzycki <pi...@gmail.com>> wrote:
Do you setup dateField in your DataGrid Column? ;)

What is the stringValue ?

On Tue, 23 Mar 2021 at 12:17, David Slotemaker de Bruine <ds...@vicensvives.com>> wrote:
Hi Piotr,

I have tried overriding the set data method. The problem is that "dataField" is undefined.

public override function set data(value:Object):void
{
super.data = value;
stringValue = value[dataField];
this.text = stringValue;
}

stringValue is cast to "".

Any thoughts?

On Tue, 23 Mar 2021 at 09:03, Piotr Zarzycki <pi...@gmail.com>> wrote:
If that's the case I would remove everything in that item renderer, override property data and there filter:

super.data = value;
if (!data) {
    this.text = "";
}

wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <ds...@vicensvives.com>> napisał(a):
Yes! but I wanted to show that the basic version is not working!

My backend returns string constants for null objects and null numbers, I need to filter these out in the renderer.

On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <pi...@gmail.com>> wrote:
Hi David,

It looks like your DataGridItemRenderer is do same thing as the default one, what's the point of creating this one ? Are you going to expand it's functionality ?

Thanks,
Piotr

wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <ds...@vicensvives.com>> napisał(a):
Hi All,

I would like to create a generic Datagrid renderer for some of my VOs. I have followed the example for TDJ but it's not going me any output or error message. My code is the following:
<?xml version="1.0" encoding="utf-8"?>
<j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:j="library://ns.apache.org/royale/jewel<http://ns.apache.org/royale/jewel>"
    xmlns:js="library://ns.apache.org/royale/basic<http://ns.apache.org/royale/basic>"
    >
    <fx:Script>
        <![CDATA[
            [Bindable("dataChange")]
            public function get stringValue():String
            {
                return data[dataField] as String;
            }
]]>
    </fx:Script>
    <j:beads>
        <j:HorizontalCenteredLayout/>
        <js:ItemRendererDataBinding />
    </j:beads>
    <j:Label text="{stringValue}"/>
</j:DataGridItemRenderer>

Is it because I am using "data[dataField]"? If so what is the best way to do this without having t create a specific Renderer for each column.

Cheers,

David


--

Piotr Zarzycki


--

David Slotemaker de Bruïne
Head of Educational Robotics



[https://docs.google.com/uc?export=download&id=1hpaD5Yp2v5dsrHcFGfM0jvZLIii5bsag&revid=0B1k3qc0H07_WSWptMmg5ejd6N3BYeERrWk1MKytQamRFMFcwPQ]

Av. Sarriá, 130 - 08017 Barcelona<https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>

T. +34 932 523 729 ext. 135

dslotemaker@vicensvives.com<ma...@vicensvives.com>


--

Piotr Zarzycki


--

David Slotemaker de Bruïne
Head of Educational Robotics



[https://docs.google.com/uc?export=download&id=1hpaD5Yp2v5dsrHcFGfM0jvZLIii5bsag&revid=0B1k3qc0H07_WSWptMmg5ejd6N3BYeERrWk1MKytQamRFMFcwPQ]

Av. Sarriá, 130 - 08017 Barcelona<https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>

T. +34 932 523 729 ext. 135

dslotemaker@vicensvives.com<ma...@vicensvives.com>
--

Piotr Zarzycki


--

David Slotemaker de Bruïne
Head of Educational Robotics



[https://docs.google.com/uc?export=download&id=1hpaD5Yp2v5dsrHcFGfM0jvZLIii5bsag&revid=0B1k3qc0H07_WSWptMmg5ejd6N3BYeERrWk1MKytQamRFMFcwPQ]

Av. Sarriá, 130 - 08017 Barcelona<https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>

T. +34 932 523 729 ext. 135

dslotemaker@vicensvives.com<ma...@vicensvives.com>

Re: Generic DataGrid Renderers

Posted by David Slotemaker de Bruine <ds...@vicensvives.com>.
package utils.renderers
{

import org.apache.royale.jewel.itemRenderers.DataGridItemRenderer;

public class StringDataGridItemRenderer extends DataGridItemRenderer
{
[Bindable]
public var stringValue:String = "";

public override function set data(value:Object):void
{
super.data = value;
stringValue = value[dataField];
this.text = stringValue;
}

public function StringDataGridItemRenderer()
{
}
}
}

On Tue, 23 Mar 2021 at 12:58, Piotr Zarzycki <pi...@gmail.com>
wrote:

> Can you show me now full code of your item renderer ?
>
> wt., 23 mar 2021 o 12:39 David Slotemaker de Bruine <
> dslotemaker@vicensvives.com> napisał(a):
>
>> Yes:
>>
>> <j:DataGridColumn label="Ciclo" dataField="ciclo" columnWidth="80"
>> itemRenderer="utils.renderers.StringDataGridItemRenderer"/>
>>
>> StringValue is a [Bindable] String var. that should hold the value of the
>> property "dataField" of the data Object. But as  dataField evaluates de
>> undefiend it get set to "".
>>
>> On Tue, 23 Mar 2021 at 12:26, Piotr Zarzycki <pi...@gmail.com>
>> wrote:
>>
>>> Do you setup dateField in your DataGrid Column? ;)
>>>
>>> What is the stringValue ?
>>>
>>> On Tue, 23 Mar 2021 at 12:17, David Slotemaker de Bruine <
>>> dslotemaker@vicensvives.com> wrote:
>>>
>>>> Hi Piotr,
>>>>
>>>> I have tried overriding the set data method. The problem is that
>>>> "dataField" is undefined.
>>>>
>>>> public override function set data(value:Object):void
>>>> {
>>>> super.data = value;
>>>> stringValue = value[dataField];
>>>> this.text = stringValue;
>>>> }
>>>>
>>>> stringValue is cast to "".
>>>>
>>>> Any thoughts?
>>>>
>>>> On Tue, 23 Mar 2021 at 09:03, Piotr Zarzycki <pi...@gmail.com>
>>>> wrote:
>>>>
>>>>> If that's the case I would remove everything in that item renderer,
>>>>> override property data and there filter:
>>>>>
>>>>> super.data = value;
>>>>> if (!data) {
>>>>>     this.text = "";
>>>>> }
>>>>>
>>>>> wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <
>>>>> dslotemaker@vicensvives.com> napisał(a):
>>>>>
>>>>>> Yes! but I wanted to show that the basic version is not working!
>>>>>>
>>>>>> My backend returns string constants for null objects and null
>>>>>> numbers, I need to filter these out in the renderer.
>>>>>>
>>>>>> On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <
>>>>>> piotrzarzycki21@gmail.com> wrote:
>>>>>>
>>>>>>> Hi David,
>>>>>>>
>>>>>>> It looks like your DataGridItemRenderer is do same thing as the
>>>>>>> default one, what's the point of creating this one ? Are you going to
>>>>>>> expand it's functionality ?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Piotr
>>>>>>>
>>>>>>> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
>>>>>>> dslotemaker@vicensvives.com> napisał(a):
>>>>>>>
>>>>>>>> Hi All,
>>>>>>>>
>>>>>>>> I would like to create a generic Datagrid renderer for some of my
>>>>>>>> VOs. I have followed the example for TDJ but it's not going me any output
>>>>>>>> or error message. My code is the following:
>>>>>>>> <?xml version="1.0" encoding="utf-8"?>
>>>>>>>> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>>>>>>>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>>>>>>>     xmlns:js="library://ns.apache.org/royale/basic"
>>>>>>>>     >
>>>>>>>>     <fx:Script>
>>>>>>>>         <![CDATA[
>>>>>>>>             [Bindable("dataChange")]
>>>>>>>>             public function get stringValue():String
>>>>>>>>             {
>>>>>>>>                 return data[dataField] as String;
>>>>>>>>             }
>>>>>>>>
>>>>>>>> ]]>
>>>>>>>>     </fx:Script>
>>>>>>>>     <j:beads>
>>>>>>>>         <j:HorizontalCenteredLayout/>
>>>>>>>>         <js:ItemRendererDataBinding />
>>>>>>>>     </j:beads>
>>>>>>>>     <j:Label text="{stringValue}"/>
>>>>>>>> </j:DataGridItemRenderer>
>>>>>>>>
>>>>>>>> Is it because I am using "data[dataField]"? If so what is the best
>>>>>>>> way to do this without having t create a specific Renderer for each column.
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>>
>>>>>>>> David
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> Piotr Zarzycki
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> *David Slotemaker de Bruïne*
>>>>>> *Head of Educational Robotics*
>>>>>>
>>>>>>
>>>>>>
>>>>>> Av. Sarriá, 130 - 08017 Barcelona
>>>>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>>>>
>>>>>>
>>>>>> T. +34 932 523 729 ext. 135
>>>>>>
>>>>>> dslotemaker@vicensvives.com
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Piotr Zarzycki
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *David Slotemaker de Bruïne*
>>>> *Head of Educational Robotics*
>>>>
>>>>
>>>>
>>>> Av. Sarriá, 130 - 08017 Barcelona
>>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>>
>>>>
>>>> T. +34 932 523 729 ext. 135
>>>>
>>>> dslotemaker@vicensvives.com
>>>>
>>> --
>>>
>>> Piotr Zarzycki
>>>
>>
>>
>> --
>>
>> *David Slotemaker de Bruïne*
>> *Head of Educational Robotics*
>>
>>
>>
>> Av. Sarriá, 130 - 08017 Barcelona
>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>
>>
>> T. +34 932 523 729 ext. 135
>>
>> dslotemaker@vicensvives.com
>>
>
>
> --
>
> Piotr Zarzycki
>


-- 

*David Slotemaker de Bruïne*
*Head of Educational Robotics*



Av. Sarriá, 130 - 08017 Barcelona
<https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>


T. +34 932 523 729 ext. 135

dslotemaker@vicensvives.com

Re: Generic DataGrid Renderers

Posted by Piotr Zarzycki <pi...@gmail.com>.
Can you show me now full code of your item renderer ?

wt., 23 mar 2021 o 12:39 David Slotemaker de Bruine <
dslotemaker@vicensvives.com> napisał(a):

> Yes:
>
> <j:DataGridColumn label="Ciclo" dataField="ciclo" columnWidth="80"
> itemRenderer="utils.renderers.StringDataGridItemRenderer"/>
>
> StringValue is a [Bindable] String var. that should hold the value of the
> property "dataField" of the data Object. But as  dataField evaluates de
> undefiend it get set to "".
>
> On Tue, 23 Mar 2021 at 12:26, Piotr Zarzycki <pi...@gmail.com>
> wrote:
>
>> Do you setup dateField in your DataGrid Column? ;)
>>
>> What is the stringValue ?
>>
>> On Tue, 23 Mar 2021 at 12:17, David Slotemaker de Bruine <
>> dslotemaker@vicensvives.com> wrote:
>>
>>> Hi Piotr,
>>>
>>> I have tried overriding the set data method. The problem is that
>>> "dataField" is undefined.
>>>
>>> public override function set data(value:Object):void
>>> {
>>> super.data = value;
>>> stringValue = value[dataField];
>>> this.text = stringValue;
>>> }
>>>
>>> stringValue is cast to "".
>>>
>>> Any thoughts?
>>>
>>> On Tue, 23 Mar 2021 at 09:03, Piotr Zarzycki <pi...@gmail.com>
>>> wrote:
>>>
>>>> If that's the case I would remove everything in that item renderer,
>>>> override property data and there filter:
>>>>
>>>> super.data = value;
>>>> if (!data) {
>>>>     this.text = "";
>>>> }
>>>>
>>>> wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <
>>>> dslotemaker@vicensvives.com> napisał(a):
>>>>
>>>>> Yes! but I wanted to show that the basic version is not working!
>>>>>
>>>>> My backend returns string constants for null objects and null numbers,
>>>>> I need to filter these out in the renderer.
>>>>>
>>>>> On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <
>>>>> piotrzarzycki21@gmail.com> wrote:
>>>>>
>>>>>> Hi David,
>>>>>>
>>>>>> It looks like your DataGridItemRenderer is do same thing as the
>>>>>> default one, what's the point of creating this one ? Are you going to
>>>>>> expand it's functionality ?
>>>>>>
>>>>>> Thanks,
>>>>>> Piotr
>>>>>>
>>>>>> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
>>>>>> dslotemaker@vicensvives.com> napisał(a):
>>>>>>
>>>>>>> Hi All,
>>>>>>>
>>>>>>> I would like to create a generic Datagrid renderer for some of my
>>>>>>> VOs. I have followed the example for TDJ but it's not going me any output
>>>>>>> or error message. My code is the following:
>>>>>>> <?xml version="1.0" encoding="utf-8"?>
>>>>>>> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>>>>>>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>>>>>>     xmlns:js="library://ns.apache.org/royale/basic"
>>>>>>>     >
>>>>>>>     <fx:Script>
>>>>>>>         <![CDATA[
>>>>>>>             [Bindable("dataChange")]
>>>>>>>             public function get stringValue():String
>>>>>>>             {
>>>>>>>                 return data[dataField] as String;
>>>>>>>             }
>>>>>>>
>>>>>>> ]]>
>>>>>>>     </fx:Script>
>>>>>>>     <j:beads>
>>>>>>>         <j:HorizontalCenteredLayout/>
>>>>>>>         <js:ItemRendererDataBinding />
>>>>>>>     </j:beads>
>>>>>>>     <j:Label text="{stringValue}"/>
>>>>>>> </j:DataGridItemRenderer>
>>>>>>>
>>>>>>> Is it because I am using "data[dataField]"? If so what is the best
>>>>>>> way to do this without having t create a specific Renderer for each column.
>>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>> David
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Piotr Zarzycki
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *David Slotemaker de Bruïne*
>>>>> *Head of Educational Robotics*
>>>>>
>>>>>
>>>>>
>>>>> Av. Sarriá, 130 - 08017 Barcelona
>>>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>>>
>>>>>
>>>>> T. +34 932 523 729 ext. 135
>>>>>
>>>>> dslotemaker@vicensvives.com
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Piotr Zarzycki
>>>>
>>>
>>>
>>> --
>>>
>>> *David Slotemaker de Bruïne*
>>> *Head of Educational Robotics*
>>>
>>>
>>>
>>> Av. Sarriá, 130 - 08017 Barcelona
>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>
>>>
>>> T. +34 932 523 729 ext. 135
>>>
>>> dslotemaker@vicensvives.com
>>>
>> --
>>
>> Piotr Zarzycki
>>
>
>
> --
>
> *David Slotemaker de Bruïne*
> *Head of Educational Robotics*
>
>
>
> Av. Sarriá, 130 - 08017 Barcelona
> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>
>
> T. +34 932 523 729 ext. 135
>
> dslotemaker@vicensvives.com
>


-- 

Piotr Zarzycki

Re: Generic DataGrid Renderers

Posted by David Slotemaker de Bruine <ds...@vicensvives.com>.
Yes:

<j:DataGridColumn label="Ciclo" dataField="ciclo" columnWidth="80"
itemRenderer="utils.renderers.StringDataGridItemRenderer"/>

StringValue is a [Bindable] String var. that should hold the value of the
property "dataField" of the data Object. But as  dataField evaluates de
undefiend it get set to "".

On Tue, 23 Mar 2021 at 12:26, Piotr Zarzycki <pi...@gmail.com>
wrote:

> Do you setup dateField in your DataGrid Column? ;)
>
> What is the stringValue ?
>
> On Tue, 23 Mar 2021 at 12:17, David Slotemaker de Bruine <
> dslotemaker@vicensvives.com> wrote:
>
>> Hi Piotr,
>>
>> I have tried overriding the set data method. The problem is that
>> "dataField" is undefined.
>>
>> public override function set data(value:Object):void
>> {
>> super.data = value;
>> stringValue = value[dataField];
>> this.text = stringValue;
>> }
>>
>> stringValue is cast to "".
>>
>> Any thoughts?
>>
>> On Tue, 23 Mar 2021 at 09:03, Piotr Zarzycki <pi...@gmail.com>
>> wrote:
>>
>>> If that's the case I would remove everything in that item renderer,
>>> override property data and there filter:
>>>
>>> super.data = value;
>>> if (!data) {
>>>     this.text = "";
>>> }
>>>
>>> wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <
>>> dslotemaker@vicensvives.com> napisał(a):
>>>
>>>> Yes! but I wanted to show that the basic version is not working!
>>>>
>>>> My backend returns string constants for null objects and null numbers,
>>>> I need to filter these out in the renderer.
>>>>
>>>> On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <pi...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi David,
>>>>>
>>>>> It looks like your DataGridItemRenderer is do same thing as the
>>>>> default one, what's the point of creating this one ? Are you going to
>>>>> expand it's functionality ?
>>>>>
>>>>> Thanks,
>>>>> Piotr
>>>>>
>>>>> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
>>>>> dslotemaker@vicensvives.com> napisał(a):
>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> I would like to create a generic Datagrid renderer for some of my
>>>>>> VOs. I have followed the example for TDJ but it's not going me any output
>>>>>> or error message. My code is the following:
>>>>>> <?xml version="1.0" encoding="utf-8"?>
>>>>>> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>>>>>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>>>>>     xmlns:js="library://ns.apache.org/royale/basic"
>>>>>>     >
>>>>>>     <fx:Script>
>>>>>>         <![CDATA[
>>>>>>             [Bindable("dataChange")]
>>>>>>             public function get stringValue():String
>>>>>>             {
>>>>>>                 return data[dataField] as String;
>>>>>>             }
>>>>>>
>>>>>> ]]>
>>>>>>     </fx:Script>
>>>>>>     <j:beads>
>>>>>>         <j:HorizontalCenteredLayout/>
>>>>>>         <js:ItemRendererDataBinding />
>>>>>>     </j:beads>
>>>>>>     <j:Label text="{stringValue}"/>
>>>>>> </j:DataGridItemRenderer>
>>>>>>
>>>>>> Is it because I am using "data[dataField]"? If so what is the best
>>>>>> way to do this without having t create a specific Renderer for each column.
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> David
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Piotr Zarzycki
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *David Slotemaker de Bruïne*
>>>> *Head of Educational Robotics*
>>>>
>>>>
>>>>
>>>> Av. Sarriá, 130 - 08017 Barcelona
>>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>>
>>>>
>>>> T. +34 932 523 729 ext. 135
>>>>
>>>> dslotemaker@vicensvives.com
>>>>
>>>
>>>
>>> --
>>>
>>> Piotr Zarzycki
>>>
>>
>>
>> --
>>
>> *David Slotemaker de Bruïne*
>> *Head of Educational Robotics*
>>
>>
>>
>> Av. Sarriá, 130 - 08017 Barcelona
>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>
>>
>> T. +34 932 523 729 ext. 135
>>
>> dslotemaker@vicensvives.com
>>
> --
>
> Piotr Zarzycki
>


-- 

*David Slotemaker de Bruïne*
*Head of Educational Robotics*



Av. Sarriá, 130 - 08017 Barcelona
<https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>


T. +34 932 523 729 ext. 135

dslotemaker@vicensvives.com

Re: Generic DataGrid Renderers

Posted by Piotr Zarzycki <pi...@gmail.com>.
Do you setup dateField in your DataGrid Column? ;)

What is the stringValue ?

On Tue, 23 Mar 2021 at 12:17, David Slotemaker de Bruine <
dslotemaker@vicensvives.com> wrote:

> Hi Piotr,
>
> I have tried overriding the set data method. The problem is that
> "dataField" is undefined.
>
> public override function set data(value:Object):void
> {
> super.data = value;
> stringValue = value[dataField];
> this.text = stringValue;
> }
>
> stringValue is cast to "".
>
> Any thoughts?
>
> On Tue, 23 Mar 2021 at 09:03, Piotr Zarzycki <pi...@gmail.com>
> wrote:
>
>> If that's the case I would remove everything in that item renderer,
>> override property data and there filter:
>>
>> super.data = value;
>> if (!data) {
>>     this.text = "";
>> }
>>
>> wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <
>> dslotemaker@vicensvives.com> napisał(a):
>>
>>> Yes! but I wanted to show that the basic version is not working!
>>>
>>> My backend returns string constants for null objects and null numbers, I
>>> need to filter these out in the renderer.
>>>
>>> On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <pi...@gmail.com>
>>> wrote:
>>>
>>>> Hi David,
>>>>
>>>> It looks like your DataGridItemRenderer is do same thing as the default
>>>> one, what's the point of creating this one ? Are you going to expand it's
>>>> functionality ?
>>>>
>>>> Thanks,
>>>> Piotr
>>>>
>>>> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
>>>> dslotemaker@vicensvives.com> napisał(a):
>>>>
>>>>> Hi All,
>>>>>
>>>>> I would like to create a generic Datagrid renderer for some of my VOs.
>>>>> I have followed the example for TDJ but it's not going me any output or
>>>>> error message. My code is the following:
>>>>> <?xml version="1.0" encoding="utf-8"?>
>>>>> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>>>>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>>>>     xmlns:js="library://ns.apache.org/royale/basic"
>>>>>     >
>>>>>     <fx:Script>
>>>>>         <![CDATA[
>>>>>             [Bindable("dataChange")]
>>>>>             public function get stringValue():String
>>>>>             {
>>>>>                 return data[dataField] as String;
>>>>>             }
>>>>>
>>>>> ]]>
>>>>>     </fx:Script>
>>>>>     <j:beads>
>>>>>         <j:HorizontalCenteredLayout/>
>>>>>         <js:ItemRendererDataBinding />
>>>>>     </j:beads>
>>>>>     <j:Label text="{stringValue}"/>
>>>>> </j:DataGridItemRenderer>
>>>>>
>>>>> Is it because I am using "data[dataField]"? If so what is the best way
>>>>> to do this without having t create a specific Renderer for each column.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> David
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Piotr Zarzycki
>>>>
>>>
>>>
>>> --
>>>
>>> *David Slotemaker de Bruïne*
>>> *Head of Educational Robotics*
>>>
>>>
>>>
>>> Av. Sarriá, 130 - 08017 Barcelona
>>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>>
>>>
>>> T. +34 932 523 729 ext. 135
>>>
>>> dslotemaker@vicensvives.com
>>>
>>
>>
>> --
>>
>> Piotr Zarzycki
>>
>
>
> --
>
> *David Slotemaker de Bruïne*
> *Head of Educational Robotics*
>
>
>
> Av. Sarriá, 130 - 08017 Barcelona
> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>
>
> T. +34 932 523 729 ext. 135
>
> dslotemaker@vicensvives.com
>
-- 

Piotr Zarzycki

Re: Generic DataGrid Renderers

Posted by David Slotemaker de Bruine <ds...@vicensvives.com>.
Hi Piotr,

I have tried overriding the set data method. The problem is that
"dataField" is undefined.

public override function set data(value:Object):void
{
super.data = value;
stringValue = value[dataField];
this.text = stringValue;
}

stringValue is cast to "".

Any thoughts?

On Tue, 23 Mar 2021 at 09:03, Piotr Zarzycki <pi...@gmail.com>
wrote:

> If that's the case I would remove everything in that item renderer,
> override property data and there filter:
>
> super.data = value;
> if (!data) {
>     this.text = "";
> }
>
> wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <
> dslotemaker@vicensvives.com> napisał(a):
>
>> Yes! but I wanted to show that the basic version is not working!
>>
>> My backend returns string constants for null objects and null numbers, I
>> need to filter these out in the renderer.
>>
>> On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <pi...@gmail.com>
>> wrote:
>>
>>> Hi David,
>>>
>>> It looks like your DataGridItemRenderer is do same thing as the default
>>> one, what's the point of creating this one ? Are you going to expand it's
>>> functionality ?
>>>
>>> Thanks,
>>> Piotr
>>>
>>> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
>>> dslotemaker@vicensvives.com> napisał(a):
>>>
>>>> Hi All,
>>>>
>>>> I would like to create a generic Datagrid renderer for some of my VOs.
>>>> I have followed the example for TDJ but it's not going me any output or
>>>> error message. My code is the following:
>>>> <?xml version="1.0" encoding="utf-8"?>
>>>> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>>>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>>>     xmlns:js="library://ns.apache.org/royale/basic"
>>>>     >
>>>>     <fx:Script>
>>>>         <![CDATA[
>>>>             [Bindable("dataChange")]
>>>>             public function get stringValue():String
>>>>             {
>>>>                 return data[dataField] as String;
>>>>             }
>>>>
>>>> ]]>
>>>>     </fx:Script>
>>>>     <j:beads>
>>>>         <j:HorizontalCenteredLayout/>
>>>>         <js:ItemRendererDataBinding />
>>>>     </j:beads>
>>>>     <j:Label text="{stringValue}"/>
>>>> </j:DataGridItemRenderer>
>>>>
>>>> Is it because I am using "data[dataField]"? If so what is the best way
>>>> to do this without having t create a specific Renderer for each column.
>>>>
>>>> Cheers,
>>>>
>>>> David
>>>>
>>>
>>>
>>> --
>>>
>>> Piotr Zarzycki
>>>
>>
>>
>> --
>>
>> *David Slotemaker de Bruïne*
>> *Head of Educational Robotics*
>>
>>
>>
>> Av. Sarriá, 130 - 08017 Barcelona
>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>
>>
>> T. +34 932 523 729 ext. 135
>>
>> dslotemaker@vicensvives.com
>>
>
>
> --
>
> Piotr Zarzycki
>


-- 

*David Slotemaker de Bruïne*
*Head of Educational Robotics*



Av. Sarriá, 130 - 08017 Barcelona
<https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>


T. +34 932 523 729 ext. 135

dslotemaker@vicensvives.com

Re: Generic DataGrid Renderers

Posted by David Slotemaker de Bruine <ds...@vicensvives.com>.
OK! I will try that!

On Tue, 23 Mar 2021 at 09:03, Piotr Zarzycki <pi...@gmail.com>
wrote:

> If that's the case I would remove everything in that item renderer,
> override property data and there filter:
>
> super.data = value;
> if (!data) {
>     this.text = "";
> }
>
> wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <
> dslotemaker@vicensvives.com> napisał(a):
>
>> Yes! but I wanted to show that the basic version is not working!
>>
>> My backend returns string constants for null objects and null numbers, I
>> need to filter these out in the renderer.
>>
>> On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <pi...@gmail.com>
>> wrote:
>>
>>> Hi David,
>>>
>>> It looks like your DataGridItemRenderer is do same thing as the default
>>> one, what's the point of creating this one ? Are you going to expand it's
>>> functionality ?
>>>
>>> Thanks,
>>> Piotr
>>>
>>> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
>>> dslotemaker@vicensvives.com> napisał(a):
>>>
>>>> Hi All,
>>>>
>>>> I would like to create a generic Datagrid renderer for some of my VOs.
>>>> I have followed the example for TDJ but it's not going me any output or
>>>> error message. My code is the following:
>>>> <?xml version="1.0" encoding="utf-8"?>
>>>> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>>>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>>>     xmlns:js="library://ns.apache.org/royale/basic"
>>>>     >
>>>>     <fx:Script>
>>>>         <![CDATA[
>>>>             [Bindable("dataChange")]
>>>>             public function get stringValue():String
>>>>             {
>>>>                 return data[dataField] as String;
>>>>             }
>>>>
>>>> ]]>
>>>>     </fx:Script>
>>>>     <j:beads>
>>>>         <j:HorizontalCenteredLayout/>
>>>>         <js:ItemRendererDataBinding />
>>>>     </j:beads>
>>>>     <j:Label text="{stringValue}"/>
>>>> </j:DataGridItemRenderer>
>>>>
>>>> Is it because I am using "data[dataField]"? If so what is the best way
>>>> to do this without having t create a specific Renderer for each column.
>>>>
>>>> Cheers,
>>>>
>>>> David
>>>>
>>>
>>>
>>> --
>>>
>>> Piotr Zarzycki
>>>
>>
>>
>> --
>>
>> *David Slotemaker de Bruïne*
>> *Head of Educational Robotics*
>>
>>
>>
>> Av. Sarriá, 130 - 08017 Barcelona
>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>
>>
>> T. +34 932 523 729 ext. 135
>>
>> dslotemaker@vicensvives.com
>>
>
>
> --
>
> Piotr Zarzycki
>


-- 

*David Slotemaker de Bruïne*
*Head of Educational Robotics*



Av. Sarriá, 130 - 08017 Barcelona
<https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>


T. +34 932 523 729 ext. 135

dslotemaker@vicensvives.com

Re: Generic DataGrid Renderers

Posted by Piotr Zarzycki <pi...@gmail.com>.
If that's the case I would remove everything in that item renderer,
override property data and there filter:

super.data = value;
if (!data) {
    this.text = "";
}

wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <
dslotemaker@vicensvives.com> napisał(a):

> Yes! but I wanted to show that the basic version is not working!
>
> My backend returns string constants for null objects and null numbers, I
> need to filter these out in the renderer.
>
> On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <pi...@gmail.com>
> wrote:
>
>> Hi David,
>>
>> It looks like your DataGridItemRenderer is do same thing as the default
>> one, what's the point of creating this one ? Are you going to expand it's
>> functionality ?
>>
>> Thanks,
>> Piotr
>>
>> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
>> dslotemaker@vicensvives.com> napisał(a):
>>
>>> Hi All,
>>>
>>> I would like to create a generic Datagrid renderer for some of my VOs. I
>>> have followed the example for TDJ but it's not going me any output or error
>>> message. My code is the following:
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>>     xmlns:js="library://ns.apache.org/royale/basic"
>>>     >
>>>     <fx:Script>
>>>         <![CDATA[
>>>             [Bindable("dataChange")]
>>>             public function get stringValue():String
>>>             {
>>>                 return data[dataField] as String;
>>>             }
>>>
>>> ]]>
>>>     </fx:Script>
>>>     <j:beads>
>>>         <j:HorizontalCenteredLayout/>
>>>         <js:ItemRendererDataBinding />
>>>     </j:beads>
>>>     <j:Label text="{stringValue}"/>
>>> </j:DataGridItemRenderer>
>>>
>>> Is it because I am using "data[dataField]"? If so what is the best way
>>> to do this without having t create a specific Renderer for each column.
>>>
>>> Cheers,
>>>
>>> David
>>>
>>
>>
>> --
>>
>> Piotr Zarzycki
>>
>
>
> --
>
> *David Slotemaker de Bruïne*
> *Head of Educational Robotics*
>
>
>
> Av. Sarriá, 130 - 08017 Barcelona
> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>
>
> T. +34 932 523 729 ext. 135
>
> dslotemaker@vicensvives.com
>


-- 

Piotr Zarzycki

Re: Generic DataGrid Renderers

Posted by David Slotemaker de Bruine <ds...@vicensvives.com>.
Yes! but I wanted to show that the basic version is not working!

My backend returns string constants for null objects and null numbers, I
need to filter these out in the renderer.

On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <pi...@gmail.com>
wrote:

> Hi David,
>
> It looks like your DataGridItemRenderer is do same thing as the default
> one, what's the point of creating this one ? Are you going to expand it's
> functionality ?
>
> Thanks,
> Piotr
>
> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
> dslotemaker@vicensvives.com> napisał(a):
>
>> Hi All,
>>
>> I would like to create a generic Datagrid renderer for some of my VOs. I
>> have followed the example for TDJ but it's not going me any output or error
>> message. My code is the following:
>> <?xml version="1.0" encoding="utf-8"?>
>> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>     xmlns:js="library://ns.apache.org/royale/basic"
>>     >
>>     <fx:Script>
>>         <![CDATA[
>>             [Bindable("dataChange")]
>>             public function get stringValue():String
>>             {
>>                 return data[dataField] as String;
>>             }
>>
>> ]]>
>>     </fx:Script>
>>     <j:beads>
>>         <j:HorizontalCenteredLayout/>
>>         <js:ItemRendererDataBinding />
>>     </j:beads>
>>     <j:Label text="{stringValue}"/>
>> </j:DataGridItemRenderer>
>>
>> Is it because I am using "data[dataField]"? If so what is the best way to
>> do this without having t create a specific Renderer for each column.
>>
>> Cheers,
>>
>> David
>>
>
>
> --
>
> Piotr Zarzycki
>


-- 

*David Slotemaker de Bruïne*
*Head of Educational Robotics*



Av. Sarriá, 130 - 08017 Barcelona
<https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>


T. +34 932 523 729 ext. 135

dslotemaker@vicensvives.com

Re: Generic DataGrid Renderers

Posted by Piotr Zarzycki <pi...@gmail.com>.
Hi David,

It looks like your DataGridItemRenderer is do same thing as the default
one, what's the point of creating this one ? Are you going to expand it's
functionality ?

Thanks,
Piotr

wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
dslotemaker@vicensvives.com> napisał(a):

> Hi All,
>
> I would like to create a generic Datagrid renderer for some of my VOs. I
> have followed the example for TDJ but it's not going me any output or error
> message. My code is the following:
> <?xml version="1.0" encoding="utf-8"?>
> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
>     xmlns:j="library://ns.apache.org/royale/jewel"
>     xmlns:js="library://ns.apache.org/royale/basic"
>     >
>     <fx:Script>
>         <![CDATA[
>             [Bindable("dataChange")]
>             public function get stringValue():String
>             {
>                 return data[dataField] as String;
>             }
>
> ]]>
>     </fx:Script>
>     <j:beads>
>         <j:HorizontalCenteredLayout/>
>         <js:ItemRendererDataBinding />
>     </j:beads>
>     <j:Label text="{stringValue}"/>
> </j:DataGridItemRenderer>
>
> Is it because I am using "data[dataField]"? If so what is the best way to
> do this without having t create a specific Renderer for each column.
>
> Cheers,
>
> David
>


-- 

Piotr Zarzycki