public String entityName;
public WOComponent nextPage;
public WOComponent nextPage(WOComponent sender) {
WOComponent result=nextPage;
if (eo.editingContext()!=null) { // save was clicked
ConfirmPageInterface confirmPage = D2W.factory().confirmPageForEntityNamed(entityName,
sender.session());
_MassModificatorDelegate cb=new _MassModificatorDelegate();
NSMutableArray keys = new NSMutableArray();
for (Enumeration e = displayPropertyKeys.objectEnumerator(); e.hasMoreElements();) {
String key = (String) e.nextElement();
if(key.matches("^((\\w+).?)+$")) {
keys.addObject(key);
}
}
cb.eo=eo; cb.displayPropertyKeys=keys; cb.nextPage=nextPage; cb.list=list;
confirmPage.setConfirmDelegate(cb);
confirmPage.setCancelDelegate(new ERDPageDelegate(nextPage));
StringBuffer message=new StringBuffer("You are about to modify <b>"+list.count()+"</b> "+entityName+"(s) in the following manner:<br><br>");
for (Enumeration e= keys.objectEnumerator(); e.hasMoreElements();) {
String key=(String)e.nextElement();
if(key.matches("((\\w+).?)+")) {
Object value=eo.valueForKey(key);
if (value!=null && (!(value instanceof String) || ((String)value).length()>0)) { // for text areas which return ""
message.append(key);
message.append("<br>");
}
}
}
message.append("<br><br>Are you sure you want to proceed?");
confirmPage.setMessage(message.toString());
result=(WOComponent)confirmPage;
}
return result;
}