[adding laszlo-dev]

It seems like we should follow the same pattern we do for LzView, etc. - add setters and deprecate the setText() calls for a release (so we can remove them) and have setText() warn and call the setter.

As for the setText() with two args, that can't really be a setter in the current regime so... do we want to allow setters to have more than one argument?

There must be a way to make baseedittext more sane - it seems like all the machinery is there to ensure you can call getValue() before the child textfield is actually initted. There's a lot of janky stuff going on, e.g. the constructor in _newinternalinputtext placing itself in its parent's _field slot.

I'd start by adding a setters for each method, and have that accumulate values so that when the child inits you can set them all at once. This is using oldstyle inputtext APIs which need to be deprecated - I'd be surprised if you didn't see warnings with the debugger on...

Once you have the setters in place, it should be much easier to clean up.

Regards,
Max Carlson
OpenLaszlo.org

On 7/30/10 10:13 AM, Henry Minsky wrote:

Regarding LPP-9227, "Replace setPattern, setText(t,isinitvalue) with
setAttribute('xxx',xxx) format"
(http://jira.openlaszlo.org/jira/browse/LPP-9227)

There's a method in baseedittext.lzx

<method name="setPattern" args="r">
             this.setAttribute('pattern', r);
             this._field.setAttribute('pattern', r);
</method>

I am thinking I can just change the setPattern method to a setter:

<!-- Set the characters which can be entered into a text field. -->
<setter name="pattern" args="r">
             super.setAttribute('pattern', r);
             this._field.setAttribute('pattern', r);
</setter>


But they also have their own version of setText

<method name="setText" args="t,isinitvalue">
             this.doSetValue(t,isinitvalue, false);
</method>

This method takes two args. So I think that they can't use a standard
setter method for this, because that is not compliant with the setter
API. I'm not sure who the callers are going to be for this, but it
seems like a new method is needed, with some name besides setText.

--
Henry Minsky
Software Architect
[email protected] <mailto:[email protected]>


Reply via email to