Re: tree2 HtmlTree and saveSate Question
Anu Padki wrote: Can you please explain briefly what does the second commandlink under the panelGrid mean? What is projectTable.jsp and what is toViewId's function? Thanks. - Anu Sorry, yes, this shouldn't be there for this example. This is my navigation control, just ignore it in this context. regards, Marcel
Re: dataScroller.jsf: How to reset pagindex
Marcel Ruff wrote: Hi, i need to reset the page index of 994 Cars found, displaying 10 cars, from 1 to 10. Page 99 / 100 If i watch page 99 and program some filter so that after reload max page is only 20 the current page 99 is far behind the end. How can i programmatically reset the current page to 0 ? Thanks Marcel Ok, i solved it by reloading the page when 'search' is clicked and not reloading it when one of the navigation buttons is clicked. This is controlled by this (my Search Button): The myBacker.searchActionToViewId() returns 'null' when navigations buttons where clicked (thus the current page index is preserved) and it returns "go_home" which reloads the page (via my examples-config.xml), i hope this helps others, Marcel
Re: tree2 HtmlTree and saveSate Question
Anu Padki wrote: I am trying to get the lazy loading working for tree2. A lot of debugguibg shows that the changed value of the nodes is not persistent acorss the requests. After I quit from the ActionListener, the new nodes are forgotten. I suspect I have to call saveState on the tree. Any one knows how to use saveState. Any clues? Is this the right direction to go? - Anu Hi Anu, the has nothing to do with your problem. The code snippets i have written in http://wiki.apache.org/myfaces/Tree2 works perfectly for me to lazy load the tree nodes. Note that my backer beans are in the "session" scope, configured in WEB-INF/examples-config.xml. You may, at a later development stage, miss the browser-back-button functionality. You press 'BACK' and the navigation of the previous page (from browser cache) does not work, than comes into the game. Put your backer beans now in the "request" scope and declare them with value="#{stindexScrollerList}" /> ... in your jsp page, and all is well :-). See http://wiki.apache.org/myfaces/How_JSF_State_Management_Works regards Marcel PS: I have updated http://wiki.apache.org/myfaces/Tree2 as well
dataScroller.jsf: How to reset pagindex
Hi, i need to reset the page index of 994 Cars found, displaying 10 cars, from 1 to 10. Page 99 / 100 If i watch page 99 and program some filter so that after reload max page is only 20 the current page 99 is far behind the end. How can i programmatically reset the current page to 0 ? Thanks Marcel
Re: tree2: How to get the expand event to load more data?
Hi Sean, thanks for your response. I found src/tomahawk/org/apache/myfaces/custom/tree2/resource/javascript/tree.js and i believe you talk about function treeNavClick() The point is that i think it should be possible to register a Java (not javascript) listener method to receive the clicks, it is in Java where i need to add sub-nodes. I don't know where the proper location is for such a listener registration to follow the JSF philosophy. tree2 probably needs some refactoring to support this. regards Marcel Sean Schofield wrote: There is a way to specify a javascript *location* instead of using the file in the component. Specify your own javascript location and then copy the javascript file from the tree2 source to that location. Then simply add your own stuff to the onclick. sean On 10/5/05, Marcel Ruff <[EMAIL PROTECTED]> wrote: Hi, when a user clicks on the '+' image of the tree to expand it, i would like to intercept this click to load more data into my tree model. How can i register for such an event? Some code snippets showing the work flow would be very helpful, thanks Marcel PS: I have found some older threads about this topic but i couldn't find out how to do it.
Re: Tree2 - on-demand load capable?
CONNER, BRENDAN (SBCSI) wrote: Yes, we did the same thing, although we supply our own +/- GIFs so we still get kind of the same effect as using the ones supplied with the component. Ahh, i think it took the code from one of your mail if i remember correctly. Please correct the Wiki page if there are some errors so others can benefit, thanks Marcel I haven't looked at the component much lately, though, so I don't know if it has been re-architected to allow the programmer to intercept the expand event that is triggered if we have showNav="true". Sean, can you comment on this? - Brendan -Original Message----- From: Marcel Ruff [mailto:[EMAIL PROTECTED] Sent: Thursday, October 06, 2005 5:02 AM To: MyFaces Discussion Subject: Re: Tree2 - on-demand load capable? Eric Pias wrote: Hello, I would like to implement a Tree2 that loads child nodes on demand. What I would like to do is sub-class TreeNode or something else and when the user clicks the + on a node, at that point my code would go out and get just the first level children under that node. I have tried implementing TreeNode and doing this type on functionality in getChildren() without success so far. Before I spend a lot more time debugging, I want to make sure that Tree2 allows for what I want to do. Does anyone know for sure? Thanks, Eric Hi Eric, i have the same task and after searching the mailing list i ended up with a workaround i found in an old mail (i can't remember who posted it). The problem with this workaround is that i needed to remove the '+' icon with and make the folder icon clickable with actionListener="#{navigationBacker.processAction}"> In my NavigationBacker.java:processAction(ActionEvent e) i load the children nodes with data from EJB3-persistency. The bad thing is that the '+' icon is now invisible, but i couldn't find a way to get the event when somebody clicks on the '+' icon. The org.apache.myfaces.custom.tree2.HtmlTree.java seems to register _expandControl = new HtmlCommandLink(); to get internally the '+' clicks, but i haven't found a way to receive the clicks in my code. I have added this with some code snippets to the Wiki page at http://wiki.apache.org/myfaces/Tree2 Please edit the page if you have a better solution, rgds Marcel
Re: Tree2 - on-demand load capable?
Eric Pias wrote: Hello, I would like to implement a Tree2 that loads child nodes on demand. What I would like to do is sub-class TreeNode or something else and when the user clicks the + on a node, at that point my code would go out and get just the first level children under that node. I have tried implementing TreeNode and doing this type on functionality in getChildren() without success so far. Before I spend a lot more time debugging, I want to make sure that Tree2 allows for what I want to do. Does anyone know for sure? Thanks, Eric Hi Eric, i have the same task and after searching the mailing list i ended up with a workaround i found in an old mail (i can't remember who posted it). The problem with this workaround is that i needed to remove the '+' icon with and make the folder icon clickable with actionListener="#{navigationBacker.processAction}"> In my NavigationBacker.java:processAction(ActionEvent e) i load the children nodes with data from EJB3-persistency. The bad thing is that the '+' icon is now invisible, but i couldn't find a way to get the event when somebody clicks on the '+' icon. The org.apache.myfaces.custom.tree2.HtmlTree.java seems to register _expandControl = new HtmlCommandLink(); to get internally the '+' clicks, but i haven't found a way to receive the clicks in my code. I have added this with some code snippets to the Wiki page at http://wiki.apache.org/myfaces/Tree2 Please edit the page if you have a better solution, rgds Marcel
tree2: How to get the expand event to load more data?
Hi, when a user clicks on the '+' image of the tree to expand it, i would like to intercept this click to load more data into my tree model. How can i register for such an event? Some code snippets showing the work flow would be very helpful, thanks Marcel PS: I have found some older threads about this topic but i couldn't find out how to do it.
Re: Tree2, event interception, criticism :-)
Timo --Blazko-- Boewing wrote: Hello all, After having read almost every discussion here on the tree2 component, I am having some final thoughts :-) I am trying since two days now to get the 99,9% common case working: having a tree component and intercepting centrally a clicked ID belonging to the selected node. First, I have no idea, why it takes quite much code to get this component working, these f:facet stuff with manual h:commandLink etc. is nice for customisation, but why not making this optional? I think most people want to use the tree2 as it is in the examples. Everyone that wants different style can write another renderer for this component, or not? And most visual appearance can be achieved by using CSS and exchanged images... This would really cause much less coding in the frontend for users of tree2 - I think it is way too much. Now, in order to find out an ID of my node selected, I have to query an f:param the "old" style? Why that? Additionally, in every example you can read that "t.setNodeSelected" shall be used as action event listener. Okay, what is "t"? It is never set up as a managed bean, and only digging example sources and messages here lead up to an idea that this might be an instance of HtmlTree or so whose instance I cannot define myself. Okay, how to implement that action event fired, t being hard wired? Or not? I think that much confusing stuff can be avoided when documentating the common case in the component overview of the website and the wiki. No one knows what node and varNodeToggler exactly can do and how to intercept fired events. Please, although between the lines that might sound that way, do not feel offended! I am thankful for that wonderful stuff, especially because it is an extra on top of JSF standard components. However, please understand this as my way of constructive criticism that may be well founded in my misunderstanding of something :-) However, creating such a tree was very quickly done using tagfiles in JSP 2.0, so I see less profit i using the tree2 component, that I would like to use but causes much coding overhead in my POV. + my 10 Cents, you express exactly my feelings. Marcel PS: What is POV? (for me it is POB = plain old brain)
Re: [ANNOUNCE] Release Candidate Available
Sean Schofield wrote: There is a 1.1.1 release candidate available. http://cvs.apache.org/builds/myfaces/release/ Note: We have two versions available. The latest source code (and nightly build) is version 1.1.0. The release candidate is version 1.1.1. Please report any bugs you find in JIRA with the correct version number. I have my app running fine with 1.1.0, when i exchange the WEB-INF/lib jars to those from myfaces 1.1.1 RC the browser displays a blank page, the logs don't show any errors, Marcel
tree2 usage: how to detect which node was clicked?
Hi, i have a tree2, but how do i detect in my backing bean which node id was clicked? I'm using actionListener="#{mybean.clicked}" and looking into the delivered ActionEvent instance didn't help me yet. thanks Marcel
Generic JSF style navigation?
Hi I'm a bit lost on how to do my page navigation the JSF style. I have a in my main page home.jsp with "header", "navigation", "body" and "footer" section, each loading a jsp page with e.g. In the "navigation" is a "tree2" and when i click on a tree node i only want to replace the jsp page in the "body" section. So always the home.jsp is reused but only the included body jsp changes. 1. How to setup the "tree2" in navigation.jsp to get the wanted events on click? 2. How to replace the "body.jsp" in my home.jsp according to the node clicked in 1.? // #{...} does not seem to work? 3. It would be nice to somehow generate dynamically the "body.jsp" replacement from the clicked tree2 node information. Thanks for lightening my befogged brain ... rgds, Marcel