質問

I'm wondering why the doRemoveObject method is not being executed when the button is clicked.

(html button)
  id: 'objectRemoveButton';
  bePush;
  onClick: (html scriptaculous request
      callback: [self doRemoveObject];
      confirm: 'Are you sure you want to delete this?');
  with: 'Remove object'
役に立ちましたか?

解決

Sounds like you did not include the prototype and/or scriptaculous libraries in the application.

Use the Seaside configure tool (http://localhost:8080/config/MyApplication) to add the 'PTDeploymentLibrary' & 'SUDeploymentLibrary' to your application (replace 'MyApplication' with the name of your application). The libraries setting can be found in the 'General' section of the configuration settings.

Alternatively, you can also programmaticaly add this to your application as follows:

|app |
app := self registerAsApplication: 'MyApplication'.
app addLibrary: PTDeploymentLibrary; addLibrary: SUDeploymentLibrary

Obviously, you can also use the PTDevelopmentLibrary.

ps: If you are developing a new application, consider using jQuery instead of Scriptaculous.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top