Foren

How to add one more row in database

srinivasa rao, geändert vor 10 Jahren.

How to add one more row in database

Regular Member Beiträge: 189 Beitrittsdatum: 29.01.14 Neueste Beiträge
Hi,

I m using liferay 6.2 with tomcat 7.0.42 and mysql.

here i m customized create account page(directly i m doing changes in tomact\folder) i m adding one more new filed there and tht is a mandatory filed.

in database i added tht filed name,but tht filed is not diaplayed in create account page

here my code:
<c:if test="<%= PrefsPropsUtil.getBoolean(company.getCompanyId(), PropsKeys.FIELD_ENABLE_COM_LIFERAY_PORTAL_MODEL_CONTACT_DETAILS) %>">
<aui:select label="Type" name="Provider">
<aui:option label="Provider" value="1" />
<aui:option label="Enrolle" value="2" />
<aui:option label="Payer" selected="<%= !Provider %>" value="0" />
</aui:select>
</c:if>

i created hook project and copied create_account,but it showing lot of errors

any help is useful for me

Regards,
Srinivas.
thumbnail
Samuel Kong, geändert vor 10 Jahren.

RE: How to add one more row in database

Liferay Legend Beiträge: 1902 Beitrittsdatum: 10.03.08 Neueste Beiträge
It would help if you could indicate what errors you're getting.

If the only changes you made to the JSP is code you listed, then I would assume some possible errors might be
  • PropsKeys.FIELD_ENABLE_COM_LIFERAY_PORTAL_MODEL_CONTACT_DETAILS - This variable is not defined in the PropsKeys class that ships with the portal.
  • The 'provider' variable might not be defined.
  • You have some logic issues with the options since you only defined the 'selected' attribute for the last option and you have 3 option. so the 2 option could never be selected.
thumbnail
Samuel Kong, geändert vor 10 Jahren.

RE: How to add one more row in database

Liferay Legend Beiträge: 1902 Beitrittsdatum: 10.03.08 Neueste Beiträge
Also, when you added a new field, I'm not sure how you implemented this. So I just want to point out that you should not modify the User_ as this could cause issues when you try to upgrade the portal later. Instead, you should create a new table to hold your new field.
thumbnail
Anil T, geändert vor 10 Jahren.

RE: How to add one more row in database

Expert Beiträge: 313 Beitrittsdatum: 14.01.12 Neueste Beiträge
Hi,

Instead of updating the User_ table create custom field for the User and update your properties.
srinivasa rao, geändert vor 10 Jahren.

RE: How to add one more row in database

Regular Member Beiträge: 189 Beitrittsdatum: 29.01.14 Neueste Beiträge
Samuel Kong:
Also, when you added a new field, I'm not sure how you implemented this. So I just want to point out that you should not modify the User_ as this could cause issues when you try to upgrade the portal later. Instead, you should create a new table to hold your new field.



Hi Samuel,

Thanks for ur reply..

i have one question here..in hook project why create_account.jsp page is got lot of errors.even it didnt find the path jsps/html/...

in server directly can i change the code?

could you please provide me any sample example on this?

or else can i create a login portlet with service builder and configure tht into create account page?
thumbnail
Samuel Kong, geändert vor 10 Jahren.

RE: How to add one more row in database

Liferay Legend Beiträge: 1902 Beitrittsdatum: 10.03.08 Neueste Beiträge
Anil, thanks for pointing out custom fields. That's much better than making a database change.

srinivasa rao:
i have one question here..in hook project why create_account.jsp page is got lot of errors.even it didnt find the path jsps/html/...


Not sure what you mean by this. If the hook can't find your JSP, then it shouldn't be causing errors.

in server directly can i change the code?


Possible but not definitely not recommended.

or else can i create a login portlet with service builder and configure tht into create account page?


You can, but if you're just adding an extra field, you can probably save yourself some work and just customize rather create a whole new portlet