Forums: 公開ディスカッション (Thread #22487)

リモートイベントハンドラ (2009-04-24 11:33 by Anonymous #43394)

リモートイベントハンドラを設定してindex.htmlを開くと
下記のエラーが発生します。

指定されたリソースは見つかりません。 url: file://C:\work_mas\mascat\col\index.html line: 2

イベント定義xmlは以下のように作成しています
<?xml version="1.0" encoding="UTF-8"?>
<eventDef>
<component id="btnNew">
<event id="onclick" finish="col" type="local"/>
</component>
<component id="btnNew1">
<event id="onclick" remoteUrl="./col.do" async="false" finish="col">
<result rootNode="response">
<target out="txtNew2" in="result"/>
</result>
<param rootNode="request">
<source obj="txtNew" node="left"/>
<source obj="txtNew1" node="right"/>
</param>
</event>
</component>
</eventDef>

原因の分かる方はご指摘下さいますようお願いいたします。

Reply to #43394×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: リモートイベントハンドラ (2009-04-24 12:21 by Anonymous #43398)

上記のエラーは
<event id="onclick" remoteUrl="./col.js" async="false" finish="col">
に変更する事によって解消されましたが、
実行すると

「応答メッセージのデータバインドに失敗しました」というエラーメッセージが発生します。

jsファイルの中身は下記の通りです。
function col(event){
with(event.layout.scope) {
var left = Number(txtNew.getValue());
var right = Number(txtNew1.getValue());
var result = NaN;

switch (cmbNew.getValue()) {
case "+":
result = left + right;
break;
case "-":
result = left - right;
break;
case "*":
result = left * right;
break;
case "/":
result = left / right;
break;
}

txtNew2.setValue(result);
}
}

原因の分かる方は御指摘くださいますようお願いいたします。
Reply to #43394

Reply to #43398×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: リモートイベントハンドラ (2009-04-24 18:08 by kazatoh #43416)

こんにちは。

できれば、チケットシステムに「サポートリクエスト」のチケットを登録していただけませんか?
チケットにはファイルを添付できるので、レイアウト定義XML・イベント定義XML・JavaScript ファイルをアップロードしていただけると解決できる人がいるかもしれません。
Reply to #43394

Reply to #43416×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: リモートイベントハンドラ (2009-04-24 18:28 by kazatoh #43422)

失礼しました。
添付ファイルがなくてもわかりそうでした (汗

ログを見るとローカル (file:// の URL) でアプリケーションを実行しています。

リモートイベントはサーバと通信を行いますので、サンプルを Apache や Tomcat
などの Web サーバに設置し、URL 欄に http://~ というアドレスを指定して動作
させる必要があります。

サンプルの動作方法は ZIP ファイル内に含まれている README.txt をご参照ください。
Reply to #43394

Reply to #43422×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: リモートイベントハンドラ (2009-04-27 13:47 by dakyou #43452)

ご指摘ありがとうございます。
Tomcatを起動し、URLを入力して実行すると下記エラーが発生しました。
2009年4月27日 11:49:21
INFO イベント処理を開始します。部品: remoteCalculateButton, イベント型: onclick

2009年4月27日 11:49:22
ERROR HTTP 404 - 指定されたURLは見つかりません。/mas_java/web/sample/calculation/calculate.do
url: http://localhost:8080/mas_java/web/sample/calculation/index.html line: 2


サンプルは Javaを利用しています。
原因が分かるようであればご指摘下さいますようお願いいたします。
Reply to #43422

Reply to #43452×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login