You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by mark goldin <ma...@gmail.com> on 2015/04/28 21:13:07 UTC

MX datagrid with and override set dataProvider

I am trying to come up with the following datagrid definition:
<mx:DataGrid headerHeight="0" rowHeight="28"
 dataProvider="{_someData">
<mx:Script>
<![CDATA[
override public function set dataProvider(value:Object):void
{
if (value)
{
}
else
{
}
}
]]>
</mx:Script>
<mx:columns>
........

I am getting:
Method marked override must override another method.

Any idea why am I getting it?

Thanks

Re: MX datagrid with and override set dataProvider

Posted by Alex Harui <ah...@adobe.com>.
Mark, is this the actual code or did you edit it before posting?  A true
top tag in MXML generally has xmlns attributes.

-Alex

On 4/28/15, 1:31 PM, "mark goldin" <ma...@gmail.com> wrote:

>But DataGrid does have set dataProvider function.
>
>On Tue, Apr 28, 2015 at 3:22 PM, Evyatar Ben Halevi-Arbib <
>evyatarbh@gmail.com> wrote:
>
>> Is mx:DataGrid tag the first tag in this custom component?
>> Because it basically tells you the parent component doesn't have a
>>function
>> with the same signature, so it can't override it.
>>
>> Regards,
>> Evyatar
>>
>> On Tue, Apr 28, 2015 at 10:13 PM, mark goldin <ma...@gmail.com>
>> wrote:
>>
>> > I am trying to come up with the following datagrid definition:
>> > <mx:DataGrid headerHeight="0" rowHeight="28"
>> >  dataProvider="{_someData">
>> > <mx:Script>
>> > <![CDATA[
>> > override public function set dataProvider(value:Object):void
>> > {
>> > if (value)
>> > {
>> > }
>> > else
>> > {
>> > }
>> > }
>> > ]]>
>> > </mx:Script>
>> > <mx:columns>
>> > ........
>> >
>> > I am getting:
>> > Method marked override must override another method.
>> >
>> > Any idea why am I getting it?
>> >
>> > Thanks
>> >
>>


Re: MX datagrid with and override set dataProvider

Posted by mark goldin <ma...@gmail.com>.
But DataGrid does have set dataProvider function.

On Tue, Apr 28, 2015 at 3:22 PM, Evyatar Ben Halevi-Arbib <
evyatarbh@gmail.com> wrote:

> Is mx:DataGrid tag the first tag in this custom component?
> Because it basically tells you the parent component doesn't have a function
> with the same signature, so it can't override it.
>
> Regards,
> Evyatar
>
> On Tue, Apr 28, 2015 at 10:13 PM, mark goldin <ma...@gmail.com>
> wrote:
>
> > I am trying to come up with the following datagrid definition:
> > <mx:DataGrid headerHeight="0" rowHeight="28"
> >  dataProvider="{_someData">
> > <mx:Script>
> > <![CDATA[
> > override public function set dataProvider(value:Object):void
> > {
> > if (value)
> > {
> > }
> > else
> > {
> > }
> > }
> > ]]>
> > </mx:Script>
> > <mx:columns>
> > ........
> >
> > I am getting:
> > Method marked override must override another method.
> >
> > Any idea why am I getting it?
> >
> > Thanks
> >
>

Re: MX datagrid with and override set dataProvider

Posted by Evyatar Ben Halevi-Arbib <ev...@gmail.com>.
Is mx:DataGrid tag the first tag in this custom component?
Because it basically tells you the parent component doesn't have a function
with the same signature, so it can't override it.

Regards,
Evyatar

On Tue, Apr 28, 2015 at 10:13 PM, mark goldin <ma...@gmail.com> wrote:

> I am trying to come up with the following datagrid definition:
> <mx:DataGrid headerHeight="0" rowHeight="28"
>  dataProvider="{_someData">
> <mx:Script>
> <![CDATA[
> override public function set dataProvider(value:Object):void
> {
> if (value)
> {
> }
> else
> {
> }
> }
> ]]>
> </mx:Script>
> <mx:columns>
> ........
>
> I am getting:
> Method marked override must override another method.
>
> Any idea why am I getting it?
>
> Thanks
>

Re: MX datagrid with and override set dataProvider

Posted by mark goldin <ma...@gmail.com>.
No, that's not it. The syntax is correct.


On Tue, Apr 28, 2015 at 3:58 PM, Rudolf Schnetler <ru...@stripedog.com>
wrote:

> Hi Mark,
>
> Did you copy your code correctly?
>
> If you did, then the problem is probably how you end the mx:Datagrid tag.
> It should be:
>
> <mx:DataGrid headerHeight="0" rowHeight="28"
>  dataProvider="{_someData"}/>
>
> Misiing the }/ just before the >.
>
> Regards
>
> Rudolf
>
> On Wed, Apr 29, 2015 at 5:13 AM, mark goldin <ma...@gmail.com>
> wrote:
>
> > I am trying to come up with the following datagrid definition:
> > <mx:DataGrid headerHeight="0" rowHeight="28"
> >  dataProvider="{_someData">
> > <mx:Script>
> > <![CDATA[
> > override public function set dataProvider(value:Object):void
> > {
> > if (value)
> > {
> > }
> > else
> > {
> > }
> > }
> > ]]>
> > </mx:Script>
> > <mx:columns>
> > ........
> >
> > I am getting:
> > Method marked override must override another method.
> >
> > Any idea why am I getting it?
> >
> > Thanks
> >
>

Re: MX datagrid with and override set dataProvider

Posted by Rudolf Schnetler <ru...@stripedog.com>.
Hi Mark,

Did you copy your code correctly?

