You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Dan Haywood (JIRA)" <ji...@apache.org> on 2015/01/29 13:04:35 UTC

[jira] [Commented] (ISIS-1021) suppress/disable the link in the first column of a table (CollectionProperty)

    [ https://issues.apache.org/jira/browse/ISIS-1021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14296753#comment-14296753 ] 

Dan Haywood commented on ISIS-1021:
-----------------------------------

Yes, this seems like the correct approach.

Will need a new facet (NotOpenableFacet or perhaps TableOnlyFacet) and a corresponding FacetFactory.

The Wicket viewer will need to check for the presence of this facet and suppress the column if there.

~~~
A couple of complications:
- by default, if an action returns a list that has a single object, then "as a convenience" the viewer shows that object rather than the table.   This behaviour would need tobe suppressed.
- conversely, if an action were to return a single object that is not-openable, then what should the system do?  It could return an error message, or perhaps it could dynamically convert to returning a list containing that single object


> suppress/disable the link in the first column of a table (CollectionProperty)
> -----------------------------------------------------------------------------
>
>                 Key: ISIS-1021
>                 URL: https://issues.apache.org/jira/browse/ISIS-1021
>             Project: Isis
>          Issue Type: New Feature
>          Components: Viewer: Wicket
>    Affects Versions: viewer-wicket-1.7.0
>            Reporter: ARI
>            Assignee: Dan Haywood
>
> Goal:
> Suppress/disable the link in the first column of a table (CollectionProperty) for marked DomainObjects.
> Proposal:
> - Add a new field to the @DomainObjectLayout like openable/viewable.
> - Special handling of title columns in CollectionContentsAsAjaxTablePanel / ObjectAdapterTitleColumn / EntityIconAndTitlePanel
> Background:
> I have a complex entity which is displayed in tables in different places.
> In one place I want to show a subset of properties only. For this
> projection I made a special in-memory object, which wraps the complex
> entity and has getters for the subset of properties only. How can I mark
> this inmemory object to be not openable, or with other words how do i suppress/disable the link in the first column.
> Dan/Martins "QuickFix" was:
> The column is added at
> https://github.com/apache/isis/blob/master/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.java#L96
> and I see no way how to suppress the addition in current master branch.
> The column is marked with "title-column" CSS class so it is easy to hide
> with: visibility:hidden;, but I'm not sure how easy is to detect on which
> page to apply this CSS rule.
> If you use 1.8.0-SNAPSHOT then maybe you can combine it with the new
> #cssClass() special method that may be used to set a custom CSS class. See
> http://issues.apache.org/jira/browse/ISIS-1000
> Am 26.01.2015 um 23:11 schrieb Dan Haywood <da...@haywood-associates.co.uk>:
> +1 to Martin's answer, there is no configuration setting but it is possible
> to hack it using Javascript and CSS and the new #cssClass in 1.8.0-SNAPSHOT.
> For example, the todo app uses #cssClass() so that completed todo items are
> shown in a table with a strikethrough.  This comes from the "done" CSS
> class:
>   public String cssClass() { return !isComplete() ? "todo" : "done"; }
> In webapp/css/application.css, if we add:
>   tr.done a {
>       pointer-events: none;
>       cursor: default;
>   }
> and in webapp/scripts/application.js, if we add:
>   $(document).ready(function() {
>       $('tr.done a').click(function() { return false; });
>   });
> then the icon for each completed item cannot be clicked.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)