Re: validation checkboxlist

2018-01-09 Thread José Antonio Delgado Trujillo
Upss
unbalanced ]
the para-name was autocorrection of the email editor!!!
thanks 

Un saludo,
José A.

> On 9 Jan 2018, at 14:45, Brian Holzer  wrote:
> 
> Hey there,
>I'm not sure if this is affecting anything, but the syntax appears to be 
> wrong for your 

Re: validation checkboxlist

2018-01-09 Thread José Antonio Delgado Trujillo
solved!!!

It was a problem with unbalanced ]

Un saludo,
José A.



Re: validation checkboxlist

2018-01-09 Thread Brian Holzer
Hey there,
   I'm not sure if this is affecting anything, but the syntax appears
to be wrong for your 

Re: validation checkboxlist

2018-01-08 Thread Lukasz Lenart
2018-01-08 20:04 GMT+01:00 José Antonio Delgado Trujillo :
> 

Re: validation checkboxlist

2018-01-08 Thread José Antonio Delgado Trujillo
Thanks a lot Lukasz,

I had the same like the example except the expression of the validation.
I misunderstood the param-name=“expression” - It was the expression to 
evaluate!!! (i was thinking about the expression to fail the validation) 


>> 

Re: validation checkboxlist

2018-01-07 Thread Lukasz Lenart
2018-01-05 19:26 GMT+01:00 José Antonio Delgado Trujillo :
> Why not key? i have the correspondan property files
> personBean.levels=Cursos
>
> I also see the label Cursos and the options

Ok, but please be aware that the most important thing is a "name"
attribute that must match the corresponding bean name and its
property.

>
> The problem is about the XML validation.
> 
>  
>   
> 

Re: validation checkboxlist

2018-01-05 Thread José Antonio Delgado Trujillo
> “personBean.levels.isEmpty”


Yes, it’s empty an in the form the first time rendered all the options are 
unchecked.


> 
> You should use "name" instead of "key"

Why not key? i have the correspondan property files
personBean.levels=Cursos

I also see the label Cursos and the options

The problem is about the XML validation.

 
  

Re: validation checkboxlist

2018-01-04 Thread Lukasz Lenart
2018-01-04 18:53 GMT+01:00 José Antonio Delgado Trujillo :
>   
> 

Re: validation checkboxlist

2018-01-04 Thread José Antonio Delgado Trujillo
OK,
Thanks for your explanation, i see clearer to use modeldriven or not.
My problem is not about the populate the options of the checkboxlist but the 
exception rule you must select at least one.

In the XML file i have


 
  

Re: validation checkboxlist

2018-01-04 Thread Lukasz Lenart
2018-01-04 13:24 GMT+01:00 José Antonio Delgado Trujillo :
> In the docs about model driven
> https://struts.apache.org/core-developers/model-driven.html 
> 
>
> It is said that you must to implement the MovelDriven interface just the 
> method getModel() to give an Object in which Struts populate with the 
> parameters request and placed on the top.

When using the ModelDriven interface, your top object on a stack will
be the Object, not an Action, so:
- with ModelDriven:  => person.levels (if
getModel() returns Person)
- without ModelDriven:  => levels (ia
property on an action level)

All OGNL expressions/tags are searching stack from the op to the
bottom, the top most object on the stack is always an action but
ModelDriven changes that, and a Model is the top most object on the
stack.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: validation checkboxlist

2018-01-04 Thread José Antonio Delgado Trujillo
In the docs about model driven
https://struts.apache.org/core-developers/model-driven.html 


It is said that you must to implement the MovelDriven interface just the method 
getModel() to give an Object in which Struts populate with the parameters 
request and placed on the top.

i din’t understand the need of that because i can populate the object if it is 
a field of the Action’s class.

So what is the difference (the use of OGNL?) i can’t accede object properties?

My object person is of type Person class and it is a field of the action 
Register. Why can’t access to levels property of the object person by 
person.levels??



Re: validation checkboxlist

2018-01-04 Thread Lukasz Lenart
2018-01-03 10:30 GMT+01:00 José Antonio Delgado Trujillo :
>

Do you use ModelDriven? because this looks like linked directly to an action


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



validation checkboxlist

2018-01-03 Thread José Antonio Delgado Trujillo
I have a form with a checkboxlist linked to a bean with an array of string 
properties. I want the user must select at least one option.

Looking for the documentation, i think this is possible with field expression, 
but it requires ONGL expression.

I did it so:

FORM


…
   
…



BEAN 
public class Person{

private String[] levels;
…
}


XML VALIDATION

   


Selecciona al menos un curso