If you did, then the problem is probably how you end the mx:Datagrid tag.
It should be:

<mx:DataGrid headerHeight="0" rowHeight="28"
 dataProvider="{_someData"}/>

Misiing the }/ just before the >.

Regards

Rudolf

On Wed, Apr 29, 2015 at 5:13 AM, mark goldin <ma...@gmail.com> wrote:

> I am trying to come up with the following datagrid definition:
> <mx:DataGrid headerHeight="0" rowHeight="28"
>  dataProvider="{_someData">
> <mx:Script>
> <![CDATA[
> override public function set dataProvider(value:Object):void
> {
> if (value)
> {
> }
> else
> {
> }
> }
> ]]>
> </mx:Script>
> <mx:columns>
> ........
>
> I am getting:
> Method marked override must override another method.
>
> Any idea why am I getting it?
>
> Thanks
>

Re: MX datagrid with and override set dataProvider

Posted by Alex Harui <ah...@adobe.com>.
I don’t think you can have a script block for a child tag. I think all
script blocks belong to the top-level tag.

You should be able to declare an mxml component with DataGrid at the top.
Flex 4 users should be able to use fx:Component in the fx:Declarations
block as well.

-Alex

On 4/28/15, 4:06 PM, "mark goldin" <ma...@gmail.com> wrote:

>Sorry for the confusion. DataGrid lives inside of a VBox along with other
>components.
>
>On Tue, Apr 28, 2015 at 5:49 PM, Rudolf Schnetler <ru...@stripedog.com>
>wrote:
>
>> I don't understand what are you trying to do. Do you want to change the
>> dataprovider dynamically depending on a condition?
>>
>> On Wed, Apr 29, 2015 at 5:13 AM, mark goldin <ma...@gmail.com>
>> wrote:
>>
>> > I am trying to come up with the following datagrid definition:
>> > <mx:DataGrid headerHeight="0" rowHeight="28"
>> >  dataProvider="{_someData">
>> > <mx:Script>
>> > <![CDATA[
>> > override public function set dataProvider(value:Object):void
>> > {
>> > if (value)
>> > {
>> > }
>> > else
>> > {
>> > }
>> > }
>> > ]]>
>> > </mx:Script>
>> > <mx:columns>
>> > ........
>> >
>> > I am getting:
>> > Method marked override must override another method.
>> >
>> > Any idea why am I getting it?
>> >
>> > Thanks
>> >
>>


Re: MX datagrid with and override set dataProvider

Posted by Rudolf Schnetler <ru...@stripedog.com>.
Is it possible for you to give the full code?

On Wed, Apr 29, 2015 at 9:06 AM, mark goldin <ma...@gmail.com> wrote:

> Sorry for the confusion. DataGrid lives inside of a VBox along with other
> components.
>
> On Tue, Apr 28, 2015 at 5:49 PM, Rudolf Schnetler <ru...@stripedog.com>
> wrote:
>
> > I don't understand what are you trying to do. Do you want to change the
> > dataprovider dynamically depending on a condition?
> >
> > On Wed, Apr 29, 2015 at 5:13 AM, mark goldin <ma...@gmail.com>
> > wrote:
> >
> > > I am trying to come up with the following datagrid definition:
> > > <mx:DataGrid headerHeight="0" rowHeight="28"
> > >  dataProvider="{_someData">
> > > <mx:Script>
> > > <![CDATA[
> > > override public function set dataProvider(value:Object):void
> > > {
> > > if (value)
> > > {
> > > }
> > > else
> > > {
> > > }
> > > }
> > > ]]>
> > > </mx:Script>
> > > <mx:columns>
> > > ........
> > >
> > > I am getting:
> > > Method marked override must override another method.
> > >
> > > Any idea why am I getting it?
> > >
> > > Thanks
> > >
> >
>

Re: MX datagrid with and override set dataProvider

Posted by mark goldin <ma...@gmail.com>.
Sorry for the confusion. DataGrid lives inside of a VBox along with other
components.

On Tue, Apr 28, 2015 at 5:49 PM, Rudolf Schnetler <ru...@stripedog.com>
wrote:

> I don't understand what are you trying to do. Do you want to change the
> dataprovider dynamically depending on a condition?
>
> On Wed, Apr 29, 2015 at 5:13 AM, mark goldin <ma...@gmail.com>
> wrote:
>
> > I am trying to come up with the following datagrid definition:
> > <mx:DataGrid headerHeight="0" rowHeight="28"
> >  dataProvider="{_someData">
> > <mx:Script>
> > <![CDATA[
> > override public function set dataProvider(value:Object):void
> > {
> > if (value)
> > {
> > }
> > else
> > {
> > }
> > }
> > ]]>
> > </mx:Script>
> > <mx:columns>
> > ........
> >
> > I am getting:
> > Method marked override must override another method.
> >
> > Any idea why am I getting it?
> >
> > Thanks
> >
>

Re: MX datagrid with and override set dataProvider

Posted by Rudolf Schnetler <ru...@stripedog.com>.
I don't understand what are you trying to do. Do you want to change the
dataprovider dynamically depending on a condition?

On Wed, Apr 29, 2015 at 5:13 AM, mark goldin <ma...@gmail.com> wrote:

> I am trying to come up with the following datagrid definition:
> <mx:DataGrid headerHeight="0" rowHeight="28"
>  dataProvider="{_someData">
> <mx:Script>
> <![CDATA[
> override public function set dataProvider(value:Object):void
> {
> if (value)
> {
> }
> else
> {
> }
> }
> ]]>
> </mx:Script>
> <mx:columns>
> ........
>
> I am getting:
> Method marked override must override another method.
>
> Any idea why am I getting it?
>
> Thanks
>