本文整理汇总了Java中org.primefaces.event.RowEditEvent类的典型用法代码示例。如果您正苦于以下问题:Java RowEditEvent类的具体用法?Java RowEditEvent怎么用?Java RowEditEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RowEditEvent类属于org.primefaces.event包,在下文中一共展示了RowEditEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEdit
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
public void onEdit( RowEditEvent event )
{
Scontrino scon = (Scontrino) event.getObject();
if ( !scon.isAnomalo() )
{
if ( StringUtils.equalsIgnoreZeros( scon.getNumero(), scon.getRifornimento().getNumeroScontrino() ) )
{
scon.cambiaStato( Scontrino.Stato.GIUSTIFICATO, new Date(), loggedUser.getUser(), "" );
}
else
{
log.debugv( "Scontrino {0} diverso dal numero scontrino {1} sul rifornimento", scon.getNumero(), scon.getRifornimento().getNumeroScontrino() );
bundleManager.error( "valodator.scon.wrong" );
FacesContext context = FacesContext.getCurrentInstance();
FacesMessage fm = new FacesMessage();
fm.setSeverity( FacesMessage.SEVERITY_ERROR );
fm.setSummary( bundleManager.getMessage( "valodator.scon.wrong" ) );
context.addMessage( "msgGrowl", fm );
scon.setNumero( null );
}
}
}
示例2: onRowEdit
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
public void onRowEdit(RowEditEvent event) {
ProjectQuotas pQuotas = (ProjectQuotas) event.getObject();
try {
projectController.adminProjectUpdate(pQuotas.getProject(), pQuotas.getNormalizedQuotas());
} catch (AppException e) {
logger.log(Level.SEVERE, "Error updating the quota for the project: " + pQuotas.getName(),
e);
MessagesController.addErrorMessage("Error updating the project, " +
"check the logs for more information");
}
// Update the timestamp in the table
Date timestamp = new Date();
pQuotas.setLastQuotaUpdate(timestamp);
int rowIndex = ((DataTable)event.getSource()).getRowIndex();
RequestContext.getCurrentInstance().update("projectmodifyForm:projectsTable:" + rowIndex
+ ":lastQuotaUpdateColumn");
logger.log(Level.INFO, "Quotas successfully updated for project: " + pQuotas.getName());
}
示例3: onRowEdit
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
public void onRowEdit(RowEditEvent event) {
Hosts host = (Hosts) event.getObject();
Hosts storedHost = hostsFacade.findByHostname(host.getHostname());
if (storedHost != null) {
storedHost.setHostIp(host.getHostIp());
storedHost.setPublicIp(host.getPublicIp());
storedHost.setPrivateIp(host.getPrivateIp());
storedHost.setAgentPassword(host.getAgentPassword());
storedHost.setRegistered(host.isRegistered());
hostsFacade.storeHost(storedHost, true);
MessagesController.addInfoMessage("Updated host");
LOG.log(Level.FINE, "Updated Host with ID: " + host.getHostname() + " Hostname: " + host.getHostIp()
+ " Public IP: " + host.getPublicIp() + " Private IP: " + host.getPrivateIp());
}
}
示例4: rowEdited
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
public void rowEdited( RowEditEvent evt )
{
if ( evt.getObject() instanceof SlotConnectionBean )
{
SlotConnectionBean editedSlotConnection = ( SlotConnectionBean ) evt.getObject();
if ( editedSlotConnection.getSlot() == null )
{
editedSlotConnection.setRack( null );
}
saveSlotConnection( editedSlotConnection );
settopEditedNotifier.fire( new SettopEditEvent(editedSlotConnection.getSettop() ) );
//clear the form after successfully saving.
editedSlotConnection.setSettop( null );
editedSlotConnection.setRack( null );
editedSlotConnection.setSlot( null );
}
}
示例5: rowEditedTest
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
@Test
public void rowEditedTest(){
SlotConnectionBean slotConnection = saveASlotConnection();
Slot slot2 = rackService.findSlotByRack( RACK_1, 2 );
slotConnection.setSlot( slot2 );
Behavior behaviour = new Behavior()
{
@Override
public void broadcast( BehaviorEvent arg0 )
{
}
};
RowEditEvent event = new RowEditEvent( new UICommand(), behaviour, slotConnection );
settopController.rowEdited( event );
settopSlotService.refresh();
SlotConnectionBean slotConnection1 = settopSlotService.getSlotConnection( "1" );
assertEquals( slot2, slotConnection1.getSlot() );
}
示例6: onRowEditSensor
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
public void onRowEditSensor(RowEditEvent event) {
SensorVO s = (SensorVO) event.getObject();
List<DataChangeHandler> handlers = changeListener.getHandlersFor(s.getId());
if (handlers != null) {
changeListener.unsubscribeAllFrom(s.getId());
sensorContainer.updateSensor(s);
changeListener.subscribeFor(
sensorContainer.getSensors().stream().filter(se -> se.getId() == s.getId()).findFirst().get().getId(),
handlers);
} else {
sensorContainer.updateSensor(s);
}
}
示例7: onPropertyEdit
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
/**
* 更新数据
*/
public void onPropertyEdit(RowEditEvent event) {
if (!checkPropertyGroupCheckedStatus()) {
return;
}
PropertyItemVO selectedItem = (PropertyItemVO) event.getObject();
LOGGER.info("Update property with : {}.", selectedItem);
String name = selectedItem.getName();
String oriName = selectedItem.getOriName();
boolean suc = false;
String fullPropPath = getPropertyNodePath(name);
String fullCommentPath = getPropertyCommentPath(name);
if (name.equals(oriName)) {
suc = nodeService.updateProperty(fullPropPath, selectedItem.getValue());
nodeService.updateProperty(fullCommentPath, selectedItem.getComment());
}
else {
nodeService.deleteProperty(getPropertyNodePath(oriName));
suc = nodeService.createProperty(fullPropPath, selectedItem.getValue());
nodeService.deleteProperty(fullCommentPath);
nodeService.createProperty(fullCommentPath, selectedItem.getComment());
}
if (suc) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Property Saved suc.", name));
}
else {
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage(FacesMessage.SEVERITY_ERROR, "Property Saved failed.", name));
}
}
示例8: onEdit
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
public void onEdit( RowEditEvent event )
{
CodificaCarburante cc = (CodificaCarburante) event.getObject();
rs.updateCodificaCarburante( cc );
jobManager.enqueueAnomalieCarburanteJob( cc );
message.info( "message.job.new.anocarb", cc.getValore() );
}
示例9: onCancel
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
public void onCancel( RowEditEvent evt ){
if ( evt.getObject() instanceof SlotConnectionBean )
{
SlotConnectionBean editedSlotConnection = ( SlotConnectionBean ) evt.getObject();
settopSlotConfigService.refresh();
editedSlotConnection = settopSlotConfigService.getSlotConnection( editedSlotConnection.getSettop().getId() );
}
}
示例10: onPropertyEdit
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
/**
* 更新数据
*
*/
public void onPropertyEdit(RowEditEvent event) {
if (!checkPropertyGroupCheckedStatus()) {
return;
}
PropertyItemVO selectedItem = (PropertyItemVO) event.getObject();
LOGGER.info("Update property with : {}.", selectedItem);
String name = selectedItem.getName();
String oriName = selectedItem.getOriName();
boolean suc = false;
String fullPropPath = getPropertyNodePath(name);
String fullCommentPath = getPropertyCommentPath(name);
if (name.equals(oriName)) {
suc = nodeService.updateProperty(fullPropPath, selectedItem.getValue());
nodeService.updateProperty(fullCommentPath, selectedItem.getComment());
} else {
nodeService.deleteProperty(getPropertyNodePath(oriName));
suc = nodeService.createProperty(fullPropPath, selectedItem.getValue());
nodeService.deleteProperty(fullCommentPath);
nodeService.createProperty(fullCommentPath, selectedItem.getComment());
}
if (suc) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Property Saved suc.", name));
} else {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Property Saved failed.", name));
}
}
示例11: onPositionEdit
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
public void onPositionEdit(RowEditEvent event){
Position position=(Position) event.getObject();
System.out.println("Position:"+position.getPositionId()+" "+position.getPositionTitle()+" "+position.getPositionDescription());
PositionDAO pdao=new PositionDAO();
String msgText="";
FacesMessage message=null;
//Avant de modifier, on verifie si tous les champs sont complet�s
if(position.getPositionTitle().trim().equals("") || position.getPositionDescription().trim().equals("")){
msgText=RessourceBundleUtil.getMessage("allFieldsNotCompleted");
System.out.println("New Position:"+position.getPositionId()+" "+position.getPositionTitle()+" "+position.getPositionDescription());
this.init();
message=new FacesMessage(FacesMessage.SEVERITY_ERROR, RessourceBundleUtil.getMessage("error"), msgText);
}else{
if(pdao.update(position)){
msgText=RessourceBundleUtil.getMessage("positionUpdated");
System.out.println("New Position:"+position.getPositionId()+" "+position.getPositionTitle()+" "+position.getPositionDescription());
message=new FacesMessage(FacesMessage.SEVERITY_INFO, RessourceBundleUtil.getMessage("success"), msgText);
}else {
msgText="Failded to update the position";
System.out.println("New Position:"+position.getPositionId()+" "+position.getPositionTitle()+" "+position.getPositionDescription());
message = new FacesMessage(FacesMessage.SEVERITY_ERROR, RessourceBundleUtil.getMessage("error"), msgText);
} }
FacesUtil.addMessage(null, message);
}
示例12: onEdit
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
public void onEdit(RowEditEvent event) {
pessoa = (Pessoa) event.getObject();
atualizar();
addMessage("Cliente " + pessoa.getNome() + " atualizado!");
}
示例13: onRowEditActor
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
public void onRowEditActor(RowEditEvent event) {
actorContainer.updateActor((ActorVO) event.getObject());
}
示例14: onRowEdit
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
public void onRowEdit(RowEditEvent event) {
String varName = ((Variables) event.getObject()).getId();
String varValue = ((Variables) event.getObject()).getValue();
settings.updateVariable(varName, varValue);
MessagesController.addInfoMessage("Updated variable : " + varName + " to: " + varValue);
}
示例15: onRowCancel
import org.primefaces.event.RowEditEvent; //导入依赖的package包/类
public void onRowCancel(RowEditEvent event) {
}