summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-01-19 07:27:52 (EST)
committerCarsten Drossel2009-01-19 07:27:52 (EST)
commit8485a3342b6a7889ccb53ed7a5dcd543bc8790f0 (patch)
treea649ff347f793cde3443f38f6c8e796619b29f97
parentb15e7c327ce640caf46219dec143b1813eaddeaf (diff)
downloadorg.eclipse.riena-8485a3342b6a7889ccb53ed7a5dcd543bc8790f0.zip
org.eclipse.riena-8485a3342b6a7889ccb53ed7a5dcd543bc8790f0.tar.gz
org.eclipse.riena-8485a3342b6a7889ccb53ed7a5dcd543bc8790f0.tar.bz2
fixed bug: the personal data submodul always showed the name of the last opened customer, not the modules customer
-rw-r--r--org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerLoader.java34
-rw-r--r--org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerPersonalDataController.java8
-rw-r--r--org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerSearchController.java4
3 files changed, 7 insertions, 39 deletions
diff --git a/org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerLoader.java b/org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerLoader.java
deleted file mode 100644
index eed5d48..0000000
--- a/org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerLoader.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 compeople AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * compeople AG - initial API and implementation
- *******************************************************************************/
-package org.eclipse.riena.demo.client.customer.controllers;
-
-public class CustomerLoader {
-
- private static String firstName;
- private static String lastName;
-
- public static String getFirstName() {
- return firstName;
- }
-
- public static void setFirstName(String firstName) {
- CustomerLoader.firstName = firstName;
- }
-
- public static String getLastName() {
- return lastName;
- }
-
- public static void setLastName(String lastName) {
- CustomerLoader.lastName = lastName;
- }
-
-}
diff --git a/org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerPersonalDataController.java b/org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerPersonalDataController.java
index a6ad71b..fb8e792 100644
--- a/org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerPersonalDataController.java
+++ b/org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerPersonalDataController.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.riena.demo.client.customer.controllers;
+import org.eclipse.riena.demo.customer.common.CustomerRecordOverview;
+import org.eclipse.riena.navigation.NavigationArgument;
import org.eclipse.riena.navigation.ui.controllers.SubModuleController;
import org.eclipse.riena.ui.ridgets.ITextRidget;
@@ -18,11 +20,15 @@ import org.eclipse.riena.ui.ridgets.ITextRidget;
*/
public class CustomerPersonalDataController extends SubModuleController {
- private Customer customer = new Customer(CustomerLoader.getFirstName(), CustomerLoader.getLastName());
+ private Customer customer;
@Override
public void configureRidgets() {
+ CustomerRecordOverview customerRecord = (CustomerRecordOverview) getNavigationNode().getContext(
+ NavigationArgument.CONTEXT_KEY_PARAMETER);
+ customer = new Customer(customerRecord.getFirstName(), customerRecord.getLastName());
+
((ITextRidget) getRidget("firstname")).bindToModel(customer, "firstName"); //$NON-NLS-1$ //$NON-NLS-2$
((ITextRidget) getRidget("lastname")).bindToModel(customer, "lastName"); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerSearchController.java b/org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerSearchController.java
index 0a0a0ee..0be0ff3 100644
--- a/org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerSearchController.java
+++ b/org.eclipse.riena.demo.client/src/org/eclipse/riena/demo/client/customer/controllers/CustomerSearchController.java
@@ -77,10 +77,6 @@ public class CustomerSearchController extends SubModuleController {
public void callback() {
int selectionIndex = kunden.getSelectionIndex();
if (selectionIndex >= 0) {
- CustomerLoader.setFirstName(searchResultContainer.getCustomerList().get(selectionIndex)
- .getFirstName());
- CustomerLoader.setLastName(searchResultContainer.getCustomerList().get(selectionIndex)
- .getLastName());
getNavigationNode()
.navigate(
new NavigationNodeId(