no message

This commit is contained in:
annabakouli 2017-12-13 14:55:12 +02:00
parent 6c2c0a8700
commit 621b72bd9c
4 changed files with 53 additions and 7 deletions

View File

@ -15,6 +15,20 @@ public class AutoCompleteData extends ComboBoxData<AutoCompleteData>{
private String url; private String url;
private Option autoCompleteOptions; private Option autoCompleteOptions;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Option getAutoCompleteOptions() {
return autoCompleteOptions;
}
public void setAutoCompleteOptions(Option autoCompleteOptions) {
this.autoCompleteOptions = autoCompleteOptions;
}
@Override @Override
public Element toXml(Document doc) { public Element toXml(Document doc) {
Element root = super.toXml(doc); Element root = super.toXml(doc);
@ -47,10 +61,13 @@ public class AutoCompleteData extends ComboBoxData<AutoCompleteData>{
if(data!=null){ if(data!=null){
this.url = (String)((Map<String,Object>)data).get("url"); this.url = (String)((Map<String,Object>)data).get("url");
Map<String,String> options = ((Map<String,Map<String,String>>)data).get("option"); Map<String,String> options = ((Map<String,Map<String,String>>)data).get("option");
if(options!=null){
this.autoCompleteOptions.setLabel(options.get("label")); this.autoCompleteOptions.setLabel(options.get("label"));
this.autoCompleteOptions.setValue(options.get("value")); this.autoCompleteOptions.setValue(options.get("value"));
} }
}
return this; return this;
} }
@Override @Override

View File

@ -2,6 +2,7 @@ package utilities.builders;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@ -69,10 +70,32 @@ public class ModelBuilder {
public <U extends FieldData<U>> U toFieldData(Object data,String type,Element dataElement){ public <U extends FieldData<U>> U toFieldData(Object data,String type,Element dataElement){
if(type.equals("combobox")){ if(type.equals("combobox")){
if(dataElement!=null){
if(dataElement.getAttribute("type").equals("autocomplete")){ if(dataElement.getAttribute("type").equals("autocomplete")){
return (U) new AutoCompleteData().fromData(data); return (U) new AutoCompleteData().fromData(data);
}else if(dataElement.getAttribute("type").equals("wordlist")) }else if(dataElement.getAttribute("type").equals("wordlist"))
return (U) new WordListData().fromData(data); return (U) new WordListData().fromData(data);
}else{
if(((ComboBoxData)data).getType().equals("autocomplete")){
return (U) new AutoCompleteData().fromData(data);
}else if(((ComboBoxData)data).getType().equals("wordlist"))
return (U) new WordListData().fromData(data);
}
}
if(type.equals("booleanDecision"))return null;
if(type.equals("radiobox"))return (U) new RadioBoxData().fromData(data);
if(type.equals("checkBox"))return (U) new CheckBoxData().fromData(data);
if(type.equals("freetext"))return null;
return null;
}
public <U extends FieldData<U>> U toFieldData(Object data,String type){
if(type.equals("combobox")){
String comboboxType = (String)((Map<String,Object>)data).get("type");
if(comboboxType.equals("autocomplete")){
return (U) new AutoCompleteData().fromData(data);
}else if(comboboxType.equals("wordlist"))
return (U) new WordListData().fromData(data);
} }
if(type.equals("booleanDecision"))return null; if(type.equals("booleanDecision"))return null;
if(type.equals("radiobox"))return (U) new RadioBoxData().fromData(data); if(type.equals("radiobox"))return (U) new RadioBoxData().fromData(data);

View File

@ -25,3 +25,7 @@ ng-sidebar-container {
/* .ng-sidebar__content { /* .ng-sidebar__content {
overflow: inherit !important; overflow: inherit !important;
} */ } */
.alignment-center{
text-align: center;
}

View File

@ -11,8 +11,10 @@
<button type="button" *ngIf="dataModel&&dataModel?.status != 1" style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" <button type="button" *ngIf="dataModel&&dataModel?.status != 1" style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;"
class="btn btn-primary" (click)="submit();">Save and Finalize</button> class="btn btn-primary" (click)="submit();">Save and Finalize</button>
<div class="ui-g-12"> <div class="ui-g-12">
<div class="alignment-center">
<ngb-pagination *ngIf="pages" [collectionSize]="pages.length*10" [page]="currentPageIndex" (pageChange)="changePageIndex($event)" aria-label="Default pagination"></ngb-pagination> <ngb-pagination *ngIf="pages" [collectionSize]="pages.length*10" [page]="currentPageIndex" (pageChange)="changePageIndex($event)" aria-label="Default pagination"></ngb-pagination>
</div> </div>
</div>
<div class="ui-g-12"> <div class="ui-g-12">
<progress-bar *ngIf="form" [formGroup]="form"></progress-bar> <progress-bar *ngIf="form" [formGroup]="form"></progress-bar>
</div> </div>