SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IntraWeb : how to dispatch?

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
rhodan



Joined: 14 Jan 2003
Posts: 5

PostPosted: Tue Jan 14, 2003 6:06 pm    Post subject: IntraWeb : how to dispatch? Reply with quote

Hi,
I'm trying to use TSiLang component with Intraweb solution (with D7 Ent.), but I don't understand how to create a Dispatcher. I'm trying to use a DataModule create with User's Session but when user switch Language it raises an exception.

Some Help?

Rhodan
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Tue Jan 14, 2003 7:38 pm    Post subject: Reply with quote

I supose that in IntraWeb applications you won't need dispatcher or you may put it onto your IntraWeb form. But I suggest to use "per form language" settings. Just configure manually your IntraWeb form active language depending on user selection or so on.
Also may be we can build a sample IntraWebn application for this case if you provide us simple specification for your case.
Back to top
View user's profile Send private message
rhodan



Joined: 14 Jan 2003
Posts: 5

PostPosted: Wed Jan 15, 2003 10:52 am    Post subject: Reply with quote

Hi from Paris,

Why don't use a Dispatcher. It's more simple to use such a component created in User's Session Class.
If not, how to control in a simple way, all IWForm with a siLang component an each?
I'm looking for a similar way to process between Classical Application and Intraweb Application. It's for our translators Smile

Thanks for your answer.

Rhodan
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Wed Jan 15, 2003 3:23 pm    Post subject: Reply with quote

We'll try to reproduce this situation. but also it would be helpful if you point us what kind of exception you get. Smile
Back to top
View user's profile Send private message
rhodan



Joined: 14 Jan 2003
Posts: 5

PostPosted: Thu Jan 16, 2003 3:10 pm    Post subject: Detailled Code Reply with quote

Hi,

this is the code used for my IW Application :

-- unit ServerController-----------------------------------------
Code:

unit ServerController;
{PUBDIST}

interface

uses
  SysUtils, Classes, IWServerControllerBase,
  // For OnNewSession Event
  IWApplication, IWAppForm, siComp,
  DataModule_User;

type
  TDMSvrCtler = class(TIWServerControllerBase)
    procedure IWServerControllerBaseNewSession(ASession: TIWApplication;
      var VMainForm: TIWAppForm);
  private
  public
  end;

  // --------- Session Class -------------
  TDMUserSession = Class (TComponent)
  public
        DM_USer : TDM_User;
        constructor Create(AOwner: TComponent); override;
  End;                                                       
implementation
{$R *.dfm}
uses
  IWInit;
constructor TDMUserSession.create(AOwner : TComponent);
Begin
     DM_User := TDM_User.Create(AOwner);
End;
procedure TDMSvrCtler.IWServerControllerBaseNewSession(
  ASession: TIWApplication; var VMainForm: TIWAppForm);
begin
  //ASession.Data := TUserSession.Create;
  ASession.Data := TDMUserSession.Create(ASession);
end;
end.

-- unit DataModule_User -----------------------------------------
Code:

unit DataModule_User;

interface

uses
  SysUtils, Classes, siComp;

type
  TDM_User = class(TDataModule)
    LangDispatcher: TsiLangDispatcher;
  private
  public
    procedure ActiveLang(Num : integer);
  end;
var
  DM_User: TDM_User;

implementation
{$R *.dfm}
Procedure TDM_User.ActiveLang(Num : integer);
Begin
     LangDispatcher.ActiveLanguage := Num;
End;
end.

-------------------------------
On an event I set
DM_User.activeLang(2);
LangDispatcher supports 2 languages.

WepApplication starts fine, but an Event an EAccessViolation occurs in my Application on line : Confused
LangDispatcher.ActiveLanguage := Num;

Thanks for your help.

Rhodan
Back to top
View user's profile Send private message
gaivans



Joined: 29 Nov 2002
Posts: 71

PostPosted: Thu Jan 16, 2003 3:44 pm    Post subject: Reply with quote

Hello,

We cannot reproduce the problem. Could you send us that project you have tested? Otherwise you can download our small test project from
http://www.sicomponents.com/soft/IW_SiLang.zip and compare with yours.
Back to top
View user's profile Send private message AIM Address MSN Messenger
rhodan



Joined: 14 Jan 2003
Posts: 5

PostPosted: Wed Jan 22, 2003 12:41 pm    Post subject: Your example works Reply with quote

Hi,

it's annoying, your example works Very Happy
I'm looking for the source of problem in my code, may be the included TMS Component for IW...

In all case thanks for your great support!

Rhodan
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group