List and buttons

Version 13.1 by Antoine Berry on 2012/09/20 13:01

Change default  buttons

When there's a list, you can choose which actions you're gonna perform on the selected entity by clicking on the related button. Usually you have 3 choices : inspect and edit on the left, and deleteon the right. But if you're in an embedded list, you don't have any actions, however you might want to add an inspect button for instance. To do that you have the actions rule :

100 : pageConfiguration like 'ListEmbedded' => actions = "left" = ("inspectAction");  com.webobjects.directtoweb.Assignment

Same problem, you don't want to show the edit button on a list :

100 : pageConfiguration like 'List' => actions = "left" = ("inspectAction"); "right" = ("deleteAction"); com.webobjects.directtoweb.Assignment

Add your custom buttons

The best thing is that you can add you custom buttons very easily using a pageController. If you don't know about that then you have to take a look at this page. Now that you know how to create your controller, you can add it to your list with the rule we've seen before :

100 : pageConfiguration like 'List' => actions = "left" = ("inspectAction", "controllerAction"); "right" = ("deleteAction"); com.webobjects.directtoweb.Assignment

Now, if you've written a method like public WOComponent copy(WOComponent sender){...}, you will be able to copy you object directly from the list, and without override any component.