0

i am new to the icefaces components, want to use ice:selectInputText component same as in showcase [ice:selectInputText showcase][1] but the default css as it is shown in showcase doesnot functions same for me. i get dropdown list when something entered but the values shown as transparent rows and nothing highlited when move mouse on any item.

Can anyone guide where can be the problem: here's my code: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>

Managed bean class:

 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";

}
  }
Zay hf
  • 139
  • 2
  • 4
  • 12

1 Answers1

1

There is more to the showcase than that is shown on the page. There are some stylesheets that are included on that page.

If you want to have the same kind of styling. Refer to their code base here and include those as well.

Ravi Kadaboina
  • 8,494
  • 3
  • 30
  • 42