Not too sure what would be causing that; perhaps because ondata is really just registered as a delegate your code is being called before the text class's ondata, and your setText call is just being overwritten?

I have a similar situation where I need to transform a date sent over the wire in numeric (milliseconds) form into a readable localized date. I used a wrapper class that had the ondata method that set the value of an inner text field. The wrapper just extended view and had only the text element and some other properties. The text field didn't have a datapath, the value was always managed by the wrapper (also used this technique for bolding rows based on dataset properties).

Good luck.

  - Bryan


On 1/25/06, James Howe <[EMAIL PROTECTED] > wrote:
I seem to be getting the data that I want but for some reason I can't seem
to change the text that is displayed by the text view.  I've put debug
statements in my if statement and I'm getting to the code which does
either this.setText("Subscribed") or this.setText("") but the text never
changes.

On Wed, 25 Jan 2006 12:33:08 -0500, Bryan Barkley <[EMAIL PROTECTED]>
wrote:

> I think you want something like
>
>    if (datapath.getNodeAttribute ('isSubscribed') == 'true')
>
>  - Bryan
>
>
> On 1/25/06, James Howe <[EMAIL PROTECTED]> wrote:
>>
>> I have a text view which is associated with an attribute value from an
>> XML
>> dataset.  The attribute in question has a value of "true" or "false".  I
>> don't want to display "true" or "false", I want to display another
>> string
>> value based on whether the attribute is true or false.  So far I haven't
>> been able to get my value to display, the text field always displays
>> 'true' or 'false'.  Some partial code that I'm currently using is:
>>
>> <gridcolumn text="Status" width="100" resizemargin="1"
>> resizable="false">
>>         <text width="${parent.width}" font="Arial"
>> datapath="@isSubscribed">
>>                 <method event="ondata">
>>                         if (... == "true") {   <--- Not sure what to do
>> here
>>                                 this.setText("Subscribed");
>>                         }
>>                         else
>>                                 this.setText("");
>>                 </method>
>>          </datapath>
>>         </text>
>> </gridcolumn>
>>
>> The XML looks something like this:
>>
>> <items>
>>         <item isSubscribed="true"/>
>>         <item isSubscribed="false"/>
>>         ...
>> </items>
>>
>> The grid to which this gridcolumn belongs has a datapath of "items" and
>> a
>> contentdatapath of "item".  I'm getting the rows I expect, but no matter
>> what I do, I can't get the text of this column to change.  It always
>> displays as 'true' or 'false.'  What am I doing wrong?
>>
>> Thanks.
>>
>> --
>> James Howe
>> _______________________________________________
>> Laszlo-user mailing list
>> [email protected]
>> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
>>



--
James Howe

_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to