Skip to content

No Reference mapping within a selection

Vahid H edited this page Mar 2, 2014 · 1 revision

A No Reference mapping within a selection

In this example we have :

continent -< hasMany Countries [ Countries has belongsTo continent:continet ]
countries -< hasMany Cities [ Cities has belongsTo country:country ]
Cities -< hasMany Boroughs - [ Boroughs has belongsTo cities ]


Try Europe United Kingdom and London and Camden

	<form method=post action=example5>
	
        <g:selectPrimary id="MyContinent2" name="MyContinent2"
            domain='ajaxdependancyselectexample.MyContinent'
            searchField='continentName'
            collectField='id'

            domain2='ajaxdependancyselectexample.MyCountry'
            bindid="mycontinent.id"
            searchField2='countryName'
            collectField2='id'
            
            appendValue='*'
            appendName='All Items'
            
            noSelection="['': 'Please choose Continent']"
            setId="MyCountry11"
            value=''/>

        <g:selectSecondary id="MyCountry11" name="MyCountry11"
            domain2='ajaxdependancyselectexample.MyCity'
            bindid="mycountry.id"
            searchField2='cityName'
            collectField2='id'

            noSelection="['': 'Please choose Continent']"
            setId="MyCity11"
            
            appendValue='*'
            appendName='All Items'
            
            value=''/>

        <g:selectSecondaryNR id="MyCity11" name="MyCity11"
            domain='ajaxdependancyselectexample.MyCity'
            bindid="myborough"
        	searchField='cityName'
            collectField='id'

            domain2='ajaxdependancyselectexample.MyBorough'
            searchField2='actualName'
            collectField2='id'

            noSelection="['': 'Please choose City']"
            setId="MyBorough11"
            
            appendValue='*'
            appendName='All Items'
            
            value=''/>

            <g:select name="MyBorough11" id="MyBorough11" 
            optionKey="id" optionValue="name"
            from="[]" required="required"  noSelection="['': 'Please choose City']" />
        <br> <input type=submit value=go> </form>

Clone this wiki locally