0

我创建了跷跷板/桌子,如下所示

(def table (seesaw/table :model [:columns [:uid :name :price :qty]
                                 :rows [{:uid "1" :name "book1" :price "20" :qty "2"}
                                        {:uid 2 :name "book2" :price "40" :qty "2"} ]]
                          :selection-mode :single))

此后,我创建了一个上下拆分面板,并在创建的表格上方添加了一个新按钮。现在在按钮的单击事件上,我想选择表格的行/项目。我正在尝试的代码如下

(defn tableButtonwidget1 [](let [top (seesaw/vertical-panel :items [table])
    bottom (seesaw/vertical-panel :items [(seesaw/button :text "Rent"  
    :listen [:action  (fn [e](if-let [s (:selection table)]
                                (println "Current selection is " s)
                                (println "No selection")))])])]
    (seesaw/top-bottom-split top bottom)))                                                                                

但是每次我选择行时都是“无选择”,谁能指导我犯了什么错误?

4

0 回答 0