//browsaBar.usl
<bme:view>
<bme:script>
function chooseBAR(){
// 如果没有选择单选按钮,则给出提示
var isChecked = false;
$("#serverCatalog input[type='radio']").each(function(){
// 文件后缀
var fix = $(this).val().substring($(this).val().lastIndexOf(".")+1);
if($(this).is(":checked") && fix == "bar"){
isChecked = true;
}
});
if(!isChecked){
alert("Please choose a bar file.");
}
return isChecked;
}
</bme:script>
<bme:panel title="Browse a BAR">
<bme:field label="Current Parent Directory" fullline="true" labelwidth="158px">
<bme:addon>
${currentParentPath }
<bme:buttongroup align="right" width="500px">
<bme:button value="OK">
<bme:fire event="click" mode="navigate" targetstep="InitEsbBar" onbefore="chooseBAR()"></bme:fire>
</bme:button>
<bme:button value="Back">
<bme:fire event="click" mode="navigate" targetstep="InitEsbBar"></bme:fire>
</bme:button>
</bme:buttongroup>
</bme:addon>
</bme:field>
</bme:panel>
<br/>
<bme:panel display="${isWindowOS}" title="Choose a disk">
<!-- 显示磁盘选择 -->
<bme:field label="DiskName" labelwidth="158px">
<bme:addon>
<c:forEach items="${diskNames}" var="dn">
<c:choose>
<c:when test="${dn eq diskName}">
<bme:button value="${dn }" disabled="true"></bme:button>
</c:when>
<c:otherwise>
<bme:button value="${dn }">
<bme:fire event="click" mode="navigate" service="browseDisk('%{#BMEModel}','${dn }')" targetstep="browseBAR"></bme:fire>
</bme:button>
</c:otherwise>
</c:choose>
</c:forEach>
</bme:addon>
</bme:field>
<br/>
</bme:panel>
<bme:panel title="Server Catalog" id="serverCatalog">
<bme:field label="Parent Directory" labelwidth="158px">
<bme:addon>
<bme:img value="${BMETheme.customPath}/images/file_up.gif">
<bme:fire event="click" mode="navigate" service="browseParentPath('%{#BMEModel}')" targetstep="browseBAR"></bme:fire>
</bme:img>
</bme:addon>
</bme:field>
<bme:datagrid property="filevos" id="files">
<bme:column width="7%" label="Choose">
<center>
<c:if test="${!isDirectroy}">
<input type="radio" name="serverBARPath" value="${filePath}"></input>
<input type="hidden" name="isLocalUpload" value="false">
</c:if>
</center>
</bme:column>
<bme:column label="Name">
<bme:img value="${BMETheme.customPath}/images/folder.gif" display="${isDirectroy}"></bme:img>
<bme:img value="${BMETheme.customPath}/images/file.gif" display="${isDirectroy == false}"></bme:img>
<c:choose>
<c:when test="${isDirectroy}">
<bme:link value="${fileName}">
<bme:fire event="click" mode="navigate" service="browseServerFile('%{#BMEModel}','${fileName }')" targetstep="browseBAR"></bme:fire>
</bme:link>
</c:when>
<c:otherwise>
${fileName}
</c:otherwise>
</c:choose>
</bme:column>
</bme:datagrid>
</bme:panel>
</bme:view>
<bme:view>
<bme:script>
function chooseBAR(){
// 如果没有选择单选按钮,则给出提示
var isChecked = false;
$("#serverCatalog input[type='radio']").each(function(){
// 文件后缀
var fix = $(this).val().substring($(this).val().lastIndexOf(".")+1);
if($(this).is(":checked") && fix == "bar"){
isChecked = true;
}
});
if(!isChecked){
alert("Please choose a bar file.");
}
return isChecked;
}
</bme:script>
<bme:panel title="Browse a BAR">
<bme:field label="Current Parent Directory" fullline="true" labelwidth="158px">
<bme:addon>
${currentParentPath }
<bme:buttongroup align="right" width="500px">
<bme:button value="OK">
<bme:fire event="click" mode="navigate" targetstep="InitEsbBar" onbefore="chooseBAR()"></bme:fire>
</bme:button>
<bme:button value="Back">
<bme:fire event="click" mode="navigate" targetstep="InitEsbBar"></bme:fire>
</bme:button>
</bme:buttongroup>
</bme:addon>
</bme:field>
</bme:panel>
<br/>
<bme:panel display="${isWindowOS}" title="Choose a disk">
<!-- 显示磁盘选择 -->
<bme:field label="DiskName" labelwidth="158px">
<bme:addon>
<c:forEach items="${diskNames}" var="dn">
<c:choose>
<c:when test="${dn eq diskName}">
<bme:button value="${dn }" disabled="true"></bme:button>
</c:when>
<c:otherwise>
<bme:button value="${dn }">
<bme:fire event="click" mode="navigate" service="browseDisk('%{#BMEModel}','${dn }')" targetstep="browseBAR"></bme:fire>
</bme:button>
</c:otherwise>
</c:choose>
</c:forEach>
</bme:addon>
</bme:field>
<br/>
</bme:panel>
<bme:panel title="Server Catalog" id="serverCatalog">
<bme:field label="Parent Directory" labelwidth="158px">
<bme:addon>
<bme:img value="${BMETheme.customPath}/images/file_up.gif">
<bme:fire event="click" mode="navigate" service="browseParentPath('%{#BMEModel}')" targetstep="browseBAR"></bme:fire>
</bme:img>
</bme:addon>
</bme:field>
<bme:datagrid property="filevos" id="files">
<bme:column width="7%" label="Choose">
<center>
<c:if test="${!isDirectroy}">
<input type="radio" name="serverBARPath" value="${filePath}"></input>
<input type="hidden" name="isLocalUpload" value="false">
</c:if>
</center>
</bme:column>
<bme:column label="Name">
<bme:img value="${BMETheme.customPath}/images/folder.gif" display="${isDirectroy}"></bme:img>
<bme:img value="${BMETheme.customPath}/images/file.gif" display="${isDirectroy == false}"></bme:img>
<c:choose>
<c:when test="${isDirectroy}">
<bme:link value="${fileName}">
<bme:fire event="click" mode="navigate" service="browseServerFile('%{#BMEModel}','${fileName }')" targetstep="browseBAR"></bme:fire>
</bme:link>
</c:when>
<c:otherwise>
${fileName}
</c:otherwise>
</c:choose>
</bme:column>
</bme:datagrid>
</bme:panel>
</bme:view>