On 21 August 2013 21:51, Jeremy Gurr <jere...@infusionsoft.com> wrote:

Hi Jeremy,
Welcome, also, to the Isis mailing list.

We are attempting to control whether the icon next to a title is visible or
> not through a property of an entity. We couldn't figure out a simple way to
> do it


The easiest way is to use CSS; add the following to
src/main/webapp/css/application.css:

.entityIconAndTitlePanel a img {
display: none;
}



> by reading the documentation or looking through the list of possible
> annotations, and so we proceeded to try and override the
> addOrReplaceLinkWrapper method of the EntityIconAndTitlePanel container.
>
> We first tried to subclass it, but the needed method was private so we
> just copied the entire class,


Great to hear you are diving into the implementation and figuring things
out.

I've just raised ISIS-500 as a ticket to make this particular component
more easily subclassable (though I'd still probably use CSS myself)



> [snip]
>
> So I have two questions. First, is there an easier way to disable the
> rendering of an icon next to the title of an entity?


CSS, above


> Second, how do we correctly override a component factory?
>
>
You've figured out already how to register your replacement, in
ComponentFactoryRegistrar.  (I'm just writing a new page on the site to
document this).

Your issue though is a Wicket one: if you have a component called
EntityIconAndTitlePanelImprovedIcon then there needs to be a HTML page
called EntityIconAndTitlePanelImprovedIcon.html.  You can see this is the
case for all of Isis' wicket components.




> As a side note, we did succeed in removing the annoying (to us anyway ;) )
> bookmark slide out panel by doing a componentFactories.replace


Aw... I was quite proud of that!

I agree that sometimes one can accidentally trigger the slide out when
going to hit "Edit"; perhaps it should be over on the right hand side (or
configurable as either, maybe).

Before you abandon it, I hope you've noted the feature whereby bookmarks
can be arranged in a hierarchy through the use of @Bookmarkable(AS_ROOT) or
@Bookmarkable(AS_CHILD).  Any children are automatically attached to their
parent.  That's the bit I'm particularly proud of, because it leverages the
Isis metamodel to provide better information to the user.

Also, we have some tickets raised to make actions optionally bookmarkable,
and pinnable, and also limited in number (MRU/LRU).




> using a subclassed BookmarkedPagesPanelFactory, where createComponent just
> returns a dummy component. There's probably an easier way to do this too.
>

Yup, probably CSS again.

#bookmarkedPagesSlidingDiv {
display: none;
}
.showPanelTab {
display: none;
}



>
> We are running the latest git code on the master branch using a project
> based on the example/application/quickstart_wicket_restful_jdo/.
>
> Here's the stack trace that results from listing our entities:
>
org.apache.wicket.markup.MarkupNotFoundException
> Failed to find markup file associated.
> EntityIconAndTitlePanelImprovedIcon: [EntityIconAndTitlePanelImprovedIcon
> [Component id = entityIconAndTitle]]
>
> org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy#getMarkup(AssociatedMarkupSourcingStrategy.java:97)
>

You can see that Wicket is complaining that it can't find any
EntityIconAndTitlePanelImprovedIcon.html file.


HTH
Dan



>
> thank you for your time,
>
> Jeremy
>
>

Reply via email to