Hide "Actions" button

Feb 2, 2012 at 4:40 PM

Hi there. Just another lame question.

I have no actions for my objects currently, I only use Naked Objects as a simple editor. Is it possible to hide the "Actions" button? It is disabled now (logically, since there are no subitems). MenuServices works like charm as you pointed out yesterday. Can the "Actions" button work similar?

In StandaloneTable.aspx the following line:

<%: Html.CollectionTable(Model) %>

emits the Actions button and the table itself. If you suggest that I should dive into the source code I will, but I think there's a simple and elegant solution (maybe an attribute again ;-) ) for this issue.

Editor
Feb 2, 2012 at 4:48 PM
I would imagine that a bit of CSS to hide the button if there are no children might do the job.

My CSS knowledge isn't quite up to knowing how to do this off the top of my head, but I'm pretty sure it's doable. Hopefully google may give up the answer?

Cheers
Dan

On 2 February 2012 17:40, dtereanszky <notifications@codeplex.com> wrote:

From: dtereanszky

Hi there. Just another lame question.

I have no actions for my objects currently, I only use Naked Objects as a simple editor. Is it possible to hide the "Actions" button? It is disabled now (logically, since there are no subitems). MenuServices works like charm as you pointed out yesterday. Can the "Actions" button work similar?

In StandaloneTable.aspx the following line:

<%: Html.CollectionTable(Model) %>

emits the Actions button and the table itself. If you suggest that I should dive into the source code I will, but I think there's a simple and elegant solution (maybe an attribute again ;-) ) for this issue.

Read the full discussion online.

To add a post to this discussion, reply to this email (nakedobjects@discussions.codeplex.com)

To start a new discussion for this project, email nakedobjects@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 2, 2012 at 5:05 PM

I have thought of css too. The relevant part is:

 

<div id="ObjectQuery-[MyObject]-Actions" class="Menu" title="No Actions Available">  

<div class="MenuName">Actions</div>

<div class="MenuItems"> </div>

</div>
However, I  think there's a better way than creating many ".ObjectQuery-[MyObject]-Actions { display: none; }" entries in the css file.
Coordinator
Feb 2, 2012 at 5:15 PM

It shouldn't be necessary to create more than one entry in the CSS  -  you should be able to do it generically.  You're looking for any div class MenuName within a higher-up div (such as Object? or Collection?)  You need to use the CSS selector that selects non-immediate children  - like Dan, I don't carry much CSS stuff in my head.

CSS is definitely the easiest way to fix it, IMO.

I think your other suggestion is good though  -  like we do on the service menus, if there are no visible actions we could miss out the action menu altogether.  You can raise it as a request on the issue tracker, but I can't make any promise as to priority.  Or try going into the source for the relevant HTML helper method  -  it should be easy to find and fix yourself for your own project, if you don't care about breaking lots of framework tests (which we have to!).

Editor
Feb 2, 2012 at 5:57 PM
would something as simple as:

div.Menu[title='No Actions Available'] {
display:none;
}

work?



On 2 February 2012 18:05, dtereanszky <notifications@codeplex.com> wrote:

From: dtereanszky

I have thought of css too. The relevant part is:

<div id="ObjectQuery-[MyObject]-Actions" class="Menu" title="No Actions Available">

<div class="MenuName">Actions</div>

<div class="MenuItems"> </div>

</div>
However, I think there's a better way than creating many ".ObjectQuery-[MyObject]-Actions { display: none; }" entries in the css file.

Read the full discussion online.

To add a post to this discussion, reply to this email (nakedobjects@discussions.codeplex.com)

To start a new discussion for this project, email nakedobjects@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 6, 2012 at 12:57 PM

Yes, it worked. Thank you.