<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Custom field on DL not updating</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=29989530" />
  <subtitle>Custom field on DL not updating</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=29989530</id>
  <updated>2026-04-05T09:02:34Z</updated>
  <dc:date>2026-04-05T09:02:34Z</dc:date>
  <entry>
    <title>RE: Custom field on DL not updating</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=32222114" />
    <author>
      <name>Fabian Lopez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=32222114</id>
    <updated>2013-12-06T22:39:31Z</updated>
    <published>2013-12-06T22:39:31Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Finally made it work!!&lt;br&gt;&lt;br&gt;i developed a hook in the struts action /document_library/edit_file_entry &lt;br&gt;after the entry is updated i manually set the expandos with a couple of methods that looks something like this.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
private static final Pattern EXPANDO_PATTERN = Pattern.compile("ExpandoAttribute--(.*)--");

private void updateExpandosForFileEntries(PortletRequest request, FileEntry fileEntry){
		Set&amp;lt;string&amp;gt; values = new HashSet&amp;lt;string&amp;gt;();
		
		for(String param :  request.getParameterMap().keySet()){
                        // aplies the method only to the expando parameters
			Matcher matcher = EXPANDO_PATTERN.matcher(param);
			if(matcher.find()){
				String expandoParam = matcher.group(1);
				
				if(values.contains(expandoParam)){
					continue;
				}
				else{
					updateExpandosForFileEntry(request, expandoParam, fileEntry);
					values.add(expandoParam);
				}
			}
		}
		
	}



private void updateExpandosForFileEntry(PortletRequest request, String expandoName, FileEntry fileEntry){
		
		String nameParam = "ExpandoAttribute--" + expandoName + "--";
		String paramValue = request.getParameter(nameParam);
		
		if(Validator.isNotNull(paramValue)){
			int type = fileEntry.getExpandoBridge().getAttributeType(expandoName);
			if(type == ExpandoColumnConstants.BOOLEAN){
				fileEntry.getExpandoBridge().setAttribute(expandoName, paramValue.equals("1")?true:false);
				return;
			}
			fileEntry.getExpandoBridge().setAttribute(expandoName, paramValue);
		} else{
			String dateYear = nameParam + "Year";
			String dateMonth = nameParam + "Month";
			String dateName = nameParam + "Day";
			String dateAmPm = nameParam + "AmPm";
			String dateHour = nameParam + "Hour";
			String dateMinute = nameParam + "Minute";
			
			Calendar expandoCalendar = Calendar.getInstance();
			
			expandoCalendar.set(Calendar.YEAR, ParamUtil.getInteger(request, dateYear));
			expandoCalendar.set(Calendar.MONTH, ParamUtil.getInteger(request, dateMonth));
			expandoCalendar.set(Calendar.DAY_OF_MONTH, ParamUtil.getInteger(request, dateName));
			expandoCalendar.set(Calendar.AM_PM, ParamUtil.getInteger(request, dateAmPm));
			expandoCalendar.set(Calendar.HOUR, ParamUtil.getInteger(request, dateHour));
			expandoCalendar.set(Calendar.MINUTE, ParamUtil.getInteger(request, dateMinute));
			
			try {
				fileEntry.getExpandoBridge().setAttribute(expandoName, expandoCalendar.getTime());
			} catch (Exception e) {
				_log.error(e);
			}
		}
	}
