[TYPO3-mvc] Creating a select box with values from a different domain model

Søren Malling soren.malling at gmail.com
Wed Feb 24 10:11:22 CET 2010


Hi,

I got a Fluid form where i would like to have a dropdown menu with
values from a model different from the one my object is a part of.

<f:form.select name="club" options="{clubArray}"
optionValueField="uid" optionLabelField="name" />

In my form I've set the object="{member}" but how I'm i suppose to add
the entries from my Tx_Groupmembers_Domain_Model_Club model to the
dropdown box?

I've tried the following with no luck

	/**
	 * @var array
	 */
	protected $clubArray;

	/**
	 * Constructs a new Member
	 *
	 */
	public function __construct() {
		$this->clubArray = new Tx_Extbase_Persistence_ObjectStorage();
	}

Is it the wrong way of initializing data from another model? And what
would the right way be?

Regards,

Søren


More information about the TYPO3-project-typo3v4mvc mailing list