2012-10-11 33 views
0

我正在使用pieGraph並根據點擊餅圖做一些頁面交互。這些工作很好。以編程方式選擇並清除ADF DVT餅圖上的選擇

<dvt:pieGraph id="graph1" tabularData="#{dc.bean.tabularData}" dataSelection="single" selectionListener="#{dc.bean.transfersGraphSelectionListener}"/>

但是我不能夠支持以下用例

  1. 單擊圖形外(或單擊選中的數據重新設定)應引起餡餅圖表失去其選擇。
  2. 在頁面上有一個清晰的按鈕,強制圖形失去當前選擇。
  3. 編程選擇數據組中的一個圖表中

我查了UIGraph API也沒有找到多少信息。

任何提示將非常有幫助。

+0

這將有助於你告訴我們你的jdev版本。 selectionListener是做什麼的?如果將表格數據設置爲空模型會發生什麼? –

+0

嗨Timo,謝謝你的回覆。我使用的是Jdev 12.1.2,但是我也很滿意任何與Jdev11g兼容的解決方案。 –

+0

我的選擇監聽器讀取選擇事件並查找哪個區域被點擊 'transfersGraphSelectionListener(SelectionEvent selectionEvent){ Set selectionSet = selectionEvent.getGraphSelection(); (GraphSelection selection:selectionSet){ if(DataSelection的選擇實例)DataSelection ds =(DataSelection)selection; Set seriesKeySet = ds.getSeriesKey()。keySet(); (Object key:seriesKeySet){ Object selectedKey = ds.getSeriesKey()。get((String)key)) –

回答

0

請將正確的代碼添加到您的原始帖子。這就是你的代碼看起來像

transfersGraphSelectionListener(SelectionEvent selectionEvent){ 
    Set<GraphSelection> selectionSet = selectionEvent.getGraphSelection(); 
    for (GraphSelection selection : selectionSet) { 
    if (selection instanceof DataSelection) { 
     DataSelection ds = (DataSelection) selection; 
     Set seriesKeySet = ds.getSeriesKey().keySet(); 
     for (Object key : seriesKeySet) { 
     Object selectedKey = ds.getSeriesKey().get((String) key)) 
     } 

看起來有點失蹤!

+0

嗨Timo Hahn,'Object selectedKey = ds.getSeriesKey()。get((String)key)'給出了我所選圖形中數據行的名稱。現在,如果我在頁面上有一個按鈕,並且要從中清除此圖形的選擇,那麼我該怎麼做? adf pieGraph在我的bean中有約束力。我希望我的情況現在更清楚了嗎? –

+0

任何想法的人? –

相關問題