Uploaded image for project: 'Teeda'
  1. Teeda
  2. TEEDA-313

任意の場所でincludeを使っている場合に、親Pageの方のボタンが実行されない場合がある

XMLWordPrintable

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major Major
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Seasar-user:8255

      任意の場所でincludeを使っている場合に、親Pageの方のボタンが実行されない場合がある。
      te:includeのあり・なしで、親のhtml(ここではhello.html)でボタンを実行したときに
      Pageクラスのdoメソッドが呼ばれるか呼ばれないかが変わる。

      下記サンプルコード。

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" xmlns:te="http://www.seasar.org/teeda/extension" xml:lang="ja" lang="ja">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title id="aaa">Hello</title>
      </head>
      <body>
      <form id="form">
      こんにちは&nbsp;&nbsp;&nbsp;<span id="name">World!!!</span>
      <input type="submit" value="calculate" id="doXxx"/>
      <te:include te:src="/add/add.html"/><br />
      </form>
      </body>
      </html>
      
      /*
       * Copyright 2004-2007 the Seasar Foundation and the Others.
       *
       * Licensed under the Apache License, Version 2.0 (the "License");
       * you may not use this file except in compliance with the License.
       * You may obtain a copy of the License at
       *
       *     http://www.apache.org/licenses/LICENSE-2.0
       *
       * Unless required by applicable law or agreed to in writing, software
       * distributed under the License is distributed on an "AS IS" BASIS,
       * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
       * either express or implied. See the License for the specific language
       * governing permissions and limitations under the License.
       */
      package examples.teeda.web.hello;
      
      import examples.teeda.web.add.AddPage;
      
      public class HelloPage {
      
      	private String name = "Seasar2";
      
      	private AddPage addPage;
      
      	public AddPage getAddPage() {
      		return addPage;
      	}
      
      	public void setAddPage(AddPage addPage) {
      		this.addPage = addPage;
      	}
      
      	public String getName() {
      		return name;
      	}
      
      	public void setName(String name) {
      		this.name = name;
      	}
      
      	public String initialize() {
      		System.out.println("initialize");
      		return null;
      	}
      
      	public String prerender() {
      		System.out.println("prerender");
      		return null;
      	}
      
      	public String getAaaTitleText() {
      		return "AAA";
      	}
      
      	public String doXxx() {
      		System.out.println("doXxx");
      		getAddPage().xyz();
      		return null;
      	}
      }
      
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" xmlns:te="http://www.seasar.org/teeda/extension" xml:lang="ja" lang="ja">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title id="aaa">Add</title>
      <style>
      .onTeedaError {
      	background-color: #FFCCCC;
      }
      </style>
      </head>
      <body>
      <span id="mockAaa">aaa</span>
      <form id="addForm">
      <div>
      <span id="messages"></span>
      </div>
      <table>
      <tr>
      <td></td><td><input type="text" id="arg1" title="INPUT1"/></td>
      <td><span id="arg1Message"></span></td>
      </tr>
      <tr>
      <td> + </td>
      <td><input type="text" id="arg2" title="INPUT2"/></td>
      <td><span id="arg2Message"></span></td>
      </tr>
      <tr>
      <td> = </td>
      <td><span id="result"></span></td>
      </tr>
      </table>
      <input type="submit" value="calculate" id="doOnceCalculate" te:renderJs="true"/>
      <input type="submit" value="back to start" id="jumpStart_index"/>
      
      <input type="hidden" id="arg2-hidden"/>
      </form>
      </body>
      </html>
      
      /*
       * Copyright 2004-2007 the Seasar Foundation and the Others.
       *
       * Licensed under the Apache License, Version 2.0 (the "License");
       * you may not use this file except in compliance with the License.
       * You may obtain a copy of the License at
       *
       *     http://www.apache.org/licenses/LICENSE-2.0
       *
       * Unless required by applicable law or agreed to in writing, software
       * distributed under the License is distributed on an "AS IS" BASIS,
       * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
       * either express or implied. See the License for the specific language
       * governing permissions and limitations under the License.
       */
      package examples.teeda.web.add;
      
      public class AddPage {
      
      	public static final String arg1_TGreaterThanConstantValidator = null;
      
      	public static final String arg2_TGreaterThanConstantValidator = null;
      
      	private int arg1;
      
      	private int arg2;
      
      	private int result;
      
      	public int getArg1() {
      		return arg1;
      	}
      
      	public void setArg1(int arg1) {
      		this.arg1 = arg1;
      	}
      
      	public int getArg2() {
      		return arg2;
      	}
      
      	public void setArg2(int arg2) {
      		this.arg2 = arg2;
      	}
      
      	public int getResult() {
      		return result;
      	}
      
      	public void setResult(int result) {
      		this.result = result;
      	}
      
      	public String doOnceCalculate() {
      		result = arg1 + arg2;
      		return null;
      	}
      
      	public void xyz() {
      		arg2 = 12345;
      	}
      }
      

            Assignee:
            higa higa
            Reporter:
            shot shot
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: