Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-1157

tableSuggestAjax not render with trinidad

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.7-SNAPSHOT
    • 1.1.7
    • None
    • None

    Description

      When I use tag definition
      -------------facelets taglib--------------------------
      <tag>
      <tag-name>tableSuggestAjax</tag-name>
      <component>
      <component-type>org.apache.myfaces.TableSuggestAjax</component-type>
      <renderer-type>org.apache.myfaces.TableSuggestAjax</renderer-type>
      </component>
      </tag>
      -------------JSF-------------------------
      <h:panelGrid id="panelG1">
      <h:panelGrid id="panelG2" columns="3">
      <s:tableSuggestAjax var="item" id="suggest" startRequest="1"
      value="#

      {inputSuggestAjax.suggestValue}

      " betweenKeyUp="300"
      maxSuggestedItems="10"
      suggestedItemsMethod="#

      {inputSuggestAjax.list}

      " charset="utf-8">
      <t:column>
      <f:facet name="header">
      <s:outputText value="First Name"/>
      </f:facet>
      <s:outputText for="suggest" label="#

      {item.fname}

      "/>
      </t:column>
      <t:column>
      <f:facet name="header">
      <s:outputText value="Last Name"/>
      </f:facet>
      <s:outputText for="lname" label="#

      {item.lname}

      "/>
      </t:column>

      </s:tableSuggestAjax>
      </h:panelGrid>

      <t:inputText id="lname" />
      </h:panelGrid>
      -----------------Java----------------------
      package edu.baylor.icpc.view.utils;

      import java.util.ArrayList;
      import java.util.List;

      public class InputSuggestAjax {
      private String suggestValue = "ab";

      public String getSuggestValue()

      { return suggestValue; }

      public void setSuggestValue(String suggestValue)

      { this.suggestValue = suggestValue; }

      public class Foo {

      private String fname;
      private String lname;

      public Foo(String fname, String lname)

      { super(); this.fname = fname; this.lname = lname; }

      public String getLname()

      { return lname; }

      public void setLname(String lname)

      { this.lname = lname; }

      public String getFname()

      { return fname; }

      public void setFname(String fname)

      { this.fname = fname; }


      }

      public List<Foo> getList(String prefix, Integer maxSize)

      { setSuggestValue(prefix); return getList(); }
      public List<Foo> getList(String prefix) { setSuggestValue(prefix); return getList(); }

      public List<Foo> getList() {
      List<Foo> list = new ArrayList<Foo>();

      if(suggestValue.startsWith("a"))

      { list.add(new Foo("Adolf","Himler")); list.add(new Foo("Alfonz","Himler")); list.add(new Foo("Alfred","Himler")); }

      else if(suggestValue.startsWith("b"))

      { list.add(new Foo("Bob","Himler")); list.add(new Foo("Brok","Himler")); list.add(new Foo("Bobo","Himler")); }

      else {

      }

      return list;
      }
      }

      -----------------------------------------
      everything is rendered but
      suggestedItemsMethod is ignored at all so it does not work
      -----------------------------------------
      When I add to the taglib
      -----------------------------------------
      <handler-class>InputSuggestAjaxComponentHandler</handler-class>

      OR

      <handler-class>
      facelets.InputSuggestAjaxComponentHandler
      </handler-class>
      -----------------------------------------
      component is not rendered and I see in my HTML <s:tableSuggestAjax ....
      -----------------------------------------
      log:

      Nov 29, 2007 7:21:39 PM org.apache.myfaces.trinidadinternal.io.HtmlResponseWriter endElement
      SEVERE: Element End name:td does not match start name:s:tableSuggestAjax
      Nov 29, 2007 7:21:39 PM org.apache.myfaces.trinidadinternal.io.HtmlResponseWriter endElement
      SEVERE: Element End name:tr does not match start name:td
      Nov 29, 2007 7:21:39 PM org.apache.myfaces.trinidadinternal.io.HtmlResponseWriter endElement
      SEVERE: Element End name:s:tableSuggestAjax does not match start name:td
      Nov 29, 2007 7:21:39 PM org.apache.myfaces.trinidadinternal.io.HtmlResponseWriter endElement
      SEVERE: Element End name:td does not match start name:tr

      Maybe I am missing something but I did exactly that is in your examples.

      http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk
      http://www.irian.at/myfaces-sandbox/tableSuggestAjax.jsp.source
      http://www.irian.at/cagatay-validation-sandbox/tableSuggestAjax.jsp.source
      http://wiki.java.net/bin/view/Projects/FaceletsTaglibsMyfacesSandbox?rev=12
      http://www.nabble.com/TableSuggestAjax-don't-work-anymore-after-a-reRender-from-Ajax4JSF-t3279629.html

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            tom.cerny@gmail.com Tomas Cerny
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: