Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JSF and the fly likes How to display the Map value in JSF button Component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to display the Map value in JSF button Component" Watch "How to display the Map value in JSF button Component" New topic

How to display the Map value in JSF button Component

Gautam Ry
Ranch Hand

Joined: Dec 30, 2008
Posts: 41
I am new in JSF. I need to display the Map value in JSF button. My code is below.

JSF code
<h:form id="contactcenterPr_form">
<h:dataTable border='1' value="#{ccSearchAndCaseProcessMB.processForOutBound}" var='var1' id="datatable1">

<h:commandButton type="button" id="hdngo1"
value=""#{var1.value}" styleClass="subBtn" />

public class ContCenterSearchAndCaseProcessMBean {
public Map getProcessForOutBound(){
Map map=new HashMap();
return map;

So, as per the above code I should be able to see four buttons as 'Claims' ,'Renewal','Query','Process' .
And I need to pass the key as a parameter in JavaScript method.

But , I am unable to see any thing.

Please, help me.


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961

One thing that probably isn't helping: DataTables should be working with ordered collections. Otherwise the table wouldn't consistently display the same rows in the same places. A related issue is that while I'm too lazy to RTFM, I don't think there's an iterator available for the HashMap interface. I think you have to get the keySet or valueSet and iterate on that.

The actual EL for retrieving a hashmap property (value) goes like this:

For retrieving a literal key's value:

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link:
subject: How to display the Map value in JSF button Component
Similar Threads
How to pass request parameter from Parent window to child window that has outputRender?
Displaying Two Buttons in one Row from HashMap
Using of nested Datatables
Show HashMap in Datatable. UIColumn with embedded Datatable. Help Needed
JSF and checkboxes