Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
shubhranshu swain
Custom field value
8 de Novembro de 2011 01:02
Resposta

shubhranshu swain

Ranking: New Member

Mensagens: 18

Data de entrada: 18 de Janeiro de 2011

Mensagens recentes

Hi All

I have created a custom field telephone. I want to get the value before the page is submitted(not from the expando table).

Pls help

Regardsemoticon
Rajesh Chaurasia
RE: Custom field value
15 de Novembro de 2011 22:47
Resposta

Rajesh Chaurasia

Ranking: Junior Member

Mensagens: 94

Data de entrada: 18 de Agosto de 2011

Mensagens recentes

You can do what you asked by first fetching the custom field value on page load and then set it to some hidden field.On submit you will have that value in backend.

Step 1: Get value from Expando Column table:

Integer webCntMaxSize = 0;
long jrnlClassNameId = ClassNameLocalServiceUtil.getClassNameId(JournalArticle.class.getName());
long company_id = user.getCompanyId();
ExpandoTable jnrnlTable = ExpandoTableLocalServiceUtil.getDefaultTable(company_id, jrnlClassNameId);
ExpandoColumn jrnlColumn = ExpandoColumnLocalServiceUtil.getColumn(jnrnlTable.getTableId(), "mxWebContentSize");
String value = jrnlColumn.getDefaultData();
System.out.println("value in server.jspf:"+value);
if (value != null) {
webCntMaxSize= Integer.parseInt(value);
}

Step 2:Set the value in hidden field as below:

<aui:form method="post" name="fm2">
<input name="fieldName" type="hidden" value="<%=value%>" />
<</aui:form>