Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: format field  (Read 14829 times)
Jeremy G.
Posts: 12


« on: September 08, 2015, 12:31:12 pm »

Hello,

I want to format integer input value, but I can't make it working.

I defined "INCLUDE = (0 TO 99999999999999)" in include properties, if I'm right, the only values accepted should be beetween 0 to 99999999999999, but i can put for example : "0srtgtrgrs" and the value is accepted.

My need : a user insert "0101010201" value
I want to display it in the input "01 01 01 02 01", I tried to insert [## ## ## ## ##] in format properties of the widget but I'm wrong it doesn't works.

Regards

Sebastien F.
Four Js
Posts: 545


« Reply #1 on: September 08, 2015, 02:05:36 pm »

Hello Jeremy,

You may want to try the PICTURE attribute.

However, if you allow spaces in the value, it will not be an INTEGER, it will be stored in a CHAR(n) or VARCHAR(n)...

With PICTURE="## ## ## ## ##" you don't need a FORMAT attribute, assuming that CHAR/VARCHAR values which are displayed are already properly formatted...

https://4js.com/online_documentation/fjs-fgl-manual-html/?path=fjs-fgl-manual#c_fgl_FSFAttributes_PICTURE.html

Seb
Reuben B.
Four Js
Posts: 1113


« Reply #2 on: September 09, 2015, 01:20:20 am »

The question was posted in Studio section of the forum so the more appropriate link maybe to the picture property in the Form Designer part of the Studio documentation https://4js.com/online_documentation/fjs-gst-manual-html/#c_gst_formdesigner_properties_PICTURE.html (although it should be the same meaning as the FGL documentation link Seb provided, sometimes Studio/.4fd property names and Genero/.per attribute names don't match)

Jeremy: Sometimes it helps to give the underlying business reason of what you are trying to do.  So in this case, with PICTURE="## ## ## ## ##" are you inputting French phone numbers?

Quote
I defined "INCLUDE = (0 TO 99999999999999)" in include properties, if I'm right, the only values accepted should be beetween 0 to 99999999999999, but i can put for example : "0srtgtrgrs" and the value is accepted.

For the reason why this might be occurring, what is the datatype of the variable?  A quick test suggests you'd get the behaviour you report if the datatype of the variable was STRING/CHAR, but if datatype was integer then I get "This value is not amongst the valid possibilities"

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Jeremy G.
Posts: 12


« Reply #3 on: September 09, 2015, 09:55:01 am »

Hello,

Ok for the wrong section, sorry for mistake.

Right the field is to input french numbers, I tried the picture and it works nicely, thx a lot.

Right again, my field is not an integer because I'm using an existing database with old values with varchar definition.

Thx a lot.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines