Nivel 1
Nivel 2
Iniciar sesión en la comunidad
Iniciar sesión para ver todas las insignias
Hi,
I want to delete the Value in the property that is type String Array. Deleting the value is working fine but I am having in issues in deleting the value.
Suppose I want to delete the value here:
Before deleting:
After deleting the value: 24.56.43.45 I am getting the comma at the end of the values and box getting not deleted along with the value. Please find the screenshots below.
After deleting:
Could anyone let me know, how to delete the entire value with box.
This is my code I used for deletion of value from form.
for(Value val:ipList){
log.info(val.getString() + " , ");
if(val !=null && val.getString().equals(deleteValue)){
ipList.remove(val);
break;
}
}
Please help me!!
Thanks,
Ratna Kumar.
¡Resuelto! Ir a solución.
Vistas
Respuestas
Total de me gusta
Hi All,
Many thanks for your suggestions!! I have resolved the issue.
I have used the ValueFactory for adding or deleting the value from the property that is String Array. Below is the code I have used.
if (ipValues != null && isDeleteIPExist && deleteip != null && !deleteip.trim().equals("")) {
log.info("Deleting IP Address : " + deleteip);
ValueFactory vFctory = node1.getSession().getValueFactory();
Value delp = vFctory.createValue(deleteip);
boolean isDel = ipList.remove(delp);
log.info("IP Deleted: " + deleteip + " ,is Deleted: " + isDel);
isModified = true;
}
Thanks,
Ratna.
Vistas
Respuestas
Total de me gusta
Ratna Kumar wrote...
Hi,
I want to delete the Value in the property that is type String Array. Deleting the value is working fine but I am having in issues in deleting the value.
Suppose I want to delete the value here:
Before deleting:
After deleting the value: 24.56.43.45 I am getting the comma at the end of the values and box getting not deleted along with the value. Please find the screenshots below.
After deleting:
Could anyone let me know, how to delete the entire value with box.
This is my code I used for deletion of value from form.
for(Value val:ipList){
log.info(val.getString() + " , ");
if(val !=null && val.getString().equals(deleteValue)){
ipList.remove(val);
break;
}
}
Please help me!!
Thanks,
Ratna Kumar.
I guess you need to check for empty as well..
Vistas
Respuestas
Total de me gusta
Agreed - looks like you are letting an empty string exist.
Vistas
Respuestas
Total de me gusta
Hi Ratna,
Either it is not coming inside your custom if condition Or the reference list is wrong. Also just check for empty & not val.getString().equals(deleteValue)
Thanks,
Vistas
Respuestas
Total de me gusta
Did any of the suggestion worked for you?
~kautuk
Vistas
Respuestas
Total de me gusta
Hi All,
Many thanks for your suggestions!! I have resolved the issue.
I have used the ValueFactory for adding or deleting the value from the property that is String Array. Below is the code I have used.
if (ipValues != null && isDeleteIPExist && deleteip != null && !deleteip.trim().equals("")) {
log.info("Deleting IP Address : " + deleteip);
ValueFactory vFctory = node1.getSession().getValueFactory();
Value delp = vFctory.createValue(deleteip);
boolean isDel = ipList.remove(delp);
log.info("IP Deleted: " + deleteip + " ,is Deleted: " + isDel);
isModified = true;
}
Thanks,
Ratna.
Vistas
Respuestas
Total de me gusta
Vistas
me gusta
Respuestas