Open Laszlo 3.4 has the best text handling right now.
Legals text handling might well still have bugs. If the examples in the legals developer's guide http://labs.openlaszlo.org/legals-nightly/docs/guide/ text.html#text.multiline look different from the examples in the 3.4 version of the developer's guide http://labs.openlaszlo.org/trunk-nightly/docs/guide/ text.html#text.multiline
then we've probably got some bugs -- please do report them.

A code sample that works in trunk (3.4) but doesn't work in legals would be most helpful to identifying and fixing the bugs.




On Mar 9, 2007, at 4:21 AM, pagux labs wrote:

Hi Guys,
I have been evaluation openlaszlo(legals) after working on another ajax framework called echo2 & GWT .....

I am trying multi line edittext in laszlo haven't succeed this far (in 3rd version i can see scroll bars but after 3 -5 lines but srcoll bars doesnt automatically move down when more lines are added ) , also unable to find any textarea component


Can anyone suggest a solution ?





MY Code

version 1

<canvas width="700" debug="true" >

  <window title="Alabot Answers" x="10" y="10"
          width="220" height="260" >
<view width="220" height="260" />


<edittext x="10" y="20" width="175" height="140" enabled="false" id="chatMsg" >
 <scrollbar/>
</edittext>
<edittext x="10" y="175" width="175" doesenter="true" id="userMsg" >
<method name="doEnterDown">
 Debug.write('Nice day if it do not rain'+userMsg.getText());
chatMsg.setText(chatMsg.getText()+" \n "+userMsg.getText ());
userMsg.setText("");
           </method>
</edittext>
  </window>

 </canvas>



version 2

<canvas width="700" debug="true" >

  <window title="Alabot Answers" x="10" y="10"
          width="220" height="260" >
<view width="220" height="260" />

<view name="main" x="10" y="20" width="175" height="140" clip="true">
    <view name="contents">
      <text multiline="true" id="chatMsg">

      </text>
    </view>
 <scrollbar/>
   </view>
<edittext x="10" y="175" width="175" doesenter="true" id="userMsg" >
<method name="doEnterDown">
 Debug.write('Nice day if it do not rain'+userMsg.getText());
chatMsg.setText(chatMsg.getText()+" \n "+userMsg.getText ());
userMsg.setText ("");
           </method>
</edittext>
  </window>

 </canvas>
version 3
   <class name="scrollinputtext" clip="true">
        <attribute name="text" type="html" value=""/>
        <method name="getText">
            return inp.getText();
        </method>
        <method name="setText" args="t">
            inp.setText(t);
        </method>
        <inputtext fontsize="18" name="inp" id="me" height="$
 {parent.height}" width="${parent.width - 20}" multiline="true"
 text="${parent.text }">
            <attribute name="lineheight" value="$
 {this.getTextHeight ()/this.maxscroll}"/>   <!-- fix this -->
            <attribute name="maxheight" value="${ this.height +
 this.lineheight * (this.maxscroll - 1)}"/>
            <attribute name="onpos" value="null"/>
            <attribute name="pos" value="0" setter="setPos(pos);"/>
            <method event="oninit">
                Debug.write('oninit imp', this, this.maxscroll,
 this.scroll);
            </method>
            <method event="onmaxscroll">
                Debug.write('onmaxscroll');
            </method>

            <method name="setPos" args="p">
                if (this.isinited) {
                    this.setScroll(1 - (p / this.lineheight));
                    this.pos = p;
                    if (this.onpos) this.onpos.sendEvent(p);
                }
            </method>
            <method event="onscroll">
                this.setPos(-this.lineheight * (this.scroll - 1),
 true);
            </method>
        </inputtext>
        <scrollbar axis="y" scrollattr="pos"
            stepsize="${ parent.inp.lineheight}" scrollmax="$
 {parent.inp.maxheight}"/>
    </class>

--
All I need is a spark....

Reply via email to