Func vs. Action vs. Predicate [duplicate]

The difference between Func and Action is simply whether you want the delegate to return a value (use Func) or not (use Action). Func is probably most commonly used in LINQ – for example in projections: or filtering: or key selection: Action is more commonly used for things like List<T>.ForEach: execute the given action for … Read more

How to run a PHP function from an HTML form?

The “function” you have is server-side. Server-side code runs before and only before data is returned to your browser (typically, displayed as a page, but also could be an ajax request). The form you have is client-side. This form is rendered by your browser and is not “connected” to your server, but can submit data to the server for processing. Therefore, … Read more

the getSource() and getActionCommand()

Assuming you are talking about the ActionEvent class, then there is a big difference between the two methods. getActionCommand() gives you a String representing the action command. The value is component specific; for a JButton you have the option to set the value with setActionCommand(String command) but for a JTextField if you don’t set this, … Read more

How to define form action in JSF?

The best solution for me is to use the default <button> tag instead. Since typical button styling is not being applied (in my case I am using Primefaces), I set it manually. Here’s the whole result: