Flex的。 pushView数据对象被转换成字符串转换成、字符串、对象、数据

由网友(姐,就是拽)分享简介:执行navigator.pushView与数据对象后,我在需要该数据对象的要被接收到下一个视图,但在某些阶段转变为一个字符串在SQL函数来使用。下面的code显示了我工作的时刻。 After executing a navigator.pushView with data object, I'm in need o...

执行navigator.pushView与数据对象后,我在需要该数据对象的要被接收到下一个视图,但在某些阶段转变为一个字符串在SQL函数来使用。 下面的code显示了我工作的时刻。

After executing a navigator.pushView with data object, I'm in need of the data object to be received into the next view, but at some stage transformed into a string to use in a sql function. The code below shows what i'm working on at the moment.

<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark" title="{data.toString()}"
    xmlns:model="model.*"
    creationComplete  = "{data=srv.findByCategory(data.toString())}"
    >

的ToString()是我快速的尝试,但最终输出的结果只是

.toString() was my quick attempt at it, but the resultant output is simply

[对象的对象]

有没有什么错误,但它只是在调试过程中显示。

There aren't any errors but it only shows during debug.

任何想法?

感谢。

/ ** 作为附属物,这里是从那里数据对象从起源初始视图code

/** As appendage, here is the code from the initial view where the data object originates from

<s:List id="list" top="0" bottom="0" left="0" right="0" width="100%"
        alternatingItemColors="0xffffff"
        contentBackgroundColor="0xffffff"
        downColor="0xfc7d1a"
        selectionColor="0xfc7d1a"           
        dataProvider="{data}"
        labelFunction="getFullName"
        change="navigator.pushView(CategoryView, list.selectedItem.toString())">

这里是一些它需要的数据对象是一个字符串的code。

And here is some of the code which needs the data object to be a String.

public function findByCategory(searchKey:String):ArrayCollection
        {
}

干杯。 ** /

Cheers. **/

推荐答案

数据是一个包含包含你从最初的观点通过信息键控对象。您需要访问你的对象正确的密钥。

data is a keyed object containing containing the info you passed from the initial view. You need to access the correct key in your object.

这应该是类似 data.myKey.toString()。我就可以确切地告诉你,如果你粘贴pushView code。

It should be something like data.myKey.toString(). I would be able to tell you exactly if you paste your pushView code.

阅读全文

相关推荐

最新文章