[Laszlo-user] edittext and password fields
André Bargull
a.bargull at intensis.de
Thu Oct 11 14:36:44 PDT 2007
But first you need to add a setter for password in LzInputTextSprite...
And people try to use constraints for "password" quite often:
http://forum.openlaszlo.org/showthread.php?t=4684
http://forum.openlaszlo.org/showthread.php?t=7394
http://forum.openlaszlo.org/showthread.php?t=9862
...
JIRA: http://www.openlaszlo.org/jira/browse/LPP-704
> Or, a klever hacker would realize that they should just define a
> setter for the parent password attribute that applies the setting
> where it is actually needed (saving the overhead of events that the
> person who wrote the $once constraint was trying to avoid). I.e.,
> 'push' the password field to where it is needed. [cc-ing John. there
> is probably a place in the docs for the following:] Remember Adam's
> first principle of constraints: "They are really handy for rapid
> prototyping, but eventually you want to eliminate them." On
> 2007-10-10, at 18:43 EDT, Henry Minsky wrote:
>> > If you look in the edittext component, it says the internal text field
>> > is using a 'once'
>> > constraint to look at the parent.password
>> >
>> > lps/components/lz/edittext.lzx:
>> >
>> > <_internalinputtext name="field"
>> > password="$once{parent.password}"
>> >
>> > So the internal field is not looking at the parent.password value more
>> > than once at init time.
>> > That could be changed to an 'always' constraint, I imagine that would
>> > work better.
>> >
>> >
>> >
>> > On 10/10/07, James Robey <jrobey at laszlosystems.com> wrote:
>>
>>> >> Hi all, I think i may have found a bug in the edittext component,
>>> >> but i
>>> >> thought someone might show this to be correct behavior in a way I
>>> >> don't yet
>>> >> see. The issue is setting password="true" on an <edittext/>
>>> >> component. It
>>> >> doesn't seem like the password attribute can be constrained. This
>>> >> example
>>> >> might also reveal a bug with $immediately{} constraints wherein
>>> >> "classroot"
>>> >> and "parent" don't exist when the constraint is evaluated.
>>> >>
>>> >> Anyone have advice on how to make this work?
>>> >>
>>> >> Test case: none of these fields (save the last hardcoded editext) has
>>> >> password styling.
>>> >>
>>> >> <canvas proxied="false" debug="true">
>>> >> <debug/>
>>> >>
>>> >> <class name="pwtest">
>>> >> <attribute name="passwordB" type="boolean" value="true"/>
>>> >> <attribute name="passwordS" type="string" value="true"/>
>>> >> <attribute name="passwordE" type="expression" value="true"/>
>>> >>
>>> >> <simplelayout axis="y"/>
>>> >>
>>> >> <edittext password="${classroot.passwordB}"/>
>>> >> <edittext password="${classroot.passwordS}"/>
>>> >> <edittext password="${classroot.passwordE}"/>
>>> >>
>>> >> <edittext password="$immediately{classroot.passwordB}"/>
>>> >> <edittext password="$immediately{classroot.passwordS}"/>
>>> >> <edittext password="$immediately{classroot.passwordE}"/>
>>> >>
>>> >> <edittext password="$once{classroot.passwordB}"/>
>>> >> <edittext password="$once{classroot.passwordS}"/>
>>> >> <edittext password="$once{classroot.passwordE}"/>
>>> >>
>>> >> <edittext password="true"/>
>>> >> </class>
>>> >>
>>> >> <pwtest/>
>>> >>
>>> >> </canvas>
>>>
>> >
>> >
>> > --
>> > Henry Minsky
>> > Software Architect
>> > hminsky at laszlosystems.com
>>
More information about the Laszlo-user
mailing list