This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Im unsure where to begin to even do this. I had hoped richfaces would have a nice feature for its tree that would do this for me, but it is looking like I will need to write the java code to do so completely on my own. Which is bad since I can MAYBE be classified as an intermediate java person. Maybe lol. So here is what the xml looks like.
I need the tree nodes to be populated using the data from <name>, <device>, and <channel>, in that order, to make a tree that does this:
I have looked at a lot of richfaces tree tutorials but havent had much luck. They mostly focus on the .xhtml pages rather than the actual java code. I did find some java code that takes data from a .properties file and converts it into a data stream, and uses that data stream to populate the tree. I was able to get that working, but it is not feasible for me to use .properties files to hold all of the data, which will be constantly changing.
So anyone know where I should begin with this? Or what I might do a search for that will help me figure it out. Ive been having a heck of a time having any luck. I wish I even knew where to begin, because I realize not many people are going to want to tackle somethign this complicated, so any tips at all will help me. I'm willing to do the work, but I have so little experience with this type of thing I am really constrained.
True wisdom is in knowing you know nothing - Socrates
Well, hopefully someone in the java forum will see this before it falls to the edge of oblivion
I think I may have found an answer to this, but would like someone to confirm it. I beleie this site tells me what I need to do:
http://www.devx.com/getHelpOn/Article/11874/0/page/1 But I would like someone to confirm it because
1 - it seems to good to be true
2 - a lot of those concepts are new to me so I can easily just be misinterpreting
Let me summarize some (alleged) facts which I have extracted from the original post:
1. You need to do this processing in the "richfaces" context. Which I googled for and found it's components for JSF. So the processing is going to be done in Java on the server side, is that correct?
2. You have some code which can run in this richfaces context and produce a tree which you're satisfied with. However it doesn't take XML as its input.
If I have that all right, then what I would suggest is to take the code which produces the tree, and modify it so that it does take XML as its input. Since I haven't seen the code, I can't suggest how you might do that. The concepts in that article you linked to might help. Just don't expect the article to provide code which you can drop into your richfaces context, instead you'll have to understand what its code does and what your code does and how to extract the useful bits from the article.
Yes your pretty much right on. Except I do not have to use richfaces at all, I just started with it because it seemed like an easy way to create a tree for my pages. I think I can take the concepts from the linked article and apply them, but I just wanted to be absolutely sure that it is what I thought it was - takes input from an xml and parses it into a tree. It seems that is what it does so that will probably work for me, I will be trying it tomorrow.
But just in case you have a chance to look, here is the java code that takes data from a .properties file and parses it into a richfaces tree:
Unfortunately this code came from en example I found demoing richfaces trees, so I dont understand all of it. This makes it difficult for me to convert the code to take data from xml instead of .properties files. I attempt to do so in the other post I have on this forum which should be right below this one, but I am probably not on the right track with it
The problem isn't that you are missing a piece of knowledge, it's that you are missing a whole lot of knowledge. As I said elsewhere in one of your threads (I think), you shouldn't expect that you can just grab some code of the internet and have it miraculously do exactly what you want.
So, first step: get your requirements cleared up. And remember, you need the requirements that originally existed, not things you identified as possibilities while you were galloping off in all directions.
Then once you have that done, you can start looking at solutions.
If I had a choice to learn all of these different concepts one at a time of course that is what I would do. But I won a design challenge from my college and now I am developing this for a company as part of winning. So I am not as ignorant on a lot of this as first impressions may seem, I do have experience but it is all classroom experience. Its mostly that developing for the web is something I havent really done, it has all been java code I have done within eclipse. Using swing gui components.
I do plan to use richfaces, because even if I dont use it for my tree, it will still make certian other things easier for me such as the row of tabs. The thing that worries me now though, is if I do use this example to create my tree, I am not going to have a clear idea of how to make what node is selected from the tree manipultae what shows up in my main content pane. But one problem at a time.
ow, i know I will nto be able to drag and drop pieces of my project into this example and make it work, but it still seems that figuring out how to integrate the two together will be the easiest way to do what I am trying to do. Or am I wrong about that. This is why I have had over 70 posts on this site and have only been a member for a little over a month. Im here trying to get some help with this.
Thanks for your comemnts, if you need any other information from me or have any other tips please feel free.
edit - the reason I "seized on richfaces" was because it was suggested to me by the contact I have at the company i am doing this for" WHen I first looked into that I did not even know how to import the richfaces library into my project. I have come quite a ways since then, but I know I have way more ground to cover