Smalltalk新线?

Smalltalk新线?,smalltalk,Smalltalk,我根本无法让它工作: renderContentOn: html html form: [ html textInput on: #newEmp of: self. html submitButton callback: [ self addEmployee: newEmp ]; text: 'Add Employee'. self employeeNames do: [ :eachEmp

我根本无法让它工作:

renderContentOn: html
    html form: [
        html textInput
        on: #newEmp of: self.

        html submitButton
        callback: [ self addEmployee: newEmp ];
        text: 'Add Employee'.

        self employeeNames do: [ :eachEmp |  html text: Character cr asString. html text: eachEmp.]
    ]

我只是一直在一条线上得到我的输出。我错过什么了吗?我尝试了几种不同的
cr
,但迄今为止都没有成功。

不要依赖回车键在浏览器中显示数据。员工姓名显然属于列表或表格(您提供的是姓名列表):


您肯定想要
html中断
,而不是
html文本:字符cr
或其任何变体。HTML故意将文本中的换行符视为简单空格


除此之外,max leske使用项目列表的想法更为可取。

您是否在浏览器中显示输出?然后,忽略换行符。尝试使用

html unorderedList: [
    self employeeNames do: [ :eachEmp | 
        html listItem: [
            html text: eachEmp ] ] ]