Rev 210 |
Blame |
Compare with Previous |
Last modification |
View Log
| Download
| RSS feed
package br.com.ec.controller;
import java.util.HashMap;
import java.util.Map;
import javax.faces.application.FacesMessage;
import javax.inject.Named;
import org.primefaces.PrimeFaces;
import org.primefaces.event.SelectEvent;
import org.springframework.context.annotation.Scope;
@Named
@Scope
("view")
public class DFView
{
public void viewProducts
() {
Map<String,
Object> options =
new HashMap<>();
options.
put("resizable",
false);
PrimeFaces.
current().
dialog().
openDynamic("viewProducts", options,
null);
}
public void viewProductsCustomized
() {
Map<String,
Object> options =
new HashMap<>();
options.
put("modal",
true);
options.
put("width",
640);
options.
put("height",
340);
options.
put("contentWidth",
"100%");
options.
put("contentHeight",
"100%");
options.
put("headerElement",
"customheader");
PrimeFaces.
current().
dialog().
openDynamic("viewProducts", options,
null);
}
public void chooseProduct
() {
Map<String,
Object> options =
new HashMap<>();
options.
put("resizable",
false);
options.
put("draggable",
false);
options.
put("modal",
true);
PrimeFaces.
current().
dialog().
openDynamic("selectProduct", options,
null);
}
public void onProductChosen
(SelectEvent event
) {
/*
Product product = (Product) event.getObject();
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Product Selected", "Name:" + product.getName());
FacesContext.getCurrentInstance().addMessage(null, message);
*/
}
public void showMessage
() {
FacesMessage message =
new FacesMessage
(FacesMessage.
SEVERITY_INFO,
"Message",
" Always Bet on Prime!");
PrimeFaces.
current().
dialog().
showMessageDynamic(message
);
}
}