• urawareds
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I am working on a project that has a very large Visualforce page.  I'm breaking it down into more manageable chunks by using a "State" object that encapsulates information about a particuar state inside of smaller objects.  The base class is abstract, and each state extends that abstract class to provide different functionality.  Anyhow, one state manages a purchase order and has a method called getPO ().  I can access that method via an Apex expression like this:

 

{!curState['PO'].PO_Number__c}

 

In that object (which works perfectly).  Obviously I cannot access the getPO() method directly because the base class does not have that method and the Controller that maintains the state object returns the abstract State obejct, I also have a method called getLineItems() that returns a collection of objects (line items on a purchase order).  The collection is a "List."  I can actually test this such as:

 

<apex:outputText value="{!curState['LineItems']}"/>

 

Which shows the collection as having the correct number of elements.

 

When I attempt to iterate over that collection in a pageBlockTable such as:

 

<apex:pageBlockTable id="lineItems" value="{!curState['LineItems']}" var="t">


it will not compile.  The error message is:

    Save error: Cannot coerce from class core.apexpages.el.adapters.RuntimeTypeMetadataELAdapter to class java.lang.Boolean

 

Perhaps I'm misunderstanding what Datatable should take in the value.  However, if I put the exact same list in the controller class, it WORKS.  Any ideas on how I can fix this?

 

Thanks in advance.

 

  • October 05, 2011
  • Like
  • 0