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

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5477
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

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

Post by Rathinagiri »

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: 4012
Joined: Wed Jul 30, 2008 6:43 pm

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

Post by Roberto Lopez »

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 653 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5477
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

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

Post by Rathinagiri »

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: 4012
Joined: Wed Jul 30, 2008 6:43 pm

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

Post by Roberto Lopez »

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: 5477
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

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

Post by Rathinagiri »

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: 4012
Joined: Wed Jul 30, 2008 6:43 pm

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

Post by Roberto Lopez »

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: 5477
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

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

Post by Rathinagiri »

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: 4012
Joined: Wed Jul 30, 2008 6:43 pm

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

Post by Roberto Lopez »

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: 4012
Joined: Wed Jul 30, 2008 6:43 pm

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

Post by Roberto Lopez »

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: 5477
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

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

Post by Rathinagiri »

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