HOW to implemente input for "transient" fields ?


i need to achieve this:

I have a model with payments on private school.

When the client came to pay, I want to show all the pending payments, but I want to let the user to input diferent amount for each payment.

Sometimes the client don’t got all the money, so they could pay less than the original amount.

I need/want that the user interact with only one screen.

I try 2 approaches;

  1. using tabular input.

  2. using phaActiveColumn extension, with CArrayDataProvider.

In approach 1) I have the problem that column “monto a pagar” don’t exist in the model, is one of my transient columns.

So i created a tabular input by hand ! but don’t seems to work, I can’t receive in the controller the column.

Approach 2) has never been used with CArrayDataProvider as input data provider, and by the moment don’t work , because they can’t retrieve model id, in this line :

$valueId = $data->{$this->modelId};

So, i’m stuck

I add an image to show what’s my idea.



My last attempt is to create a new class, based on my model class, and add some public attributes, but i’m affraid that when the model try to access database didn’t find those attributes and fail.

Alternatively I could use the real model to read data from database and loop results and create an array of extended models, and use that array to show and edit records.

Last resource, create a real table/model…

Any idea will be thankfully received.

Best Regards