In CQ How disable the topmost node of a tag - content-management-system

Is there any way to disable the topmost node of a tag when I am adding a tag.
It is like suppose I have a dialog in which there is a field with xtype= tags and the tag is XYZ under which A, B, C are child nodes.
I want the author to select only A or B or C. He can not select XYZ.
How can I implement this. in the tagging_field.js
Thanks.

Sorry for replying after long time, this might be helpful for others. This can be achieved something like this, if the user/author selects xyz tag the value gets added to the tag field, you can get the array of values added in the tag field using getValue method and if the array contains the xyz value delete the value and setValue back to the tag field using setValue method
Here is the link to API docs for tag field for you to refer. Tag Field API Docs
Regards,
Yash Ahuja.

Related

Accessibility ARIA issues with react-select

We are using react-select component in one of our projects and trying to resolve accessibility issues. Right now, there is no way to provide the required aria attributes to the input element which has the aria-autocomplete="list" attribute.
https://www.digitala11y.com/aria-autocomplete-properties/
Above is the reference link to what we are trying to achieve. Below is the short story from the above link.
If an element has aria-autocomplete set to list or both, authors MUST ensure both of the following conditions are met:
The element has a value specified for aria-controls that refers to the element that contains the collection of suggested values.
Either the element or a containing element with role combobox has a value for aria-haspopup that matches the role of the element that contains the collection of suggested values.
I opened a PR to add the ability to add ARIA properties to the input element. https://github.com/JedWatson/react-select/pull/4132
But I wanted to check if I'm missing something if anyone has already worked on this. Please let me know if you need any other details.

Actor Has Tag is returning false for my comparison

I am trying to check for an actor's tag, "object", but the function is always returning false. I am using LineTrace to check actor's info, object names for instance are return good. I will put a link to a couple of screenshots of my blueprints.
https://ibb.co/H2R5S5y
https://ibb.co/xqTvmLb
Any help would be appreciated, if you need more info I will happily provide it to you.
You set the tag in the Component Tags but checking for the tag in Hit Actor.
You can either set the tag in Actor(by clicking the row above the root component and below the +Add Component) in the blueprint, and check for the tag in Hit Actor.
Or
Set the tag in Component Tags and check the tag in Hit Component

Implement a tag system in SugarCRM

I'd like to implement a tag system to a SugarCRM that has the following characteristics:
User can create any new tag just by writing the new tag into the tag field
Existing tags are suggested for user to choose, in order to avoid having similar tags (e.g. if user tried to enter "sugar" as tag, it should be suggested for them to choose "SugarCRM")
Search by tag should result only records that have that tag, but not records that have that tag as a keyword in title or description fields
All record in all modules should have a tag field
It would be nice if a search by tag could be made throughout all modules
Does anyone know if there is already some implementation for this?
There are several on SugarForge. I've used SugarTAGS from CARRENET (http://www.sugarforge.org/projects/sugartags/) as a starting point before.

Wicket - can you specify markups IDs for elements inside repeaters?

I'm having a hard time testing our Wicket application using Selenium because of the random markup ids.
For individual elements, I can use abc.setOutputMarkupId(true).setMarkupId("myId")
to set their markup id explicitly.
But what if the element is added dynamically using a repeater (like ListView)? Is there a way to specify how the markup id sequence should look like?
Well, can't you do the same thing with ListView? If you make your own ListView implementation, and then in the populateItem(final ListItem<?> listItem) method, on that respective listItem you do:
listItem.setOutputMarkupId(true); // write id attribute of element to html
listItem.setMarkupId("id"+i);
where i is some index you initialize in the ListView's constructor or something?
as Andrei told that its possible but dangerous.
setMarkupId doc:
Retrieves id by which this component is represented within the markup. This is either the id attribute set explicitly via a call to
org.apache.wicket.Component.setMarkupId(java.lang.String), id
attribute defined in the markup, or an automatically generated id - in
that order. If no explicit id is set this function will generate an id
value that will be unique in the page. This is the preferred way as
there is no chance of id collision.
http://www.kiwidoc.com/java/l/p/org.apache.wicket/wicket/1.4.0/p/org.apache.wicket/c/Component#top
and also you cant get the markup id with getMarkupId()

how to get id of a node in TinyMCE?

I want to get the id of a node inside TinyMCE.
I searched in the documentation, but could not find this.
How can this be done?
First, it is important which node you want to get the id from.
If you want to get the if of the parent node of your selection in TinyMCE use
tinymce.activeEditor.selection.getNode().id;
EDIT: In case you have a single node in your editor you can access this node id using
tinymce.activeEditor.getBody().firstChild.id;
let say if you have id as txtatinyID
<textarea class="editorHtml" id="txtatinyID"></textarea>
so following will return txtatinyID in tinyMCE V4
$(tinymce.activeEditor.selection.getNode()).closest('body').data('id')
So it will find the body of the current active editor and on the base of it will look for body and in it will get the value of data-id.