Hi all,
Using version 3.3.3, I think I've hit a bug in edittext. When the
datapath is constrained, the initial value gets replaced with "" (an
empty string).
Here's my example of the problem:
-------------------------------------------------------------------
<canvas>
<dataset name="foo">
<item attr1="the value" />
</dataset>
<attribute name="theDatapath" type="string" value="foo:/item/@attr1" />
<!--- This edittext should show text "the value", but it is blank. -->
<edittext width="100%" datapath="$once{canvas.theDatapath}" />
</canvas>
-------------------------------------------------------------------
I've tracked the problem to edittext.lzx line 87, where there's a check
to see if _initialtext has been set:
if ( this._initialtext != null ){
However, since the default value of _initialtext is "" rather than null,
this expression always evaluates to true. If I change the check to:
if ( this._initialtext != "" ){
Then my test case above works properly.
I've checked in JIRA and don't think this has been entered.
The code for edittext.lzx hasn't changed, but the bug doesn't happen in
the version 4 nightly build.
While I'm waiting for version 4 to become production-ready, what should
I do?
Should I use my fix privately, or attempt to submit it into the official
Laszlo code base?
Also, does anyone see a problem with my fix?
Thanks for your help/advice.
--Michael