• Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.1.5
    • Component/s: XHR/dhtml/Ajax
    • Labels:
    • Environment:
      Windows, Apache Tomcat 6.0, Firefox 2.0, Tapestry 4.1.1


      RenderBlock. When I tried to change block asynchronously from one to another which contains Form component(or another dojo component), old block removing, new tried to insert(application gets correct ajax responce) but init script runs before new block inserted, and fails because component form not exists yet(and in init script tapestry.registerForm(), try to register yet not existing Form).

      When i try to update component which contains RenderBlock error occures:

      FATAL exception raised: Form not found with id form
      ERROR: 9:54:35: Error evaluating script: //<![CDATA[ dojo.require("tapestry.form");tapestry.form.registerForm("form", true); //]]> Error : Form not found with id form : http://localhost:8080/iTrack/app?service=asset&path=%2Fdojo%2Fdojo.js : line 15

      Page gets such response which invokes error!

      Probably it is not a bug, but a can't find what is wrong.

      Its html code
      <span jwcid="@Menu">

      <table width = "100%">
      <tr witdh = "100%" >
      <td width="30%" valign="top" id="showTable">
      <span jwcid="showTable@iTrack:JsTree" source="ognl:treeModel" jsVariableName="literal:nodesTree" value="ognl:myNode" >
      <span jwcid="@DirectLink" listener="listener:treeStateChanged" async="true" parameters="">
      <span jwcid="@Insert" value="" />

      <td width="70%" valign="top">

      <span id="showWindow">
      <span jwcid="showWindow@RenderBlock" block="ognl:selectedBlock" />

      <span jwcid="addIssue@Block">
      <h3>Adding issue to component <span id="editingComponent"><span jwcid="editingComponent@Insert" value="ognl:componentName" /></span></h3>
      <span id="editingArea">
      <span jwcid="@If" condition="ognl:message!=null"><h4><span jwcid="editingArea@Insert" value="ognl:message"/></h4></span>
      <span jwcid="@bf:BeanForm"





      <span jwcid="empty@Block">
      Hello all

      <span jwcid="fullish@Block">
      Bye bye every body


      Its java code

      package com.iTrack.pages;

      import java.util.ArrayList;
      import java.util.Arrays;
      import java.util.Collection;
      import java.util.Date;
      import java.util.HashMap;
      import java.util.List;
      import java.util.Map;

      import org.apache.tapestry.IRequestCycle;
      import org.apache.tapestry.IScript;
      import org.apache.tapestry.PageRenderSupport;
      import org.apache.tapestry.TapestryUtils;
      import org.apache.tapestry.annotations.EventListener;
      import org.apache.tapestry.annotations.InjectScript;
      import org.apache.tapestry.annotations.Persist;
      import org.apache.tapestry.components.Block;
      import org.apache.tapestry.engine.IPageLoader;
      import org.apache.tapestry.event.BrowserEvent;
      import org.apache.tapestry.html.BasePage;
      import org.apache.tapestry.spec.IComponentSpecification;

      import com.iTrack.components.JsTree.model.SimpleTreeNode;
      import com.iTrack.model.component.Component;
      import com.iTrack.model.component.Issue;
      import com.iTrack.model.component.Project;
      import com.iTrack.model.user.User;
      import com.iTrack.pages.showprojects.AbstractNode;
      import com.iTrack.pages.showprojects.ComponentNode;
      import com.iTrack.pages.showprojects.IssueNode;
      import com.iTrack.pages.showprojects.ProjectNode;
      import com.iTrack.pages.showprojects.RootNode;
      import com.iTrack.util.DaoFactory;

      public abstract class ShowProjects extends BasePage {

      private SimpleTreeNode myNode;

      private ArrayList<SimpleTreeNode> allNodes;

      ArrayList<Block> blocks = new ArrayList<Block>();

      public abstract IScript getScript();

      public abstract int getSelectedBlockId();
      public abstract void setSelectedBlockId(int id);

      public ArrayList<SimpleTreeNode> getTreeModel() {
      setAllNodes(new ArrayList<SimpleTreeNode>());
      SimpleTreeNode root = new RootNode((long) getAllNodes().size());

      List<Project> projects = (List<Project>) DaoFactory.getComponentDao()
      for (Project project : projects)

      { root.insert(getTree(project)); }

      return root.getPlainTree();

      public SimpleTreeNode getMyNode()

      { return myNode; }

      public void setMyNode(SimpleTreeNode myNode)

      { this.myNode = myNode; }

      private SimpleTreeNode getTree(Component component) {
      SimpleTreeNode ans;
      if (component instanceof Project)

      { ans = new ProjectNode((long) getAllNodes().size(), (Project)component); }


      { ans = new ComponentNode((long) getAllNodes().size(), component); }


      Collection<Component> children = component.getSubComponents();
      for (Component child : children)

      { ans.insert(getTree(child)); }

      Collection<Issue> issues = component.getIssues();
      for (Issue issue : issues)

      { IssueNode issueNode = new IssueNode((long) getAllNodes().size(), issue); getAllNodes().add(issueNode); ans.insert(issueNode); }

      return ans;

      public Block getSelectedBlock()

      { return blocks.get(getSelectedBlockId()); }

      public void treeStateChanged(Long id) {

      SimpleTreeNode node = getAllNodes().get(id.intValue());
      if (node instanceof ComponentNode)

      { setSelectedBlockId(0); getPage().getRequestCycle().getResponseBuilder().updateComponent( "showWindow"); ComponentNode componentNode = (ComponentNode) node; setCurrentNode(componentNode); getPage().getRequestCycle().getResponseBuilder().updateComponent( "editingComponent"); }


      public String getComponentName() {
      if (getCurrentNode() != null)

      { return getCurrentNode().toString(); }

      return "";

      public void finishLoad(IRequestCycle arg0, IPageLoader arg1,
      IComponentSpecification arg2)

      { super.finishLoad(arg0, arg1, arg2); setIssueData(new Issue()); blocks.add((Block) getComponent("addIssue")); blocks.add((Block) getComponent("fullish")); setSelectedBlockId(1); }

      public void save(IRequestCycle cycle) {
      if (getCurrentNode() == null)

      { setMessage("change component please"); cycle.getResponseBuilder().updateComponent("editingArea"); cycle.getResponseBuilder().updateComponent("showTable"); return; }

      (Component) ((ComponentNode) getCurrentNode()).getElement());
      getIssueData().setCreator((User) DaoFactory.getUserDao().getById(1));
      getIssueData().setLastUpdate(new Date(System.currentTimeMillis()));

      setIssueData(new Issue());
      setMessage("issue successfully added");

      public void delete(IRequestCycle cycle) {


      public ArrayList<SimpleTreeNode> getAllNodes()

      { return allNodes; }

      public void setAllNodes(ArrayList<SimpleTreeNode> nodes)

      { allNodes = nodes; }

      public abstract AbstractNode getCurrentNode();
      public abstract void setCurrentNode(AbstractNode currentNode);

      public abstract Issue getIssueData();
      public abstract void setIssueData(Issue editingIssue);

      public abstract String getMessage();
      public abstract void setMessage(String message);

      Ajax response

      <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"" [
      <!ENTITY nbsp ' '>
      <ajax-response><response id="showWindow" type="element">
      <h3>Adding issue to component <span id="editingComponent">firstChild1</span></h3>
      <span id="editingArea">

      <form method="post" action="/iTrack/app;jsessionid=E6183CDDDB726B0866BEA7DDB52134EE" id="form">
      <div style="display:none;" id="formhidden"><input type="hidden" name="formids" value="notCustomized1
      <input type="hidden" name="component" value="showWindowForm" />
      <input type="hidden" name="page" value="ShowProjects" />
      <input type="hidden" name="service" value="direct" />
      <input type="hidden" name="session" value="T" />
      <input type="hidden" name="submitmode" value="" />
      <input type="hidden" name="submitname" value="" />
      <input type="hidden" name="notCustomized1" value="T" />
      <input type="hidden" name="rows" value="VBP_b_c_a_a" />
      <input type="hidden" name="rows" value="VBP_b_d_c_b" />
      <input type="hidden" name="rows" value="VBP_b_e_c_a" />
      <input type="hidden" name="rows" value="VBP_b_f_a_c" />
      <input type="hidden" name="rows" value="VBP_b_g_a_c" />
      <input type="hidden" name="notCustomized2" value="T" />
      <input type="hidden" name="hasSave" value="T" />
      <input type="hidden" name="hasCancel" value="F" />
      <input type="hidden" name="hasRefresh" value="F" />
      <input type="hidden" name="hasDelete" value="F" />

      <table id="table">
      <span id="rows">
      <tr id="informal">

      <td class="bf_Left" id="informal_0"><label for="name">Name</label>:</td>

      <td class="bf_Right" id="informal_1"><input type="text" name="name" value="" id="name"

      class="text" /></td>

      </span><span id="rows_1">

      <tr id="informal_2">

      <td class="bf_Left" id="informal_3"><label for="description">Description</label>:</td


      <td class="bf_Right" id="informal_4"><textarea name="description" id="description"><


      </span><span id="rows_2">
      <tr id="informal_5">

      <td class="bf_Left" id="informal_6"><label for="resolution">Resolution</label>:</td>

      <td class="bf_Right" id="informal_7"><input type="text" name="resolution" value="" id

      ="resolution" class="text" /></td>


      </span><span id="rows_3">
      <tr id="informal_8">
      <td class="bf_Left" id="informal_9"><label for="status">Status</label>:</td>

      <td class="bf_Right" id="informal_10"><select name="status" id="status">

      <option value="0">[OPEN]</option>

      <option value="1">[OPENNED]</option>

      <option value="2">[INPROGRESS]</option>

      <option value="3">[CLOSED]</option>



      </span><span id="rows_4">

      <tr id="informal_11">

      <td class="bf_Left" id="informal_12"><label for="priority">Priority</label>:</td>

      <td class="bf_Right" id="informal_13"><select name="priority" id="priority">

      <option value="0">[CRITICAL]</option>

      <option value="1">[BLOCKER]</option>

      <option value="2">[MAJOR]</option>

      <option value="3">[MINOR]</option>

      <option value="4">[TRIVIAL]</option>



      <td colspan="2" class="bf_Buttons">

      <span><input type="submit" name="save" id="save" value="Add issue" class="button" /></span>







      </response><response id="initializationscript" type="script"><script>


      dojo.require("tapestry.form");tapestry.form.registerForm("form", true);



      1. Home.html
        0.4 kB
        Kenneth William


        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        130d 5h 16m 1 Andreas Andreou 17/Sep/07 13:51
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12568121 ] jira [ 12591212 ]
        Mark Thomas made changes -
        Workflow jira [ 12403609 ] Default workflow, editable Closed status [ 12568121 ]
        Kenneth William made changes -
        Attachment Home.html [ 12367648 ]
        Andreas Andreou made changes -
        Assignee Andreas Andreou [ andyhot ]
        Resolution Cannot Reproduce [ 5 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Andreas Andreou added a comment -

        I tried similar code and it worked for me...

        If you like, reopen this and attach a zip that i can easily
        mvn jetty:run
        and see what you're describing.

        Andreas Andreou added a comment - I tried similar code and it worked for me... If you like, reopen this and attach a zip that i can easily mvn jetty:run and see what you're describing.
        Jesse Kuhnert made changes -
        Fix Version/s 4.1.3 [ 12312516 ]
        Fix Version/s 4.1.4 [ 12312763 ]
        Jesse Kuhnert made changes -
        Field Original Value New Value
        Fix Version/s 4.1.1 [ 12312021 ]
        Fix Version/s 4.1.3 [ 12312516 ]
        Victor Denisov created issue -


          • Assignee:
            Andreas Andreou
            Victor Denisov
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: