how to make one button inactive and other active on button press and persist the state in zk.
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.
精彩评论