Java: Map遍历

Categories: Java; Tagged with: ; @ January 26th, 2010 10:43
		// 2. 遍历map中所有的元素
		Iterator>> iter = mapSheet.entrySet().iterator();
		while(iter.hasNext()) {
			Entry> entry = iter.next();
			int sheetIndex = entry.getKey(); // Key
			List listReportItems = entry.getValue(); // Value

		}

Flex: 运行Application出现URI is not absolute错误的解决方法

Categories: Flex; Tagged with: ; @ January 26th, 2010 9:10

Application已经改动, 但仍使用了运行中的旧有Application, 因此会出现该错误.

解决方法: 点击Application, run(debug) as, 而不是直接点击run 或 debug中的记录.

Flex:使用direction控制TileList的显示方向

Categories: Flex; Tagged with: ; @ January 21st, 2010 18:11

TileBase.direction

属性

direction:String  [读写]

此控件布置其子控件的方向。可能的值为 TileBaseDirection.HORIZONTAL 和 TileBaseDirection.VERTICAL。默认值为 TileBaseDirection.HORIZONTAL。

如果值为 TileBaseDirection.HORIZONTAL,则将沿第一行布置拼贴直至达到可见的列数或 maxColumns,然后再填充新行。如果创建的行数多于一次能够显示的行数,控件将显示垂直 scrollbar。如果值为 TileBaseDirection.VERTICAL,情况相反。

此属性可用作数据绑定的源。修改此属性后,将调度 directionChanged 事件。

Pasted from <http://livedocs.adobe.com/flex/3_cn/langref/mx/controls/listClasses/TileBase.html#direction>

如下图, 展示了一个竖排的TileList

image

DragDrop时, 使用DragEvent.dragInitiator来获得Drag源头, 而非DragEvent.relatedObject

Categories: Flex; Tagged with: ; @ January 21st, 2010 17:23

首发: http://riashanghai.com/node/123

问题描述:

在进行DragDrop时, 我使用了DragDrop.relatedObject来获得Drag触发的UIComponent

如: var dargUI:TileList = e.relatedObject as TileList;

在AIR中运行, 可用且没有任何错误, 但当使用浏览器版本时, e.relatedObject为null, 上一行代码报错.

 

解决方法:

因此, 如果需要在两种环境中都可以运行, 应使用e.dragInitiator来获取Drag触发的源头:

	//----------------------------------
	//  dragInitiator 来源: DragEvent
	//----------------------------------

	/**
	 *  The component that initiated the drag.
	 */
	public var dragInitiator:IUIComponent;

Flex: Datagrid派发ITEM_EDIT_BEGIN后因fm/focusManager为Null报错的解决方法

Categories: Flex; Tagged with: ; @ January 15th, 2010 22:09

某DataGrid 监听Editor_BEGIN事件, 如果有数据未保存切换界面时, 会弹出Alert, 在弹出Alert之后, 确定切换界面时, DataGrid报错:
DataGrid的itemEditorItemEditBeginHandler方法中:
var fm:IFocusManager = focusManager; 该fm也就是focusManager为Null, 导致出现错误.
恰好focusManager属性为Protected.
解决方法, 在DataGridGrade(该类继承了DataGrid)的onEditBegin方法中增加了

if(focusManager == null) {
	e.preventDefault()
	return;
}

Newer Posts <-> Older Posts



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.