Skip to content
Snippets Groups Projects
Commit 89653adb authored by alec.schmidt's avatar alec.schmidt
Browse files

search now works as intended

parent 59746149
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -175,6 +175,7 @@ public class FXMLController { ...@@ -175,6 +175,7 @@ public class FXMLController {
@FXML @FXML
protected void searchAction() { protected void searchAction() {
ContactController searchResult = contacts.search(searchBox.getText()); ContactController searchResult = contacts.search(searchBox.getText());
searchResult.printContacts();
tView.getItems().setAll(searchResult.getList()); tView.getItems().setAll(searchResult.getList());
} }
......
...@@ -28,8 +28,6 @@ public class Famille extends Contact { ...@@ -28,8 +28,6 @@ public class Famille extends Contact {
return true; return true;
if (this.getSocials().contains(s)) if (this.getSocials().contains(s))
return true; return true;
if (s.contains(this.getRelation()))
return true;
return false; return false;
} }
} }
...@@ -181,8 +181,8 @@ public class ContactController implements java.io.Serializable{ ...@@ -181,8 +181,8 @@ public class ContactController implements java.io.Serializable{
public ContactController search(String s) public ContactController search(String s)
{ {
ContactController result = new ContactController(); ContactController result = new ContactController();
for (Contact contact : this.contacts) { for (Contact contact : this.contacts) {
System.out.println(contact.getClass().toString());
if (contact instanceof Professionel) if (contact instanceof Professionel)
{ {
Professionel p = (Professionel)contact; Professionel p = (Professionel)contact;
...@@ -202,7 +202,7 @@ public class ContactController implements java.io.Serializable{ ...@@ -202,7 +202,7 @@ public class ContactController implements java.io.Serializable{
result.append(contact); result.append(contact);
} }
} }
result.printContacts();
return result; return result;
} }
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<TextField fx:id="socialBox" layoutX="185.0" layoutY="521.0" /> <TextField fx:id="socialBox" layoutX="185.0" layoutY="521.0" />
<Button layoutX="698.0" layoutY="521.0" mnemonicParsing="false" onAction="#doneEditing" text="Add" /> <Button layoutX="698.0" layoutY="521.0" mnemonicParsing="false" onAction="#doneEditing" text="Add" />
<Button fx:id="btnSave" layoutX="1086.0" layoutY="2.0" mnemonicParsing="false" onAction="#saveLocally" text="Save" /> <Button fx:id="btnSave" layoutX="1086.0" layoutY="2.0" mnemonicParsing="false" onAction="#saveLocally" text="Save" />
<TextField layoutX="11.0" layoutY="2.0" promptText="Type here to search" /> <TextField fx:id="searchBox" layoutX="11.0" layoutY="2.0" promptText="Type here to search" />
<Button layoutX="191.0" layoutY="2.0" mnemonicParsing="false" onAction="#searchAction" text="Search" /> <Button layoutX="191.0" layoutY="2.0" mnemonicParsing="false" onAction="#searchAction" text="Search" />
<Button fx:id="btnLoad" layoutX="1021.0" layoutY="2.0" mnemonicParsing="false" onAction="#loadLocalSave" text="Load" /> <Button fx:id="btnLoad" layoutX="1021.0" layoutY="2.0" mnemonicParsing="false" onAction="#loadLocalSave" text="Load" />
<ComboBox fx:id="cBoxType" layoutX="698.0" layoutY="463.0" onAction="#selectType" prefWidth="150.0" /> <ComboBox fx:id="cBoxType" layoutX="698.0" layoutY="463.0" onAction="#selectType" prefWidth="150.0" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment