Hi Christian,
Welcome to the list, and thanks for trying out Isis.

>From a quick skim over your code, it doesn't look like there's anything
wrong, so you might have uncovered an issue with the Wicket viewer.

I do know that the autocomplete functionality works [1], [2], and this may
be a better UI experience anyway... so try that out too.

I'll take a look when I get a chance, but if you could also create a very
simple example test case on github, that'd be really helpful.

Cheers
Dan

[1] http://isis.apache.org/core/guides/isis-applib.html#d5e779
[2] http://isis.apache.org/core/guides/isis-applib.html#d5e2277


On 5 January 2013 19:24, Christian Steinebach <
[email protected]> wrote:

> Hei everybody!
>
> I'm trying to learn isis and DDD, using the wicket viewer.
> I have a class TransportDemand which has as a property a pickup
> destination and a delivery destination.
>
> The Destination is again defined as a class.
> The TransportDemands 'factory and repository' has an action
> newTransportDemand();
>
> In order to give the user a choice for the pickup/delivery destinations I
> created a method
> choicesPickup() in the class TransportDemand
>
> But, in the UI there are no choices presented when selecting 'New
> Transport Demand'. Only 'null' is written.
>
> When removing choicesPickup() and declaring the class Destination as
> @Bounded, the list of destinations is shown.
>
> What have I done wrong? Some code fragments below.
>
>           Thank your for any help
>                  Christian
>
>
>
>
>
> ---- TransportDemand.java
> public class TransportDemand extends AbstractDomainObject implements
> Comparable<TransportDemand> {
>
>     private Destination pickup;
>     public Destination getPickup() {
>         return pickup;
>     }
>     public List<Destination> choicesPickup(){
>         return destinations.allDestinations();
>     }
> .....
>     private Destinations destinations;
>     public void setDestinations(final Destinations destinations) {
>         this.destinations = destinations;
>     }
> }
>
> ---- TransportDemands.java
> public class TransportDemands extends AbstractFactoryAndRepository{
> ...
>     public TransportDemand newTransportDemand(
>             @Named("Pickup") Destination pickup,
>             @Named("Delivery") Destination delivery
>             )
>             {
>         final TransportDemand transportDemand =
> newTransientInstance(TransportDemand.class);
>         transportDemand.setPickup(pickup);
>         transportDemand.setDelivery(delivery);
>         transportDemand.setOwnedBy(currentUserName());
>         persist(transportDemand);
>         return transportDemand;
>     }
>
>     public List<TransportDemand> allTransportDemands(){
>         final String currentUser = currentUserName();
>         final List<TransportDemand> items =
> allMatches(TransportDemand.class,
> TransportDemand.thoseOwnedBy(currentUser));
>         Collections.sort(items);
>         return items;
>     }
>
>
> ---- Destinations.java
> public class Destinations extends AbstractFactoryAndRepository{
> ....
>     public List<Destination> allDestinations() {
>         final List<Destination> items = allInstances(Destination.class);
>         Collections.sort(items);
>         return items;
>     }
> }

Reply via email to