Re: Wicket Markup side-by-side
I agree; Wicket and JQuery cannot substitute each other. My apologies if I was not clear enough. Here is little history: Actually I was going through JQuery Ajax events and other basic tutorial and wanted to understand Wicket7's Ajax Event handling and HeaderItems - just to compare and learn how Wicket changes the final markup against the final markup using plain JQuery. At one point I was stuck as I was using wrong HeaderItem in Wicket to achieve same what I was doing with JQuery function in plain html to hide the link on click. Using one particular HeaderItem was not resulting in similar JavaScript function after markup which I had using plain JQuery function. That made me curious to know and compare final HTML markup side by side by using straight forward JQuery/JavaScript and then doing same thing with Wicket by setting different HeaderItems; to understand how setting different header effects the final Markup and know internals of Wicket HeaderItem from there. For example, what markup looks like when using JavaScriptContentHeaderItem (and when to use it), or how it would look when using OnLoadHeaderItem? And then comparing the final markup against plain HTML written with JQuery/Javascript function. Not much of use may be; but just wanted to get more insight of how Wicket HeaderItem and Ajax Events works; with comparing those against vanilla JQuery/JavaScript usage. I hope this explanation would help in understanding my original question. Thanks, -Mihir. On Fri, Sep 25, 2015 at 3:39 PM, Martin Grigorov wrote: > Hi, > > What kind of examples/snippets do you have in mind? > Wicket cannot substitute jQuery, and vise versa. For better user experience > I'd recommend to use JavaScript (jQuery) when possible. > E.g. using AjaxLink when you can use plain JS for some interaction is > actually bad practice. > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Fri, Sep 25, 2015 at 5:51 PM, Mihir Chhaya > wrote: > > > Hello, > > > > I recently started digging little deeper into how Wicket 7 > > converts/generates markup when adding JS or CSS resources at the > > page/component level. > > And that gave me an idea of contributing to the wicket community by > showing > > code snippet (side-by-side) with pure JQuery and then how to achieve same > > with Wicket 7 (and resulting markup). > > > > I am not sure if there is already a place available for such or if > anybody > > is working and I could join the efforts. > > > > Any suggestions/recommendations? > > > > Thanks, > > -Mihir. > > >
Re: Wicket Markup side-by-side
Hi, What kind of examples/snippets do you have in mind? Wicket cannot substitute jQuery, and vise versa. For better user experience I'd recommend to use JavaScript (jQuery) when possible. E.g. using AjaxLink when you can use plain JS for some interaction is actually bad practice. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Fri, Sep 25, 2015 at 5:51 PM, Mihir Chhaya wrote: > Hello, > > I recently started digging little deeper into how Wicket 7 > converts/generates markup when adding JS or CSS resources at the > page/component level. > And that gave me an idea of contributing to the wicket community by showing > code snippet (side-by-side) with pure JQuery and then how to achieve same > with Wicket 7 (and resulting markup). > > I am not sure if there is already a place available for such or if anybody > is working and I could join the efforts. > > Any suggestions/recommendations? > > Thanks, > -Mihir. >
Wicket Markup side-by-side
Hello, I recently started digging little deeper into how Wicket 7 converts/generates markup when adding JS or CSS resources at the page/component level. And that gave me an idea of contributing to the wicket community by showing code snippet (side-by-side) with pure JQuery and then how to achieve same with Wicket 7 (and resulting markup). I am not sure if there is already a place available for such or if anybody is working and I could join the efforts. Any suggestions/recommendations? Thanks, -Mihir.
Re: Wicket Tree - Getting The Selected Node
Thanks Sven. Things are clear to me now. Regards, Anup -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Tree-Getting-The-Selected-Node-tp4672040p4672044.html Sent from the Users forum 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: Wicket Tree - Getting The Selected Node
Hi, @Override public Component newContentComponent(String id, IModel model) { return new Folder(id, this, model) { /** * Always clickable. */ @Override protected boolean isClickable() { return true; } @Override protected void onClick(AjaxRequestTarget target) { Employee employee = getModelObject(); // keep selection somewhere, exchange components or switch to other page } @Override protected boolean isSelected() { // get selected status somewhere return false; } }; } Have fun Sven On 25.09.2015 14:12, Anup wrote: Sven Meier wrote a NestedTree does not have any notion of 'selection'. But the set of expanded nodes is kept in the tree's model object, see AbstractTree#expand() and #collapse(). You decide how to represent each node's content, for this you'll have to override AbstractTree#newContentComponent(). The default will just expand and collapse the tree branches on each click, see org.apache.wicket.extensions.markup.html.repeater.tree.content.Folder You can override Folder's methods or use any other component to represent your nodes. Thanks Sven. I have understood the above as I can see the expanded nodes by inspecting tree.getModel(). What still foxes me is how do I take some action, when the user clicks a particular node? For example if each node is representing an employee, then how can I display the details of the desired employee when the user clicks/selects on the corresponding employee node? Regards, Anup -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Tree-Getting-The-Selected-Node-tp4672040p4672042.html Sent from the Users forum 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket Tree - Getting The Selected Node
Sven Meier wrote > a NestedTree does not have any notion of 'selection'. > But the set of expanded nodes is kept in the tree's model object, see > AbstractTree#expand() and #collapse(). > > You decide how to represent each node's content, for this you'll have to > override AbstractTree#newContentComponent(). The default will just > expand and collapse the tree branches on each click, see > > org.apache.wicket.extensions.markup.html.repeater.tree.content.Folder > > You can override Folder's methods or use any other component to > represent your nodes. Thanks Sven. I have understood the above as I can see the expanded nodes by inspecting tree.getModel(). What still foxes me is how do I take some action, when the user clicks a particular node? For example if each node is representing an employee, then how can I display the details of the desired employee when the user clicks/selects on the corresponding employee node? Regards, Anup -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Tree-Getting-The-Selected-Node-tp4672040p4672042.html Sent from the Users forum 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: Wicket Tree - Getting The Selected Node
Hi, a NestedTree does not have any notion of 'selection'. But the set of expanded nodes is kept in the tree's model object, see AbstractTree#expand() and #collapse(). You decide how to represent each node's content, for this you'll have to override AbstractTree#newContentComponent(). The default will just expand and collapse the tree branches on each click, see org.apache.wicket.extensions.markup.html.repeater.tree.content.Folder You can override Folder's methods or use any other component to represent your nodes. Have fun Sven On 25.09.2015 13:41, Anup Gokhale wrote: Hi. Am a complete noob to Wicket and am currently learning Wicket by writing small example applications. Have worked my way through all the basic components like TextField, Links, Labels, Buttons, ListView, DataTable etc. Have now reached DefaultNestedTree and it's many avatars. Am totally stuck in fetching the currently selected nodes. How do our models know which node(s) the user has currently selected in the tree? Also are there any events that get fired when the user clicks on a tree node? This is my very first post to the wicket user group, and I must say that Wicket developers and committers have done a commendable job. Thanks for developing such a wonderful framework. Warm regards, Anup Gokhale --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket Tree - Getting The Selected Node
Hi. Am a complete noob to Wicket and am currently learning Wicket by writing small example applications. Have worked my way through all the basic components like TextField, Links, Labels, Buttons, ListView, DataTable etc. Have now reached DefaultNestedTree and it's many avatars. Am totally stuck in fetching the currently selected nodes. How do our models know which node(s) the user has currently selected in the tree? Also are there any events that get fired when the user clicks on a tree node? This is my very first post to the wicket user group, and I must say that Wicket developers and committers have done a commendable job. Thanks for developing such a wonderful framework. Warm regards, Anup Gokhale --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus