Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Ayden Smith   on Sep 19 In Java Category.

  
Question Answered By: Jamie Williams   on Sep 19

I'm not sure whether "advertisementCategoryDataAction.componentList"
is a collection of string or not. but I guess
selectedAdvertisement.title is a String.
Probably you've bound the selectItems tag lib to a collection of
object and the selectOneMenu to a String. So there is an
incompatibility in types.

I suppose that advertisementCategoryDataAction.componentList is a
collection of YourComponent class which has a member called title. You
must override the equals method and compare the input argument with
this.title. Something like this


public class YourCompoenent {

public String getTitle() {...}
public void setTitle(String title) {...}

@Override
public boolean equals(Object object) {

if(object instanceof String)
return this.getTitle().equals(object);
}
return super.equals(object);
}

}

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on A question regarding ICEFACES Or get search suggestion and latest updates.


Tagged: