kontrola formulare v dialog probe

verze3
Michal 2026-08-27 22:24:56 +02:00
parent 69317372ab
commit 91ab4d662e
1 changed files with 8 additions and 2 deletions

View File

@ -99,7 +99,6 @@ public class DialogProbe extends JFrame {
templateComboBox.setEnabled(false);
templateComboBox.setBounds(150, getNextY(checkBoxTemplate), 200, 25);
for (SnmpTemplate template : Client.snmpTemplate) {
System.err.println(node.getDeviceType() + " - " + template.getDeviceType());
if (node.getDeviceType() == template.getDeviceType()) {
TemplateItem item = new TemplateItem(template.getId(), template.getName(), template);
templateComboBox.addItem(item);
@ -233,7 +232,14 @@ public class DialogProbe extends JFrame {
save.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// kontrola chyb
String nazev = nameField.getName();
if (nazev == null) {
return;
}
String oid = oidField.getText();
if (oid == null) {
return;
}
// sestaveni probe
probe.setNodeId(node.getId());
probe.setName(nameField.getText());