2012-08-16 85 views
1

我想知道为什么单击按钮时doRemoveObject方法没有被执行。onClick按钮:未执行回调

(html button) 
    id: 'objectRemoveButton'; 
    bePush; 
    onClick: (html scriptaculous request 
     callback: [self doRemoveObject]; 
     confirm: 'Are you sure you want to delete this?'); 
    with: 'Remove object' 
+1

您可以指定单击按钮时是否有任何错误记录到控制台? (开发工具chrome/safari或firebug) – 2012-08-17 20:09:54

+0

ReferenceError:Ajax未定义 – Cantillon 2012-08-19 14:28:54

回答

3

听起来像你没有在应用程序中包含原型和/或scriptaculous库。

使用Seaside配置工具(http:// localhost:8080/config/MyApplication)将'PTDeploymentLibrary'&'SUDeploymentLibrary'添加到您的应用程序中(用您的应用程序的名称替换'MyApplication')。库设置可以在配置设置的“常规”部分找到。

或者,你也可以programmaticaly添加到您的应用程序如下:

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

当然,你也可以使用PTDevelopmentLibrary。

ps:如果您正在开发一个新的应用程序,请考虑使用jQuery而不是Scriptaculous。