* Please ignore the mismatch between the Myclass_viewmodel and it's constructor named as TrsItem_ViewModelTrs
On Wed, Mar 2, 2016 at 3:18 PM, Shan Wijesinghe <[email protected]> wrote: > Thank you for the information Dan. > > I did the following. But it seems title is not set still. What is the > problem. > > // Mixin > > @DomainObject(nature = Nature.MIXIN) > @DomainObjectLayout(titleUiEvent = Myclass_viewmodel.TitleUiEvent.class) > public class Myclass_viewmodel { > > private final Myclass myclass; > > public TrsItem_ViewModelTrs(Myclass myclass) { > > this.myclass = myclass ; > } > ... > > > > public static class TitleUiEvent extends > org.apache.isis.applib.services.eventbus.TitleUiEvent<Myclass_viewmodel> { > > protected String title ; > public String getTitle() { > return title ; > } > > public void setTitle(String title) { > this.title = title ; > } > public TitleUiEvent() { > > } > } > > } > > > // Subscriber > > > @DomainService(nature=NatureOfService.DOMAIN) > public class MyclassTitle extends AbstractSubscriber{ > @com.google.common.eventbus.Subscribe > public void on(TitleUiEvent ev) { > if(ev.getSource() instanceof Myclass_viewmodel) { > > ev.setTitle("MY TITLE"); > > } > } > > } > > > On Wed, Mar 2, 2016 at 12:53 PM, Dan Haywood <[email protected] > > wrote: > >> The easiest approach is probably to use the UiEvent classes defined in >> @DomainObjectLayout, and then set up a subscriber of these events. >> >> HTH, Dan >> On 2 Mar 2016 07:03, "Shan Wijesinghe" <[email protected]> wrote: >> >> > Hi all, >> > >> > I have a JAXB annotated view model. I want to change "title" and >> > "iconName" using a Mixin to my original java class without adding title >> > and iconName methods to original class. How can I do this. Please make >> > suggestions. Thanks in advance. >> > >> > --regards >> > Dilshan. >> > >> > >
