Fórum

aui:validator documentation

Michal R, modificado 9 Anos atrás.

aui:validator documentation

Junior Member Postagens: 25 Data de Entrada: 28/05/12 Postagens Recentes
Hi,
where is aui:validator documented?
I found this http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Alloy+UI+Forms+(aui)
However, aui:validator is not there.
Nothing here http://docs.liferay.com/portal/6.2/taglibs/ either.
thumbnail
Michael Williams, modificado 9 Anos atrás.

RE: aui:validator documentation

New Member Postagens: 19 Data de Entrada: 14/03/14 Postagens Recentes
Hi Michal,

That is the current documentation on aui:validator. I'll be happy to give a better explanation of it for you though. aui:validator is a tag used in aui:input fields to validate the fields for the form. For example:

--------------
<aui:input name="Name" value=''" label="Name">
<aui:validator name="required" />
<aui:validator name="alpha" />
</aui:input>
--------------

In the example above the value of the name attribute of the aui:validator tag marks the field as required and says that only alpha characters are allowed. If you were to try to validate the field with other characters then alpha you would receive a default error message that says "please enter only alpha characters." If you want to
replace the default error message, you have to add a "errorMessage" attribute to the aui:validator tag. For example:

---------------
<aui:validator name="alpha" errorMessage"Enter characters that exist in the alphabet next time please" />
---------------

There are several values for you to choose from for the name attribute of the aui:validator tag:

**acceptFiles:** List of filetypes accepted. (Default:empty)

**alpha:** Evaluates whether or not a field contains only alpha characters.
(Default:none)

**alphanum:** A boolean value that determines whether a field is suppose to
contain only alphanumeric characters and evaluates it accordingly.
(Default:false)

**date:** A boolean value that determines whether a field is a Date and
evaluates it accordingly. (Default:false)

**digits:** A boolean value that determines whether a field is suppose to
contain only digits and evaluates it accordingly. (Default:false)

**email:** A boolean value that determines whether a field is a date and
evaluates it accordingly. (Default:false)

**equalTo:** Evaluates whether a field is equal to the field written.
(Default:empty)

**iri:** A boolean value that determines whether a field is a IRI and evaluates
it accordingly (Default:false)

**max:** Evaluates whether the integer value is less than or equal to the value
written. (Default:none)

**maxLength:** Evaluates whether a field is over the maximum length of
characters specified. (Default:empty)

**min:** Evaluates whether the integer value is greater than or equal to the
value written. (Default:none)

**minLength:** Evaluates whether a field is under the minimum length of
characters specified. (Default:empty)

**number:** A Boolean value that determines whether a field is suppose to
contain only numeric values and evaluates it accordingly. (Default:false)

**range:** Evaluates whether the integer value lies within the range given.
(Default:none)

**rangeLength:** Evaluates whether a field lies within the range of characters
written. (Default:empty)

**required:** Evaluates whether the field is required before submission.
(Default:false)

**url:** A boolean value that determines whether a field is a URL and evaluates
it accordingly. (Default:false)

For attributes that have a max or min and require a value, you will need to specify it in the tag. For example:

---------------
<aui:validator name="max">20</aui:validator>
---------------

Note that the aui:validator tag will need to be placed within a larger aui:form tag of your JSP and that you will need to reference the proper taglibs. Here is an example JSP for a portlet:

---------------
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>

<portlet:defineObjects />

<aui:form name="myForm" action="" method="post">
<aui:input name="Name" value='' label="Name">
<aui:validator name="required" />
<aui:validator name="alpha" errorMessage"Enter characters that exist in the alphabet next time please" />
</aui:input>
<aui:button type="submit" name="submit" value="submit" />
</aui:form>
---------------

Hope this helps.
Michal R, modificado 9 Anos atrás.

RE: aui:validator documentation

Junior Member Postagens: 25 Data de Entrada: 28/05/12 Postagens Recentes
Excellent, thank you!

The expertise is obviously there (with the Liferay staff), why not make this info part of the official documentation (or at least the wiki article)?
There it would surely get appropriate visibility and return on investment.
thumbnail
James Hinkey, modificado 9 Anos atrás.

RE: aui:validator documentation

Junior Member Postagens: 62 Data de Entrada: 15/02/11 Postagens Recentes
Hi Michal,

Thank you for posting your question and inquiring about incorporating information, like that in Mike's aui:validator response, in our official docs.

