Hi Bharani,

thanks for putting together that demo.

So, the reason that those two actions don't appear - "addToState" and
"removeFromState"- is because of an unimplemented feature of the Wicket
viewer.

You'll have seen that properties, collections and actions all have the
concept of supporting methods.

For property, getXxx()/setXxx(...), we have hideXxx(),  disableXxx(),
validateXxx(...), defaultXxx(), choicesXxx(), autoCompleteXxx()  . There
are also the little used modifyXxx(...) and clearXxx(...), which are called
instead of the setter if present.  These were originally to support mutual
registration pattern for bidir relationships, but are not generally needed
these days because JDO/DN (the ORM) handles this for us.

For collection getYyy()/setYyy(...) we have hideYyy(), disableYyy(),
addToYyy(...), removeFromYyy(...), validateAddToYyy(...),
validateRemoveFromYyy(...).  The idea of the addTo and removeFrom is to
allow objects to be added or removed from the collection (assuming that the
collection is mutable).

For action zzz(...) we have hideZzz(), disableZzz(), validateNZzz(...),
defaultNZzz(), choicesNZzz(), autoCompleteNZzz().

The unimplemented feature in the Wicket viewer is that it doesn't support
the notion of mutable collections.  That is, if there is an addTo and
removeFrom then the underlying metamodel says that the collection is
mutable, but the Wicket viewer just ignores it.  (Note that the RO viewer
*does* support mutable collections).

So, this is why your "actions" are being ignored... because they aren't
being recognized as actions, they are being recognized as supporting
methods of the collection.

Fix:
- rename addToStates to addState
- rename removeFromStates to removeState

There's probably a ticket for this; if you are feeling inspired, see if you
can find it (or raise a new one to get this addressed somehow).

HTH
Dan


PS: spend some time setting up fixtures, it'll save some time.

PPS: Also, uncomment

#isis.viewer.wicket.rememberMe.encryptionKey=myEncryptionKey

in viewer_wicket.properties, to save having to log in all the time.





On Wed, 8 Feb 2017 at 17:23 Bharanidharan Srinivasan <[email protected]>
wrote:

> Hi Dan,
>
> Thanks a ton for the quick response.
>
> I created a test project and pushed it to git. Available in the following
> URL
> https://github.com/bharani16/testApp.git
>
> I have a simple Country class and State class as domain objects, with
> country->state relationship as 1->N. Wondering if I am making any mistake
> with Join annotation.
>
> Could you please check and let me know the issue in the code.
>
> Thanks & Regards
> Bharani
> On 2017-02-08 14:45 (+0530), Dan Haywood <[email protected]>
> wrote:
> > Hi Bharani,
> > And welcome to the users mailing list.
> >
> > Could you create a simple app and push to git to demonstrate the issue?
> >
> > In the meantime, note that actions are associated with collections either
> > by using @MemberOrder annotation or in the layout.xml.
> >
> > The todoapp (http://github.com/isisaddons/isis-app-todoapp) also has an
> > example you could look at, also the kitchensinkapp.
> >
> > HTH,
> > Dan
> >
> > PS : could you subscribe to the mailing list so that your posts don't
> have
> > to be moderated? Thx.
> >
> > On Wed, 8 Feb 2017, 09:48 Bharanidharan Srinivasan, <[email protected]
> >
> > wrote:
> >
> > Hi,
> >
> > I am new to Apache ISIS - got a query on mapping action id in layout.xml.
> >
> > Assume value of action id in the layout.xml should map to one of the
> public
> > methods in the domain object. But this is not working for me..
> >
> > I have a class A, that has a collection of objects of class B, with
> methods
> > to get/set/add/remove the objects in collection. I want to depict this
> > collection in a grid with add/remove actions.
> >
> > The grid is appearing- but the add and remove buttons are not displayed.
> >
> > What could be the issue?
> >
> > Thanks & Regards
> > Bharani
> >
>

Reply via email to