You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Carla Pappalardo <ca...@hotmail.com> on 2013/10/22 02:40:55 UTC

Dependent drop-down list.






	
	
	
	


Hi everyone,

I would be interested to use dependent drop-down list. Is it possible?
I've been seen these example about Country/State[1], but I can't go on implementation. 




Can you guide me?,


[1] https://issues.apache.org/jira/browse/ISIS-478



Thanks!


 		 	   		  

Re: Dependent drop-down list.

Posted by Jeroen van der Wal <je...@stromboli.it>.
Hi Carla,

Below is some sample code (getters and setters omitted) on how to implement
dependent state choices, the fourth parameter of the update address action.
On the injected state service you have to write a filter or query which
returns the states for a given country.

Hope this helps.

Cheers,

Jeroen

~~~~


public class Address {

    private String addressLine;
    ...
    private String zip;
    ...
    private State state;
    ...
    private Country country;
    ...

    @DescribedAs("Update address")
    public Address updateAdress(
            final @Named("Adress line") String addressLine,
            final @Named("zip") String zip,
            final @Named("Country") Country country,
            final @Named("State") State state) {
        setAddressLine(addressLine);
        setZip(zip);
        setCountry(country);
        setState(state);
        return this;
    }

    public List<State> choices3UpdateAddress(
            final Country country) {
        return states.findByCountry(country);
    }

    ...

    private States states;

    public final void injectStates(final States states) {
        this.states = states
    }
}



On Tue, Oct 22, 2013 at 2:40 AM, Carla Pappalardo <
carla.pappalardo@hotmail.com> wrote:

>
>
>
>
>
>
>
>
>
>
>
>
> Hi everyone,
>
> I would be interested to use dependent drop-down list. Is it possible?
> I've been seen these example about Country/State[1], but I can't go on
> implementation.
>
>
>
>
> Can you guide me?,
>
>
> [1] https://issues.apache.org/jira/browse/ISIS-478
>
>
>
> Thanks!
>
>
>