java - Save data of Custom Fields in Liferay -


i have followed steps of this guide add custom field in liferay, , able label , text box enter data on account details page (html\portlet\users_admin\user\details.jsp).

my code is:

<div class="exp-ctrl-holder">     <liferay-ui:custom-attribute         classname="<%= user.class.getname() %>"         classpk="<%= 0 %>"         editable="<%= true %>"         label="<%= true %>"         name="bio"     /> </div> 

the problem when save not populating field on page. when write in "bio: input" , click on save, page loads , had written cleared. why? what's missing?

thanks,

this incorrect: classpk="<%= 0 %>".

classpk user's primary-key i.e. userid. while adding user classpk 0 since there no user created yet, when have saved or updating, user have classpk , custom-field bio saving associated userid.

instead need use

`classpk="<%= (seluser != null) ? seluser.getuserid() : 0 %>" 

so when save , user updated, users custom-field populated.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -