You need to sign in to do that
Don't have an account?

PageBlockTable with Webservice call?
Hey all,
I've had this problem that's been bothering me for a few days here. I'm trying to fill a call from a webservice into a pageblocktable, and I'm getting absolutely nowhere. I've completed a workaround by instantiating a new datatable for each column I want to display, but I was wondering if there were any way to display this all in one table.
Right now I have:
public class PageBlockTest { public class TestThis { public List<Decimal> Line {get;set;} public List<String> INum {get;set;} } public List<TestThis> testMe = new List<TestThis> (); public List<TestThis> getTestData() { testMe = new List<TestThis>(); TestThis tt = new TestThis(); //The LineNumList and the ItemNumList are filled with the data from the webservice call. tt.Line = LineNumList; tt.INum = ItemNumList; testMe.add(tt); return testMe; } }
And my visualforce code:
<apex:pageblock id = "myTest"> <apex:pageBlockTable value = "{!TestData}" var = "d"> <apex:column> {!d.Line} </apex:column> <apex:column> {!d.INum} </apex:column> </apex:pageBlockTable> </apex:pageblock>
And I get the entire contents of the list in one field row. How do I make them display like a table should?
You currently have an object holding two lists. But what you need it a list of objects containing two values.
Your TestThis class should only hold one value for Line and one value for INUM, instead of a list for each one.
Then filling in this data will need to be in a loop:
All Answers
You currently have an object holding two lists. But what you need it a list of objects containing two values.
Your TestThis class should only hold one value for Line and one value for INUM, instead of a list for each one.
Then filling in this data will need to be in a loop:
You sir are a lifesaver. Thank you!