1
这是openlaszlo中的一个聊天应用程序。我在输入文字区写入。并在文本区域接收发送的文本。过了一段时间,我无法看到文本字段中的文本。所以,我想在文本区域添加一个滚动条。但我不能让它工作。有任何想法吗?提前致谢!!无法在文本字段中添加滚动条
<canvas height="100%" width="100%" bgcolor="white" allowfullscreen="true" debug="true">
<class name="chatSender">
<attribute name="_netConnection" />
<attribute name="_sharedObject" />
<handler name="oninit">
this._netConnection = new NetConnection();
this._netConnection.connect("rtmp://115.187.37.167/oflaDemo/room1");
this._sharedObject = SharedObject.getRemote("chat", this._netConnection.uri, true);
this._sharedObject.connect(this._netConnection);
Debug.write("ChatSender initiated");
</handler>
<method name="sendMessage" args="mensaje">
Debug.write("SendMessage: " + mensaje)
this._sharedObject.send("messageHandler",mensaje);
</method>
</class>
<class name="chatReceiver">
<attribute name="_netConnection" />
<attribute name="_sharedObject" />
<handler name="oninit"><![CDATA[
this._netConnection = new NetConnection();
this._netConnection.connect("rtmp://115.187.37.167/oflaDemo/room1");
this._sharedObject = SharedObject.getRemote("chat", this._netConnection.uri, true);
this._sharedObject.connect(this._netConnection);
this._sharedObject.messageHandler = function(str) {
var textoAnterior = texto.text;
Debug.write(textoAnterior + "<br/>" + str);
texto.setAttribute("text", textoAnterior + "<br/>" + str);
};
Debug.write ("chatReceiver initiated");
]]>
</handler>
</class>
<chatReceiver name="chatRec"/>
<chatSender name="chatSen"/>
<simplelayout/>
<view width="100%" height="80%" bgcolor="white" clip="true">
<text id="texto" width="100%" height="90%" multiline="true" clip="true">
</text>
</view>
<view bgcolor="blue" width="70%">
<simplelayout axis="x"/>
<inputtext bgcolor="cyan" width="100%" id="mensajeAEnviar"/>
<button width="50" onclick="canvas.chatRec._cajaChat=texto; canvas.enviarTexto(mensajeAEnviar.text);">Send</button>
</view>
<method name="enviarTexto" args="texto">
Debug.write("enviarTexto:" + mensajeAEnviar.text);
canvas.chatSen.sendMessage(mensajeAEnviar.text);
mensajeAEnviar.setAttribute("text","");
</method>
</canvas>
如果我的回答解决了问题,我建议您接受答案。 – 2012-08-17 12:22:59
感谢您的帮助。我病了。所以我看不到你的回应。抱歉耽搁了。再次感谢.. – Pallab 2012-08-20 10:09:43
没问题,我只是试图保持Stackoverflow上的OpenLaszlo讨论活跃,因为OpenLaszlo论坛已经变成了一个悲伤的地方,与我们几年前的活动相比。如果你有其他OpenLaszlo相关的问题,将来会有更多的人来帮助你解决Stackoverflow问题。 – 2012-08-20 10:57:31