The Liferay Knowledge Management (KM) team is working to get more UI documentation into the Developer's Guide. Shortly we'll be launching a new site, the Liferay Developer's Network (LDN), which lends itself well to adding smaller tutorials for UI components like aui:validator. We're working to make it easier for knowledgeable Liferay engineers and community developers to contribute tutorials that are well tested, helpful, and enjoyable to read. You'll hear more about LDN soon.

Thanks for your patience.

Jim
thumbnail
Michael Williams, modificado 9 Anos atrás.

RE: aui:validator documentation

New Member Postagens: 19 Data de Entrada: 14/03/14 Postagens Recentes
Hi Michal,

Glad I could be of help. Thanks for your suggestion! As Jim said, LDN will be launched soon enough and you can bet that your suggestion will be taken into account when designing tutorials for the site.

Thanks.

Mike
Javier Vera, modificado 9 Anos atrás.

RE: aui:validator documentation

New Member Postagens: 18 Data de Entrada: 01/08/14 Postagens Recentes
is this for real? i've actually got surprised on the lack of information when it comes to Liferay. Its kinda sad when it comes to the development enthusiasts and workers. However its quite understandable for Liferay company to keep this information for themselves and their ad-hoc trainings. Maybe overtime they will take Oracle's culture...

:ouin: :ouin:
thumbnail
James Hinkey, modificado 9 Anos atrás.

RE: aui:validator documentation

Junior Member Postagens: 62 Data de Entrada: 15/02/11 Postagens Recentes
Javier,

I hear your frustration with regards to the need for more expert Liferay documentation. One of the changes we've made in the upcoming Liferay Developer Network (LDN), which is planned for beta in the next few weeks, has to do with making it easier for experts to submit documentation. I'll explain.

One challenge for contributors has been determining where to add their content in the Developer's Guide. In which chapter should their content go and where in that chapter should they add their content? What should the contributor do if there's no current chapter that is a fit for their content? In LDN's developer documents, we've done away with the linear book/chapter/section format and have adopted a topical approach. The content from the Developer's Guide has been broken down into concise articles that focus on particular topics (e.g., aui:validator). And they're grouped together by topical area in articles that we call Tutorials. For developers learning the fundamentals of developing in Liferay, we're providing Learning Paths in which they build sample apps following Liferay's best practices. Readers can start learning the basics via Learning Paths and can dive deeper into specifics with Tutorials as they apply what they learn in the apps they're actively building as they read.

Liferay experts, on staff and in the community, will be able to submit articles in a drop-box of sorts. This will be a GitHub directory for starters, but we'll make contributions possible via the site in the near future. Developers won't need to worry about what existing chapter or section to add their content, they simply add it to a directory. From there Liferay reviews it, tests it, and incorporates it as a new Tutorial article for LDN.

This is just one of the ways we're actively working to provide official documentation for you. Hope this is an encouragement to you.

Thank you for voicing your concerns.

Jim
thumbnail
James Hinkey, modificado 9 Anos atrás.

RE: aui:validator documentation

Junior Member Postagens: 62 Data de Entrada: 15/02/11 Postagens Recentes
One more thing I wanted to mention ... Mike Williams submitted a Learning Path and Tutorial that includes aui:validator. It's in review and getting prepped for publication. emoticon
thumbnail
Richard Sezov, modificado 9 Anos atrás.

RE: aui:validator documentation

Regular Member Postagens: 220 Data de Entrada: 07/02/07 Postagens Recentes
Hey guys,

One thing for you to know: we never keep anything to ourselves. As an open source product, both the development of the product and the production of documentation are done completely out in the open. You don't have to wait for anything to be published on the site to see what we're currently working on. Though the documentation may be rough as it's still being written, you can see everything we're currently working on at Github:

https://github.com/liferay/liferay-docs

The documentation that Mike posted is an example of something we're currently working on. Rest assured we're trying to get this into your hands as quickly as possible!

Feel free to follow any of our personal repositories to see anything you want. Mine is here:

https://github.com/sez11a/liferay-docs

Often, you'll find documentation that is complete and waiting for review in my pull requests. Once it gets edited and pushed to the master branch, we publish it on the website regularly. Of course, there's more: if you want to see what we've got in the pipeline, our JIRA project is also completely open for anyone to view:

https://issues.liferay.com/browse/LRDOCS/

You can add tickets and comment on any existing ticket we have. If there's something you think we should prioritize, we'd love to know!