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 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
public Element toXml(Document doc) {
Element root = super.toXml(doc);
@ -47,8 +61,11 @@ public class AutoCompleteData extends ComboBoxData<AutoCompleteData>{
if(data!=null){
this.url = (String)((Map<String,Object>)data).get("url");
Map<String,String> options = ((Map<String,Map<String,String>>)data).get("option");
this.autoCompleteOptions.setLabel(options.get("label"));
this.autoCompleteOptions.setValue(options.get("value"));
if(options!=null){
this.autoCompleteOptions.setLabel(options.get("label"));
this.autoCompleteOptions.setValue(options.get("value"));
}
}
return this;

View File

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

View File

@ -24,4 +24,8 @@ ng-sidebar-container {
/* .ng-sidebar__content {
overflow: inherit !important;
} */
} */
.alignment-center{
text-align: center;
}

View File

@ -11,7 +11,9 @@
<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>
<div class="ui-g-12">
<ngb-pagination *ngIf="pages" [collectionSize]="pages.length*10" [page]="currentPageIndex" (pageChange)="changePageIndex($event)" aria-label="Default pagination"></ngb-pagination>
<div class="alignment-center">
<ngb-pagination *ngIf="pages" [collectionSize]="pages.length*10" [page]="currentPageIndex" (pageChange)="changePageIndex($event)" aria-label="Default pagination"></ngb-pagination>
</div>
</div>
<div class="ui-g-12">
<progress-bar *ngIf="form" [formGroup]="form"></progress-bar>