0
我有使用Struts的autocompleter通過JSON填充的選擇框:檢查JSON填充的Struts autocompleter
<sj:autocompleter
id="stop"
name="stopId"
href="%{stopsUrl}"
list="stops"
listValue="stopName"
listKey="stopId"
autocomplete="true"
loadMinimumCount="2"
delay="200"
tabindex="1"
onSelectTopics="onStopSelected"
/>
這使得一個Ajax請求stopsUrl
返回各自有一個stopId
和stops
對象的列表stopName
以及stopType
。 我需要在某處保存stopType
(我猜想通過使用JQuery data
函數),然後當用戶選擇一個停止時,onStopSelected
函數將檢索stopType
並對其執行某些操作。
所以我想我需要檢查JSON響應中的數據,以獲得每個站點的stopType
。但是我怎樣才能訪問它?我需要訂閱哪個活動?有沒有可能使用Struts?