Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select List without #callbacks: #279

Closed
GoogleCodeExporter opened this issue Mar 25, 2015 · 5 comments
Closed

Select List without #callbacks: #279

GoogleCodeExporter opened this issue Mar 25, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

A select list without callback block triggers "random" other callbacks on the 
page.

renderContentOn: html 
    html form: [
        html select
            list: #(1 2 3 4 5 6 7 8).
        html submitButton
            callback: [ self halt ];
            with: 'Hallo' ]

The halt is never executed though.

Original issue reported on code.google.com by renggli on 12 Jan 2009 at 10:04

@GoogleCodeExporter
Copy link
Author

sending #beSubmitOnChange to the select tag makes it show up. The first 
response sent
me to the config page, strangely rendered. The next two tries I got the halt. 
Then I
noticed that selecting '2' triggers the halt. '4' triggers the config page. So 
they
really aren't random. The rendering context in the Walkback in Squeak shows that
callbacks are indeed being assigned to the options.

It will take more work for me to figure out where these callbacks are being 
registered...

Original comment by p3ano...@gmail.com on 9 Jul 2009 at 3:27

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Turns out this is a "edge case". Three things go into it, the options are string
integers; the name, if not explicitly assigned, defaults to the callback 
registry key
which is a string integer; when the post request comes in, the field name is 
this
string integer that happens to match a key in the callback registry so the 
matching
callback gets called. So, for instance, if i have options as in the example, if 
I put
8 elements with callbacks on the page before it, the select box's name will be 
"9"
and the callbacks will work as expected:
    html form: [
        1 to: 8 do: [ :i |
            html textInput 
            callback: [ :value |  self inform: value ];
            with:  i displayString  ].
        html select
            list: #(1 2 3 4 5 6 7 8);
            beSubmitOnChange.
        html submitButton
            callback: [ self halt ];
            with: 'Hallo' ]


The most benign fix would be giving a unique name to the select element. This 
would
also be a workaround. But it wouldn't stop someone from using '1' as the name 
and
getting the same problem.

Original comment by p3ano...@gmail.com on 13 Jul 2009 at 4:23

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by renggli on 8 Sep 2009 at 7:09

  • Added labels: Version-Seaside3.0
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by renggli on 8 Sep 2009 at 7:10

  • Added labels: ****
  • Removed labels: Version-Seaside2.9

@GoogleCodeExporter
Copy link
Author

Fixed with changes for Issue 374

Original comment by obi...@gmail.com on 30 Dec 2009 at 2:22

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant