voyent
Tooltip in nested Datatable seem not to work?  XML
Forum Index -> Components
Author Message
MichaelBreu

Joined: 17/Aug/2011 10:08:42
Messages: 19
Offline


Hello,

Working with icefaces 4.1,
I have run into a problem with tooltips in nested datatables.

I was not able to make it work. Therefore I constructed a small example, with a list

a1 -> b11, b12
a2 -> b21, b22





With icefaces 3.1 (and the old style tooltips) this worked. But not with icefaces 4.1 .

I have tried various tricks, like defining equals/hashcode on outer row elements, or defining alwaysExecuteContents="true" in the datatables (don't know whether this could help).

You will find my code below. (sorry, did not find out, how to keep code formatting, find also a zip file enclosed).
It seems that the inner datatable cannot restore it's row content.

Any idea, for a workaround?

Thank you for your kind support.

Wallenstein

Testpage


a
b
 

Code:
 
         <h:form>
           <ace:delegate id="outerListDelegate">
             <ace:dataTable style="width:150px;" var="someA" value="#{simpleTooltipTester.nestingList}" id="outerTable"  alwaysExecuteContents="true">
               <ace:column headerText="outerName" id="outer">
                 <ace:panel id="aTooltip">
                    #{someA.name}
                 </ace:panel>
               </ace:column>
               <ace:column headerText="inner" id="inner">
                 <ace:delegate id="nestedDelegate">
                   <ace:dataTable var="nested" value="#{someA.list}" id="nestedTable" alwaysExecuteContents="true">
                     <ace:column headerText="nestedName" id="nested">
                       <ace:panel id="nestedTooltip">
                       #{nested.name}
                       </ace:panel>
                     </ace:column>
                   </ace:dataTable>
                 </ace:delegate>
                  <ace:tooltip id="nestedTooltip" style="width: 370px" forDelegate="nestedDelegate" for="nestedTooltip"
                   fetch="#{nested}" store="#{testTooltipDelegationBean.nested}">
                   <ace:ajax execute="@form" event="display" />
                  Name: #{testTooltipDelegationBean.nested.name}
                  </ace:tooltip>
               </ace:column>
             </ace:dataTable>
           </ace:delegate>
 
 
           <ace:tooltip id="outerProfileTooltip" style="width: 370px" forDelegate="outerListDelegate" for="aTooltip"
             fetch="#{someA}" store="#{testTooltipDelegationBean.a}">
             <ace:ajax execute="@form" event="display" />
                    Name: #{testTooltipDelegationBean.a.name}
             </ace:tooltip>
 </h:form>
 


TestBean
Code:
 package de.blb.portale.su_plattform.testing;
 
 import java.util.ArrayList;
 import java.util.List;
 
 import org.springframework.stereotype.Controller;
 
 @Controller
 public class SimpleTooltipTester {
 	
 	private List<A> nestingList = new ArrayList<A>();
 	
 	public SimpleTooltipTester() {
 		super();
 		Nested b11 = new Nested("b11");
 		Nested b12 = new Nested("b12");
 		Nested b21 = new Nested("b21");
 		Nested b22 = new Nested("b22");
 		
 		
 		A a1 = new A("a1");
 		a1.list.add(b11);
 		a1.list.add(b12);
 		A a2 = new A("a2");
 		a2.list.add(b21);
 		a2.list.add(b22);
 		
 		nestingList.add(a1); 
 		nestingList.add(a2);
 		
 	}
 	public List<A> getNestingList() {
 		return nestingList;
 	}
 	public void setNestingList(List<A> nestingList) {
 		this.nestingList = nestingList;
 	}
 	public class A {
 		@Override
 		public int hashCode() {
 			final int prime = 31;
 			int result = 1;
 			result = prime * result + getOuterType().hashCode();
 			result = prime * result + ((name == null) ? 0 : name.hashCode());
 			return result;
 		}
 		@Override
 		public boolean equals(Object obj) {
 			if (this == obj)
 				return true;
 			if (obj == null)
 				return false;
 			if (getClass() != obj.getClass())
 				return false;
 			A other = (A) obj;
 			if (!getOuterType().equals(other.getOuterType()))
 				return false;
 			if (name == null) {
 				if (other.name != null)
 					return false;
 			} else if (!name.equals(other.name))
 				return false;
 			return true;
 		}
 		String name;
 
 		public A(String name) {
 			super();
 			this.name = name;
 		}
 		List<Nested> list = new ArrayList<Nested>();
 		
 		public String getName() {
 			return name;
 		}
 		public List<Nested> getList() {
 			return list;
 		}
 		private SimpleTooltipTester getOuterType() {
 			return SimpleTooltipTester.this;
 		}
 	}
 	public class Nested {
 		@Override
 		public int hashCode() {
 			final int prime = 31;
 			int result = 1;
 			result = prime * result + getOuterType().hashCode();
 			result = prime * result + ((name == null) ? 0 : name.hashCode());
 			return result;
 		}
 		@Override
 		public boolean equals(Object obj) {
 			if (this == obj)
 				return true;
 			if (obj == null)
 				return false;
 			if (getClass() != obj.getClass())
 				return false;
 			Nested other = (Nested) obj;
 			if (!getOuterType().equals(other.getOuterType()))
 				return false;
 			if (name == null) {
 				if (other.name != null)
 					return false;
 			} else if (!name.equals(other.name))
 				return false;
 			return true;
 		}
 		String name;
 
 		public Nested(String name) {
 			super();
 			this.name = name;
 		}
 		public String getName() {
 			return name;
 		}
 		private SimpleTooltipTester getOuterType() {
 			return SimpleTooltipTester.this;
 		}
 	}
 
 }
 

DelegationBean
Code:
package de.blb.portale.su_plattform.testing;
 
 import org.springframework.stereotype.Controller;
 
 @Controller
 public class TestTooltipDelegationBean {
 	SimpleTooltipTester.A a;
 	SimpleTooltipTester.Nested nested;
 	public SimpleTooltipTester.A getA() {
 		return a;
 	}
 	public void setA(SimpleTooltipTester.A a) {
 		this.a = a;
 	}
 	public SimpleTooltipTester.Nested getNested() {
 		return nested;
 	}
 	public void setNested(SimpleTooltipTester.Nested nested) {
 		this.nested = nested;
 	}
 
 }
 

 Filename nestedTables.zip [Disk] Download
 Description Source Code Fragment
 Filesize 2 Kbytes
 Downloaded:  2511 time(s)

 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team