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: placeholder in web application with HTML5  (Read 11434 times)
Daniele A.
Posts: 28


« on: April 11, 2014, 05:26:34 pm »

Hi,
with genero BDL 2.50 + GAS 2.50.xx
there is a way to use the "placeholder" attribute  for EDIT fields ?
the value could be read from the comment attribute or tag attribute,
some suggestions for modifying the Edit.xhtml are appreciated !


bye
Daniele
.
Four Js
Posts: 65


« Reply #1 on: April 14, 2014, 11:25:47 am »


Hi Daniele,

There must be some solution to adapt the rendering, at least by modifying the snippet file.
Can you give more information on what you try to achieve ?

Regards,
Guney
Daniele A.
Posts: 28


« Reply #2 on: April 14, 2014, 11:44:12 am »

Hi Guney,
I'm going to write a web-application (retail app) for touch screen devices,
so i'd like to use "placeholder" to avoid the Label widget (and waste few space in the screen)

in example you can see in the attachment



* example.png (6.81 KB, 453x240 - viewed 1388 times.)
.
Four Js
Posts: 65


« Reply #3 on: April 14, 2014, 05:11:30 pm »


Hi Daniele,

If I refer to your screenshot, what you want is to display labels inside the fields, when the fields are empty. The label would disappear when you start typing a value in the field. And by default no label would be displayed next to the EDIT field.
This is the purpose of known FGL feature request #25026. I'll add you to customer list reporting it. I don't know when it will be implemented.
Concerning a solution on GAS side, you can still remove the label by changing "text" into "" in StaticLabel.xhtml file but the edit field would not expand as layout will be kept.
So in your case, you should find a solution on FGL/4gl side by modifying the form or waiting the #25026.

By the way, did you try to use Genero Mobile?

Regards,
Guney
   

 
Reuben B.
Four Js
Posts: 1047


« Reply #4 on: April 14, 2014, 11:11:04 pm »

Isn't this a one line change to the snippet?

Add the line ...

placeholder='{tag || null}'

... inside the input element like so (approx line 68) ...

Code
  1. <input
  2.    ...
  3.    maxlength='{maxlength || null}'
  4.    placeholder='{tag || null}'
  5.    readonly='{isModifiable ? null : ""}'
  6.   ...
  7. </input>
      

(the attributes are coded in alphabetical order hence why I've inserted between maxlength and readonly attributes)   .

Use comment instead of tag if you want to use the comment attribute.  My first attempt was to use title e.g.

EDIT f01 = formonly.field, TITLE="Label Text";

... but unfortunately it doesn't look like the title attribute is passed into the formfield template (its used in table column)

Reuben

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


« Reply #5 on: April 15, 2014, 11:45:51 am »


You are right, you can use the COMMENT to display the label value in the Edit field:

In Edit.xhtml

placeholder='{comment || null}'

and in per file

edit f1 = formonly.v1, COMMENT="Label Text";

The Title won't work as it is expected to be used only for tables, as defined in BDL documentation.

However, the Edit field won't take the whole place if you remove the label on GAS level; you will still have to adapt your form file and remove the label.

Regards,
Guney

Daniele A.
Posts: 28


« Reply #6 on: April 16, 2014, 12:06:05 pm »

Guney, Reuben

the solution editing the Edit.xhtml adding the placeholder with the tag attribute is exactly what i need !
end indeed works !

thanks to all
Daniele
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines