Foren

aui:input for Date field and custom css

Owen James, geändert vor 12 Jahren.

aui:input for Date field and custom css

New Member Beiträge: 3 Beitrittsdatum: 27.09.11 Neueste Beiträge
Hi !

Here comes a new question and i hope people around could help me again.

I have a model with a Date field and a form. I used the aui:input to display the Date field by copying what i saw on the details.jsp (where the date of birth of a user is displayed). But, unlike to details.jsp, my aui:input display date and time and i don't want time to be displayed. I've try a lot of combinaison, including formatting the date so that the time will not be set, but still...

I've read and re read details.jsp and didn't understand why their aui:input didn't display time.

I've another question related to aui:input for Date field.

For an excerpt of code, i have

<aui:input name="birthday" value="<%= dteOfBirth%>" label=""/> where dteOfBirth is set to new Date(). My context model have a set/getBirthDay getter/setter.

What can i do if i want the generated "Select" fields to be aligned in a certain way ? Particularly, i want to reduce length for the day part, adjust length for the month part so that all the generated components will hold on one line.

Thanks in advance.
MICHAIL MOUDATSOS, geändert vor 12 Jahren.

RE: aui:input for Date field and custom css

Regular Member Beiträge: 110 Beitrittsdatum: 04.10.11 Neueste Beiträge
Owen James:

I have a model with a Date field and a form. I used the aui:input to display the Date field by copying what i saw on the details.jsp (where the date of birth of a user is displayed). But, unlike to details.jsp, my aui:input display date and time and i don't want time to be displayed. I've try a lot of combinaison, including formatting the date so that the time will not be set, but still...


The value of the input field, is it connected to a String property? If not, try it and in getter just fetch the toString value out of your Date object and then, get the desired substring. In setter try to create a Date object out of the given string. You can add input validation code/tags to ensure valid input.



Owen James:

What can i do if i want the generated "Select" fields to be aligned in a certain way ? Particularly, i want to reduce length for the day part, adjust length for the month part so that all the generated components will hold on one line.


I would go and tamper with css properties for presentational-wise things. You can define specific classes for which you would set the css properties in aui tags (I think there's a styleClass parameter to set to the name of the CSS class whose properties will apply to the aui tag)