&amp;lt;/string&amp;gt;&amp;lt;/string&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;I know it's dirty but i had to do it &lt;img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif"&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Fabian Lopez</dc:creator>
    <dc:date>2013-12-06T22:39:31Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom field on DL not updating</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=32211145" />
    <author>
      <name>Fabian Lopez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=32211145</id>
    <updated>2013-12-06T14:42:53Z</updated>
    <published>2013-12-06T14:42:53Z</published>
    <summary type="html">Hi.&lt;br /&gt;&lt;br /&gt;In my case, I am having this problem with the portal administrator, however y put all the permissions for the field to the power user role wich is also a role on the user i&amp;#39;m using but the custom field remains unmodified.&lt;br /&gt;&lt;br /&gt;I&amp;#39;m using version 6.1 GA3 of LP if that brings any light on the matter.&lt;br /&gt;&lt;br /&gt;Thanks in advance.</summary>
    <dc:creator>Fabian Lopez</dc:creator>
    <dc:date>2013-12-06T14:42:53Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom field on DL not updating</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=32196614" />
    <author>
      <name>Sushil Patidar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=32196614</id>
    <updated>2013-12-06T05:37:06Z</updated>
    <published>2013-12-06T05:37:06Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Etienne Roy:&lt;/div&gt;&lt;blockquote&gt;Hi, &lt;br /&gt;I create a custom field for the Documents and Media Document &lt;br /&gt;this new field add automatically on the page&lt;br /&gt;When I add a new document, the new field was saved in the expendo table but I can&amp;#39;t update this field after&lt;br /&gt;&lt;br /&gt;Do I have to make a modification to update the field ?&lt;br /&gt;&lt;br /&gt;thanks&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Hi,&lt;br /&gt;         I think problem is related to update permissions. Have you set update permissions for that custom field. First assign update permissions,then check.&lt;br /&gt;         I hope this may help you.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks</summary>
    <dc:creator>Sushil Patidar</dc:creator>
    <dc:date>2013-12-06T05:37:06Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom field on DL not updating</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=32196528" />
    <author>
      <name>Nagendra Kumar Busam</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=32196528</id>
    <updated>2013-12-06T05:11:12Z</updated>
    <published>2013-12-06T05:11:12Z</published>
    <summary type="html">Which version of liferay you are using?&lt;br /&gt;&lt;br /&gt;Can you share code snippet for how you are adding your custom fields programmatically , so that we can look where the actual issue is</summary>
    <dc:creator>Nagendra Kumar Busam</dc:creator>
    <dc:date>2013-12-06T05:11:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom field on DL not updating</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=32186446" />
    <author>
      <name>Fabian Lopez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=32186446</id>
    <updated>2013-12-05T19:44:17Z</updated>
    <published>2013-12-05T19:44:17Z</published>
    <summary type="html">I&amp;#39;m having the same problem,&lt;br /&gt;&lt;br /&gt;after creating some expando columns programatically they appear to be working fine even creating the DL entry but after creation if i try to update any of the custom attributes nothing happend however the normal attributes of the DL entry change as expected.&lt;br /&gt;&lt;br /&gt;more information &lt;a href="http://www.liferay.com/es/community/forums/-/message_boards/message/32183188"&gt;here&lt;/a&gt;&lt;br /&gt;any ideas?</summary>
    <dc:creator>Fabian Lopez</dc:creator>
    <dc:date>2013-12-05T19:44:17Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom field on DL not updating</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=30112872" />
    <author>
      <name>Zsigmond Rab</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=30112872</id>
    <updated>2013-10-03T19:36:49Z</updated>
    <published>2013-10-03T19:36:49Z</published>
    <summary type="html">Hi Etienne,&lt;br /&gt;&lt;br /&gt;why cannot you update? What is the symptom either on the UI or in the log files.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Zsigmond</summary>
    <dc:creator>Zsigmond Rab</dc:creator>
    <dc:date>2013-10-03T19:36:49Z</dc:date>
  </entry>
  <entry>
    <title>Custom field on DL not updating</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=29989529" />
    <author>
      <name>Etienne Roy</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=29989529</id>
    <updated>2013-09-30T16:34:43Z</updated>
    <published>2013-09-30T16:34:43Z</published>
    <summary type="html">Hi, &lt;br /&gt;I create a custom field for the Documents and Media Document &lt;br /&gt;this new field add automatically on the page&lt;br /&gt;When I add a new document, the new field was saved in the expendo table but I can&amp;#39;t update this field after&lt;br /&gt;&lt;br /&gt;Do I have to make a modification to update the field ?&lt;br /&gt;&lt;br /&gt;thanks</summary>
    <dc:creator>Etienne Roy</dc:creator>
    <dc:date>2013-09-30T16:34:43Z</dc:date>
  </entry>
</feed>
