Four Js Development Tools Forum

Discussions by product => Genero Studio => Topic started by: Jeremy G. on September 08, 2015, 12:31:12 pm



Title: format field
Post by: Jeremy G. 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



Title: Re: format field
Post by: Sebastien F. 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


Title: Re: format field
Post by: Reuben B. 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


Title: Re: format field
Post by: Jeremy G. 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.