2014-01-22 29 views
0

我正在嘗試使用ajax實現optiontransferselect。我無法將值從左側移動到右側。我在代碼中添加了<%@ taglib uri="/struts-dojo-tags" prefix="sx"%>標記,並且還包含<sx:head/>,但它不起作用。請幫我解決問題。如何使用ajax實現optiontransferselect

my.jsp

<%@taglib uri="/struts-tags" prefix="s" %> 
<%@ taglib uri="/struts-dojo-tags" prefix="sx"%> 
<head> 
<sx:head/> 
</head> 

<div class="width2 margin-bottom margin-top"> 
       <div class="profile-text"> 
        Preferred Location 
       </div> 

       <s:optiontransferselect 
       id="city" 
       name="cityNo" 
       list="cityList" 
       listKey="id" 
       listValue="cityName" 
       headerKey="0" 
       headerValue="City" 
       onfocus="getcitywithCountry(false);" 

       doubleList="prefererList" 
       doubleId="city" 
       doubleListKey="cityId.id" 
       doubleListValue="cityId.cityName" 
       doubleHeaderKey="0" 
       doubleHeaderValue="--selected locations--" 
       doubleName="selectedLocations" allowUpDownOnLeft="false" allowUpDownOnRight="false"/> 

      </div> 
+0

哪個版本的Struts2? –

+0

我正在使用的版本是2.3.1.2 –

+0

@UmarMuktharKadherIbrahim您不需要'dojo'在'struts2'中運行'optiontransferselect'。你能發佈完整的jsp嗎? –

回答

0

我看不出有你的代碼錯誤。您需要刪除<%@ taglib uri="/struts-dojo-tags" prefix="sx"%>參考。將<sx:head/>替換爲<s:head/>