pagux labs wrote:
thanks a ton David !! I was almost about to give up on Laslo prototype (started work on echo2) ....your help was really timely .....now i got entire night to pull of prototype ....btw I tested this code with legals it works fine :-) .....

You are very welcome. Glad to hear it worked on Legals too. OL has proved over time to be very capable and flexible enough to work around most perceived shortcomings.


I have also added this in OpenLaxlo wiki for others to benefit -> http://wiki.openlaszlo.org/Tips_and_Tricks

i noticed this single line did the magic -> scroll.page(1) -> i tried to search in documentation but could any relevant section ...could also tell us briefly what it does ?

The LZX Reference manual defines the page() method on the bascrollbar tag. Note scrollbar extends basescrollbar.

Paging is essentially a way to reposition the slide position of the scrollbar. You can reposition the scrollbar N pages up or down on a single call, the number of pages is determined by the parameter passed on the call. The size of a page is determined by the height of the scroll target, that is the view being scrolled.

In this case scroll.page(1) will attempt to slide the scrollbar down one page each time a chat user submits some text. Given typical usage suggests only a few lines of text will be added at a time this provides the effect you require.

David


Thnx,
Gaurav





On 3/11/07, *David Russell* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    The attached code should do just what you need, I've just verified
    it on
    OL 3.3.3.

    Best of luck with your presentation.

    David

    > Hi Benjamin,
    > I went ahead and downloaded Stable openLazlo release and STILL IT
    > DOESNT WORK  :-(
    > All I want is scroll bar to automatically move down as more text is
    > added programmatically (its an protype chat application)
    > I have written with 4 versions of code what could have been a
    simple
    > text area component functionality other frameworks seems to easily
    > provide .
    >
    > I am sending all version of my code ...Can you giuys make
    it  Work ??
    > What i intend to do is simple  (prototype) ....
    > Anything user writes in edittext (userMsg) is displayed in another
    > read only  component  (chatMsg) AND Scrollbar should move down if
    > extra text is added ...its really frustrating I have wasted so much
    > time such a simple ....I have to show a protype  on monday to client
    > get approval for building application on  laszlo platform !!

    <canvas width="100%" height="100%">

      <window title="Alabot Answers"
              align="center" valign="middle" width="220" height="260" >

        <view x="10" y="20" width="175" height="140" clip="true"
    bgcolor="0x6895F0">
          <text id="chatMsg" multiline="true" fgcolor="white"/>
          <scrollbar id="scroll"/>
        </view>

        <edittext x="10" y="175" width="175" doesenter="true">
          <method name="doEnterDown">
            chatMsg.setText(chatMsg.getText() + " \n "+ this.getText());
            this.setText ("");
            scroll.page(1);
         </method>
        </edittext>

      </window>

    </canvas>





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

Reply via email to