ok, I think I need other set of eyes on this code…I’m sure it’s something minor that I’m not seeing…
I have code that displayed an editor form:
function editor(event,rc,prc){
event.paramValue(“id”, " ");
prc.system = ppsdService.get(rc.id);
event.setView(“ppsd/editor”);
}
This code for the form:
#html.startForm(action=“PPSDHandlerORM.save”)#
#html.entityFields(entity=prc.system,fieldwrapper=“div”)#
#html.submitButton()# or #html.href(href=“PPSDHandlerORM”,text=“Cancel”)#
#html.endForm()#
–As you can see, I cfdump the rc.id value, and it’s there; however, as soon as the submit occurs, which calls to the actions “Save”, rc.id is no longer available, which caused a new id and record to be created instead of editing an existing one… Am I missing something that would cause the rc.id to be ignored as soon as the form action is called?
function save(event,rc,prc){
event.paramValue(“id”, “”);
var system = populateModel(ppsdService.get( rc.id ));
var vResults = validateModel(system );
system.setModifiedDate(now());
prc.system = system;
event.setView(“ppsd/debug”);
if( !vResults.hasErrors() ){
ppsdService.save( system );
getPlugin(“MessageBox”).info(“System Saved!”);
setNextEvent(“PPSDHandlerORM/index”);
}
else{
getPlugin(“MessageBox”).error(messageArray=vResults.getAllErrors());
return editor(event,rc,prc);
}
}
Thank you looking over this for me…