开发者

how to make one button inactive and other active on button press and persist the state in zk.

开发者 https://www.devze.com 2023-04-05 13:02 出处:网络
in a window i have 2 buttons- edit and view. Now unless a user presses the \'edit\' button, i intend that the \'view\' button must remain disabled.

in a window i have 2 buttons- edit and view. Now unless a user presses the 'edit' button, i intend that the 'view' button must remain disabled. Once he presses the edit button, the 'view' button must become enabled and the 'edit' button must become disabled. also when either of them are enabled ,then on clicking there must be a redirection. Also this state must persist(i.e the 'view' button enabled and 'edit' disabled) when i get back to the same page after redirection or redirected to the same page. I tried the following but am getting the error: "Event listeners not support native content" Could someone please help me out.

        <button id = "ViewBtn" width="80px" label="View"
           disabled="true">
               <attribute name="onClick">

                   <zscript>
                  <![CDATA[
                  Executions.sendRedirect("View.zul");
                  ]]>
                 </zscript>
                   </attribute>
         </button>
    </row>
    <row>

        <button id = "EditBtn" width="80px" label="Edit"
               >
           <attribute name="onClick">
                <zscript>
                  <![CDATA[
                  disabled="true";
                  ViewBtn.setDisabled("false");
                  Executions.sendRedirect("Edit.zul");
                  ]]>
                 </zsc开发者_如何学Pythonript>
           </attribute>
        </button>

    </row>

Thanks.


It is because you place inside of .

The event listener (declared with ) already assumes zscript (java code), so you don't have to declare it.

0

精彩评论

暂无评论...
验证码 换一张
取 消