Author: chris.laprun(a)jboss.com
Date: 2010-10-26 07:48:52 -0400 (Tue, 26 Oct 2010)
New Revision: 4843
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/import.xhtml
Log:
- GTNWSRP-117: Import button is now only enabled if we have enough information to perform
an import.
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2010-10-26
10:42:51 UTC (rev 4842)
+++
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2010-10-26
11:48:52 UTC (rev 4843)
@@ -690,6 +690,11 @@
this.provider = provider;
}
+ public boolean isReadyForImport()
+ {
+ return selected && !ParameterValidation.isNullOrEmpty(window);
+ }
+
public String getHandle()
{
return handle;
@@ -733,6 +738,14 @@
FacesContext.getCurrentInstance().renderResponse();
}
+ public void selectCurrentWindow(ValueChangeEvent event)
+ {
+ window = (String)event.getNewValue();
+
+ // bypass the rest of the life cycle and re-display page
+ FacesContext.getCurrentInstance().renderResponse();
+ }
+
public List<SelectItem> getPages()
{
List<String> pageIdentifiers = provider.getPageIdentifiers();
@@ -835,6 +848,17 @@
{
return export;
}
+
+ public boolean isReadyForImport()
+ {
+ boolean ready = false;
+ for (SelectablePortletHandle portlet : exportedPortlets)
+ {
+ ready = ready || portlet.isReadyForImport();
+ }
+
+ return ready;
+ }
}
public static class FailedPortletsDisplay
Modified:
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/import.xhtml
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/import.xhtml 2010-10-26
10:42:51 UTC (rev 4842)
+++
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/import.xhtml 2010-10-26
11:48:52 UTC (rev 4843)
@@ -51,7 +51,10 @@
onclick="this.form.submit()">
<f:selectItems value="#{portlet.pages}"/>
</h:selectOneListbox>
- <h:selectOneListbox id="currentWindow"
value="#{portlet.window}" rendered="#{! empty portlet.page}">
+ <h:selectOneListbox id="currentWindow"
value="#{portlet.window}" rendered="#{! empty portlet.page}"
+
valueChangeListener="#{portlet.selectCurrentWindow}"
+ immediate="true"
+ onclick="this.form.submit()">
<f:selectItems value="#{portlet.windows}"/>
</h:selectOneListbox>
</h:column>
@@ -63,7 +66,7 @@
<div class="ButtonLeft">
<div class="ButtonRight">
<div class="ButtonMiddle">
- <h:commandButton id="import"
action="#{consumer.importPortlets}"
+ <h:commandButton id="import"
action="#{consumer.importPortlets}"
disabled="#{!consumer.currentExport.readyForImport}"
value="#{i18n.import_import}"/>
</div>
</div>
Show replies by date