• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

need help choosing best tag for this

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a list that holds values, and I just need to display those values one after another on a page.

Then give the users the ability to click on each one and it will take them to the next page, depending on which one they click on.

Im not sure what to use here, still new to so many of the jsf tags
in additon to c and h tags I am using

rich:
richfaces:
a4j:
ajax:

so any of those or the h: tag that would be most appropriate is fine
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think a simple JSF solution, with a listener on the various values in the select list, is all you need.

-Cameron McKenzie
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you elaborate please?

Ive been messing with this all day, and so far the best I have gotten is using h: outputText, and since this is a list it is printing out I just get this as the output:

[APosttest, three, Moved Tese, Matt Test Two, space Test, project name, matt, three, space remove, two, tash2, spaces2, WSN Pond Measurements, tash, Single Test, spaces, Test01, MDN, exampleProject1, DoubleTest, spaces2]

I need a way to remove the [] and put those into a list going vertically down the page.

Maybe I need to change it out of a list, Im not sure?


edit - well i stumbled across one temporary solution that gives the look I am going for but no functionality...I just use another recursiveTreeNodeAdaptor and set showLines="false"
it looks like a list at least....
but I have the same problem Im having with the actual tree when I do that.
How do you make it where clicking on one of the nodes will do something, like send the user to another page?
I looked at the recursiveTreeNodeAdaptor javadoc and there is really nothing there to handle this.
I know the rich tree has to do more than just display the tree, there has to be some way to control what clicking on a node does right?


If you can answer either of these questions for me it should solvemy problem
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe you should look at this: http://www.ibm.com/developerworks/library/j-jsf2/

There are 4 articles in this series, BTW, and I think it's one of the best quick-start intros to JSF around.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah I read those when I first got started and I just re read the one you linked. But I still cant get this to work.

From what I can see he uses just the String CD to bind to a dataList. I tried this with my last bt its just blank.

The only reason I keep trying to use this list is because it loads itself up with all the values.

If I just try to use the projectName String from the project class, it returns nothing becuase that value has not yet been loaded with any data. The only reason I keep trying to use this list is because by some miracle I got it to load the values into the list from the web service before my jsf pages try to use them.

I know this doesnt make much sense since there are so many things left out.

Im just tired and dont feel like doing this but I dont have any time left
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah Im trying to follow this rich's example.

I just don't see how he is doing something.

He is using cd to populate his dataTable.

cd is from the StoreController class and it is of type CD cd;

So I made a ProjectControl class, and made MeasurementProject project; with setter and getter.

But this is still giving me blank space.

So he has to be doing something that is loading values into CD cd, but I dont see where he is doing this
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As always talking through it here seems to be getting me closer....

maybe someone can give me the final nudge here?

So in my controller class I have my MeasurementProject measurementProjectCollection (this is the same as Cd cd in rich's example). With setter and getter. Plus a String project



Then I perform an action on both of these to change their values. The action being performed here is taking the data froma web service and binding it to these values:



Im not totally sure what is being bound to measurementProjectCollection, but it seems to be what i want, because when I print out the value of project it comes out as the very first project from the data service. ANd when I bind project to my managed bean and use that as an output on my page it does display this very first project. The problem is, there are multiple projects. So I mean Icould so String project1; project2, project3, etc etc and then use that for loop over and over to bind the different values, and then on my jsf page just have a lot of h:outputText tags for each project1 - projectx. But this isnt very feasible, especially since the amount of projects will be changing. I could just do project1 - project100m because it is very unlikely there will be more than that per user, but you can see the trouble here.

So, in that for loop I can just bind the value returned over each iteration to a list, which is what I am doing for my tree. But this gets e back to square one.
If I just bind the list to my jsf page, the output is [project1, project2,projectx, etc etc]

So any idea what I should do here?


edit - I guess it comes down to teh fact that I need something to hold the multiple values for project, and be able to bind that to my jsf page, but make it come out in a nice list instead of just every value jumbled together between brackets
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There has to be just an easy to use tag that takes the values of the list and sorts them in a column!
That is exactly what the rich:tree does, there has to be somethign else too I would think
 
reply
    Bookmark Topic Watch Topic
  • New Topic