开发者

Creating Flex Elements Server Side

i wonder if it is possible to pre-configurate Flex Elements on the Server. I have the Problem with a custom ItemRenderer which turns out to be very slow. It would be开发者_如何学Python very cool to pre-process such an element on the server instead in the clients browser... somehow? Maybe it is possible to produce the MXML dynamically on the server for that.

This is it basically. I create a Label for each data entry in an array list. This entry is added to a BorderContainer and this goes to the containing element as a whole here. Sometimes i add 200 - 300 items this way which is costing very high computing cost at client side. So i wonderd if i could just pass this as a whole dynamic mxml element to the client.

override public function set data(value:Object):void {

        _data = value as WordResultObject;

        var data:WordResultObject = _data as WordResultObject;

        this.removeAllElements();

        if(_data!=null)
        {


            _l.text = data.wordform;

            _l.setStyle("fontSize", data.fontSize);
            _l.setStyle("color", data.color);

            _l.toolTip = "Frequency: " + data.freq;

            if(data.date != null)
            {

                _l.toolTip += "\nDate: " + AppUtils.TimeString(data.date as Date);

                _l.addClickEvent(data.id as int, data.date as Date);
            }
            _border.addElement(_l);


            this.addElement(_border);


        }
    }

Thank you

Andreas


I wonder if it is possible to pre-configurate Flex Elements on the Server.

Not that I know of. Perhaps if you go back to Flex 1 / 1.5 which was primarily a server based platform. I do not expect rolling your code back to an "old" server would improve efficiency at all, though. How would you expect this work? What benefit are you expecting to receive.

I have the Problem with a custom ItemRenderer which turns out to be very slow.

Show your code; and perhaps we can help you with writing your renderer to be more efficient.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