Error not Unique in ID space in a template

asked 2013-09-24 03:18:30 +0800

daovallec gravatar image daovallec
11 2

updated 2013-09-24 03:19:07 +0800

I have this View in ZK:

    <style src="/widgets/grid/inline_row_editing/style.css" />
    <div apply="org.zkoss.bind.BindComposer"
         viewModel="@id('vm')     @init('com.gemalto.segmentation.viewModel.users.InplaceEditingViewModel')"

        <grid id="demoGrid"
              model="@load(vm.languageContributions) @template((vm.displayEdit and each.editingStatus) ? 'editable' : 'noneditable')">
                <auxheader colspan="4"
                           label="Create Users">
                        <label />
                        <button label="create" 
                                onClick="@command('onAddNew', languageContributionStatus=each)" />
                        <checkbox checked="@bind(vm.displayEdit)"
                                  label="Enable Multiple Inline Row Editing">

                <column width="160px">Email</column>
                <column width="160px">Password</column>
                <column width="160px">Confirm-Password</column>
                <column width="160px">Role</column>
                <column width="160px">Mnos</column>
                <column width="110px" visible="@load(vm.displayEdit)">Edit</column>
                <column width="110px"     visible="@load(vm.displayEdit)">Remove</column>
            <template name="editable">
@save(each.languageContribution.email, before='confirm')" />
@save(each.languageContribution.password, before='confirm')" />      
@save(each.languageContribution.confirmPass, before='confirm')" />  
@save(each.languageContribution.role, before='confirm')" />

                    <button id="MnoE" label="Mnos">
                        <attribute name="onClick"><![CDATA[
            if (!MnoEWin.isVisible())

                        onClick="@command('confirm', languageContributionStatus=each)" />
                        onClick="@command('changeEditableStatus2', languageContributionStatus=each)" />

            <template name="noneditable">

                    <label value="@load(each.languageContribution.email)" />
                    <label value="@load(each.languageContribution.password)" />
                    <label value="@load(each.languageContribution.password)" />
                    <label value="@load(each.languageContribution.role)" />

                    <button id = "edita"
                        onClick="@command('changeEditableStatus', languageContributionStatus=each)" />
                    <button label="delete"
                                onClick="@command('onDelete', languageContributionStatus=each)" />



And i do not why in

<template name="noneditable">

I have only One button with id

    <button id = "editar"
                    onClick="@command('changeEditableStatus', languageContributionStatus=each)" />

I have an error: Not Unique in ID space [Page myYFM_] editar. If i have only one button with that id.

Somebody can help me?

delete flag offensive retag edit


id shud be unique within a container but u are here within template so u need to ensure your id is also incrementing, so link to auto incremented value or unique number. try to give some count or something in your model and use that in your button id.like id="button${each.count}" .

shraddhadixit89 ( 2014-10-06 12:45:03 +0800 )edit

Accept the answer if it resolved and marked it done

sjoshi ( 2014-10-07 11:40:51 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-09-24 05:57:57 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8

Do one thing Please remove id of button and ZK would generate the id for this button If u will see you are going to loop and According to ZK two or more component do not contain same id and this button in loop and it will generate more than one time so you will get this exception because two button will rendered with same id editar

link publish delete flag offensive 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

1 follower



Asked: 2013-09-24 03:18:30 +0800

Seen: 109 times

Last updated: Oct 06 '14

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