Henry,

I actually came to a little different resolution where I just did a
setNodeAttribute on the onblur instead of the updateData, but I think
your method outline below is a better implementation.  As far as the
edittext working, the only thing that I could come up with is that the
edittext has the datapath but there is an inputtext view inside of the
edittext so I had thought that might have something to do with it.  I am
also confused about your previous example talking about how the datapath
needs to point to the "terminal".  We have done this in our application
in the past and I don't know if it really adheres to the "terminal"
hypothesis; 

<dataset name="ds">
        <stuff text="Default" width="500"/>
</dataset>
<inputtext datapath="ds:/stuff" text="$path{'@text'}"
width="$path{'@width'}"/>


David
-----Original Message-----
From: Henry Minsky [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 18, 2007 10:24 PM
To: David Buckler; Max Carlson
Cc: Laszlo
Subject: Re: [Laszlo-user] Inputtext and updateData Broken?

I filed a bug report on this at
http://www.openlaszlo.org/jira/browse/LPP-5292

I'm a little confused as to why the <edittext> test case works at all,
how does it know to put the data back into the "edit" attribute? I am
wondering if it just happens to work because the datapointer/datapath is
set to point there via the last call by the $path operator.



On Dec 19, 2007 1:14 AM, Henry Minsky <[EMAIL PROTECTED]> wrote:
> There's another bug that's keeping this example from working, the 
> default updateData() method for inputtext is not getting the modified 
> input text.
>
> A workaround
>
> LzInputText's updateData method is written as
>
> function updateData (){
>     return this.sprite.text;
> }
>
> But nothing seems to actually be updating the LzInputTextSprite 'text'
> field when the onblur event happens.
>
>
> LzInputText ought to be updateData defined like this I think, or else 
> something in the textsprite should be updating that field 
> automatically
>
> function updateData (){
>     return this.getText();
> }
>
>
> A workaround would be to override the updateData method on inputtext, 
> like this
>
> <inputtext datapath="ds:/stuff/@input" text=" $path{'@input'}" >
>   <method name="updateData">
>     this.setText( this.getText() );
>     return this.text;
>   </method>
>
>
>     <method event="onblur">
>       this.datapath.updateData();
>     </method>
> </inputtext>
>
>
>
>
> On Dec 19, 2007 1:01 AM, Henry Minsky <[EMAIL PROTECTED]> wrote:
> > My understanding is that updateData method on datapath needs to have

> > a datapath which actually points to a 'terminal' element that 
> > returns a value, i.e.,
> >
> > <inputtext datapath="ds:/stuff/@input" text=" $path{'@input'}" >
> >
> > I'm not sure why edittext works without such a path. The $path 
> > expression doesn't set the datapath automatically. It is just an 
> > accessor.
> >
> > If it used to work to say <inputtext datapath="ds:/stuff" text="
> > $path{'@input'}" > we should find out which changeset caused it to 
> > stop working, and why.
> >
> >
> >
> >
> >
> > On Dec 18, 2007 12:27 PM, David Buckler <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > >
> > > I think I have found a decent sized bug in version 4.0.7.  All 
> > > over our application we use databound inputtext but in the newest 
> > > version it appears that this is no longer supported.  If you look 
> > > at the example below, change the text of the inputtext and then 
> > > click to the edittext and look at ds in the debugger you see that 
> > > the dataset doesnt update.  The edittext works perfectly but has 
> > > the border which is not desirable in our UI.  Is this a feature of

> > > the inputtext that has been removed in this version or is this a
bug?
> > >
> > > <canvas width="100%" height="100%">
> > >
> > > <dataset name="ds">
> > >  <stuff edit="default edit" input="default input"/> </dataset>
> > >
> > > <simplelayout axis="x" spacing="20"/>
> > >
> > > <inputtext datapath="ds:/stuff" text="$path{'@input'}">
> > >     <method event="onblur">
> > >         this.datapath.updateData();
> > >     </method>
> > > </inputtext>
> > >
> > > <edittext datapath="ds:/stuff" text="$path{'@edit'}">
> > >     <method event="onblur">
> > >          this.datapath.updateData();
> > >     </method>
> > > </edittext>
> > >
> > >
> > > </canvas>
> >
> >
> >
> > --
> > Henry Minsky
> > Software Architect
> > [EMAIL PROTECTED]
> >
>
>
>
> --
> Henry Minsky
> Software Architect
> [EMAIL PROTECTED]
>



--
Henry Minsky
Software Architect
[EMAIL PROTECTED]

Reply via email to