html代码片段如下:
<td align="right">锁定原因:</td>
<td align="left">
#if(sysUser.is_lock==0)
<input id="sysUser.lock_reason" name="sysUser.lock_reason" class="input-normal"
maxlength="100" value="#(sysUser.lock_reason)" readonly="readonly"/>
#else
<input id="sysUser.lock_reason" name="sysUser.lock_reason" class="input-normal"
maxlength="100" value="#(sysUser.lock_reason)"/>
#end
</td>
问题,这种写法,idea会报错Duplicate id reference,如果改成
<input id="sysUser.lock_reason" name="sysUser.lock_reason" class="input-normal" maxlength="100" value="#(sysUser.lock_reason)" #if(sysUser.is_lock==0) readonly="readonly" #end/>
又会报Attribute #if(sysUser.is_lock is not allowed here
虽然第一种写法不影响执行结果,总是很别扭,强迫症啊,有没有解决办法?
项目:JFinal