You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Kothari, Rahul" <Ra...@bofasecurities.com> on 2005/06/27 15:36:01 UTC
Lazy List problem
Hello All,
I have a collection - externalRatings which is of type
CpExternalCreditRating. CpExternalCreditRating contains an object
appCreditRatingSource inside it. Basically, there are nested objects. I
use the nested tags to display all the info onto the user screen. The
values get displayed properly , problem is when I update something and
submit the form ... I get an java.lang.IllegalArgumentException: No bean
specified exception. When I removed the text fields using
appCreditRatingSource objects inside the CpExternalCreditRating objects
and tried to just update the values inside CpExternalCreditRating....it
submitted the form without any problem and I was able to retrieve the
collection from my DynaForm.....so ,
"externalRatings[0].appCreditRatingSource.srcNm" throws an exception but
"externalRatings[0].ratingValTxt" works fine.
Here is my Form bean....
public class UpdateCpRatingForm extends DynaValidatorForm {
/**
* override the reset method....its called before hitting Action
*/
List externalRatings = null;
private Map values = new HashMap();
public void reset(ActionMapping mapping, HttpServletRequest
request) {
super.reset(mapping, request);
externalRatings = ListUtils.lazyList(new ArrayList(), new
ExternalRatingBeanFactory());
this.set("externalRatings",externalRatings);
}
public void setValue(String key, Object value) {
this.set(key, value);
}
public Object getValue(String key) {
return this.get(key);
}
public Map getAllValues() {
return this.getMap();
}
class ExternalRatingBeanFactory implements Factory {
/**
* Create a new instance of the TradeAdjBean object
*/
public Object create() {
return new CpExternalCreditRating();
}
}
}
Please suggest what to do ? I have been stuck with this for some time
now.
Rahul