HMGSCRIPT 2012: Programming For The Web in The Right Way :)

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5162
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 128 times
Been thanked: 129 times
Contact:

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Rathinagiri » Thu Jul 05, 2012 3:26 am

Nice contribution. We shall add this to the contrib.js.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Roberto Lopez
HMG Founder
Posts: 3899
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 135 times

Post by Roberto Lopez » Thu Jul 05, 2012 4:37 am

HMGSCRIPT R29
- new setCurrency Textbox method:

setCurrency ( nIintDigits, nDecimals, cDecimalSeparator, cGgroupSeparator, cCurrencySymbol )

- new setMask Textbox method:

setMask ( cMask )

# digit
A alphabetic
U uppercase
L lowercase
C capitalize
? any character
\ to escape

- fixed: problems in query server module.

- changed: Browse demo (append checks for duplicates).

- changed: Query demo (getting multiple records).

- changed: Textbox demo to show how to use setMask and setCurrency.

setCurrency and setMask uses JavaScripTools library (http://javascriptools.sourceforge.net)
included now in HMGSCRIPT distribution.
Enjoy!
Attachments
hmgscript.r29.zip
(1.46 MiB) Downloaded 161 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Rathinagiri
Posts: 5162
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 128 times
Been thanked: 129 times
Contact:

Post by Rathinagiri » Thu Jul 05, 2012 4:42 am

That's it Roberto. :)

I think this tool includes a dynamic table too.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Roberto Lopez
HMG Founder
Posts: 3899
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 135 times

Post by Roberto Lopez » Thu Jul 05, 2012 4:44 am

rathinagiri wrote:That's it Roberto. :)
Yeah! :)

I guess that we are ready for real world applications now.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Rathinagiri
Posts: 5162
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 128 times
Been thanked: 129 times
Contact:

Post by Rathinagiri » Thu Jul 05, 2012 5:09 am

For whole numbers the numeric textbox is good. But with decimal, the first digit we press is taken as a number after the decimal point even though we don't press the decimal separator. This is some what different behavior from the HMG desktop counterpart.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Roberto Lopez
HMG Founder
Posts: 3899
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 135 times

Post by Roberto Lopez » Thu Jul 05, 2012 12:44 pm

rathinagiri wrote:For whole numbers the numeric textbox is good. But with decimal, the first digit we press is taken as a number after the decimal point even though we don't press the decimal separator. This is some what different behavior from the HMG desktop counterpart.
Creating an HMG compatible inputmask in JS, is possible, but since I have not enough time to do it, I've opted for use a third party library instead.

Hopefully, I'll find enough time in the future to do it.

Of course... if a contributor can do it, all we will be very happy :)
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Rathinagiri
Posts: 5162
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 128 times
Been thanked: 129 times
Contact:

Post by Rathinagiri » Thu Jul 05, 2012 2:46 pm

While implementing the numeric mask, I have seen that, HMG compatible numeric text box is possible if we don't have currency symbol. :)

So, these are the new methods for textbox for contrib.js:

Code: Select all

TextBox.prototype.setNumericMask = function ( nDigits, nDecimals, cDecimalSeparator, cGroupSeparator, lMinusAllowed )
{
   var numParser3 = new NumberParser( nDecimals, cDecimalSeparator, cGroupSeparator, true );
   var numMask3 = new NumberMask( numParser3, document.getElementById( this.getId() ), nDigits );
   numMask3.allowNegative = lMinusAllowed;
   numMask3.leftToRight = true;
}   

TextBox.prototype.isValid = function ()
{
   return getObject( this.getId() ).mask.isComplete();
}
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Roberto Lopez
HMG Founder
Posts: 3899
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 135 times

Post by Roberto Lopez » Thu Jul 05, 2012 2:48 pm

rathinagiri wrote:That's it Roberto. :)

I think this tool includes a dynamic table too.
Yes.

Despite that, you can easily create a paged browse or grid (query based).

The only thing that you need is to write appropriate expression in cFforCondition parameter.

Let's suppose that you want the first page (20 rows) of people with last name starting win 'A'. In such case, the condition will be:

last = 'A' .AND. ( ordkeyno() >=1 .AND. ordkeyno() <= 20 )

For the second page:

last = 'A' .AND. ( ordkeyno() >=21 .AND. ordkeyno() <= 40 )

And so on...

I'm thinking in add support to browse class to make it easier, but is already very easy now.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3899
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 135 times

Post by Roberto Lopez » Thu Jul 05, 2012 4:17 pm

rathinagiri wrote:While implementing the numeric mask, I have seen that, HMG compatible numeric text box is possible if we don't have currency symbol. :)

So, these are the new methods for textbox for contrib.js:

Code: Select all

TextBox.prototype.setNumericMask = function ( nDigits, nDecimals, cDecimalSeparator, cGroupSeparator, lMinusAllowed )
{
   var numParser3 = new NumberParser( nDecimals, cDecimalSeparator, cGroupSeparator, true );
   var numMask3 = new NumberMask( numParser3, document.getElementById( this.getId() ), nDigits );
   numMask3.allowNegative = lMinusAllowed;
   numMask3.leftToRight = true;
}   

Regarding setNumericMask, I could modify setCurrency method to expose more NumberParser properties and have only one method with different functionalities.

Besides that, we must incorporate the included format and parse methods to set and get numbers directly to the textbox.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Rathinagiri
Posts: 5162
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 128 times
Been thanked: 129 times
Contact:

Post by Rathinagiri » Thu Jul 05, 2012 4:30 pm

I do agree for your valid points Roberto.

If the currency symbol is missing or an empty string, we can use as a numeric textbox.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

Post Reply