This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Managed bean in faces-config.xml for DataTable | ||
---|---|---|---|
Product: | javaee | Reporter: | arungupta <arungupta> |
Component: | JSF | Assignee: | _ potingwu <potingwu> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | Macintosh | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
arungupta
2008-08-18 00:49:40 UTC
If the entity bean is already defined in faces-config.xml, then that should be used instead. To consist with the Managed Beans creating, looks like we will need to use 'capitalized' name for the managed-bean-name: <managed-bean> <managed-bean-name>Cities</managed-bean-name> <managed-bean-class>server.Cities</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> and then generate codes like: <h:outputText value="#{Cities.id}" title="Id" /> <h:outputText value="#{Cities.cityName}" title="CityName" /> <h:outputText value="#{Cities.countryName}" title="CountryName" /> I think we should not automatically insert new <managed-bean> definition here without asking users. I think we had better to add an UI in the drag-n-drop dialog asking which <managed-bean> they want to use for this new codes. Users can also use this UI to search exist <managed-bean> definition or just a new name for the IDE to automatically create it and use it. The suggested approach sounds reasonable to me. Implementation note: - in class org.netbeans.modules.web.jsf.palette.items.JsfFormCustomizer, add the following UI below entry "Entity Class:". <JRadioButton> Registered Managed Bean: <JComboBox> <JRadioButton> Create New Managed Bean: <JTextField> <JRadioButton> Do not use Managed Bean. - in method checkStatus, whenever it found a valid Entity Class, search the matched (same class) Managed Beans by calling org.netbeans.modules.web.jsf.editor.jspel.getBeans. Then list them in the JComboBox. If found, set the default to "Registered Managed Bean:" and select the first entry. - in method evaluateInput, call jsfTable.setVariable with the user input of Managed Bean. Create new Managed Bean entry by calling org.netbeans.modules.web.jsf.api.facesmodel.FacesConfig.addManagedBean when user check "Create New Managed Bean". *** Issue 85594 has been marked as a duplicate of this issue. *** It's implemented in 7.0 trunk. changeset 545efc178d35 in main details: http://hg.netbeans.org/main?cmd=changeset;node=545efc178d35 Integrated into 'main-golden', will be available in build *200812121401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/545efc178d35 User: potingwu@netbeans.org Log: Implement Issue#144217: Managed bean in faces-config.xml for DataTable Improve the UI and code generation for JSF Form and JSF Table; automatically setup a valid managed bean and use it in the JSP EL. |