You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Daniel Keir Haywood (Jira)" <ji...@apache.org> on 2020/03/19 15:33:00 UTC
[jira] [Updated] (ISIS-1971) [WON'T FIX] JAXB view model: setting
view's properties via PostConstruct method not honored
[ https://issues.apache.org/jira/browse/ISIS-1971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Keir Haywood updated ISIS-1971:
--------------------------------------
Fix Version/s: (was: 2.0.5)
2.0.0-M3
Summary: [WON'T FIX] JAXB view model: setting view's properties via PostConstruct method not honored (was: JAXB view model: setting view's properties via PostConstruct method not honored)
It's not clear to me that a view model should support @PostConstruct. But perhaps there could be some other Isis-specific callback if required (we have created()... ?)
> [WON'T FIX] JAXB view model: setting view's properties via PostConstruct method not honored
> -------------------------------------------------------------------------------------------
>
> Key: ISIS-1971
> URL: https://issues.apache.org/jira/browse/ISIS-1971
> Project: Isis
> Issue Type: Bug
> Affects Versions: 2.0.0-M1
> Reporter: Andi Huber
> Priority: Major
> Fix For: 2.0.0-M3
>
>
> {code:java}
> // CALLER
> @DomainService(nature=NatureOfService.VIEW_MENU_ONLY)
> @DomainObjectLayout(named="Scalar Demo")
> public class ScalarMenu {
>
> @Inject private FactoryService factoryService;
> @Action
> @ActionLayout(cssClassFa="fa-font")
> public TextDemo text(){
> val demo = factoryService.instantiate(TextDemo.class);
> return demo;
> }
> }
> // VIEW MODEL
> @XmlRootElement(name = "Demo")
> @XmlType
> @XmlAccessorType(XmlAccessType.FIELD)
> @DomainObject(nature=Nature.VIEW_MODEL)
> @Log
> public class TextDemo {
> @PostConstruct
> public void initDefaults() {
>
> log.info("TextDemo::initDefaults");
>
> string = "a string (click me)";
> }
>
> @Property(editing=Editing.ENABLED)
> @XmlElement @Getter @Setter private String string; // string shows up on UI as empty, even though initDefaults was called
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)