Jump to content

Forms problem


codeb

Recommended Posts

I work on database application with one main form and one toolbar on it. When I click one of button on toolbar, second form show, but... On second form I have some UniDBLokupCombos and when I change some get some error message, after that nothing on form can work (like button to close form, other combos etc). After that mesage I must close form on close button on window. When I call form again everything work perfect....? What I can do?

Link to comment
Share on other sites

  • Administrators

Two Issues logged:

 

0001186: Bug when exception is raised in Form.OnShow event

0001185: Bug when exception is raised before created form is shown

 

Temporary workaround:

 

Create forms using below method:

 

  
 frmPredmet:= TfrmPredmet.Create(uniapplication);
 try
  .
  .
  .
 	frmPredmet.show;
  .
  .
  .

 except
frmPredmet.Free;
raise;
 end;

Link to comment
Share on other sites

I don't know how you can't start application. Here is compiled one (must include in URL this parameters orgid=1 and userid=1).

Now I use code that you write and don't get error messages but now one shows up when I enter in first UniDBLookupCombo.

Somethings wrong but I can't find what?

 

One more thing... I have problem with UniDBNavigator also. When I click on some buttons also get error....

Link to comment
Share on other sites

  • Administrators

I don't know how you can't start application. Here is compiled one (must include in URL this parameters orgid=1 and userid=1).

 

I did and I got this error:

 

qPredmeti: Type mismatch for field 'klas', expecting: WideString actual: Integer

 

Now I use code that you write and don't get error messages but now one shows up when I enter in first UniDBLookupCombo.

Somethings wrong but I can't find what?

 

Where is first UniDBLookupCombo.?

 

One more thing... I have problem with UniDBNavigator also. When I click on some buttons also get error....

 

Where is UniDBNavigator?

 

I get below error when I press some of the buttons:

 

Cannot perform this operation on a closed dataset

 

 

Please give me exact steps to reproduce your errors.

Link to comment
Share on other sites

  • Administrators

You have right, I made some changes to DB and you get old base and new application. Here is new SQL dump and project.

After run with parameters go to PageControl Tab "predmeti", then click on "+", then you will get problematic form .

 

OK, what will I choose next in problematic form to reprduce it? There are so many options there.

Link to comment
Share on other sites

Ok! You can go first to UniDBLookupComboBox-es, when enter text (type in 01 in first, 01 or 02 in second) you will get error. Also you can add UniDBNavigator and you will see, when you click on button (like add) error will show up.

Are you have some messenger or something to chat in real time?

Link to comment
Share on other sites

  • Administrators

Ok! You can go first to UniDBLookupComboBox-es, when enter text (type in 01 in first, 01 or 02 in second) you will get error. Also you can add UniDBNavigator and you will see, when you click on button (like add) error will show up.

Are you have some messenger or something to chat in real time?

 

I put 01 and 02 and no error appears. Maybe because of recent changes I've done to Lookup components.

 

Which dataset should I attach UniDBNavigator to ? There are so many Datasets in your project.

Link to comment
Share on other sites

  • Administrators

Please wait for next build which addresses some of your issues.

 

-----

 

procedure TmainForm.setlevel0;
begin
 btnPresignacija.Visible:=false;
 btnDodajObavezu.visible:=false;
 
 FrmPredmet.btnStampanjeDostavnice.visible:=true;
 frmPredmet.btStampanjeOmota.visible:=true;
 frmPredmet.btnDodavanjeAkata.visible:=true;
 
 UniPanel11.Visible:=false;
 UniPanel9.Visible:=true;
 UniPanel4.Visible:=true;
 UniToolBar1.Visible:=true;
 UniPagecontrol1.Pages[1].Visible:=true;
end;

 

In above code you modify frmPredmet, but you don't show it. Modifying an invisible Form is not supported in uniGUI. Beside you never use frmPredmet in your code afterwards.

 

In above code you do lots of Visble:=True/False. While it is legal to do that it is not best way to design a Web app. It creates lots of unnecessary JS code at runtime which slows down your app performance.

 

-------

 

frmStavke:=Tfrmstavke.Create(uniapplication);

frmStavke.show;

 

Why you create Forms in code?

 

Why not simply call:

 

frmStavke.ShowModal;

 

------

 

procedure TMainForm.UniFormResize(Sender: TObject);
begin
UniPageControl1.Width:= screen.Width -95;
UniPageControl1.height:= screen.height;

UniPageControl1.left:=0;
end;

procedure TMainForm.UniFormScreenResize(Sender: TObject; AWidth,
 AHeight: Integer);
begin
UniPageControl1.Width:= screen.Width -150;
UniPageControl1.height:= screen.height -270;

UniPageControl1.left:=97;
end;

 

You use lots of code to manually maintain positions. It is not needed and adds unnecessary complexity to your code. Use built-in Aligning and Anchoring features which are powerful enough to create a decent floating UI.

Link to comment
Share on other sites

  • Administrators

Besides, please specify the exact piece of code where you are stuck, the exact steps to reproduce your problem and the exact error messages you get. In your project at many points I receive "Can not perform X on a closed Dataset" I don't see this as a problem as it has nothing to do with uniGUI.

 

Thanks

Link to comment
Share on other sites

First thanks on some suggestions

 

 

I use this 'big' code

procedure TmainForm.setlevel0;

begin

btnPresignacija.Visible:=false;

btnDodajObavezu.visible:=false;

 

FrmPredmet.btnStampanjeDostavnice.visible:=true;

frmPredmet.btStampanjeOmota.visible:=true;

frmPredmet.btnDodavanjeAkata.visible:=true;

 

UniPanel11.Visible:=false;

UniPanel9.Visible:=true;

UniPanel4.Visible:=true;

UniToolBar1.Visible:=true;

UniPagecontrol1.Pages[1].Visible:=true;

end;

because I don't wont to use more and more forms.Thank on suggestion, I need fast application but not heavy application.

 

I use this because

frmStavke:=Tfrmstavke.Create(uniapplication);

frmStavke.show;

I get Ajax error on some form when I use simple

frmStavke.ShowModal;

Same thing when I use align position on PageControl (like alClient)

 

You have right, some tables is not open, because I don't use it in this moment.From that reason you get

Can not perform X on a closed Dataset

My biggest problem is this Ajax Error messages like one when enter UniDBLookupCombo on frmPredmeti form.

 

You write on some post that you fix some issues on lookup components

I fixed some issues.
What you change?
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...