- 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
@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
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
}
this.mobileNumberUpdatedEvent.fire(new AdminMobileNumberUpdatedEvent(updatedNumber));
// All fine, redirect
- return "admin_edit_mobile"; //NOI18N
+ return "admin_show_mobile"; //NOI18N
}
@Override
@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;
}
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.
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.
<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>
<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>
<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>
<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>
<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>
<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>