[Wicket-user] Wicket (1.2.4) TabbedPanel Guidance Question
Hello everyone: I have a MySQL database with names of people. I have created a facade class which will retrieve all the people whose last name starts with a particular letter or group of letters . I have all this working just fine. I can get all of this to come to a web page and display in a table with no problem What I want to do is create a tabbed panel with several tabs. Each tab would represent a group of letters (A-K, L-R for example) for the people's last name in my database. My confusion comes when I have to create the classes and html files for the tabs. I want to create one Java class (the one I already have) and hook it to one html page template. Then simply pass in the range of letters for each tab and display the tabs. I don't want to have x number of html files for x number of tabs. I also don't want to have to create a separate class for each tab. The examples I see seem to do this and I believe this is a maintenance nightmare. Does any one I have any guidance? I am currently looking at fragments. This seems like it might make it easier to do one html class, but I don't think it addresses my desire for one Java class Thanks Phil Willemann -- View this message in context: http://www.nabble.com/Wicket-%281.2.4%29-TabbedPanel-Guidance-Question-tf3587043.html#a10024104 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Wicket (1.2.4) TabbedPanel Guidance Question
I have the following: 1.) TabbedPanelPage.java panel page with 4 tabs (in my case PlayersTab) 2.) PlayersTab.java file which will do a getPanel to return a PlayersPanel. PlayersPanel is derived from Panel. 3.) PlayersPanel.java file which is the facade class to my MySQL database. I use a line like this add(new ListView("rows",players) { ... to attach the database data to the wicket:id rows 4.) PlayersPanel.html which is essentially just a wicket:panel wrapper around a table of data 5.) TabbledPanelPage.html whose main part is: [tabbed panel will be here] I expect the TabbedPanelPage to have 4 tabs - each tab being constructed from the PlayersPanel etc,.. I believe all this is correct however when I navigate to the TabbedPanelPage html page it is unable to get access to rows I get an error message that says basically this: ...but that you either did not add the component to your page at all, or that the hierarchy does not match. There is obviously a disconnect. I don't believe TabbedPanelPage should have to know about rows (the reason why I did the facade in the first place.), however how can I get the TabbedPanelPage to let PlayersPanel do the work? Thanks Phil -- View this message in context: http://www.nabble.com/Wicket-%281.2.4%29-TabbedPanel-Guidance-Question-tf3587043.html#a10028146 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Wicket (1.2.4) TabbedPanel Guidance Question
Here is the code from the relevant java and html files. TabbedPanelPage.java as follows: public class TabbedPanelPage extends BasePage { public TabbedPanelPage() { setModel(new Model("tabpanel")); // A-G, H-N, O-S, T-Z // create a list of ITab objects used to feed the tabbed panel List tabs = new ArrayList(); tabs.add(new PlayersTab("A","G")); tabs.add(new PlayersTab("H","N")); tabs.add(new PlayersTab("O","S")); tabs.add(new PlayersTab("T","Z")); // add the tabbed panel to the webpage add(new TabbedPanel("tabs",tabs)); } ** PlayersTab.java as follows public class PlayersTab extends AbstractTab { private final String start; private final String end; public PlayersTab(String start, String end) { super(new Model(start+"-"+end)); this.start = start; this.end = end; } public Panel getPanel(String id) { return new PlayersPanel(id,start,end); } ** PlayersPanel.java as follows: public class PlayersPanel extends Panel { private static Log log = LogFactory.getLog(PlayersPanel.class); List players = null; private HibernatePlayerFacade facade = new HibernatePlayerFacade(); public PlayersPanel(String id, String start, String end) { super(id); try { players = facade.listPlayers(start, end); add(new ListView("rows",players) { protected void populateItem(ListItem item) { final Player player = (Player)item.getModelObject(); item.add(new Label("ID",player.getID().toString())); item.add(new Label("FirstName",player.getFirstName())); item.add(new Label("LastName",player.getLastName())); item.add(new Label("Suffix",player.getSuffix())); } }); } catch (DatabaseException ex) { ex.printStackTrace(); } } ** TabbedPanelPage.html as follows: ** http://www.w3.org/1999/xhtml";> typical style sheets. [tabbed panel will be here] ** PlayersPanel.html ** ID First Name Last Name Suffix ID First Name Last Name Suffix -- View this message in context: http://www.nabble.com/Wicket-%281.2.4%29-TabbedPanel-Guidance-Question-tf3587043.html#a10028634 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Wicket (1.2.4) TabbedPanel Guidance Question
I posted the correct file however the forum is having problems with the span command. I changed span to sspan so you could see what I was doing: ID First Name Last Name Suffix ID First Name Last Name Suffix -- View this message in context: http://www.nabble.com/Wicket-%281.2.4%29-TabbedPanel-Guidance-Question-tf3587043.html#a10028735 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Wicket (1.2.4) TabbedPanel Guidance Question
The error I get when I render the TabbedPanelPage is: WicketMessage: Unable to find component with id 'rows' in [MarkupContainer [Component id = panel, page = data.TabbedPanelPage, path = 1:tabs:panel.PlayersPanel,WicketMessage: Unable to find component with id 'rows' in [MarkupContainer [Component id = panel, page = data.TabbedPanelPage, path = 1:tabs:panel.PlayersPanel,isVisible = true, isVersioned = true]]. This means that you declared wicket:id=rows in your markup, but that you either did not add the component to your page at all, or that the hierarchy does not match. This error seems to tell me when rendering the TabbedPanelPage it can't find the wicket component rows which is in PlayersPanel. If I have "rows" in the java file and in the html file I would expect it to show up. Is this some sort of timing issue where the parent page is rendered and then the children are rendered? That might explain what is happening. Should I use a wicket form inside the PlayersPanel.java and then refer to it in the PlayersPanel.html file? I appreciate all your help and your patience with me. I will see Wicket is really cool. Phil -- View this message in context: http://www.nabble.com/Wicket-%281.2.4%29-TabbedPanel-Guidance-Question-tf3587043.html#a10028912 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Wicket (1.2.4) TabbedPanel Guidance Question
No I never get a stack trace. Everything seems fine until the "rows" issue. I get the error listed in my last post and a copy of the html with the "rows" line in red. I have used the quickstart and the Apress Wicket book as guides in my wicket learning.If I want you to debug it in quickstart, how do I do it? It is currently a Netbeans project. Do I post the entire project? Are there guidelines for this? Thanks again -- View this message in context: http://www.nabble.com/Wicket-%281.2.4%29-TabbedPanel-Guidance-Question-tf3587043.html#a10035153 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Wicket (1.2.4) TabbedPanel Guidance Question
I was using wicket 1.2.4. I downloaded the quickstart 1.2.5 bin and extracted to my machine. I stripped out hibernate and all irrelevant parts. The only significant change I had to make was to the TabbedPanelPage.html file. I had to get rid of the wicket:extend reference. You will see a comment in the file. Without removing this I could not get the error I have been seeing. With its removal ,you now get the error I was seeing. I put all my files in wicket.quickstart and this is what I have zipped up. Thanks Phil http://www.nabble.com/file/7937/quickstart.zip quickstart.zip -- View this message in context: http://www.nabble.com/Wicket-%281.2.4%29-TabbedPanel-Guidance-Question-tf3587043.html#a10051923 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user