开发者

update xml file at runtime in flex

How can I add new nodes/elements/properties to the existing xml file at runtime in flex. I have a xml file which is used to display components in flex. I want to add/edit component and their properties at runtime.

xml file sample:

<view id="productView" label="Products">
<panel id="chartPanel" type="CHART" ChartType="Pie2D" title="Productwise Sales"  x="215" y="80" width="425" he开发者_运维问答ight="240" showValues="0" >  
  < /panel> 
< /view>

To add new component I have created an object with all the properties and elements of components. How can I convert this object in xml format and update the existing xml file?

Thanks in advance!


There is not direct way to do so.

If you wanna create objects which is dinamically created trought XML, you must wrap each component which you are planing to use.

If i were on such a problem to solve, i would probably create a proxy class, which primary target will be to produce objects out of the xml, and check if the objects ( represented by their name ) exists - just to apply the new properties.

you basically shall override each class which you are planing to use in order to be refreshed trought XML ( some Interface implementation would do the job here, due the common behaviour ).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