Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
ppt
Corso JSF.ppt 783.9 kB 1 02-Sep-2010 07:52 m.sanfilippo
zip
SmeaCrud-src.zip 31.7 kB 1 31-Aug-2010 16:02 Administrator
war
SmeaCrud.war 30.9 kB 1 31-Aug-2010 16:02 Administrator
gif
jsf.gif 5.7 kB 1 23-Aug-2010 19:42 Administrator

This page (revision-70) was last changed on 02-Sep-2010 09:10 by m.sanfilippo  

This page was created on 23-Aug-2010 19:35 by Administrator

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Difference between version and

At line 476 added 35 lines
%%tab-Parte7
!!Parte 7
!prenotazione.xhtml
%%prettify
{{{
<ui:composition
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
template="/template/masterLayout.xhtml"
xmlns:f="http://java.sun.com/jsf/core">
<ui:define name="content">
<h:panelGrid columns="2">
<h:outputLabel for="camera" value="camera"/>
<h:selectOneMenu id="camera" value="#{listController.prenotazione.camera}">
<f:selectItems value="#{listController.camere}" var="camera" itemValue="#{camera}" itemLabel="#{camera.nome}"/>
</h:selectOneMenu>
<h:outputLabel for="cliente" value="cliente"/>
<h:inputText id="cliente" value="#{listController.prenotazione.cliente}" required="true">
</h:inputText>
<h:outputLabel for="dal" value="Dal"/>
<h:inputText id="dal" value="#{listController.prenotazione.dataInizio}" required="true">
<f:convertDateTime pattern="yyyymmdd" />
</h:inputText>
<h:outputLabel for="al" value="Al"/>
<h:inputText id="al" value="#{listController.prenotazione.dataFine}" required="true">
<f:convertDateTime pattern="yyyymmdd" />
</h:inputText>
<h:commandButton value="annulla" action="/views/list" immediate="true"/>
<h:commandButton value="salva" action="#{listController.salvaPrenotazione}"/>
</h:panelGrid>
</ui:define>
</ui:composition>
}}}
At line 512 added 43 lines
!CameraConverter.java
%%prettify
{{{
package corsojsf.managedbeans;
import corsojsf.model.Camera;
import java.util.List;
import javax.faces.component.UIComponent;
import javax.faces.component.UISelectItems;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import javax.faces.convert.FacesConverter;
@FacesConverter(forClass=Camera.class)
public class CameraConverter implements Converter {
@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
List<Camera> items = (List<Camera>) ((UISelectItems) component.getChildren().get(0)).getValue();
for (Camera camera : items) {
if (camera.getNome().equals(value)) {
return camera;
}
}
throw new ConverterException("Impossibile convertire " + value);
}
@Override
public String getAsString(FacesContext context, UIComponent component, Object value) {
if (value instanceof Camera) {
return ((Camera) value).getNome();
} else {
throw new IllegalArgumentException("Impossibile convertire oggetti " + value.getClass().getCanonicalName());
}
}
}
}}}
At line 557 added 45 lines
!ListController.java (porzione)
%%prettify
{{{
[...]
public String nuovaPrenotazione() {
setPrenotazione(new Prenotazione());
return "/views/prenotazione";
}
public String modificaPrenotazione(Prenotazione prenotazione) {
setPrenotazione(prenotazione);
return "/views/prenotazione";
}
public void eliminaPrenotazione(Prenotazione prenotazione)
{
getPrenotazioni().remove(prenotazione);
}
public String salvaPrenotazione() {
Prenotazione daSavlare = getPrenotazione();
if (getPrenotazioni() == null) {
this.prenotazioni = new LinkedList<Prenotazione>();
}
if (this.prenotazioni.contains(daSavlare)) {
getPrenotazioni().remove(daSavlare);
}
getPrenotazioni().add(daSavlare);
setPrenotazione(new Prenotazione());
return "/views/list";
}
[...]
}}}
/%
/%
/%
/%
Version Date Modified Size Author Changes ... Change note
70 02-Sep-2010 09:10 23.707 kB m.sanfilippo to previous
69 02-Sep-2010 07:52 23.693 kB m.sanfilippo to previous | to last
68 02-Sep-2010 07:51 23.676 kB m.sanfilippo to previous | to last
67 01-Sep-2010 16:54 24.929 kB Administrator to previous | to last
66 01-Sep-2010 16:54 23.674 kB Administrator to previous | to last
65 01-Sep-2010 16:52 24.749 kB Administrator to previous | to last
64 01-Sep-2010 08:21 23.674 kB m.sanfilippo to previous | to last
63 01-Sep-2010 08:13 23.384 kB m.sanfilippo to previous | to last
62 31-Aug-2010 17:48 23.384 kB m.sanfilippo to previous | to last
61 31-Aug-2010 16:27 23.372 kB Administrator to previous | to last
« This page (revision-70) was last changed on 02-Sep-2010 09:10 by m.sanfilippo