• 15 апреля стартует «Курс «SQL-injection Master» ©» от команды The Codeby

    За 3 месяца вы пройдете путь от начальных навыков работы с SQL-запросами к базам данных до продвинутых техник. Научитесь находить уязвимости связанные с базами данных, и внедрять произвольный SQL-код в уязвимые приложения.

    На последнюю неделю приходится экзамен, где нужно будет показать свои навыки, взломав ряд уязвимых учебных сайтов, и добыть флаги. Успешно сдавшие экзамен получат сертификат.

    Запись на курс до 25 апреля. Получить промодоступ ...

Lotus Можно Ли Кодом Узнать Закрыта Секция Или Открыта На Форме?

  • Автор темы StarikStarik2705
  • Дата начала
S

StarikStarik2705

есть форма и я хочу выполнить код какой то с условием что секция открыта, или закрыта, к примеру ws.currentDocument.gotoField("1dfgdfg") обращаюсь к полю в секции, если секция закрыта этот код выдаст ошибку что я немогу добраться до поля. Есть ли возможность узнать закрыта или открыта секция?
 

savl

Lotus Team
28.10.2011
2 597
310
BIT
179
NotesRichTextSection class
Properties: IsExpanded
To access a NotesRichTextSection object, use the NotesRichTextNavigator methods in conjunction with the type RTELEM_TYPE_SECTION
Data type: Boolean
Syntax
To get: flag = notesRichTextSection.IsExpanded
To set: notesRichTextSection.IsExpanded = flag

Legal values
True indicates that the section is expanded.
False indicates that the section is collapsed.
Note For Release 6, IsExpanded is reliable only if "Don't auto expand or collapse" is set for the environment in which the code is running (Previewed, Opened for reading, Opened for editing, or Printed). This is the default setting. IsExpanded is not reliable where "Auto-expand section" or "Auto-collapse section" is set.
 
S

StarikStarik2705

NotesRichTextSection class
Properties: IsExpanded
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim dc As NotesDocumentCollection
Set dc = db.UnprocessedDocuments
Dim doc As NotesDocument
Set doc = dc.GetFirstDocument
Dim rti As NotesRichTextItem
Set rti = doc.GetFirstItem("Body")
Dim rtnav As NotesRichTextNavigator
Set rtnav = rti.CreateNavigator
If Not rtnav.FindFirstElement(RTELEM_TYPE_SECTION) Then
Messagebox "Body item does not contain a section,",, _
"Error"
Exit Sub
End If
Dim rts As NotesRichTextSection
Do
Set rts = rtnav.GetElement
If rts.IsExpanded Then
Messagebox "Section is expanded",, rts.Title
Else
Messagebox "Section is not expanded",, rts.Title
End If
Loop While rtnav.FindNextElement

Нет нет нет, эта штука найдёт секцию внутри Рич поля, а в моём случае я просто на форме секцию сделал, и хочу узнать закрыта она или нет
 

savl

Lotus Team
28.10.2011
2 597
310
BIT
179
Хм.. вот оно как...
Если с ходу, без сильных раздумий: в UI - обрабатывать ошибку GotoField, которую ты получаешь, ее номер 4407.
4407 Document command is not available.
Можно ли такое сделать в BackEnd...
Думаю без RTF со встроенной секцией никак.
Смотрел через scanEz, секция как отдельный объект не отображается.
Да и через XML не поможет, вот: 'qwe2' - внутри секции
Так что...
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE document SYSTEM 'xmlschemas/domino_8_5_3.dtd'>
<document xmlns='http://www.lotus.com/dxl' version='8.5' maintenanceversion='3.0'
replicaid='44257A620026FDA7' form='123'>
<noteinfo noteid='90a' unid='CDE0F5328E65352344257B34004437CC' sequence='2'>
<created><datetime>20130320T162507,32+04</datetime></created>
<modified><datetime>20130320T162520,61+04</datetime></modified>
<revised><datetime>20130320T162520,60+04</datetime></revised>
<lastaccessed><datetime>20130320T162520,61+04</datetime></lastaccessed>
<addedtofile><datetime>20130320T162510,89+04</datetime></addedtofile></noteinfo>
<updatedby><name>CN=/O=/C=RU</name></updatedby>
<revisions><datetime>20130320T162510,88+04</datetime></revisions>
<item name='$EncryptionStatus'><textlist><text>0</text></textlist></item>
<item name='$SignatureStatus'><textlist><text>0</text></textlist></item>
<item name='INN'><textlist><text>44444</text></textlist></item>
<item name='InnEQ'><textlist><text>44444</text></textlist></item>
<item name='qwe2'><textlist><text>123123123</text></textlist></item></document>
 
Мы в соцсетях:

Обучение наступательной кибербезопасности в игровой форме. Начать игру!