Jump to content

Login Form ajax error


Lena

Recommended Posts

Hi.

V. 0.99.0.1169

I am adding Login Form in my project and I got error.

Where my mistake?

Breakpoint stops here:

ustring.h  

 // Constructors

  UnicodeString(): Data(0) {}

 

Login Form code:

void __fastcall TUniLoginForm1::UniBitBtnCanselClick(TObject *Sender)
{
 ModalResult = mrCancel;
}
//---------------------------------------------------------------------------
void __fastcall TUniLoginForm1::UniLoginFormShow(TObject *Sender)
{
 UniEditLogin->SetFocus();
}
//---------------------------------------------------------------------------

void __fastcall TUniLoginForm1::ACallBackLogin(TComponent *Sender, int AResult)
{
 if(UniEditLogin->Text == "")
 {
  UniEditLogin->SetFocus();
 }
 else if(UniEditPassword->Text == "")
	  {
	   UniEditPassword->SetFocus();
	  }
}


//---------------------------------------------------------------------------

void __fastcall TUniLoginForm1::UniBitBtnEnterClick(TObject *Sender)
{

try
 {

  if(UniEditLogin->Text == "")
  {
	ShowMessage(L"Enter login", &ACallBackLogin);
	return;
  }

  if(UniEditPassword->Text == "")
  {
	ShowMessage(L"Enter password", &ACallBackLogin);
	return;
  }

  UniMainModule()->FDQueryLogin->Active = false;
  UniMainModule()->FDQueryLogin->ParamByName(L"LOGIN")->AsString = UniEditLogin->Text;
  UniMainModule()->FDQueryLogin->ParamByName(L"PASSWORD")->AsString = UniEditPassword->Text;
  UniMainModule()->FDQueryLogin->Active = true;

  if(UniMainModule()->FDQueryLogin->RecordCount == 0)
  {
   ShowMessage(L"No user");
   //ModalResult = mrCancel;
  }
  else if(UniMainModule()->FDQueryLogin->RecordCount == 1)
	 {
		   //test:
		   ModalResult = mrOk; //I am here

	  }
	


}
   catch (const Exception &E)
	   {
		//
	   }
}
//---------------------------------------------------------------------------

In Main Form I also have event OnShow and OnBeforeShow.

 

And all my grids on Main Form have event:

function beforeInit(sender, config)
{
  sender.titleAlign = 'center';
  //sender.titleAlign = 'right';
  //sender.titleAlign = 'left';
   Ext.onReady(function () {
    sender.headerCt.getMenu().items.items[2].hide(); //separator
    sender.headerCt.getMenu().items.items[3].hide();
  });
}

post-32-0-10486000-1433234376_thumb.jpg

Link to comment
Share on other sites

If add comments in all Grids error disappears.

function beforeInit(sender, config)
{
  sender.titleAlign = 'center';
  //sender.titleAlign = 'right';
  //sender.titleAlign = 'left';
   //Ext.onReady(function () {
    //sender.headerCt.getMenu().items.items[2].hide(); //separator
    //sender.headerCt.getMenu().items.items[3].hide();
  //});
}
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...