aspose file tools*
The moose likes JSF and the fly likes BreadCrumb trail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "BreadCrumb trail" Watch "BreadCrumb trail" New topic
Author

BreadCrumb trail

Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
Hi there Guys.

I am using a Stack in my bean to track where a user is a process. I want to display this to the user on there page like a bread crumb trail. I am getting it working with a datatable, but, that displays each step one on top of the other. like this.
page1
page2
page3

How could I change what I have so that it displays like this.
page1 - page2 - page3 etc...

I think this is pretty self explanatory so node code. But if you want to see the code, I'll post it.

thanks.
cheers
Darryl
Dylan Honorez
Greenhorn

Joined: Oct 02, 2006
Posts: 29
Instead of looping over your stack in your JSF/JSP file, I would define an extra getter on your bean, where you loop over it. Then instead of using your datatable, I would use a normal outputText.


SCJP - SCWCD
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
That's a lekker idea Dylan,

It does open up another can of worms though, I want the user to be able to use the breadcrumb to navigate through the site. So each item in the trail needs to be hyperlinked. That's what's nice about the datatable, you can bind your datatable to a HtmlDataTable in your bean, and figure out which element was acted on / clicked.

It's odd that "the jsf okes" think about this kind of problem with the select boxes, but not with the lists. In the select boxes / items, you can specify that they are either pagedirection or linedirection. So they will either render going down, or going across. Why note give the option for your lists as well. I spose it does get complicated when your list contains complex data types that have more than 1 element, ie more than 1 column to display in the table..., how would that then display if you were rendering your table across as opposed to downwards.

Anyway, I'll try it out Dylan, and if I get something "elegant" working I'll post it here, otherwise, if there is a non hack way of doing, any help would be appreciated.

thanks
cheers
Darryl
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
Ok, maybe the code is necessary, 'cos I can't see how Dylan's jook will work. You see, I want the user to be able to click anywhere on the breadcrumb trail, and he goes there. So here is all the code. This is working fine, the only thing is, I would like the breadcrumb trail, to move across the page, as opposed to down.

//BEAN



//THE JSP FILE


So the breadcrumb trail's purpose is more than just a display, it is functional. And using it this way works very well, it's just the way it is rendered that I am not happy with. Any help please !!!

cheers
Darryl
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
Howzit guys,

Ok, so what I'm busy doing now is this.

I have the type HtmlPanelGroup on my bean. Whenever the user performs an action that needs to add something to the BreadcrumbTrail, I dynamically add an HtmlCommandLink to the panel. And add an ActionListener to the link. like this.



Than in my jsp I bind an <h:panelGroup to this HtmlPanelGroup in my bean.

Still a bit buggy, but when I've got it working I'll post it here. I think it might be useful to some people. What I like about it, although it is a jook, is that you don't have to write your own custom component.

Having said that, if anyone out there perhaps has a better (cleaner) idea, please feel free to let me know ;-)

cheers
Darryl
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
Ok last post. I have found the cleanest solution, although the above 2 work, this is the best, by far.

Tomahawk dataList layout="simple"

Works just like dataTable, just renders across.

Bob's your uncle.

cheers
Darryl
 
 
subject: BreadCrumb trail