1

visibile attribute/property in Zul - Value set via Code- And it can be disabled via Browser Inspect

asked 2018-01-09 20:17:11 +0800

kd16 gravatar image kd16 flag of India
23 4

updated 2018-01-09 20:45:10 +0800

Greetings ZK Community,

I disabled a Button in one of my Project Screen, visible="@load(vm.access)" access is boolean variable and it works. If I inspect Screen via Browser then it looks like this

<td id="k1CP46-chdex" style="display:none;height:100%">
<a id="k1CP46" class="actionbtn fa fa-undo z-a" style="display:none;" title="Cancel" ></a>
</td>

If I modify it like this,

<td id="k1CP46-chdex" style="height:100%">
<a id="k1CP46" class="actionbtn fa fa-undo z-a" style="height:100%" title="Cancel" ></a>
</td>

(Also, href="javascript:; is there after title in above snippet.(Wrote here as Question is spam if I add there) )

Then Hidden Button is VISIBLE and Also that Works. Is this normal behavior?!

Scenario: I am disabling access for "Back" button- if access boolean is false, So User won't see previous List Page. But if User change from Browser Inspect, User is able to see previous List Page by Clicking on "Back" button.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-01-10 02:36:13 +0800

chillworld gravatar image chillworld flag of Belgium
5357 4 9
https://github.com/chillw...

updated 2018-01-10 02:36:29 +0800

Pretty normal in all html.
The thing is that you need to work with the if attribute, but that's not dynamic.
In code this looks like appending and removing the item from your page, in stead of just changing the visibility.

But there is also good news.
HTML has now a shadow dom what's the solution of your problem.
ZK works also with the shadow dom from version 8, but your browser need to be compatible with the shadow dom.

With zk 8.0 you can do the following :

<if test="@load(vm.someBoolean)">
     ...
</if>

The if component will work with the shadow dom, and it's dynamic.

Greetz chill.

link publish delete flag offensive edit

Comments

Thank you for clarifying. @chillworld

kd16 ( 2018-02-28 12:48:22 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2018-01-09 20:17:11 +0800

Seen: 16 times

Last updated: Jan 10 '18

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More