Questions tagged [action]

An Action is a response of the program on occurrence detected by the program that may be handled by the program events.

Many languages and frameworks use this noun as synonym of function, without return value, where its main purpose is to do something.

For example the .NET delegate Action represents a function without parameters and return value.

In the Unified Modeling Language (UML), an action is a named element that is the fundamental unit of executable functionality. The execution of an action represents some transformation or processing in the modeled system. An action execution represents the run-time behavior of executing an action within a specific behavior execution.

4664 questions
788
votes
3 answers

Func vs. Action vs. Predicate

With real examples and their use, can someone please help me understand: When do we need a Func delegate? When do we need an Action delegate? When do we need a Predicate delegate?
InfoLearner
  • 13,592
  • 17
  • 65
  • 108
399
votes
4 answers

Differences between action and actionListener

What is the difference between action and actionListener, and when should I use action versus actionListener?
Murat Güzel
  • 4,786
  • 4
  • 16
  • 12
353
votes
12 answers

commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated

Sometimes, when using , or , the action, actionListener or listener method associated with the tag are simply not being invoked. Or, the bean properties are not updated with submitted UIInput values. What are…
Muhammad Hewedy
  • 26,344
  • 42
  • 116
  • 201
220
votes
13 answers

android pick images from gallery

I want to create a picture chooser from gallery. I use code intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(intent, TFRequestCodes.GALLERY); My problem is that in…
Buda Gavril
  • 19,769
  • 35
  • 114
  • 174
189
votes
13 answers

Get controller and action name from within controller?

For our web application I need to save the order of the fetched and displayed items depending on the view - or to be precise - the controller and action that generated the view (and the user id of course, but that's not the point here). Instead of…
Rob
  • 10,600
  • 13
  • 51
  • 86
160
votes
9 answers

How to dismiss notification after action has been clicked

Since API level 16 (Jelly Bean), there is the possibility to add actions to a notification with builder.addAction(iconId, title, intent); But when I add an action to a notification and the action is pressed, the notification is not going to be…
endowzoner
  • 2,058
  • 3
  • 16
  • 20
151
votes
6 answers

JavaScript: how to change form action attribute value based on selection?

I'm trying to change the form action based on the selected value from a dropdown menu. Basically, the HTML looks like this:
n00b0101
  • 6,643
  • 16
  • 40
  • 36
134
votes
9 answers

Uses of Action delegate in C#

I was working with the Action Delegates in C# in the hope of learning more about them and thinking where they might be useful. Has anybody used the Action Delegate, and if so why? or could you give some examples where it might be useful?
Biswanath
  • 8,877
  • 12
  • 41
  • 57
119
votes
10 answers

Action Image MVC3 Razor

What is the best way to replace links with images using Razor in MVC3. I simply doing this at the moment: Edit Is there a better way?
davy
  • 4,312
  • 9
  • 43
  • 64
95
votes
5 answers

Web API Routing - api/{controller}/{action}/{id} "dysfunctions" api/{controller}/{id}

I have the default Route in Global.asax: RouteTable.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = System.Web.Http.RouteParameter.Optional } ); I wanted to…
Mickael Caruso
  • 7,193
  • 10
  • 35
  • 63
91
votes
5 answers

How to set the action for a UIBarButtonItem in Swift

How can the action for a custom UIBarButtonItem in Swift be set? The following code successfully places the button in the navigation bar: var b = UIBarButtonItem(title: "Continue", style: .Plain, target: self,…
kmiklas
  • 11,204
  • 17
  • 55
  • 84
82
votes
3 answers

Modelling a permissions system

How would you model a system that handles permissions for carrying out certain actions inside an application?
James P.
  • 17,929
  • 27
  • 89
  • 147
81
votes
2 answers

What does metavar and action mean in argparse in Python?

I am reading through argparse module. I got stuck as what to metavar and action means >>> parser.add_argument('integers', metavar='N', type=int, nargs='+', ... help='an integer for the accumulator') >>>…
eagertoLearn
  • 8,372
  • 22
  • 66
  • 108
77
votes
3 answers

How can I pass a parameter in Action?

private void Include(IList includes, Action action) { if (includes != null) { foreach (var include in includes) action(); } } I want to call it like that this.Include(includes,…
Jop
  • 855
  • 1
  • 7
  • 10
71
votes
8 answers

Creating delegates manually vs using Action/Func delegates

Today I was thinking about declaring this: private delegate double ChangeListAction(string param1, int number); but why not use this: private Func ChangeListAction; or if ChangeListAction would have no return value I could…
Elisabeth
  • 18,252
  • 48
  • 179
  • 303
1
2 3
99 100