PDA

View Full Version : section.edit() toggles, doesn't just set on



HankFay
2013-08-08, 18:23
The .edit() method of the Section class, per the wiki, is supposed to put the section in edit mode. In fact, however, both in RC7 release and the latest RC8 pre-release, it toggles edit mode.

Which is actually great, if (and only if) there is an attribute that we could use to know whether the section was in fact in edit mode already.

This is so in dev/run and in runtime.

So, the $64,000 question: is there a way to know whether a section is in editmode?

thanks,

Hank

barrymavin
2013-08-08, 20:43
If you want to put the section into editmode and not untoggle it if it is already in editmode use the following (which can be an inline delegate ir coded as below)

Lianja.showDocument("page: page1.section1?action=editmode")

this puts the section into editmode but does not toggle it out of editmode if its already in that state.

HankFay
2013-08-08, 21:08
If you want to put the section into editmode and not untoggle it if it is already in editmode use the following (which can be an inline delegate ir coded as below)

Lianja.showDocument("page: page1.section1?action=editmode")

this puts the section into editmode but does not toggle it out of editmode if its already in that state.

Glad I asked!

thanks,

Hank