You need to sign in to do that
Don't have an account?
Prabha
Maps in visualforce
Hi
Is the following possible in pageblock table?
I have a map structure: map<string, list<string>> ,
the values could be,
for example:
key: fruits:
values: orange, apple, grape
key: Vehicle:
values: car, motorbike, trolley, lorry, truck
key: shape:
values: round, square.
Now I want to show that in a pagblock table where keys as column headers and values as column values!
I was only able to get that with map<string, string>.
<apex:pageBlockTable value="{!a1}" var="ms"> <apex:repeat value="{!a1}" var="r"> <apex:column headerValue="{!r}"> <apex:repeat value="{!a1[r]}" var="r1"> {!r1} </apex:repeat> </apex:column> </apex:repeat> </apex:pageBlockTable>
Please enlighten me on this.
Can it be done as the way I want it to be?
Prabhan
Hi
The same is possible with a break tag in repeat.
like the following.
But I want to populate 'null' or '-' for the empty values, highlight the row when we move the mouse over, like in pageblock. Can you please suggest me some solution for that.
Prabhan
All Answers
Hi,
U can use html table to get the result.
I'll give u an example how to use html table with Map:
<apex:pageBlock>
<table >
<tr>
<apex:repeat value="{!mapObj}" var="ms"> <!--- mapObj uor map <String,List<String>> -->
<td style="padding-left:5px;">
<span style="font-weight: bold;padding-left: 5px;">{!ms} </span>
<table>
<apex:repeat value="{!mapObj[ms]}" var="r1"> <!-- Second repeat is here.-->
<tr>
<td>
{!r1}
</td>
</tr>
</apex:repeat>
</table>
</td>
</apex:repeat>
</tr>
</table>
</apex:pageBlock>
Please let me know if u have any problem on same and if this post helps u plz give KUDOS by click on star at left.
Hi
The same is possible with a break tag in repeat.
like the following.
But I want to populate 'null' or '-' for the empty values, highlight the row when we move the mouse over, like in pageblock. Can you please suggest me some solution for that.
Prabhan