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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...