Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Smalltalk new lines?

Tags:

smalltalk

I can't get this to work at all:

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.]
    ]

I just keep getting my output on one line. Am I missing something? I've tried several variations of cr but none have worked thus far.

like image 490
MrDuk Avatar asked Jun 30 '26 22:06

MrDuk


1 Answers

Don't rely on carriage returns to display your data in the browser. The employee names obviously belong either in a list or a table (you are providing a list of names):

html unorderedList: [
    self employeeNames do: [ :eachEmp | 
        html listItem: [
            html text: eachEmp ] ] ]
like image 186
Max Leske Avatar answered Jul 03 '26 04:07

Max Leske