Genii Weblog

Working on Hide-When sample

Mon 11 Oct 2004, 09:57 AM



by Ben Langhinrichs
One of the interesting ways people use our Midas Rich Text LSX is to manipulate, and often get rid of, hide-when formulas.  The reason why getting rid of them is so important is explained more fully in Rich Text 101 - Hide-when formulas, but I'm sure many of you have experienced it.  A form has a rich text field with certain hide-when formulas, and after the hide-when formulas are changed or removed, the rich text is still hidden, or not hiding, as the case may be.  This is because the hide-when flags and formulas are stored in the rich text separately from the form.

In any case, these and more complex hide-when issues are fairly easily handled by Midas, but I wind up answering too many questions about how to set and clear and manipulate them, so I am working on a Hide-When sample database that will show both our Midas Rich Text LSX and @Midas Formulas setting and clearing hide-when flags and formulas on both documents and forms.  Some examples:

Using Midas Rich Text LSX to clear all hide-when flags and formulas
Set rtitem = New GeniiRTItem
Call rtitem.ConnectBackend(doc.Handle, "Body")
If rtitem.IsConnected Then
   rtitem.Everything.HideFormula = ""
   rtitem.Everything.ParagraphStyle = |
      -HIDE_WEB 
      -HIDE_NOTES 
      -HIDE_READ
     -HIDE_PREVIEW_READ 
      -HIDE_EDIT 
      -HIDE_PREVIEW_EDIT 
      -HIDE_PRINT 
      -HIDE_MOBILE 
      -HIDE_EMBEDDED 
      -HIDE_COPY|
   rtitem.Save
End If

Using @Midas Formulas to clear all hide-when flags and formulas
@DbCommand("Midas":"NoCache"; "HideFormula"; ""; @DocumentUniqueID; "Body", "");
@DbCommand("Midas":"NoCache"; "ParagraphStyle"; ""; @DocumentUniqueID; "Body", "-HIDE_WEB -HIDE_NOTES -HIDE_READ -HIDE_PREVIEW_READ -HIDE_EDIT -HIDE_PREVIEW_EDIT -HIDE_PRINT -HIDE_MOBILE -HIDE_EMBEDDED -HIDE_COPY);

Using Midas Rich Text LSX to replace text in hide-when formula
Set rtitem = New GeniiRTItem
Call rtitem.ConnectBackend(doc.Handle, "Body")
If rtitem.IsConnected Then
   Call rtitem.Everything.ReplaceText("LeadArbitrator", "Leader", "HIDE_FORMULA");
   If rtitem.Modified Then rtitem.Save
End If

Any requests
If you have any specific requests for this or any other sample db, let me know here or by e-mail to .

Copyright 2004 Genii Software Ltd.

What has been said:

No documents found