manageOption("create");
return;
}
if(!ids.isEmpty()){
final UnitOfMeasure c=manager.find(new Long(ids.get(0)));
cbox.setText(c.getName());
sbox.setText(c.getDescription().getShortDescription());
dbox.setText(c.getDescription().getLongDescription());
cmbox.setText(c.getDescription().getComment());
if(options.get(0).equals("show")){
cbox.setDisabled(true);
sbox.setDisabled(true);
dbox.setDisabled(true);
cmbox.setDisabled(true);
}
if(options.get(0).equals("edit")){
cbox.setDisabled(true);
Button okButton=new Button("OK");
okButton.addEventListener("onClick", new EventListener(){
public void onEvent(Event event) throws Exception {
c.getDescription().setShortDescription(sbox.getText());
c.getDescription().setLongDescription(dbox.getText());
c.getDescription().setComment(cmbox.getText());
manager.update(c);
detach();
}
});