]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Mon, 22 Aug 2016 13:18:40 +0000 (15:18 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 24 Aug 2016 19:38:46 +0000 (21:38 +0200)
- removed onPostback from "edit pages" (as if this is set, the old data is being set back ... yes, remember the JSF life-cycle
- added error message when no data has been changed (generic)
- added missing navigation rule
- added noisy debug lines

src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
web/WEB-INF/faces-config.xml
web/admin/contact/admin_contact_edit.xhtml
web/admin/fax/admin_fax_edit.xhtml
web/admin/landline/admin_landline_edit.xhtml
web/admin/mobile/admin_mobile_edit.xhtml
web/admin/user/admin_user_edit.xhtml

index 6525d92760b9a333035e27549b115d38e80f89cc..22ae9972442c640dadf3b496127523ef8066f909 100644 (file)
@@ -252,6 +252,9 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
 
        @Override
        public String editMobileData () {
+               // Log message
+               System.out.println(MessageFormat.format("{0}.editMobileData: CALLED!", this.getClass().getSimpleName())); //NOI18N
+
                // Is all data set
                if (this.beanHelper.getMobileNumber() == null) {
                        // Not set, throw NPE
@@ -293,8 +296,17 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
                        return ""; //NOI18N
                }
 
+               // Log message
+               System.out.println(MessageFormat.format("{0}.editMobileData: this.mobileProvider.providerId={1},this.beanHelper.mobileNumber.mobileProvider.providerId={2},this.phoneNumber={3},this.beanHelper.mobileNumber.phoneNumber={4}", this.getClass().getSimpleName(), this.getMobileProvider().getProviderId(), this.beanHelper.getMobileNumber().getMobileProvider().getProviderId(), this.getPhoneNumber(), this.beanHelper.getMobileNumber().getPhoneNumber())); //NOI18N
+
                // Is the mobile provider and number the same?
                if ((Objects.equals(this.getMobileProvider(), this.beanHelper.getMobileNumber().getMobileProvider())) && (Objects.equals(this.getPhoneNumber(), this.beanHelper.getMobileNumber().getPhoneNumber()))) {
+                       // Log message
+                       System.out.println(MessageFormat.format("{0}.editMobileData: No difference - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
+                       // Show message
+                       this.showFacesMessage("form_edit_mobile:mobileNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED"); //NOI18N
+
                        // No difference in both together, no need to edit
                        return ""; //NOI18N
                }
@@ -310,7 +322,7 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
                this.mobileNumberUpdatedEvent.fire(new AdminMobileNumberUpdatedEvent(updatedNumber));
 
                // All fine, redirect
-               return "admin_edit_mobile"; //NOI18N
+               return "admin_show_mobile"; //NOI18N
        }
 
        @Override
@@ -384,6 +396,7 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
 
        @Override
        public void setPhoneNumber (final Long phoneNumber) {
+               System.out.println(MessageFormat.format("{0}: Setting phoneNumber={1},previous:{2}", this.getClass().getSimpleName(), phoneNumber, this.phoneNumber));
                this.phoneNumber = phoneNumber;
        }
 
index 1daaa2ec1e7fe81a0d5ed121e9bc29754c755d6f..1baa1a4f0a08fa9921074b468dc0f64df9403b4c 100644 (file)
@@ -708,3 +708,4 @@ ERROR_ADMIN_NO_PHONE_AREA_CODE_ENTERED=Keine Ortsvorwahl eingegeben.
 ERROR_ADMIN_NO_PHONE_NUMBER_ENTERED=Keine Rufnummer eingegeben.
 ADMIN_PERSONAL_DATA_LAND_LINE_NUMBER=Festnetznummer:
 PAGE_TITLE_ADMIN_LIST_CONTACT_MOBILE_NUMBER=Mobilfunknummern auflisten
+ERROR_ADMIN_NO_CHANGE_ENTERED=Selben Daten wurden abgeschickt, keine \u00c4nderung durchfgef\u00fchrt.
index efc553eb1fb11dc9c55576c3b08387f8da22bd26..fbcc51bf0185ca2ea95bc63063db59a4b7d7c568 100644 (file)
@@ -708,3 +708,4 @@ ERROR_ADMIN_NO_PHONE_AREA_CODE_ENTERED=No city (area) dial prefix entered.
 ERROR_ADMIN_NO_PHONE_NUMBER_ENTERED=No call number entered.
 ADMIN_PERSONAL_DATA_LAND_LINE_NUMBER=Land-line number:
 PAGE_TITLE_ADMIN_LIST_CONTACT_MOBILE_NUMBER=List mobile numbers
+ERROR_ADMIN_NO_CHANGE_ENTERED=Same data has been sent, no change done.
index 200a86a2ac93d32067793b2e78cf9d738c22f007..71cf4042d6b1a5cd140946eadf33c29c9edcb916 100644 (file)
                        <to-view-id>/admin/landline/admin_landline_delete.xhtml</to-view-id>
                </navigation-case>
        </navigation-rule>
+       <navigation-rule>
+               <from-view-id>/admin/mobile/admin_mobile_delete.xhtml</from-view-id>
+               <navigation-case>
+                       <from-outcome>admin_show_mobile_provider</from-outcome>
+                       <to-view-id>/admin/mobile_provider/admin_mobile_provider_show.xhtml</to-view-id>
+               </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_list_mobile</from-outcome>
+                       <to-view-id>/admin/mobile/admin_mobile_list.xhtml</to-view-id>
+               </navigation-case>
+       </navigation-rule>
+       <navigation-rule>
+               <from-view-id>/admin/mobile/admin_mobile_edit.xhtml</from-view-id>
+               <navigation-case>
+                       <from-outcome>admin_show_mobile</from-outcome>
+                       <to-view-id>/admin/mobile/admin_mobile_show.xhtml</to-view-id>
+               </navigation-case>
+       </navigation-rule>
        <navigation-rule>
                <from-view-id>/admin/mobile/admin_mobile_list.xhtml</from-view-id>
                <navigation-case>
index c973a90c15fb0a1a456a1d0b94ed58ad93b6b292..ecb3d09da2af1a696426eaa5310c9ee8414ed9b0 100644 (file)
@@ -11,7 +11,7 @@
                <ui:define name="metadata">
                        <f:metadata>
                                <f:viewParam name="contactId" value="#{beanHelper.contact}" converter="ContactConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_CONTACT_ID_NOT_SET}" />
-                               <f:viewAction onPostback="true" action="#{beanHelper.copyContactToController()}" />
+                               <f:viewAction action="#{beanHelper.copyContactToController()}" />
                        </f:metadata>
                </ui:define>
 
index 20e186d60d58296e03cc65dd508ced2b6ef07368..920737e3ea1e29cbca654d51ff9dec05ce030027 100644 (file)
@@ -11,7 +11,7 @@
                <ui:define name="metadata">
                        <f:metadata>
                                <f:viewParam name="phoneId" value="#{beanHelper.faxNumber}" converter="FaxNumberConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
-                               <f:viewAction onPostback="true" action="#{beanHelper.copyFaxNumberToController()}" />
+                               <f:viewAction action="#{beanHelper.copyFaxNumberToController()}" />
                        </f:metadata>
                </ui:define>
 
index c29fca9a7477206c22c3e1f141584012f15d570c..fdde99c1f1c2ce5073db28cdb74d88e646fba735 100644 (file)
@@ -11,7 +11,7 @@
                <ui:define name="metadata">
                        <f:metadata>
                                <f:viewParam name="phoneId" value="#{beanHelper.landLineNumber}" converter="LandLineNumberConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
-                               <f:viewAction onPostback="true" action="#{beanHelper.copyLandLineNumberToController()}" />
+                               <f:viewAction action="#{beanHelper.copyLandLineNumberToController()}" />
                        </f:metadata>
                </ui:define>
 
index 09f436e475a41832f70c3027bce6cc6002d9d5f0..88aef070f7fc781f0805872bed6b89914582d213 100644 (file)
@@ -10,7 +10,7 @@
        <ui:define name="metadata">
                <f:metadata>
                        <f:viewParam name="phoneId" value="#{beanHelper.mobileNumber}" converter="MobileNumberConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
-                       <f:viewAction onPostback="true" action="#{beanHelper.copyMobileNumberToController()}" />
+                       <f:viewAction action="#{beanHelper.copyMobileNumberToController()}" />
                </f:metadata>
        </ui:define>
 
index be0d4472d73e65d3a0e2da490e59aad39953afba..083296fa3abf3eca1b3323b44276bfc425f5cb8e 100644 (file)
@@ -12,7 +12,7 @@
                <ui:define name="metadata">
                        <f:metadata>
                                <f:viewParam name="userId" value="#{beanHelper.user}" converter="UserConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_USER_ID_NOT_SET}" />
-                               <f:viewAction onPostback="true" action="#{beanHelper.copyUserToController()}" />
+                               <f:viewAction action="#{beanHelper.copyUserToController()}" />
                        </f:metadata>
                </ui:define>