Author: chris.laprun(a)jboss.com
Date: 2011-09-23 06:00:16 -0400 (Fri, 23 Sep 2011)
New Revision: 7498
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/producer/producer.xhtml
Log:
- GTNWSRP-244: Retrieve the property name from the selected object directly instead of
using a parameter which value is set *before* the name of the property is actually set.
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java 2011-09-23
09:45:45 UTC (rev 7497)
+++
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java 2011-09-23
10:00:16 UTC (rev 7498)
@@ -32,10 +32,13 @@
import org.gatein.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+import javax.faces.component.UIComponent;
+import javax.faces.component.html.HtmlDataTable;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
+import javax.xml.namespace.QName;
import java.io.Serializable;
import java.util.Collections;
import java.util.LinkedList;
@@ -250,9 +253,28 @@
public void selectProperty(ActionEvent event)
{
- selectedProp = beanContext.getParameter("propName");
+ // Retrieve parent table from event
+ HtmlDataTable table = getParentDataTable((UIComponent)event.getSource());
+
+ // Get selected prop
+ RegistrationPropertyDescription prop =
(RegistrationPropertyDescription)table.getRowData();
+
+ selectedProp = prop.getNameAsString();
}
+ private HtmlDataTable getParentDataTable(UIComponent component)
+ {
+ if (component == null)
+ {
+ return null;
+ }
+ if (component instanceof HtmlDataTable)
+ {
+ return (HtmlDataTable)component;
+ }
+ return getParentDataTable(component.getParent());
+ }
+
protected String getObjectTypeName()
{
return null; // default implementation as not used
@@ -295,7 +317,7 @@
{
this.registrationRequirements = new
ProducerRegistrationRequirementsImpl(registrationRequirements);
- Map descriptions = registrationRequirements.getRegistrationProperties();
+ Map<QName, RegistrationPropertyDescription> descriptions =
registrationRequirements.getRegistrationProperties();
registrationProperties = new
LinkedList<RegistrationPropertyDescription>(descriptions.values());
Collections.sort(registrationProperties);
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/jsf/producer/producer.xhtml
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/jsf/producer/producer.xhtml 2011-09-23
09:45:45 UTC (rev 7497)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/jsf/producer/producer.xhtml 2011-09-23
10:00:16 UTC (rev 7498)
@@ -132,9 +132,7 @@
<h:commandLink id="confirm-delete"
action="confirmPropDeletion"
value="#{i18n.producer_config_reg_prop_remove}"
styleClass="actionDelete"
-
actionListener="#{producer.selectProperty}">
- <f:param name="propName"
value="#{property.nameAsString}"/>
- </h:commandLink>
+
actionListener="#{producer.selectProperty}"/>
</h:column>
</h:dataTable>
</f:subview>
Show replies by date