Dynamic Placeholder
Posted: Thu Feb 01, 2018 8:27 pm
We want to use the Placeholder property instead a fieldlabel for mobile view. Unfortunately we can't set the placeholder value during the rezisizing process. Does anyone have an idea to solve it?
It's only possible to set the Placeholder during createInstance but not dynamic
Code: Select all
Define_Com Class(#prim_acol<#prim_EVEF>) Name(#pFldFields)
Evtroutine Handling(#Com_owner.CreateInstance)
For Each(#Member) In(#Com_owner.ComponentMembers) Operation(*Instance_Of #prim_EVEF)
#pFldFields.Insert( #Member )
Endfor
Endroutine
Code: Select all
Evtroutine Handling(#Com_owner.DesignChanged) Design(#Design)
* If no design instance supplied, it must be the default "desktop" size
If (#Design *Is *null)
#Com_owner.SizeForDesktop
Else
If (#Design.Name = Mobile)
#Com_owner.SizeForMobile
Endif
Endif
Endroutine
Mthroutine Name(SizeForMobile)
#pFldFields<>.LabelPosition := None
#pFldFields<>.Height := 30
#pFldFields<>.MarginLeft := 0
#pFldFields<>.MarginTop := 50
For Each(#oFld) In(#pFldFields)
#oFld.placeholder := #oFld.LabelText
Endfor
Endroutine
Mthroutine Name(SizeForDesktop)
#pFldFields<>.LabelPosition := Left
#pFldFields<>.Height := 25
#pFldFields<>.MarginLeft := 150
#pFldFields<>.MarginTop := 0
* remove placeholder
#pFldFields<>.placeholder := *blanks
Endroutine
It's only possible to set the Placeholder during createInstance but not dynamic
Code: Select all
Evtroutine Handling(#Com_owner.CreateInstance)
For Each(#Member) In(#Com_owner.ComponentMembers) Operation(*Instance_Of #prim_EVEF)
#pFldFields.Insert( #Member )
#Member.placeholder := #Member.LabelText
Endfor
Endroutine