Tap5 should check abstract and parent classes before throwing "Embedded xxx 
component(s) are defined within component class xxx but are not present in the 
component template" Exception
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: TAP5-317
                 URL: https://issues.apache.org/jira/browse/TAP5-317
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.0.16
            Reporter: Buck O' Five


Currently I'm using a very generic CRUD system which uses an abstract page 
class to eliminate obvious redundancy.  The abstract page class has a component 
instance and does not have an associated .tml file.  The reference to the 
component is in the parent page classes .tml file (this allows for custom 
settings per entity).  This used to work with just an error logged but with 
recent updates to Tap5-105 it now throws an error.   I suspect the issue is 
because the component instance is in the abstract class but when all is said 
and done this should be valid. right?

Here is a very very slimmed down example to reproduce:

in base folder:

public abstract class AbstractEntityList<T> {
        private T entity;
        
        @Component(parameters= {"source=dataSource","row=entity"})
        private EntityList<T> entityList;
        
        public abstract Object getDataSource();
        
        public T getEntity() {
                return entity;
        }
        public void setEntity(T entity) {
                this.entity = entity;
        }               
}




in components folder:

public class EntityList<T> {

        @Parameter @Property
        private GridDataSource source;

        @Parameter @Property
        private T row;

        // Grid properties
        @Component(parameters= {"source=inherit:source", "row=row"})
        private Grid grid;      
}

EntityList.tml
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
    <t:grid t:id="grid"></t:grid>    
</html>



in entities folder:
public class Merchant {

        private String name;
        
        public Merchant(){}
        public Merchant(String name){
                setName(name);
        }
        
        public String getName() {
                return name;
        }
        public void setName(String name) {
                this.name = name;
        }
        
}



in pages folder:

public class Merchants extends AbstractEntityList<Merchant>{
                        
        public Object getDataSource()
        {
                List<Merchant> list = new ArrayList<Merchant>();
                for(int i=0;i<5;i++)
                        list.add(new Merchant("Test "+i));
                
                return list;
        }
}

Merchants.tml
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
        <div t:type="EntityList"></div>
</html>




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to