晋加答 发表于 2008-9-4 09:32

屏蔽菜单问题

我想根据用户类型 展现不同的页面。用户类型存于session 。

当是普通用户时,屏蔽某些菜单。该怎么做呢。

程序代码是放在页面上还是Action上呢。

比如:我想屏蔽下面一个菜单,该怎么做呢
<tr>
  <td colspan="2" class="menubg" onclick="kai_main(103);">
  <div class="leftmenuG">
  <img src="<%=IMG_PATH%>ico_4.gif" width="22" height="22">
  </div>
  <div class="leftmenuT">
  用户管理
  </div>
  </td>
</tr>
<tr id=103 style="display:none">
  <td colspan="2">
      <table border="0" cellspacing="1" cellpadding="1" width="100%">

       <tr>
        <td class="mbg2" onclick="jumpto('103', 3, 0, '/patch/CheckLinkAction.do?goto=adduser')">
        <span class="arrow"><font face="webdings">4</font></span>新增用户
        </td>
     </tr>
                                                               
     <tr>
        <td class="mbg2" onclick="jumpto('103', 3, 1, '/patch/CheckLinkAction.do?goto=listuser')">
        <span class="arrow"><font face="webdings">4</font></span>查询用户
        </td>
    </tr>

   </table>
   </td>
</tr>

晋加答 发表于 2008-9-4 10:17

帮帮忙哩

晋加答 发表于 2008-9-4 15:06

这样为什么不行???Ifshow的值总是none.....为什么?

<%
    String type = "";
    String Ifshow="none";
        if(object1 instanceof com.sortec.patch.user.TUserVO)
        {
                type = ((com.sortec.patch.user.TUserVO)object1).type;       
                        if(type=="1")
                        {Ifshow="block";}
                        if(type=="0")
                        {Ifshow="none";}       
        }
%>

<tr style="display:<%=Ifshow%>">
                                                <td colspan="2" class="menubg" onclick="kai_main(103);">
                                                        <div class="leftmenuG">
                                                                <img src="<%=IMG_PATH%>ico_4.gif" width="22" height="22">
                                                        </div>
                                                        <div class="leftmenuT">
                                                                用户管理
                                                        </div>
                                                </td>
                                        </tr>

页: [1]

编程论坛