Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

required attribute not enforced #16

Open
oaixnomis opened this issue Apr 29, 2014 · 6 comments
Open

required attribute not enforced #16

oaixnomis opened this issue Apr 29, 2014 · 6 comments

Comments

@oaixnomis
Copy link

required attribute is not automatically added to the element, and also can be deleted after the attribute is added manually.
screen shot 2014-04-29 at 1 42 13 pm
screen shot 2014-04-29 at 1 41 33 pm

@superinconnu
Copy link

The same remark , i agree.

@bbpennel
Copy link
Member

Yes, required is not currently implemented. For the most part, attributes that effect how many of an element/attribute are allowed are not implemented at present. Those features have mostly just been added when other people contribute them.

Implementing use="required" would be relatively simple compared to some of the other restrictions, it seems like it would just require updating:

SchemaProcessor.prototype.build_attribute
XMLElement.prototype.populateChildren

@superinconnu
Copy link

I changed XMLElement.prototype.populateChildren as you said but it didn't work .
I added this lines and i think the problem is due to the addAttributeEvent

for(var i = 0; i < self.objectType.attributes.length; i++){
if (self.objectType.attributes[ii].use){
var childElement = self.addAttribute(self.objectType.attributes[i]);
this.editor.activeEditor.addAttributeEvent(this, childElement); }}

@DustinWehr
Copy link

I mostly implemented this. The remaining problem is that I haven’t given the Add Attribute menu button to the call to XMLElement.prototype.populateChildren (instead I temporarily modified GUIEditor.prototype.addAttributeEvent to not require it, as a hack), because I don't see how to easily fetch it. This manifests when I delete the auto-added attribute; the Add Attribute menu doesn’t immediately update appropriately (to allow you to re-add the attribute), though it does if you switch editors and then switch back.

@bbpennel, is there an easy way to get a pointer to the button labeled X in the currently-visible Add Attribute menu when the currently-selected element has X as a possible attribute?

@HugoBoss33
Copy link

Hi,
I'm really interested by this feature but i don't know how to implement it.
could you help me?

@vog
Copy link
Contributor

vog commented Jul 11, 2017

For reference, this topic is also discussed in #55.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants