[wix-users] How come the RTF content in the ScrollableText be modified dynamically using session.Database.OpenView and InsertTemporary

Shintaro Takechi devst119 at gmail.com
Thu Nov 5 23:45:56 PST 2020


By the way, the ScrollableText side is implemented as following.
I can see in the orca that text is properly assigned and the UI is
displaying the "default text" correctly.

<Control Id="Verification" Type="ScrollableText" X="180" Y="80" Width="410"
Height="280" Sunken="yes" TabSkip="no"
Text="{\rtf1\ansi\deff0{\colortbl;\red0\green0\blue0;\red255\green0\blue0;}default
text\line}"/>

I am attempting to update the Text column to following Rich Text Content.

{\rtf1\ansi\deff0{\colortbl;\red0\green0\blue0;\red255\green0\blue0;}
\cf1
This line is the default color\line
\cf2
This line is red\line
\cf1
This line is the default color
}

If I did not call the CustomAction, the default text is properly displayed.
However, if I attempt to update (and view.InsertTemporary(record)), the
ScrollableText displays nothing. (Not even the default value).

On Thu, Nov 5, 2020 at 3:49 PM Shintaro Takechi <devst119 at gmail.com> wrote:

> Hi,
>
> Thanks to this question ( https://stackoverflow.com/a/33679439/1076116 ),
> I was able to make a custom action that temporary update and modifies the
> MSI Database on the fly.
>
> In a nutshell following is the custom action code that I have to update
> the Table. I have dialog EndDlg with ScrollableText control Verification.
>
> ```
> var view = session.Database.OpenView("SELECT * FROM Control WHERE
> Dialog_='EndDlg' AND Control='Verification'");
> view.Execute();
> var record = view.Fetch();
> view.Delete(record);
> record.SetString("Text", sRtfText);
> view.InsertTemporary(record); // also tried original post's
> view.Modify(ViewModifyMode.InsertTemporary, record); as well but no luck
> ```
>
> However, upon the End Dialog is opened, somehow, the updated text is gone
> and default text is shown.
>
> When I do check for the text column, in the custom action, I can see that
> it has been updated properly. (I checked ahead of modification via CA to
> make sure default WAS there and IS UPDATED).
>
> Just for the sake of it I made another custom action that is separate from
> this custom action just to check for the Text entry in the EndDlg
> Verification Control and it is properly updated. And it was updated
> properly as expected.
>
> I thought it may be due to the fact that EndDlg is called via OnExit, so I
> added the same control in the first dialog, but the result is the same, the
> Text is not updated on the screen (actually the text is removed).
>
> If it is updated properly, why is it gone?
>



More information about the wix-users mailing list