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.

4938 questions
863
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
  • 14,952
  • 20
  • 76
  • 124
411
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,986
  • 4
  • 19
  • 12
367
votes
13 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
  • 29,102
  • 44
  • 127
  • 219
245
votes
21 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
  • 21,409
  • 40
  • 127
  • 196
210
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
  • 11,492
  • 14
  • 59
  • 94
178
votes
10 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,238
  • 3
  • 17
  • 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,863
  • 17
  • 42
  • 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
  • 9,075
  • 12
  • 44
  • 58
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,474
  • 10
  • 48
  • 71
113
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
  • 9,772
  • 23
  • 80
  • 122
98
votes
6 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
  • 13,085
  • 22
  • 67
  • 103
96
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
  • 8,721
  • 11
  • 40
  • 72
89
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
  • 975
  • 1
  • 7
  • 10
88
votes
9 answers

Ansible - Print message - debug: msg="line1 \n {{ var2 }} \n line3 with var3 = {{ var3 }}"

In Ansible (1.9.4) or 2.0.0 I ran the following action: - debug: msg="line1 \n {{ var2 }} \n line3 with var3 = {{ var3 }}" $ cat roles/setup_jenkins_slave/tasks/main.yml - debug: msg="Installing swarm slave = {{ slave_name }} at {{ slaves_dir }}/{{…
AKS
  • 16,482
  • 43
  • 166
  • 258
84
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.
  • 19,313
  • 27
  • 97
  • 155
1
2 3
99 100