You need to sign in to do that
Don't have an account?
GerhardNewman2
Thanks,
Inner datatable or pageblocktable
I want to have a related list on my accounts page that shows open opportunites.
For each open opportunity I want to list any products
I can't find anyway of outputing any information at all after each row in my PageBlockTable.
In the code below the text "OutputAnythingHere" does not get rendered.
What I want to do is add a new pageBlockTable at my OutputAnythingHere placeholder, which would give me an inner table to iterate the products for the opportunity.
Code:
<apex:form > <apex:pageBlock title="Open Opportunites"> <apex:pageBlockButtons location="top"> <apex:commandButton action="/006/e—retURL=/{!id}" value="New Opportunity" id="theButton"/> </apex:pageBlockButtons> <apex:pageblocktable value="{!OpenOpportunities}" var="aOpportunity" width="100%" > <apex:column width="3%" headervalue="Action"> <apex:outputLink value="/{!aOpportunity.ID}/e"><b>Edit</b> <apex:param name="retURL" value="/{!id}"/> </apex:outputLink> </apex:column> <apex:column width="35%" headervalue="Opportunity Name"> <apex:outputLink value="/{!aOpportunity.ID}">{!aOpportunity.Name}</apex:outputLink> </apex:column> <apex:column width="25%" headervalue="Stage" value="{!aOpportunity.Stagename}"/> <apex:column width="10%" headerdir="RTL" headervalue="Net Revenue" dir="RTL" value="{!aOpportunity.CurrencyIsoCode} {!aOpportunity.Sum_Net_Revenue__c}"/> <table width="100%"><tr align="right"><td><b>OutputAnythingHere</b></td></tr></table> </apex:pageblockTable> <table width="100%"><tr align="right"><td><b>Total {!OpenTotal}</b></td></tr></table> </apex:pageBlock> </apex:form>
Thanks,
Gerhard
Couldn't you use the <apex:repeat> tag to iterate through the products something like:
The problem isn't a loop, its an inner loop.
Using a repeat like this:
works fine by itself, but placing this code inside a PageBlockTable does absolutely nothing.
As said in my original post, I cannot get anything additional rendered inside the PageBlockTable loop.
This gives me a partial solution as I can now at least output the data. However I would much prefer to be able to use PageBlockTable so that I get correct styling. Now I will have to start the formating process all over again.....
By name, pageBlockTable and dataTable create <table> tags and <tr> and <td> tags. Repeat works for iteration the same way pBT does but does not output these table tags for you. I think you are going to have a hard time getting what you want by nesting pBTs, because you're going to wind up with nested <table>s. While it is legal HTML, I can't promise that our css is going to behave the way you'd expect it to. pageBlockTable's styling is very specific to our use cases, which have not included nesting lists.
Thanks!
So something like:
Seems like it should work.
I used apex:repeat as the solution. The code below works fine for me and it looks just how I wanted.