2

Id attribute set in zul code doesn't reflect in html code? [closed]

asked 2013-07-10 11:13:15 +0800

nsharma gravatar image nsharma flag of India
917 1 11

updated 2013-07-12 07:12:18 +0800

hswain gravatar image hswain flag of India
1763 3 10
http://corejavaexample.bl...

I have to make my code as per ADA(Americans disability act) specifications:

one of the specification is :-

Use label elements to associate text labels with form controls.

Provide a description for groups of form controls using fieldset and legend elements.

Use the title attribute to identify form controls when the label element cannot be used.

Ensure that all id values are unique on a web page.

In simple words i have to associate my label element with my input element, for this I have to add a "for="input_ element_ id"" attribute in my label.

But my problems is that zk generates its own id in html code and doesn't use the id specified in the zul code: below is the zul code for a textbox:-

<textbox type="password" id="password"  focus="@load(not empty vm.something)"
                vflex="1" value="@save(vm.password)" onOK="@command('dosomething')">
</textbox>

and here is the HTML code generated for the same:-

<input id="t_19" class="z-textbox" type="password" value="" >

here id="t_19" but in zul code i had specified id="password",so I can't use for="id" in label.

any one help on this?

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by nsharma
close date 2015-08-17 05:46:28

3 Answers

Sort by ยป oldest newest most voted
1

answered 2015-03-18 17:40:13 +0800

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

updated 2015-03-18 17:45:57 +0800

Well actually, zk use an IdGenerator. The id's are never the same just because we don't want some guy creating scripts who can trigger javascript on id's.

If you don't want this, you have to implement your own IdGenerator.

Some usefull links :

http://books.zkoss.org/wiki/ZKDeveloper'sReference/Testing/TestingTips#Approach2:ImplementID_Generator

http://books.zkoss.org/wiki/User:Jimmyshiau/EtcIdGenerator (See the IdAsUuidGenerator)

Greetz chill.

link publish delete flag offensive edit
0

answered 2015-03-18 15:44:04 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2015-03-18 15:45:28 +0800

Ensure that all id values are unique on a web page.

This is automatically done by ZK. Write this in your documentation!

link publish delete flag offensive edit
0

answered 2015-03-13 22:44:29 +0800

Anon283 gravatar image Anon283
1

Hello my little friend.

You have to declare in your window

xmlns:w="ht(remove space)tp://ww(remove space)w.zkoss.(remove space)org/2005(remove space)/zk(remove space)/client"

that will make your zul can work with jQuery, now to get the value of a textbox by id it would be like

jQuery("$idTextBox01").val()

Hope this works

Manito arriba, suscribite che y mega like

link publish delete flag offensive edit

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-07-10 11:13:15 +0800

Seen: 114 times

Last updated: Mar 18 '15

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