Commit bce18cc5 by Kim Gyeongeun

#56952 設問設定機能追加(初期化されない問題修正)

parent b697f54d
...@@ -263,6 +263,15 @@ public class EnqueteAction extends AbstractAction { ...@@ -263,6 +263,15 @@ public class EnqueteAction extends AbstractAction {
return getHtmlPath(enqueteForm.template,confirmPage); return getHtmlPath(enqueteForm.template,confirmPage);
} }
/**
* 戻るボタン
* @throws SystemException
*/
@Execute(validator = false)
public String reInput() throws SystemException {
return getHtmlPath(enqueteForm.template,indexPage);
}
public EnqueteSumBatchAction enqueteSumBatchAction; public EnqueteSumBatchAction enqueteSumBatchAction;
/** /**
* アンケート回答確認画面でアンケート回答を押下した場合の処理 * アンケート回答確認画面でアンケート回答を押下した場合の処理
...@@ -419,6 +428,9 @@ public class EnqueteAction extends AbstractAction { ...@@ -419,6 +428,9 @@ public class EnqueteAction extends AbstractAction {
Integer orgniz = SinaburoConstant.EnqueteType.ORGANIZATION_CONTRIBUTE; Integer orgniz = SinaburoConstant.EnqueteType.ORGANIZATION_CONTRIBUTE;
valueReplace(enqueteForm); valueReplace(enqueteForm);
//条件付必須チェック(初期画面表示・非表示セット)
questionService.setQuestionDisable(enqueteForm.questionList);
//回答数を求め、必須チェックを行う。 //回答数を求め、必須チェックを行う。
for(Question question : enqueteForm.questionList){ for(Question question : enqueteForm.questionList){
question.answerCount = valueCount(question); question.answerCount = valueCount(question);
...@@ -689,9 +701,6 @@ public class EnqueteAction extends AbstractAction { ...@@ -689,9 +701,6 @@ public class EnqueteAction extends AbstractAction {
Answer answer = question.answerList.get(i); Answer answer = question.answerList.get(i);
answerIdValue = StringUtil.isNotBlank(answer.answerIdValue) ? answer.answerIdValue :answerIdValue; answerIdValue = StringUtil.isNotBlank(answer.answerIdValue) ? answer.answerIdValue :answerIdValue;
if(StringUtil.equals(answerIdValue, answer.answerId.toString()) ){ if(StringUtil.equals(answerIdValue, answer.answerId.toString()) ){
answer.answerIdValue = answerIdValue; answer.answerIdValue = answerIdValue;
}else{ }else{
......
...@@ -14,8 +14,6 @@ import javax.persistence.Transient; ...@@ -14,8 +14,6 @@ import javax.persistence.Transient;
import org.apache.commons.lang.builder.StandardToStringStyle; import org.apache.commons.lang.builder.StandardToStringStyle;
import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringBuilder;
import jp.agentec.sinaburocast.common.SinaburoConstant;
@Entity @Entity
@Table(name="m_answer") @Table(name="m_answer")
public class Answer extends AbstractEntity { public class Answer extends AbstractEntity {
...@@ -57,9 +55,6 @@ public class Answer extends AbstractEntity { ...@@ -57,9 +55,6 @@ public class Answer extends AbstractEntity {
@Column(name = "default_flg") @Column(name = "default_flg")
public int defaultFlg; public int defaultFlg;
@Transient
public short answerInitDisable = SinaburoConstant.initDisable.NO;
/** MEnquete関連プロパティ */ /** MEnquete関連プロパティ */
@ManyToOne @ManyToOne
@JoinColumn(name = "enquete_id", referencedColumnName = "enquete_id") @JoinColumn(name = "enquete_id", referencedColumnName = "enquete_id")
......
...@@ -11,6 +11,7 @@ import org.seasar.extension.jdbc.where.SimpleWhere; ...@@ -11,6 +11,7 @@ import org.seasar.extension.jdbc.where.SimpleWhere;
import org.seasar.framework.container.annotation.tiger.Component; import org.seasar.framework.container.annotation.tiger.Component;
import org.seasar.framework.container.annotation.tiger.InstanceType; import org.seasar.framework.container.annotation.tiger.InstanceType;
import org.seasar.framework.util.IntegerConversionUtil; import org.seasar.framework.util.IntegerConversionUtil;
import org.seasar.framework.util.StringUtil;
import jp.agentec.sinaburocast.common.SinaburoConstant; import jp.agentec.sinaburocast.common.SinaburoConstant;
import jp.agentec.sinaburocast.entity.AdminUser; import jp.agentec.sinaburocast.entity.AdminUser;
...@@ -301,25 +302,20 @@ public class QuestionService extends AbstractService<Question> { ...@@ -301,25 +302,20 @@ public class QuestionService extends AbstractService<Question> {
//初期表示情報セット //初期表示情報セット
for (Question question : questionList) { for (Question question : questionList) {
for (Answer answer : question.answerList) { for (Answer answer : question.answerList) {
if (question.condRequiredQuestionNo != null && question.condRequiredQuestionNo == 0 if (question.condRequiredQuestionNo != null && question.condRequiredQuestionNo == 0 && requiredQuestionInfo.get(answer.answerId) == null) {
&& answer.defaultFlg == 1 && requiredQuestionInfo.get(answer.answerId) == null) { if (answer.defaultFlg == 0 && StringUtil.isBlank(answer.answerIdValue)) {continue;}
requiredQuestionInfo.put(answer.answerId, answer.defaultFlg); requiredQuestionInfo.put(answer.answerId, 1);
} }
} }
} }
for (Question question : questionList) { for (Question question : questionList) {
//条件付必須チェック(初期画面表示・非表示セット) //条件付必須チェック(初期画面表示・非表示セット)
for (Answer answer : question.answerList) {
if (question.condRequiredQuestionNo != null && question.condRequiredQuestionNo != 0 if (question.condRequiredQuestionNo != null && question.condRequiredQuestionNo != 0
&& StringUtils.isNotBlank(question.condRequiredAnswer)) { && StringUtils.isNotBlank(question.condRequiredAnswer)) {
List<String> requiredAnswerIdList = new ArrayList<String>(Arrays.asList(question.condRequiredAnswer.split(","))); List<String> requiredAnswerIdList = new ArrayList<String>(Arrays.asList(question.condRequiredAnswer.split(",")));
for (String requiredAnswerId : requiredAnswerIdList) { for (String requiredAnswerId : requiredAnswerIdList) {
if (requiredQuestionInfo.get(IntegerConversionUtil.toInteger(requiredAnswerId)) == null) { question.questionInitDisable = (requiredQuestionInfo.get(IntegerConversionUtil.toInteger(requiredAnswerId)) == null) ?
question.questionInitDisable = SinaburoConstant.initDisable.YES; SinaburoConstant.initDisable.YES : SinaburoConstant.initDisable.NO;
answer.answerInitDisable = SinaburoConstant.initDisable.YES;
break;
}
}
} }
} }
} }
......
...@@ -68,7 +68,7 @@ $tools.getMsg("errorheader") ...@@ -68,7 +68,7 @@ $tools.getMsg("errorheader")
#if($!question.controlId == "0") #if($!question.controlId == "0")
<input type="radio" class="#he($!question.questionId)" id="#he($!answer.answerId)" name="$!answerIdValueRadioName" value="$!escape.html($!velocityCount)" #if($!answer.answerIdValue == $velocityCount.toString() && $enqueteForm.initCount =="2") checked #{end} <input type="radio" class="#he($!question.questionId)" id="#he($!answer.answerId)" name="$!answerIdValueRadioName" value="$!escape.html($!velocityCount)" #if($!answer.answerIdValue == $velocityCount.toString() && $enqueteForm.initCount =="2") checked #{end}
#if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end #if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end
#if($!answer.answerInitDisable == "1") disabled #end />$!answer.answer #if($!question.questionInitDisable == "1") disabled #end />$!answer.answer
##end ##end
##<!-- 自由入力欄。freeTextFlg=1(あり)、2(必須) --> ##<!-- 自由入力欄。freeTextFlg=1(あり)、2(必須) -->
...@@ -80,7 +80,7 @@ $tools.getMsg("errorheader") ...@@ -80,7 +80,7 @@ $tools.getMsg("errorheader")
##if($!answer.freeTextFlg != "1" && $!answer.freeTextFlg != "2") ##if($!answer.freeTextFlg != "1" && $!answer.freeTextFlg != "2")
<input type="checkbox" class="#he($!question.questionId)" id="#he($!answer.answerId)" name="$answerIdValueName" value="$!escape.html($!answer.answerNo)" #if($answer.answerIdValue != "" && $enqueteForm.initCount =="2") checked #end <input type="checkbox" class="#he($!question.questionId)" id="#he($!answer.answerId)" name="$answerIdValueName" value="$!escape.html($!answer.answerNo)" #if($answer.answerIdValue != "" && $enqueteForm.initCount =="2") checked #end
#if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end #if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end
#if($!answer.answerInitDisable == "1") disabled #end #if($!question.questionInitDisable == "1") disabled #end
/>$!answer.answer />$!answer.answer
##end ##end
......
...@@ -44,7 +44,7 @@ $tools.getMsg("errorheader") ...@@ -44,7 +44,7 @@ $tools.getMsg("errorheader")
#if($!question.controlId == "2") #if($!question.controlId == "2")
<td width="$tdWidthPercent%" valign = "top" > <td width="$tdWidthPercent%" valign = "top" >
#set($answerIdValueName = "questionList[$questionIndex].answerList[0].answerIdValue") #set($answerIdValueName = "questionList[$questionIndex].answerList[0].answerIdValue")
<select name="$answerIdValueName" class="#he($!question.questionId),#he($!answer.answerId)" #if($!question.questionInitDisable == "1") disabled #end> <select name="$answerIdValueName" class="#he($!question.questionId) #he($!answer.answerId)" #if($!question.questionInitDisable == "1") disabled #end>
#foreach($selectAnswer in $question.answerList) #foreach($selectAnswer in $question.answerList)
<option value="$!selectAnswer.answerId" #if($enqueteForm.initCount =="2" && $!selectAnswer.answerId == $!selectAnswer.answerIdValue) selected #elseif($!selectAnswer.defaultFlg == "1" && $enqueteForm.initCount!="2") selected #end >$!escape.html($!selectAnswer.answer)</option> <option value="$!selectAnswer.answerId" #if($enqueteForm.initCount =="2" && $!selectAnswer.answerId == $!selectAnswer.answerIdValue) selected #elseif($!selectAnswer.defaultFlg == "1" && $enqueteForm.initCount!="2") selected #end >$!escape.html($!selectAnswer.answer)</option>
#end #end
...@@ -80,14 +80,14 @@ $tools.getMsg("errorheader") ...@@ -80,14 +80,14 @@ $tools.getMsg("errorheader")
<input type="radio" class="#he($!question.questionId) #he($!answer.answerId)" name="$!answerIdValueRadioName" id=$answerId value="$velocityCount" <input type="radio" class="#he($!question.questionId) #he($!answer.answerId)" name="$!answerIdValueRadioName" id=$answerId value="$velocityCount"
#if($!answer.answerIdValue == $velocityCount.toString() && $enqueteForm.initCount =="2") checked #{end} #if($!answer.answerIdValue == $velocityCount.toString() && $enqueteForm.initCount =="2") checked #{end}
#if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end #if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end
#if($!answer.answerInitDisable == "1") disabled #end> #if($!question.questionInitDisable == "1") disabled #end>
<label for=$answerId>$!answer.answer</label> <label for=$answerId>$!answer.answer</label>
</div> </div>
##<!-- 自由入力欄。freeTextFlg=1(あり)、2(必須) --> ##<!-- 自由入力欄。freeTextFlg=1(あり)、2(必須) -->
#if($!answer.freeTextFlg == 1 || $!answer.freeTextFlg == 2) #if($!answer.freeTextFlg == 1 || $!answer.freeTextFlg == 2)
<div data-role="fieldcontain"> <div data-role="fieldcontain">
<input type="text" class="#he($!answer.answerId)" id="$answerValue" name="$answerValue" size="$!answer.freeTextColWidth" value="$!escape.html($!answer.answerValue)" /> <input type="text" class="#he($!question.questionId) #he($!answer.answerId)" id="$answerValue" name="$answerValue" size="$!answer.freeTextColWidth" value="$!escape.html($!answer.answerValue)" />
<label for=$answerValue class="ui-hidden-accessible"></label> <label for=$answerValue class="ui-hidden-accessible"></label>
</div> </div>
#end #end
...@@ -99,14 +99,14 @@ $tools.getMsg("errorheader") ...@@ -99,14 +99,14 @@ $tools.getMsg("errorheader")
<div data-role="fieldcontain"> <div data-role="fieldcontain">
<input type="checkbox" class="#he($!question.questionId) #he($!answer.answerId)" id=$answerId name="$answerIdValueName" value="$!escape.html($!answer.answerNo)" #if($answer.answerIdValue != "" && $enqueteForm.initCount =="2") checked #end <input type="checkbox" class="#he($!question.questionId) #he($!answer.answerId)" id=$answerId name="$answerIdValueName" value="$!escape.html($!answer.answerNo)" #if($answer.answerIdValue != "" && $enqueteForm.initCount =="2") checked #end
#if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end #if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end
#if($!answer.answerInitDisable == "1") disabled #end> #if($!question.questionInitDisable == "1") disabled #end>
<label for=$answerId id="#he($!answer.answerId)">$!answer.answer</label> <label for=$answerId id="#he($!answer.answerId)">$!answer.answer</label>
</div> </div>
##<!-- 自由入力欄。freeTextFlg=1(あり)、2(必須) --> ##<!-- 自由入力欄。freeTextFlg=1(あり)、2(必須) -->
#if($!answer.freeTextFlg == 1 || $!answer.freeTextFlg == 2) #if($!answer.freeTextFlg == 1 || $!answer.freeTextFlg == 2)
<div data-role="fieldcontain"> <div data-role="fieldcontain">
<input type="text" class="#he($!answer.answerId)" id="$answerValue" name="$answerValue" size="$!answer.freeTextColWidth" value="$!escape.html($!answer.answerValue)" #if($!question.questionInitDisable == "1") disabled #end/> <input type="text" class="#he($!question.questionId) #he($!answer.answerId)" id="$answerValue" name="$answerValue" size="$!answer.freeTextColWidth" value="$!escape.html($!answer.answerValue)" #if($!question.questionInitDisable == "1") disabled #end/>
<label for=$answerValue class="ui-hidden-accessible"></label> <label for=$answerValue class="ui-hidden-accessible"></label>
</div> </div>
#end #end
...@@ -116,7 +116,7 @@ $tools.getMsg("errorheader") ...@@ -116,7 +116,7 @@ $tools.getMsg("errorheader")
#if($velocityCount == 0) #if($velocityCount == 0)
<div data-role="fieldcontain"> <div data-role="fieldcontain">
<select name="$answerIdValueName" class="#he($!question.questionId),#he($!answer.answerId)" #if($!question.questionInitDisable == "1") disabled #end> <select name="$answerIdValueName" class="#he($!question.questionId) #he($!answer.answerId)" #if($!question.questionInitDisable == "1") disabled #end>
#foreach($selectAnswer in $question.answerList) #foreach($selectAnswer in $question.answerList)
<option value="$!selectAnswer.answerId" #if($!selectAnswer.defaultFlg == "1") selected #end >$!selectAnswer.answer</option> <option value="$!selectAnswer.answerId" #if($!selectAnswer.defaultFlg == "1") selected #end >$!selectAnswer.answer</option>
#end #end
...@@ -127,24 +127,24 @@ $tools.getMsg("errorheader") ...@@ -127,24 +127,24 @@ $tools.getMsg("errorheader")
##<!-- 3:TEXTAREA ユーザー入力値を値にする。--> ##<!-- 3:TEXTAREA ユーザー入力値を値にする。-->
#elseif($!question.controlId == "3") #elseif($!question.controlId == "3")
<div data-role="fieldcontain"> <div data-role="fieldcontain">
<textArea type="text" class="#he($!question.questionId)" name="$answerIdValueName" cols="$!question.dispWitdth" rows="$!question.rowCount">$!answer.answerIdValue</textarea> <textArea type="text" class="#he($!question.questionId) #he($!answer.answerId)" name="$answerIdValueName" cols="$!question.dispWitdth" rows="$!question.rowCount" #if($!question.questionInitDisable == "1") disabled #end>$!answer.answerIdValue</textarea>
</div> </div>
##<!-- 4:TEXTFIELD ユーザー入力値を値にする。--> ##<!-- 4:TEXTFIELD ユーザー入力値を値にする。-->
#elseif($!question.controlId == "4") #elseif($!question.controlId == "4")
<div data-role="fieldcontain"> <div data-role="fieldcontain">
<input type="text" class="#he($!question.questionId)" id="$answerIdValueName" name="$answerIdValueName" value="$!escape.html($!answer.answerIdValue)" size="$!question.dispWitdth" #if($!question.questionInitDisable == "1") disabled #end/> <input type="text" class="#he($!question.questionId) #he($!answer.answerId)" id="$answerIdValueName" name="$answerIdValueName" value="$!escape.html($!answer.answerIdValue)" size="$!question.dispWitdth" #if($!question.questionInitDisable == "1") disabled #end/>
<label for=$answerIdValueName class="ui-hidden-accessible"></label> <label for=$answerIdValueName class="ui-hidden-accessible"></label>
</div> </div>
##<!-- 5:日付入力 ユーザー入力値を値にする。--> ##<!-- 5:日付入力 ユーザー入力値を値にする。-->
#elseif($!question.controlId == "5") #elseif($!question.controlId == "5")
<div data-role="fieldcontain"> <div data-role="fieldcontain">
<input type="date" class="#he($!question.questionId)" id="$answerIdName" name="$answerValue" value="$!escape.html($!answer.answerValue)" #if($!question.questionInitDisable == "1") disabled #end/> <input type="date" class="#he($!question.questionId) #he($!answer.answerId)" id="$answerIdName" name="$answerValue" value="$!escape.html($!answer.answerValue)" #if($!question.questionInitDisable == "1") disabled #end/>
<label for=$answerIdName class="ui-hidden-accessible"></label> <label for=$answerIdName class="ui-hidden-accessible"></label>
<input type="hidden" name="$answerIdValueName" value="$!answer.answerId" /> <input type="hidden" name="$answerIdValueName" value="$!answer.answerId" />
</div> </div>
#elseif($!question.controlId == "6") #elseif($!question.controlId == "6")
<div data-role="fieldcontain"> <div data-role="fieldcontain">
<select name="$answerIdValueName" class="#he($!question.questionId),#he($!answer.answerId)" #if($!question.questionInitDisable == "1") disabled #end> <select name="$answerIdValueName" class="#he($!question.questionId) #he($!answer.answerId)" #if($!question.questionInitDisable == "1") disabled #end>
<option value="" >下記より選択してください</option> <option value="" >下記より選択してください</option>
#foreach($pecent1 in $enqueteForm.organizationListFor1Percent) #foreach($pecent1 in $enqueteForm.organizationListFor1Percent)
<option value="$!pecent1.organizationId" #if($!answer.answerIdValue == $!pecent1.organizationId) selected #end>$!{pecent1.organizationNo} : $!escape.html($!{pecent1.organizationName})</option> <option value="$!pecent1.organizationId" #if($!answer.answerIdValue == $!pecent1.organizationId) selected #end>$!{pecent1.organizationNo} : $!escape.html($!{pecent1.organizationName})</option>
......
...@@ -15,7 +15,7 @@ $(function() { ...@@ -15,7 +15,7 @@ $(function() {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") { if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("checked", false); $("#${answer.answerId}").attr("checked", false);
$("#${answer.answerId}").attr("disabled", true); $("#${answer.answerId}").attr("disabled", true);
} else if ("${question.controlId}" == "2" || "${question.controlId}" == "3" || "${question.controlId}" == "4") { } else if ("${question.controlId}" == "2" || "${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").val(""); $("#${question.questionId}").val("");
$("#${question.questionId}").attr("disabled", true); $("#${question.questionId}").attr("disabled", true);
} else if ("${question.controlId}" == "5") { } else if ("${question.controlId}" == "5") {
...@@ -26,7 +26,7 @@ $(function() { ...@@ -26,7 +26,7 @@ $(function() {
} else { } else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") { if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("disabled", false); $("#${answer.answerId}").attr("disabled", false);
} else if ("${question.controlId}" == "2" || "${question.controlId}" == "3" || "${question.controlId}" == "4") { } else if ("${question.controlId}" == "2" || "${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").attr("disabled", false); $("#${question.questionId}").attr("disabled", false);
} else if ("${question.controlId}" == "5") { } else if ("${question.controlId}" == "5") {
$(".${question.questionId}").attr("disabled", false); $(".${question.questionId}").attr("disabled", false);
......
#set($title = "アンケート") #set($title = "アンケート")
<!-- preHeader --> <!-- preHeader -->
#parse( "/WEB-INF/view/common/preHeader_mb.vm" ) #parse( "/WEB-INF/view/common/preHeader_mb.vm" )
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
function reInput() {
location.href = "/em/user/enquete/reInput/";
}
//-->
</script>
<body style="font-family: monospace; width: 240px; border: 2px solid black;"> <body style="font-family: monospace; width: 240px; border: 2px solid black;">
<!--ヘッダー--> <!--ヘッダー-->
#parse( "/WEB-INF/view/common/header_mb.vm" ) #parse( "/WEB-INF/view/common/header_mb.vm" )
...@@ -37,7 +44,7 @@ ...@@ -37,7 +44,7 @@
<br> <br>
<!-- ※回答内容を修正する場合は、ブラウザの戻る機能で前画面へお戻りください。--> <!-- ※回答内容を修正する場合は、ブラウザの戻る機能で前画面へお戻りください。-->
<br> <br>
<input type="button" value="戻る" onclick="history.back();" /> <input type="button" value="戻る" onclick="reInput();return false;" />
<br> <br>
<hr> <hr>
<br> <br>
......
#set($title = "アンケート回答") #set($title = "アンケート回答")
<script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script> <script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script>
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
window.onload = function () {
$("input[type=text], input[type=date], textArea[type=text]").each(function(){
if ($(this).prop("disabled")) {
$(this).val("");
$(this).textinput().textinput("disable");
if ($(this).prop("type") == "date") {
$(this).next().hide();
}
}
});
}
// -->
</script>
#foreach($question in $!enqueteForm.questionList) #foreach($question in $!enqueteForm.questionList)
#foreach($answer in $question.answerList) #foreach($answer in $question.answerList)
<script language="javascript" type="text/javascript" charset="utf-8"> <script language="javascript" type="text/javascript" charset="utf-8">
...@@ -16,34 +31,36 @@ $(function() { ...@@ -16,34 +31,36 @@ $(function() {
if ("${question.condRequiredAnswer}".split(",").indexOf(thisAnswerId) < 0) { if ("${question.condRequiredAnswer}".split(",").indexOf(thisAnswerId) < 0) {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") { if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
key = "${answer.answerId}"; key = "${answer.answerId}";
var controlName = ("${question.controlId}" == "0")? "radio" : "checkbox"; $("." + key).prop("checked", false);
$("." + key).checkboxradio('refresh').checkboxradio('disable');
document.getElementById(key).classList.remove("ui-"+controlName+"-on"); } else if ("${question.controlId}" == "2" || ${question.controlId} == "6") {
document.getElementById(key).classList.add("ui-"+controlName+"-off"); key = "${question.questionId}";
$("#" + key).children().children("span:eq(1)").removeClass("ui-icon-"+controlName+"-on"); $("." + key).val("");
$("#" + key).children().children("span:eq(1)").addClass("ui-icon-"+controlName+"-off"); $("." + key).selectmenu("refresh").selectmenu("disable");
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
$("#" + key).closest("span.ui-icon").removeClass("ui-checkbox-on"); key = "${question.questionId}";
$("#" + key).closest("span.ui-icon").addClass("ui-checkbox-off"); $("." + key).val("");
$("." + key).attr("checked", false); $("." + key).textinput("disable");
$("." + key).attr("disabled", true);
} else if ("${question.controlId}" == "2" || "${question.controlId}" == "3" || "${question.controlId}" == "4") {
$("#${question.questionId}").val("");
$("#${question.questionId}").attr("disabled", true);
} else if ("${question.controlId}" == "5") { } else if ("${question.controlId}" == "5") {
$(".${question.questionId}").val(""); key = "${question.questionId}";
$(".${question.questionId}").attr("disabled", true); $("." + key).val("");
$(".${question.questionId}").next().hide(); $("." + key).textinput("disable");
$("." + key).next().hide();
} }
} else { } else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") { if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
key = "${answer.answerId}"; key = "${answer.answerId}";
$("." + key).prop("disabled", false); $("." + key).checkboxradio('enable');
} else if ("${question.controlId}" == "2" || "${question.controlId}" == "3" || "${question.controlId}" == "4") { } else if ("${question.controlId}" == "2" || "${question.controlId}" == "6") {
$("#${question.questionId}").attr("disabled", false); key = "${question.questionId}";
$("." + key).selectmenu("enable");
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
key = "${question.questionId}";
$("." + key).textinput("enable");
} else if ("${question.controlId}" == "5") { } else if ("${question.controlId}" == "5") {
$(".${question.questionId}").attr("disabled", false); key = "${question.questionId}";
$(".${question.questionId}").next().show(); $("." + key).textinput("enable");
$("." + key).next().show();
} }
} }
} }
......
#set($title = "アンケート回答確認画面") #set($title = "アンケート回答確認画面")
<!-- preHeader --> <!-- preHeader -->
#parse( "/WEB-INF/view/common/preHeader_sp.vm" ) #parse( "/WEB-INF/view/common/preHeader_sp.vm" )
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
function reInput() {
location.href = "/em/user/enquete/reInput/";
}
//-->
</script>
<body> <body>
<div data-role="page" id="enqueteConfirm" data-theme="f"> <div data-role="page" id="enqueteConfirm" data-theme="f">
...@@ -42,7 +48,7 @@ ...@@ -42,7 +48,7 @@
<br> <br>
<!-- ※回答内容を修正する場合は、ブラウザの戻る機能で前画面へお戻りください。--> <!-- ※回答内容を修正する場合は、ブラウザの戻る機能で前画面へお戻りください。-->
<br> <br>
<input type="button" value="戻る" onclick="history.back();" /> <input type="button" value="戻る" onclick="reInput();return false;" />
<br> <br>
<hr> <hr>
<br> <br>
......
...@@ -39,18 +39,18 @@ $(function() { ...@@ -39,18 +39,18 @@ $(function() {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") { if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("checked", false); $("#${answer.answerId}").attr("checked", false);
$("#${answer.answerId}").attr("disabled", true); $("#${answer.answerId}").attr("disabled", true);
} else if ("${question.controlId}" == "2" || "${question.controlId}" == "3" || "${question.controlId}" == "4") { } else if ("${question.controlId}" == "2" || "${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").val(""); $("#${question.questionId}").val('');
$("#${question.questionId}").attr("disabled", true); $("#${question.questionId}").attr("disabled", true);
} else if ("${question.controlId}" == "5") { } else if ("${question.controlId}" == "5") {
$(".${question.questionId}").val(""); $(".${question.questionId}").val('');
$(".${question.questionId}").attr("disabled", true); $(".${question.questionId}").attr("disabled", true);
$(".${question.questionId}").next().hide(); $(".${question.questionId}").next().hide();
} }
} else { } else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") { if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("disabled", false); $("#${answer.answerId}").attr("disabled", false);
} else if ("${question.controlId}" == "2" || "${question.controlId}" == "3" || "${question.controlId}" == "4") { } else if ("${question.controlId}" == "2" || "${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").attr("disabled", false); $("#${question.questionId}").attr("disabled", false);
} else if ("${question.controlId}" == "5") { } else if ("${question.controlId}" == "5") {
$(".${question.questionId}").attr("disabled", false); $(".${question.questionId}").attr("disabled", false);
...@@ -253,7 +253,7 @@ $tools.getMsg("errorheader") ...@@ -253,7 +253,7 @@ $tools.getMsg("errorheader")
#if($!question.controlId == "0") #if($!question.controlId == "0")
##if($!answer.freeTextFlg != "1" && $!answer.freeTextFlg != "2") ##if($!answer.freeTextFlg != "1" && $!answer.freeTextFlg != "2")
<input type="radio" class="#he($!question.questionId)" id="#he($!answer.answerId)" name="$!answerIdValueRadioName" value="$velocityCount" #if($!answer.answerIdValue == $velocityCount.toString() && $enqueteForm.initCount =="2") checked #end <input type="radio" class="#he($!question.questionId)" id="#he($!answer.answerId)" name="$!answerIdValueRadioName" value="$velocityCount" #if($!answer.answerIdValue == $velocityCount.toString() && $enqueteForm.initCount =="2") checked #end
#if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end #if($!answer.answerInitDisable == "1") disabled #end> $!escape.html($!answer.answer) #if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end #if($!question.questionInitDisable == "1") disabled #end> $!escape.html($!answer.answer)
##end ##end
##<!-- 自由入力欄。freeTextFlg=1(あり)、2(必須) --> ##<!-- 自由入力欄。freeTextFlg=1(あり)、2(必須) -->
...@@ -264,7 +264,7 @@ $tools.getMsg("errorheader") ...@@ -264,7 +264,7 @@ $tools.getMsg("errorheader")
#elseif($!question.controlId == "1") #elseif($!question.controlId == "1")
##if($!answer.freeTextFlg != "1" && $!answer.freeTextFlg != "2") ##if($!answer.freeTextFlg != "1" && $!answer.freeTextFlg != "2")
<input type="checkbox" class="#he($!question.questionId)" id="#he($!answer.answerId)" name="$answerIdValueName" value="$!escape.html($!answer.answerNo)" #if($answer.answerIdValue != "" && $enqueteForm.initCount =="2") checked #end <input type="checkbox" class="#he($!question.questionId)" id="#he($!answer.answerId)" name="$answerIdValueName" value="$!escape.html($!answer.answerNo)" #if($answer.answerIdValue != "" && $enqueteForm.initCount =="2") checked #end
#if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end #if($!answer.answerInitDisable == "1") disabled #end> $!escape.html($!answer.answer) #if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end #if($!question.questionInitDisable == "1") disabled #end> $!escape.html($!answer.answer)
##end ##end
##<!-- 自由入力欄。freeTextFlg=1(あり)、2(必須) --> ##<!-- 自由入力欄。freeTextFlg=1(あり)、2(必須) -->
......
...@@ -232,7 +232,8 @@ ...@@ -232,7 +232,8 @@
<tr> <tr>
<td nowrap class="td_return"> <td nowrap class="td_return">
<!-- <input type="button" value="戻る" onclick="history.back();" />--> <!-- <input type="button" value="戻る" onclick="history.back();" />-->
<a href="#" class="btn_return" onclick="history.back();return false;"><span class="btn_return_text" title="戻る">戻る</span></a> #set($back-path = '/em/user/enquete/reInput/')
<a class="btn_return" href="/em/user/enquete/reInput/"><span class="btn_return_text" title="戻る">戻る</span></a>
</td> </td>
</tr> </tr>
</table> </table>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment