我是 icefaces 组件的新手,想使用与展示 [ice:selectInputText 展示][1] 中相同的 ice:selectInputText 组件,但展示中显示的默认 css 对我来说功能不同。当输入某些内容时,我会得到下拉列表,但是当在任何项目上移动鼠标时,值显示为透明行并且没有突出显示。
谁能指导问题出在哪里:这是我的代码:test.xhtml
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ice="http://www.icesoft.com/icefaces/component">
<h:head></h:head>
<h:body>
<h:form>
<h:panelGroup>
<h:outputLabel value="Enter your name(autocomplete) :"></h:outputLabel>
<ice:selectInputText id="heloo"
value="#{helloBean.selectedItem}"
rows="10" width="152" valueChangeListener="#{helloBean.ValueChangeL}" actionListener="#{helloBean.ActionL}">
<f:selectItems value="#{helloBean.itemList}"></f:selectItems>
</ice:selectInputText>
</h:panelGroup>
</h:form>
</h:body>
</html>
托管bean类:
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
import com.icesoft.faces.component.selectinputtext.SelectInputText;
@ManagedBean( name= "helloBean")
@SessionScoped
public class HelloBean {
private String selectedItem;
private Integer seelectedId;
private List<SelectItem> itemList=new ArrayList<SelectItem>();
public String getSelectedItem() {
return selectedItem;
}
public void setSelectedItem(String selectedItem) {
this.selectedItem = selectedItem;
}
public Integer getSeelectedId() {
return seelectedId;
}
public void setSeelectedId(Integer seelectedId) {
this.seelectedId = seelectedId;
}
public List<SelectItem> getItemList() {
return itemList;
}
public void setItemList(List<SelectItem> itemList) {
this.itemList = itemList;
}
public void ValueChangeL(ValueChangeEvent event)
{
String query=(String) event.getNewValue();
System.out.println("query is "+query);
SelectItem item1=new SelectItem();
SelectItem item2=new SelectItem();
SelectItem item3=new SelectItem();
item1.setLabel("abc");
item1.setValue(1);
item2.setLabel("bbc");
item2.setValue(2);
item3.setLabel("aaa");
item3.setValue(3);
itemList.add(item1);
itemList.add(item2);
itemList.add(item3);
}
public void ActionL(ActionEvent event)
{
System.out.println("HELLO IN LISTENER of SELECTINPUTTEXT"+event.getSource().toString());
System.out.println("HELLO IN LISTENER of PHASEID IS"+event.getPhaseId());
if ( event != null && event.getSource() instanceof SelectInputText )
{
SelectInputText comp_ = (SelectInputText) event.getSource();
SelectItem selectItem_ = comp_.getSelectedItem();//critical line
System.out.println("selected id"+selectItem_.getValue());
seelectedId=(Integer)selectItem_.getValue();
}
}
public String submitFunc()
{
System.out.println("checking selected item: "+ selectedItem );
System.out.println("checking selected id: "+ seelectedId );
return "success";
}
}