I tried creating a custom component as you have mentioned...The problem is
the select box is not appearing on the page.  Only the label 'Test:' I
created for it appears.  Where am I going wrong?


This my tml


<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_2_0.xsd";> 
        <label class="strong">Test: </label>
        <t:select t:id="test" value="testValue" model="testModel"
onchange="javascript:this.form.submit();"/>
</t:container> 


JAVA

public class TeamSelect {

        @Parameter(required=true) 
        @Property 
        private Object value; 

        @Inject
        private ServiceFacade serviceFacade;
        
        @SessionState
    private UserSession userSession;
        
        @Property
        private long testValue;
        
        public SelectModel getTestModel() { 
                //do your lookup and return the model... 
                System.out.println("serviceFacade: " + serviceFacade);
                System.out.println("userSession: " + userSession);
                
                return new IdSelectModel(new ArrayList<String>(), "Default", 
true); 
        } 
}

Im using it in a page like this - 

<t:teamselect value="selectedTeam"/>

@Property
private Long selectedTeam;

-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-create-a-custom-component-tp3306682p3306950.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to