Atozed Forums

Full Version: COMMUNICATION BETWEEN INTRAWEB FORMS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Dear Companions

I would like to request a help from you.

I am new to using Intraweb.

I'm studying the Intraweb that was originally installed in Delhi Tokyo (Version 14).

I have a question that I need your help with.

Let's imagine a Delphi project for Windows.
And in this project I have 2 forms:
a)-the first is for research
b)-the second for Registration
In the Search form I have a Button: EDIT, in which I create the Register form and pass to it the Table ID.
In the form of Registration I have a property with ID of the Table.
From then on, the Register form is autonomous and manages your actions using the ID Property.

But as I understand it, what works in a Windows application would no longer work in an Intraweb Web Application.

The problem is that I understand that in Intraweb I cannot use the Public Section
of any Form or datamodule, because the value will be public for all users connected.

So, how do you pass values between one form and another?

Grateful

Carlos
Brazil
IntraWeb acts very much like a normal Windows VCL/FMX application. You can use the public section of each form class (but not the non class area) safely. In fact, just look at the IntraWeb demos and how they pass data around.
Thanks for your attention!

Please, how can I access the Intraweb Demos?
Dear sir

Let me see if I understood.

Can I have the following situation Below?

FORM 1:
=====
procedure TIWForm2.IWButton1Click(Sender: TObject);
var
frm: TIWForm3;
begin
frm := TIWForm3.Create(WebApplication);
frm.UserMessage := edtUserMassage.Text;
frm.Show;
end;

FORM 2:
=====
type
TIWForm3 = class(TIWAppForm)
IWButton1: TIWButton;
procedure IWAppFormShow(Sender: TObject);
procedure IWButton1Click(Sender: TObject);
private
FUserMessage: string;
public
property UserMessage: string read FUserMessage write FUserMessage;
end;

implementation

{$R *.dfm}

procedure TIWForm3.IWAppFormShow(Sender: TObject);
begin
WebApplication.ShowNotification(FUserMessage);
end;

QUESTION : The USERMESSAGE property value will only be visible for the current user?

Thanks for your help.
Yes, but as you have it private you wont be able to set it here:

frm.UserMessage := edtUserMassage.Text;

You need to make it public in TIWForm3
Yes, each connected user has its own instance of a TIWForm3, so when you set FUserMessage for one user, the other user will still have a different FUserMessage value.

If you have 2 connected users, you will have 2 instances of TIWForm3.
Your information was very clear to me!

Now I understand that I can use the Public section of any form.
for the purpose of creating properties and allowing forms to
communicate.

I'm still starting to study Intraweb.

Thank you very much for your kindness and attention!