Re: how to use wicket tree in extension
Assuming the class diagram at http://jweekend.com/dev/ArticlesPage/ is up-to-date for your version of Wicket, perhaps you can override protected ITreeState newTreeState() to return an ITreeState that you pass between pages (or, put in your custom WebSession if that makes more sense in your app or in a table or ). I wouldn't be surprised if Matej comes back to say there's a neater way than that! Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com Haulyn Jason-2 wrote: Yes, that's right, is that a way to tell the new page(and the new instance of the tree), the status of the old tree? I means expand the node which I clicked? Thanks! On Sat, Aug 15, 2009 at 9:00 AM, jWeekend jweekend_for...@cabouge.comwrote: Is your menu (tree) in some parent page class that both the first and the linked-to page extend? When you go to a new page instance you will get a new instance of the Tree. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com Haulyn Jason-2 wrote: No, just use Tree in extension package. On Fri, Aug 14, 2009 at 11:17 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: are you using LinkTree? -igor On Fri, Aug 14, 2009 at 12:15 AM, Haulyn R. Jasonsaharab...@gmail.com wrote: Hi,all: I design a page with a tree for page navigation. But I can not find more information from Internet to learn how to use the Tree component. I can display the tree as menu1 |-sub_menu1 |-sub_menu2 menu2 |-sub_menu3 |-sub_menu4 and I remove root node, make all tree expand while init the tree, but I do not know how to add links to the sub_menus, I tried to add some code like this: @Override protected void onNodeLinkClicked(AjaxRequestTarget target, TreeNode node) { DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node; NavigationTreeNode navigationTreeNode = (NavigationTreeNode) treeNode.getUserObject(); if (navigationTreeNode.isURL) { setResponsePage(navigationTreeNode.getURL()); super.onNodeLinkClicked(target, node); } else { super.onNodeLinkClicked(target, node); } } this looks work well, but when I clink on a link, the page redirect to the target page, but I can not keep the tree with the selected node expand. Can anyone help me or give me some reference URLs? Thanks! -- -- Enjoy. Thanks! Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Enjoy. Thanks! Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 贾昊林 Haulyn Jason -- View this message in context: http://www.nabble.com/how-to-use-wicket-tree-in-extension-tp24967306p24980702.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Enjoy. Thanks! Haulyn Microproduction Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 Haulyn Jason -- View this message in context: http://www.nabble.com/how-to-use-wicket-tree-in-extension-tp24967306p25010539.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: how to use wicket tree in extension
instead of navigating between pages and passing the tree state around why not simply swap panels. that way the tree instance is the same and keeps its state. -igor On Mon, Aug 17, 2009 at 8:23 AM, Haulyn R. Jasonsaharab...@gmail.com wrote: Yes, that's right, is that a way to tell the new page(and the new instance of the tree), the status of the old tree? I means expand the node which I clicked? Thanks! On Sat, Aug 15, 2009 at 9:00 AM, jWeekend jweekend_for...@cabouge.comwrote: Is your menu (tree) in some parent page class that both the first and the linked-to page extend? When you go to a new page instance you will get a new instance of the Tree. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com Haulyn Jason-2 wrote: No, just use Tree in extension package. On Fri, Aug 14, 2009 at 11:17 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: are you using LinkTree? -igor On Fri, Aug 14, 2009 at 12:15 AM, Haulyn R. Jasonsaharab...@gmail.com wrote: Hi,all: I design a page with a tree for page navigation. But I can not find more information from Internet to learn how to use the Tree component. I can display the tree as menu1 |-sub_menu1 |-sub_menu2 menu2 |-sub_menu3 |-sub_menu4 and I remove root node, make all tree expand while init the tree, but I do not know how to add links to the sub_menus, I tried to add some code like this: �...@override protected void onNodeLinkClicked(AjaxRequestTarget target, TreeNode node) { DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node; NavigationTreeNode navigationTreeNode = (NavigationTreeNode) treeNode.getUserObject(); if (navigationTreeNode.isURL) { setResponsePage(navigationTreeNode.getURL()); super.onNodeLinkClicked(target, node); } else { super.onNodeLinkClicked(target, node); } } this looks work well, but when I clink on a link, the page redirect to the target page, but I can not keep the tree with the selected node expand. Can anyone help me or give me some reference URLs? Thanks! -- -- Enjoy. Thanks! Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Enjoy. Thanks! Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 贾昊林 Haulyn Jason -- View this message in context: http://www.nabble.com/how-to-use-wicket-tree-in-extension-tp24967306p24980702.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Enjoy. Thanks! Haulyn Microproduction Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: how to use wicket tree in extension
Yes, Igor's solution is easier (and will remember other tree state beyond just which nodes are expanded) if you are able to use this panel swapping technique instead of your current markup-inheritance solution for the common menu (tree). It looks like a common decision one has to make: whether to pass components around (remember, only ever use a component instance on a single page instance at any one time!) versus just passing around component state (in this case, which nodes are expanded and which are collapsed). Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com igor.vaynberg wrote: instead of navigating between pages and passing the tree state around why not simply swap panels. that way the tree instance is the same and keeps its state. -igor On Mon, Aug 17, 2009 at 8:23 AM, Haulyn R. Jasonsaharab...@gmail.com wrote: Yes, that's right, is that a way to tell the new page(and the new instance of the tree), the status of the old tree? I means expand the node which I clicked? Thanks! On Sat, Aug 15, 2009 at 9:00 AM, jWeekend jweekend_for...@cabouge.comwrote: Is your menu (tree) in some parent page class that both the first and the linked-to page extend? When you go to a new page instance you will get a new instance of the Tree. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com Haulyn Jason-2 wrote: No, just use Tree in extension package. On Fri, Aug 14, 2009 at 11:17 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: are you using LinkTree? -igor On Fri, Aug 14, 2009 at 12:15 AM, Haulyn R. Jasonsaharab...@gmail.com wrote: Hi,all: I design a page with a tree for page navigation. But I can not find more information from Internet to learn how to use the Tree component. I can display the tree as menu1 |-sub_menu1 |-sub_menu2 menu2 |-sub_menu3 |-sub_menu4 and I remove root node, make all tree expand while init the tree, but I do not know how to add links to the sub_menus, I tried to add some code like this: �...@override protected void onNodeLinkClicked(AjaxRequestTarget target, TreeNode node) { DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node; NavigationTreeNode navigationTreeNode = (NavigationTreeNode) treeNode.getUserObject(); if (navigationTreeNode.isURL) { setResponsePage(navigationTreeNode.getURL()); super.onNodeLinkClicked(target, node); } else { super.onNodeLinkClicked(target, node); } } this looks work well, but when I clink on a link, the page redirect to the target page, but I can not keep the tree with the selected node expand. Can anyone help me or give me some reference URLs? Thanks! -- -- Enjoy. Thanks! Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Enjoy. Thanks! Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 贾昊林 Haulyn Jason -- View this message in context: http://www.nabble.com/how-to-use-wicket-tree-in-extension-tp24967306p24980702.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Enjoy. Thanks! Haulyn Microproduction Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/how-to-use-wicket-tree-in-extension-tp24967306p25011340.html Sent from the Wicket - User mailing list archive at Nabble.com
how to use wicket tree in extension
Hi,all: I design a page with a tree for page navigation. But I can not find more information from Internet to learn how to use the Tree component. I can display the tree as menu1 |-sub_menu1 |-sub_menu2 menu2 |-sub_menu3 |-sub_menu4 and I remove root node, make all tree expand while init the tree, but I do not know how to add links to the sub_menus, I tried to add some code like this: @Override protected void onNodeLinkClicked(AjaxRequestTarget target, TreeNode node) { DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node; NavigationTreeNode navigationTreeNode = (NavigationTreeNode) treeNode.getUserObject(); if (navigationTreeNode.isURL) { setResponsePage(navigationTreeNode.getURL()); super.onNodeLinkClicked(target, node); } else { super.onNodeLinkClicked(target, node); } } this looks work well, but when I clink on a link, the page redirect to the target page, but I can not keep the tree with the selected node expand. Can anyone help me or give me some reference URLs? Thanks! -- -- Enjoy. Thanks! Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 Haulyn Jason
Re: how to use wicket tree in extension
are you using LinkTree? -igor On Fri, Aug 14, 2009 at 12:15 AM, Haulyn R. Jasonsaharab...@gmail.com wrote: Hi,all: I design a page with a tree for page navigation. But I can not find more information from Internet to learn how to use the Tree component. I can display the tree as menu1 |-sub_menu1 |-sub_menu2 menu2 |-sub_menu3 |-sub_menu4 and I remove root node, make all tree expand while init the tree, but I do not know how to add links to the sub_menus, I tried to add some code like this: �...@override protected void onNodeLinkClicked(AjaxRequestTarget target, TreeNode node) { DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node; NavigationTreeNode navigationTreeNode = (NavigationTreeNode) treeNode.getUserObject(); if (navigationTreeNode.isURL) { setResponsePage(navigationTreeNode.getURL()); super.onNodeLinkClicked(target, node); } else { super.onNodeLinkClicked(target, node); } } this looks work well, but when I clink on a link, the page redirect to the target page, but I can not keep the tree with the selected node expand. Can anyone help me or give me some reference URLs? Thanks! -- -- Enjoy. Thanks! Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: how to use wicket tree in extension
No, just use Tree in extension package. On Fri, Aug 14, 2009 at 11:17 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: are you using LinkTree? -igor On Fri, Aug 14, 2009 at 12:15 AM, Haulyn R. Jasonsaharab...@gmail.com wrote: Hi,all: I design a page with a tree for page navigation. But I can not find more information from Internet to learn how to use the Tree component. I can display the tree as menu1 |-sub_menu1 |-sub_menu2 menu2 |-sub_menu3 |-sub_menu4 and I remove root node, make all tree expand while init the tree, but I do not know how to add links to the sub_menus, I tried to add some code like this: @Override protected void onNodeLinkClicked(AjaxRequestTarget target, TreeNode node) { DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node; NavigationTreeNode navigationTreeNode = (NavigationTreeNode) treeNode.getUserObject(); if (navigationTreeNode.isURL) { setResponsePage(navigationTreeNode.getURL()); super.onNodeLinkClicked(target, node); } else { super.onNodeLinkClicked(target, node); } } this looks work well, but when I clink on a link, the page redirect to the target page, but I can not keep the tree with the selected node expand. Can anyone help me or give me some reference URLs? Thanks! -- -- Enjoy. Thanks! Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Enjoy. Thanks! Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 贾昊林 Haulyn Jason
Re: how to use wicket tree in extension
Is your menu (tree) in some parent page class that both the first and the linked-to page extend? When you go to a new page instance you will get a new instance of the Tree. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com Haulyn Jason-2 wrote: No, just use Tree in extension package. On Fri, Aug 14, 2009 at 11:17 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: are you using LinkTree? -igor On Fri, Aug 14, 2009 at 12:15 AM, Haulyn R. Jasonsaharab...@gmail.com wrote: Hi,all: I design a page with a tree for page navigation. But I can not find more information from Internet to learn how to use the Tree component. I can display the tree as menu1 |-sub_menu1 |-sub_menu2 menu2 |-sub_menu3 |-sub_menu4 and I remove root node, make all tree expand while init the tree, but I do not know how to add links to the sub_menus, I tried to add some code like this: @Override protected void onNodeLinkClicked(AjaxRequestTarget target, TreeNode node) { DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node; NavigationTreeNode navigationTreeNode = (NavigationTreeNode) treeNode.getUserObject(); if (navigationTreeNode.isURL) { setResponsePage(navigationTreeNode.getURL()); super.onNodeLinkClicked(target, node); } else { super.onNodeLinkClicked(target, node); } } this looks work well, but when I clink on a link, the page redirect to the target page, but I can not keep the tree with the selected node expand. Can anyone help me or give me some reference URLs? Thanks! -- -- Enjoy. Thanks! Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Enjoy. Thanks! Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com yahoo: jia_hao...@yahoo.com msn: saharab...@gmail.com skype: saharabear QQ: 378606292 贾昊林 Haulyn Jason -- View this message in context: http://www.nabble.com/how-to-use-wicket-tree-in-extension-tp24967306p24980702.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org