CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Trimming String Fields?

by Aggie85 » 09 Mar 2014 23:30

Howdy!

I tried implementing an OnAsyncExit event to implement trimming of the field text, but it has negative side effects on my pages (i.e. caused some regions to not draw right after my first control exits).

So my question is how can I implement a simple ajax routine to strip any blanks on an edit field after the users tabs out?

My OnAsyncExit routine was written as follows:

void __fastcall TIWAppFormActionsDataModule::OnDBEditAsyncExit(TObject *Sender, TStringList *EventParams)
{
TIWEdit * pEdit = dynamic_cast<TIWEdit *> (Sender);
if (pEdit == NULL)
{
return;
}

pEdit->Text = pEdit->Text.Trim();
}

Thanks in advance,

Aggie85
Aggie85
 
Posts: 273
Joined: 15 May 2013 02:24

by Aggie85 » 10 Mar 2014 10:13

Just an update!

I still would like a javascript solution for real-time visual effects, but for now I have just added a generic OnSetText event to my string fields within my edit data sets!

Thanks,

Aggie85
Aggie85
 
Posts: 273
Joined: 15 May 2013 02:24

by Jorge Sousa » 10 Mar 2014 10:43

Hi

I tried implementing an OnAsyncExit event to implement trimming of the field text, but it has negative side effects on my pages (i.e. caused some regions to not draw right after my first control exits).


This is very strange! Why should a simple andcorrectly implemented event handler would cause some regions to not draw right?

But the Field.OnSetText or DataSet.BeforePost would be just fine.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Aggie85 » 10 Mar 2014 10:52

cgdevtools_support wrote:Hi

I tried implementing an OnAsyncExit event to implement trimming of the field text, but it has negative side effects on my pages (i.e. caused some regions to not draw right after my first control exits).


This is very strange! Why should a simple andcorrectly implemented event handler would cause some regions to not draw right?

But the Field.OnSetText or DataSet.BeforePost would be just fine.


Many of my pages have client side resizing (i.e. TIWURLWindows that auto-height, grids that use OnAdjustedHeightToRows. The pages are rendered correctly the first time but after the first OnAsyncExit() event is fired, many pages to to HECK!! It is probably an IW effect, but I can live with the OnSetText() method though it isn't visual until AFTER a submit is done!

Thanks again!

Aggie85
Aggie85
 
Posts: 273
Joined: 15 May 2013 02:24


Return to JQEdit

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.