简体   繁体   English

onClick按钮:未执行回调

[英]onClick button: callback not executed

I'm wondering why the doRemoveObject method is not being executed when the button is clicked. 我想知道为什么单击按钮时没有执行doRemoveObject方法。

(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. 听起来你没有在应用程序中包含原型和/或scriptaculous库。

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). 使用Seaside配置工具(http:// localhost:8080 / config / MyApplication)将“PTDeploymentLibrary”和“SUDeploymentLibrary”添加到您的应用程序中(将“MyApplication”替换为您的应用程序名称)。 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: 或者,您也可以通过programmaticaly将其添加到您的应用程序中,如下所示:

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

Obviously, you can also use the PTDevelopmentLibrary. 显然,您也可以使用PTDevelopmentLibrary。

ps: If you are developing a new application, consider using jQuery instead of Scriptaculous. ps:如果您正在开发一个新的应用程序,请考虑使用jQuery而不是Scriptaculous。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM