manipulating $rs in Recordset_Selected Event

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

manipulating $rs in Recordset_Selected Event

Post by digitalphotoworld »

I try to modify the data in Recordset_Selected Event BEFORE anything is happen to the data. For this, I use the following code:

// Recordset Selected event
function Recordset_Selected(&$rs) {

		while (!$rs->EOF) {  		
			if ($rs->fields['color'] == 1) 
				$rs->fields['name'] = "red";
			else  
				$rs->fields['name'] = "green";
			$rs->MoveNext();
		}

}

If I use var_dump($rs), I can see the raw data and that my changes are working well. But in Listpage the changes have no affect.

Is it not possible to change the data in this event? And if so, for what is this event good?


arbei
User
Posts: 9284

Post by arbei »

You should change the ViewValue of the field in Row_Rendered Server Event instead of changing the rs.

Read the example in help file topic: "Server Events and Client Scripts" -> "Row_Rendered" for more information.


Post Reply