1

Can I randomly generate Id's?

asked 2017-01-10 07:44:49 +0800

pemko gravatar image pemko
13 2

My problem is that the user can create many articles (one article is one zul file) and I include the articleNumberSelecrtorRow.zul many times in articleNumberSelector.zul. Now i get the id error. Is it possible to add a random value to the id?

delete flag offensive retag edit

Comments

can you post your code? Include do implement idscope so normally you can re use your id's under an include.

chillworld ( 2017-01-10 08:19:18 +0800 )edit

Edit: Sorry I have some trouble with this comment section, I will be back. I can't answer the whole thing, I make a little fiddle and post it here

pemko ( 2017-01-10 10:32:15 +0800 )edit

http://pastebin.com/QpweCYih <-- here is my answer

pemko ( 2017-01-10 10:34:24 +0800 )edit

Hello

I can't use that. Maybe it's because of the version?

Failed to load /productselector/wizard/components/group.zul

Cause: Component definition not found: idspace in [LanguageDefinition: xul/html], [SYS file:/C:/*/wizard/components/group.zul line 2 col 14]

pemko ( 2017-01-10 12:23:39 +0800 )edit

then you can use a window, or create your own component what extends for example div and implements idspace.(implementing the interface is enough, no extra things needed)

chillworld ( 2017-01-10 14:17:31 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-01-10 11:17:10 +0800

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

updated 2017-01-11 06:11:13 +0800

It's like I already said.

You need to put the group.zul in a component what's include the IdSpace.

What you can do is put <idspace> in the group.zul and put all the other code into this tag.

Chill.

link publish delete flag offensive edit

Comments

1

another even simpler alternative it NOT to use an ID at all. In repeated elements this is often not necessary at all. If you need to listen to events, simply forward the events to a common ancestor. See: https://www.zkoss.org/wiki/ZKDeveloper'sReference/EventHandling/EventForwarding, Robert

cor3000 ( 2017-01-11 01:25:33 +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
1 follower

RSS

Stats

Asked: 2017-01-10 07:44:49 +0800

Seen: 26 times

Last updated: Jan 11 '17

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