comparison src/main/webapp/datasetFieldForEditFragment.xhtml @ 10:a50cf11e5178

Rewrite LGDataverse completely upgrading to dataverse4.0
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 08 Sep 2015 17:00:21 +0200
parents
children
comparison
equal deleted inserted replaced
9:5926d6419569 10:a50cf11e5178
1 <div
2 xmlns:h="http://java.sun.com/jsf/html"
3 xmlns:f="http://java.sun.com/jsf/core"
4 xmlns:ui="http://java.sun.com/jsf/facelets"
5 xmlns:c="http://java.sun.com/jsp/jstl/core"
6 xmlns:p="http://primefaces.org/ui"
7 xmlns:jsf="http://xmlns.jcp.org/jsf">
8
9 <!-- input text start -->
10 <span id="pre-input-#{dsf.datasetFieldType.name}" class="pre-input-tag"/>
11
12 <p:inputText value="#{dsfv.valueForEdit}" id="inputText" tabindex="#{block.index+1}"
13 styleClass="form-control #{dsfv.datasetField.datasetFieldType.name == 'title' and DatasetPage.editMode == 'CREATE' ? 'datasetfield-title' : ''}"
14 rendered="#{!dsfv.datasetField.datasetFieldType.controlledVocabulary
15 and (dsfv.datasetField.datasetFieldType.fieldType == 'TEXT'
16 or dsfv.datasetField.datasetFieldType.fieldType == 'INT'
17 or dsfv.datasetField.datasetFieldType.fieldType == 'FLOAT'
18 or dsfv.datasetField.datasetFieldType.fieldType == 'URL'
19 or dsfv.datasetField.datasetFieldType.fieldType == 'DATE'
20 or dsfv.datasetField.datasetFieldType.fieldType == 'EMAIL'
21 )}"/>
22
23 <p:watermark for="inputText" value="#{dsfv.datasetField.datasetFieldType.watermark}"></p:watermark>
24
25 <p:inputTextarea value="#{dsfv.valueForEdit}" id="description" tabindex="#{block.index+1}"
26 rows="5" cols="60" styleClass="form-control"
27 rendered="#{dsfv.datasetField.datasetFieldType.fieldType == 'TEXTBOX'}" />
28
29 <p:watermark for="description" value="#{dsfv.datasetField.datasetFieldType.watermark}"></p:watermark>
30
31 <div class="ui-message ui-message-error ui-widget ui-corner-all" aria-live="polite" jsf:rendered="#{dsfvIndex eq 0 and !empty dsfv.datasetField.validationMessage}">
32 <span class="ui-message-error-detail">#{dsfv.datasetField.validationMessage}</span>
33 </div>
34
35 <div class="ui-message ui-message-error ui-widget ui-corner-all" aria-live="polite" jsf:rendered="#{!empty dsfv.validationMessage}">
36 <span class="ui-message-error-detail">#{dsfv.validationMessage}</span>
37 </div>
38
39 <!-- This button / script is for replication data for the title field and is client side only -->
40 <ui:fragment rendered="#{dsfv.datasetField.datasetFieldType.name == 'title' and DatasetPage.editMode == 'CREATE' }">
41 <input type="button" id="replicationDataButton" tabindex="#{block.index+1}"
42 class="btn btn-default" value="Add &#34;Replication Data for&#34; to Title"
43 onclick="replicationFor();return false;"/>
44
45 <script type="text/javascript">
46 function replicationFor() {
47 $(".datasetfield-title")[0].value = "Replication Data for: " + $(".datasetfield-title")[0].value;
48 $('#replicationDataButton').prop('disabled', true);
49 }
50 </script>
51 </ui:fragment>
52 </div>