I trawled through the forum looking for this, apologies in advance if I didn’t find that it’s been discussed elsewhere.
I want to save on screen real estate by overlaying field labels in the corresponding fields like this
[attachment=1]Screen shot 2010-03-14 at 7.29.05 AM.png[/attachment]
I want to hide the label as the cursor enters the field; and show it again if the field is empty when the cursor leaves the field, like this
[attachment=0]Screen shot 2010-03-14 at 7.29.41 AM.png[/attachment]
I use a prefix convention of lbl_ for the labels and attach form methods for the onFocusGained and OnFocusLost events for each field
function HideFieldLabel(event) {
// On tabbing into a field, hide the in-field label
var vElementName = event.getElementName();
elements["lbl_"+vElementName].visible = false
}
function ShowFieldLabel(event) {
// On tabbing out of a field, Display the in-field label if the field is empty
var vElementName = event.getElementName();
var vVal = controller.getDataProviderValue(vElementName)
elements["lbl_"+vElementName].visible = !vVal // Don't show it if there's text
}
This works fine in SmartClient, but not in Webclient (Safari on a Mac when testing in Developer 5.1). In SC, clicking over the label/field trigger the field’s method, but in WC it doesn’t. I thought about putting the label behind the field and making the field transparent, but I need the field background for other things (highlighting fields that need attention).
Does anyone have a workable example, or any comments?