Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

CoreInputText instanceOf error

Adrian Ahmed
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to create an interface for a questionnaire where to use a tr:selectManyCheckBox and tr:inputText.
Bellow i give you the relevant code and at the end I'll address the question.

<tr:selectManyCheckbox id="#{concat('question')">
<f:selectItems value="#{question.optionItems}">

<tr:inputText id="#{concat('question')"/>

public static int COUNTER = 0;
public static String concat(String str){
str = str+COUNTER;
return str;

public SelectItem[] getOptionItems{
return optionItems;

public String next(){
javax.faces.component.UIViewRoot root = FacesContext.getCurrentInstance() .getViewRoot() ;
Map requestMap = FacesContext.getExternalContext().getRequestParameterMap() ;
Iterator it = map.entrySet().iterator();
String str = null;
Object ob=null;
ob = root.findComponent(str);

if(ob instanceOf CoreSelectManyCheckbox){
log.debug("coreselectManyCheckbox " + str);
CoreSelectManyCheckbox checkBoxes = (CoreSelectManyCheckbox) ob;
log.debug("coreselectManyCheckbox values " + checkBoxes.getValue());
}else if(ob instanceOf CoreInputText){
log.debug("coreinputtext " +str);
CoreInputText coreinputtext = (CoreInputText) ob;
log.debug("coreinputtext values " + coreinputtext.getValue());


The problem is the logger writes:
coreselectManyCheckbox question1
coreselectManyCheckbox values [1,2,3,5]
coreselectManyCheckbox question2
coreselectManyCheckbox values null

I don't understand why I get this logs? In my opinion I should get:

coreselectManyCheckbox question1
coreselectManyCheckbox values [1,2,3,5]
coreinputtext question2
coreinputtext values test

Please help me to understand what is wrong with instanceOf test

Always! Wait. Never. Shut up. Look at this tiny ad.
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!