HibernateRelationshipsUI |
|
Your trail: |
Difference between
version 45
and
version 44:
At line 363 changed 1 line. |
!!Add the ability to add and delete entries [#8] |
In order to allow modification of the Category, you'll need to change the ''categoryId'' from being a hidden field to being a drop-down. With Struts, the easiest way to populate a drop-down is when the application starts up. You ''could'' populate it in the Action's ''edit()'' method, but if any validation errors occur, the variable would not be re-added to the request. |
At line 365 added 1 line. |
Add an AVAILABLE_CATEGORIES field to ''src/dao/**/__Constants.java__'': |
At line 366 changed 3 lines. |
# Modify struts_form.xdt so collections ending with "ies" will get their POJO's names ending with "y" (i.e. entries -> Entry). |
# TODO: Figure out how to get DateConverter and TimestampConverter to play nicely with each other (maybe combine them) |
# Style up the "posted at" text |
[{Java2HtmlPlugin |
At line 369 added 16 lines. |
/** |
* The name of the available categories list in application scope |
*/ |
public static final String AVAILABLE_CATEGORIES = "availableCategories"; |
}] |
|
Grab the list of possible categories in ''src/web/**/listener/__StartupListener.java__'' and stuff them into the servlet context: |
|
[{Java2HtmlPlugin |
|
context.setAttribute(Constants.AVAILABLE_ROLES, mgr.getAllRoles()); |
context.setAttribute(Constants.AVAILABLE_CATEGORIES, mgr.getObjects(Category.class)); |
}] |
|
If you're using < AppFuse 1.9, you'll need to fix [LookupManager.java|https://appfuse.dev.java.net/source/browse/appfuse/src/service/org/appfuse/service/LookupManager.java?r1=1.6&r2=1.7] and [LookupManagerImpl.java|https://appfuse.dev.java.net/source/browse/appfuse/src/service/org/appfuse/service/impl/LookupManagerImpl.java?r1=1.3&r2=1.4] so the above code works. |
|
At line 390 added 2 lines. |
!!Add the ability to add and delete entries [#8] |
|
Back to HibernateRelationshipsUI,
or to the Page History.
|