This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes display Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "display" Watch "display" New topic
Author

display

Joe Jose
Ranch Hand

Joined: Jan 14, 2004
Posts: 125
Hi,

I am using jsf ri 1.1 and tomahawk_1.0. I just need to alter the diplay in the dropdown list. The dropdown list displays the customer names. In the customer names there are parent customers and child customers. I just want to display the parent customer and beneath that corresponding child customers . For example,

xxx Parent
tab space xx1
tab space xx2
tab space xx3
yyy Parent
tab space yy1
tab space yy2
tab space yy3

List contains database driven values. I am trying to use css for this display. But I am not sure how can I display according to parent and child since its data driven.

Here is the jsp selectItems tag I used :



In the managed bean :



The tab space is not displaying in the dropdown list box.
Please tell me have you got any thoughts on it. I am not sure where I have got mistaken.

Thanks,
Joe.
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
hmm there is a tricky workaround for your issue

while(itr.hasNext()) {

usr = (UserCustomer) itr.next(); if(usr.getParentCustomerId() == 0) {
s = ""; }else {
s = "����� ";
}

NOOO, the else block is not spaces, instead of hitting space bar, fill spaces using <alt>255.


I think it will do the job for you !!

Thanks,
[ September 21, 2006: Message edited by: Rajeev Ravindran ]

SCJP, SCWCD, SCBCD, Oracle Certified Professional (SQL n PL/SQL)
Joe Jose
Ranch Hand

Joined: Jan 14, 2004
Posts: 125
Originally posted by Rajeev Ravindran:
hmm there is a tricky workaround for your issue

while(itr.hasNext()) {

usr = (UserCustomer) itr.next(); if(usr.getParentCustomerId() == 0) {
s = ""; }else {
s = "����� ";
}

NOOO, the else block is not spaces, instead of hitting space bar, fill spaces using <alt>255.


I think it will do the job for you !!

Thanks,

[ September 21, 2006: Message edited by: Rajeev Ravindran ]



Hi Rajeev,

Thank you very much for your reply. I am sorry to say that, the solution you gave doens't seem to work. I have given like this :

Hope this is what you meant. The list displays like
Parent
<alt>255Child0
<alt>255Child1

Thanks,
Joe.
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
grrrr just kidding

i meant to say press the alt key and hit 255 (just like you use <ctrl>C for copy), its an ascii for blank space but its not like hitting space bar !

Thanks,
[ September 22, 2006: Message edited by: Rajeev Ravindran ]
Joe Jose
Ranch Hand

Joined: Jan 14, 2004
Posts: 125
Originally posted by Rajeev Ravindran:
grrrr just kidding

i meant to say press the alt key and hit 255 (just like you use <ctrl>C for copy), its an ascii for blank space but its not like hitting space bar !

Thanks,

[ September 22, 2006: Message edited by: Rajeev Ravindran ]


ooops.... silly me .
I got it
Very thoughtful of you Rajeev.
Thanks, :thumb:
[ September 22, 2006: Message edited by: Joe Jose ]
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
there has to be a better way of doing this.
see http://www.w3schools.com/tags/tag_optgroup.asp - thats what you need. i am not sure if it is possible to print out an "optgroup" using myfaces's h:selectOneMenu tag or not, but it would be worth spending some time researching into it.
[ September 24, 2006: Message edited by: Lynette Dawson ]

MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
Joe Jose
Ranch Hand

Joined: Jan 14, 2004
Posts: 125
Originally posted by Lynette Dawson:
there has to be a better way of doing this.
see http://www.w3schools.com/tags/tag_optgroup.asp - thats what you need. i am not sure if it is possible to print out an "optgroup" using myfaces's h:selectOneMenu tag or not, but it would be worth spending some time researching into it.

[ September 24, 2006: Message edited by: Lynette Dawson ]


Thank you very much for the information Lynette .
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
That is something new for me too. Thanks for the info !!

Thanks,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: display
 
Similar Threads
On Drop Down Error summary=(j_id52:txtascedNarow: Validation Error: Value is not valid)
iterate in jsf
Form calling a session scoped backing bean constructor twice
Getting One Dropdown Menu Selection to Affect the Values of a Second Dropdown Menu
getting this Ajax code to work with jsp