[TYPO3-english] Re: Typo3 foreign_table: How to specify a specific column to a select drop down menu?

christian ewigfrost christian-kulozik at gmx.net
Wed Oct 25 09:46:39 CEST 2017


Quote: Mikel wrote on Tue, 24 October 2017 16:40
----------------------------------------------------
> Do you need something like that?
> 'foreign_table_where' => 'AND tx_icingaconfgen_domain_model_kunde.your_property = ###REC_FIELD_[tx_icingaconfgen_your_model_to_compare.your_property]###',
> 
> Sorry, but I'm not sure if I understand your use case. It is a bit hard to read :-)
> 
> You can also have a look on https://docs.typo3.org/typo3cms/TCAReference/ColumnsConfig/Type/Select.html#itemsprocfunc <https://docs.typo3.org/typo3cms/TCAReference/ColumnsConfig/Type/Select.html#itemsprocfunc>
> You can prepare the items for the select in your own method.
> 
> Mikel
> 
> 
> > Am 24.10.2017 um 15:04 schrieb christian ewigfrost <christian-kulozik (at) gmx.net>:
> > 
> > Hmmm... But that's not waht i want to do: What this does is just filtering the assignable records by their properties and then lets me choose the record in the select. But it assigns the entire record or the uid of the record to the property of the creatable record as understand. 
> > What i want to do is:
> > 
> > Say i'd set 'kundeuid' with the value 'customer01' or something while creating a record of the class Kunde. Then i create a record of the class 'Appliance'. It also has a property named 'kundeuid' and i want to set it through a select that is filled with the 'kundeuid' s from all the records of the class Kunde. One option of this select would be 'customer01' from the record of Kunde i created. I'd choose it and the property 'kundeuid' of the created Appliance record should be also 'customer01'... _______________________________________________
> > TYPO3-english mailing list
> > TYPO3-english (at) lists.typo3.org
> > http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
----------------------------------------------------

OK, let me try to explain again. Maybe my thought process comes across better this time:

In the backend of TYPO3 i have the folder where my records are stored of cause. There are records of the class "Kunde" stored (these are the customers - just the german word for it). Each record of this class has the property 'kundeuid' which isn't the same as the automatically generated property 'uid', but a property that was set manually. Then there are records of the class Appliance. This Appliance record has a property that is also named 'kundeuid' and acts as a way to determine which 'Kunde' record this 'Appliance' record belongs to. (technically it's a 1:n relation between Kunde and Appliance). 

Now what i want to do is: 

The user should be able to create a record of Appliance in the backend. The property 'kundeuid' of Appliance should be a select drop down menu that has all the 'kundeuid' values of all existing Kunde records in it. The user should choose one of those values to determine visually which Kunde record the Appliance record "belongs" to. The property 'kundeuid' of the class Appliance should get exactly this value! Let me get to the problem now...

My problem currently: 

'type' => 'select',
                                                               'renderType' => 'selectSingle',
                                                               'foreign_table' => 'tx_icingaconfgen_domain_model_kunde',

The code above fills the select drop down menu with records of the class Kunde by using it as a foreign_table. That's clear to me... BUT: The property 'kundeuid' of class Appliance doesn't get the value assigned to it that i want. In the drop down menue i don't see the 'kundeuid' property values of all te Kunde records but other values of another property (i think it's the first column of that table). If i choose it in the drop down and then create the Appliance record the Appliance record gets the value of the automatically generated property 'uid' of the specific Kunde record assigned... But i want to assign my own property value 'kundeuid' to it...

Is this possible at all or do i missunderstand the entire concept of it?



More information about the TYPO3-english mailing list