asp.net mvc - Orchard data entry forms without admin -
we're working diligently @ learning orchard, goal of creating not websites, business-centric web applications write in months using mvc, hope much more efficient using various parts available.
the lastly mile, though, seems big block -- how tell orchard should create shape allows end-user edit data? there's bit on of end-user editing @ creating module orchard stores info front-end picks after data's been entered , carries through controller's post operation. can't figure out how through initial operation.
to elaborate, in straight mvc might allow user come in info themselves. i'd have /controllers/personcontroller.cs , there write create() function. i'd add together view in /views/person/create.cshtml , "return view()" controller. in create(person p), httpget method, i'd heavy lifting save object.
now in orchard have personpart , personpartdriver which, understand above article, write post method take personpart , save object.
class personcontroller : controller { private readonly irepository<personpartrecord> personrepository; public personcontroller(irepository<personpartrecord> _personrepository) { personrepository = _personrepository; } [httppost] public create(personpart part) { personrepository.create(part.record); } } all well, how orchard invoke editor(personpart, dynamic) method form user initial info entry?
protected override driverresult editor(personpart part, dynamic shapehelper) { homecoming contentshape("parts_person_edit", () => shapehelper.editortemplate( templatename: "parts/person", model: part, prefix: prefix)); } or write create() method in controller? if that, though, i'm bypassing entire shape creation system, no? itches in of brain saying should rather doing display() and, in template, making editable form, have display() readonly view of person ... how create know want editable view?
hope question makes sense, , hope can assist.
thanks.
have orchard.customforms
var model = _contentmanager.buildeditor(contentitem); homecoming view(model); but you'll need code above. homecoming shaperesult(this,model) too
asp.net-mvc orchardcms orchardcms-1.8 orchard-modules
No comments:
Post a Comment