Jahia 6 - Length of a container field

View: New views
2 Messages — Rating Filter:   Alert me  

Jahia 6 - Length of a container field

by MesDocs ParMail :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

How can I test the length of a container field (BigText) ?

In version 5 of jahia I did the following  via scriptlet :

String MyFieldDesc = myContainer.getFieldValue("FieldDesc","");
String excerpt = removeTags(MyFieldDesc);
if ((excerpt.length()) > 0) {
.....
}

In Jahia 6 I can access the field with the following statement :

<template:field name='fieldDesc' valueBeanID="MyFieldDesc" display="false" />


Thanks
_______________________________________________
template_list mailing list
template_list@...
http://lists.jahia.org/cgi-bin/mailman/listinfo/template_list

Re: Jahia 6 - Length of a container field

by Sergiy Shyrkov-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

currently you can do it using e.g. the JSTL's fn:length() function in
the following way:

            <%@ taglib uri="http://java.sun.com/jsp/jstl/functions"
prefix="fn" %>

            <template:field name='fieldDesc' valueBeanID="myFieldDesc"
display="false" />
            length: ${fn:length(myFieldDesc.value)}

Kind regards
Sergiy

MesDocs ParMail wrote:

> Hi,
>
> How can I test the length of a container field (BigText) ?
>
> In version 5 of jahia I did the following  via scriptlet :
>
> String MyFieldDesc = myContainer.getFieldValue("FieldDesc","");
> String excerpt = removeTags(MyFieldDesc);
> if ((excerpt.length()) > 0) {
> .....
> }
>
> In Jahia 6 I can access the field with the following statement :
>
> <template:field name='fieldDesc' valueBeanID="MyFieldDesc" display="false" />
>
>
> Thanks
> _______________________________________________
> template_list mailing list
> template_list@...
> http://lists.jahia.org/cgi-bin/mailman/listinfo/template_list
>  

_______________________________________________
template_list mailing list
template_list@...
http://lists.jahia.org/cgi-bin/mailman/listinfo/template_list