For the record (so others do not waste a lot of time)
in controller:
_value=XML(thipage.body,sanitize=True)

should have been
value=XML(thipage.body,sanitize=True)

first example will clear the nicedit panel
second example will include content from db.page.body

got there in the end?

On Feb 27, 8:17 pm, murray3 <[email protected]> wrote:
> Thanks Massimo,
> I did try using _value=XML(thipage.body,sanitize=True)  previouslyand
> although it saves the value in correct format, when the input button
> clicked /  activated thenicedittextarea clears?
>
> If you click it again the updated record data shows but is a mixture
> of the correct format
> data and some markup?
> Have you encountered this problem before ?
> Chrism
>
> On Feb 27, 3:28 pm, mdipierro <[email protected]> wrote:
>
> > for your second problem
>
> > >                 else:
> > >                         response.flash="form is invalid!"
>
> > should be
>
> > >                 elif form.errors:
> > >                         response.flash="form is invalid!"
>
> > About your first problem:
>
> > replace
>
> > _value=thispage.body
>
> > with
>
> > _value=XML(thipage.body,sanitize=True)
>
> > On Feb 27, 2:27 am, murray3 <[email protected]> wrote:
>
> > > works with the following in controller:
> > > def edit():
> > >                 try: thispage=db(db.page.id==request.args[0]).select()
> > > [0]
> > >                 except: redirect(URL(r=request,f='index'))
> > >                 form=FORM(DIV(TEXTAREA(_style="width: 98%;",
> > > _name="wikibody1",
> > > _id="wikibody1",_value=thispage.body)),INPUT
> > > (_type="submit",_value="Save"))
> > >                 if form.accepts(request.vars,session):
> > >                         thispage.update_record
> > > (body=form.vars.wikibody1)
> > >                         response.flash="form accepted!"
> > >                 else:
> > >                         response.flash="form is invalid!"
> > >                 return dict(form=form,page=thispage)
>
> > > BUT I'm having trouble as theNiceditrepresentation does not show on
> > > refresh, I can show it on
> > > a nonniceditview using {{=XML(page.body,sanitize=True)}} in HTML
> > > but
> > > not sure what to add in above controller to allow the same
> > > functionality??
>
> > > Also the response.flash="form is invalid!" code runs when I load the
> > > above edit view, that must mean it is submitting form on page load,
> > > which I do not want!
>
> > > I would like to add that I would be keen to offer my services to
> > > Document this little journey of discovery for others :)
> > > chrism
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to