kazpgmの日記

『プログラム自動作成@自動生成』作成の日記

TOOL更新_ユーザ側の確認画面では入力データをhiddenで持っている。(次バージョンの話)

1.ユーザ側の確認画面では入力データをhiddenで持っている。(次バージョンの話)そのため「Item_ItemUaddControllerクラス」で以下のようにしている。

$this->_o['hiddens'] = makeHidden( array_diff($this->_o, 
array('mode' => 'upd_confirm')));

2.これでできるhidden。この中に"module"、"controller"、"action"(これらはZendFrameworkが使っているのだ)がある。この"action""が曲者で、「kaz.js」の「do_Submit_Clk2(act)」の「document.frm.action = act;」がjavascriptエラーになる。

<form name="frm" id="frm" method="post" action="">
<input type="hidden" name="module" value="item">
<input type="hidden" name="controller" value="itemUadd">
<input type="hidden" name="action" value="updconfirm">

3.そのためめ「Item_ItemUaddControllerクラス」を以下のようにした。("module"、"controller"、"action"を消す)

$this->_o['hiddens'] = makeHidden( array_diff($this->_o, 
array('mode' => $this->_o['mode'], 'module' => $this->_o['module'], 
'controller' => $this->_o['controller'], 'action' => $this->_o['action'])));

4.するとhiddenの中にに"module"、"controller"、"action"がなくなるので、「kaz.js」の「do_Submit_Clk2(act)」の「document.frm.action = act;」がうまく動きだす。これがなかなか気づかなかった。

10/17 21:00-01:00
10/19 2:00-2:10 ”(次バージョンの話)”を追記した。
2011/01/05 21:00-23:00 『array('mode' => 'upd_confirm', 'module' => 'item', 'controller' => 'itemUadd', 'action' => 'updconfirm')));』 を『array('mode' => $this->_o['mode'], 'module' => $this->_o['module'], 'controller' => $this->_o['controller'], 'action' => $this->_o['action'])));』に変更した。