We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40092
    • 265 Posts
    Here i am again, sorry.

    I can't seem to figure why this is going wrong.

    In a form i try to join a country.

    So i made a new migx config, set the class and package name correct and saved it.
    In the form where i want the info i make in the Formtabs a new field, set the input tv type to migxdb and configs to koppellanden(the config i just created) and save it.

    Having my schema setup like this:

    	<object class="Accomodations" table="accomodations" extends="xPDOSimpleObject">
    		<field key="code" dbtype="varchar" precision="100" phptype="string" null="false" />
    		<field key="land_id" dbtype="int" precision="11" phptype="integer" null="false" />
    		<field key="alias" dbtype="varchar" precision="250" phptype="string" null="false" />
    		<field key="naam" dbtype="varchar" precision="200" phptype="string" null="false" />
    		<field key="plaats" dbtype="varchar" precision="200" phptype="string" null="false" />
    		<field key="intro" dbtype="varchar" precision="250" phptype="string" null="false" />
    		<field key="vanafPrijs" dbtype="decimal" precision="9,2" phptype="float" null="false" />
    		<field key="numberDays" dbtype="int" precision="10" phptype="integer" null="false" />
    		<field key="infoAlgemeen" dbtype="text" phptype="string" null="false" />
    		<field key="infoFaciliteiten" dbtype="text" phptype="string" null="false" />
    		<field key="infoAccomodatie" dbtype="text" phptype="string" null="false" />
    		<field key="klasse" dbtype="decimal" precision="5,1" phptype="string" null="false" />
    		<field key="soort" dbtype="varchar" precision="100" phptype="string" null="false" />
    		<field key="type" dbtype="varchar" precision="250" phptype="string" null="false" />
    		<field key="details" dbtype="text" phptype="string" null="false" />
    		<field key="thumbnail" dbtype="varchar" precision="200" phptype="string" null="false" />
    		<field key="active" dbtype="int" precision="1" phptype="integer" null="false" />
    		<field key="lastminute" dbtype="int" precision="11" phptype="integer" null="false" />
    		<field key="aangemaakt" dbtype="int" precision="11" phptype="integer" null="false" />
    		<field key="gewijzigd" dbtype="int" precision="11" phptype="integer" null="false" />
    		<field key="reisSoorten" dbtype="text" phptype="string" null="false" />
    		<field key="accomodatieTypes" dbtype="text" phptype="string" null="false" />
    		<field key="offer_price" dbtype="decimal" precision="9,2" phptype="float" null="false" />
    		<field key="video" dbtype="varchar" precision="200" phptype="string" null="false" />
    		<field key="losse_prijs" dbtype="decimal" precision="9,2" phptype="float" null="false" />
    		<field key="meta_beschrijving" dbtype="text" phptype="string" null="true" />
    		<field key="meta_zoekwoorden" dbtype="varchar" precision="500" phptype="string" null="true" />
    		<field key="zoover" dbtype="int" precision="1" phptype="integer" null="true" />
    		<field key="dag_prijs" dbtype="decimal" precision="9,2" phptype="float" null="false" />
    		<field key="klm" dbtype="tinyint" precision="1" phptype="integer" null="false" />
    <field key="deleted" dbtype="int" precision="10" phptype="integer" null="false" />
            <composite alias="Images" class="Images" local="id" foreign="idAccomodation" cardinality="many" owner="local" />  
    		<composite alias="Files" class="Files" local="id" foreign="idAccomodation" cardinality="many" owner="local" />
    	<composite alias="Country" class="Countries" local="land_id" foreign="id" cardinality="many" owner="local" />
     
    	</object>
    
    
    	<object class="Countries" table="countries" extends="xPDOSimpleObject">
    		<field key="naam" dbtype="varchar" precision="200" phptype="string" null="false" />
    		<field key="vluchtprijs" dbtype="varchar" precision="5" phptype="string" null="false" />
    		<field key="alias" dbtype="varchar" precision="200" phptype="string" null="false" />
    		<field key="image" dbtype="varchar" precision="200" phptype="string" null="false" />
    		<field key="showInMenu" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
    		<field key="meta_keywords" dbtype="text" phptype="string" null="false" />
    		<field key="meta_description" dbtype="text" phptype="string" null="false" />
    		<field key="vluchtinformatie" dbtype="text" phptype="string" null="false" />
    		<field key="button1_value" dbtype="varchar" precision="255" phptype="string" null="false" />
    		<field key="button1_title" dbtype="varchar" precision="255" phptype="string" null="false" />
    		<field key="button1_content" dbtype="text" phptype="string" null="false" />
    		<field key="button2_value" dbtype="varchar" precision="255" phptype="string" null="false" />
    		<field key="button2_title" dbtype="varchar" precision="255" phptype="string" null="false" />
    		<field key="button2_content" dbtype="text" phptype="string" null="false" />
    		<field key="button3_value" dbtype="varchar" precision="255" phptype="string" null="false" />
    		<field key="button3_title" dbtype="varchar" precision="255" phptype="string" null="false" />
    		<field key="button3_content" dbtype="text" phptype="string" null="false" />
    		<field key="button4_value" dbtype="varchar" precision="255" phptype="string" null="false" />
    		<field key="button4_title" dbtype="varchar" precision="255" phptype="string" null="false" />
    		<field key="button4_content" dbtype="text" phptype="string" null="false" />
    		<field key="half_ticket" dbtype="decimal" precision="9,2" phptype="float" null="false" />
    		<field key="aangemaakt" dbtype="int" precision="11" phptype="integer" null="false" />
    		<field key="sort_order" dbtype="int" precision="11" phptype="integer" null="false" />
    		<field key="gewijzigd" dbtype="int" precision="11" phptype="integer" null="false" />
    <field key="deleted" dbtype="int" precision="10" phptype="integer" null="false" />
    		<aggregate alias="Accomodation" class="Accomodations" local="id" foreign="land_id" cardinality="one" owner="foreign" /> 
    
    	</object>
    


    As you can see i need the form to display the country name(fieldkey="naam") from the Countries based on what's given in The Accomodations in land_id.

    Per accident i found that it now only displays based on the id in Accomodations, not the one in Countries.

      • 40092
      • 265 Posts
      My bad i had the ownership mixed up. Countries was offcourse owner of the (primary) key.

      However, i'm wondering now how i can change a country (setup in listbox) input options countr==actualID||country2==actualID etc. So the user sees the name from Countries, but on change it has to set the land_id in Accomodations.
        • 40092
        • 265 Posts
        Hmmmm, whilst Countries nicely show up, i cannot edit them.

        I've tried making the values with a listbox and setting the field to Accomodations.land_id but that unfortunately does not work?