Fórum

Custom field value

shubhranshu swain, modificado 12 Anos atrás.

Custom field value

New Member Postagens: 18 Data de Entrada: 19/01/11 Postagens 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
thumbnail
Rajesh Chaurasia, modificado 12 Anos atrás.

RE: Custom field value

Regular Member Postagens: 183 Data de Entrada: 18/08/11 Postagens 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>