AEM 6.4 [coral-3] – Toggle dialog fields based on dropdown selection - Doesn’t work for multiple values - aem

In AEM 6.4 [coral-3], we could implement toggling of dialog fields based on the dropdown selection by adding granite:data node and granite:class. But this works only for single value. How to make it work for multiple values. For example, if a dropdown has three values [x, y, z] then I would like to show "text1" if we select x OR y and would like to show "text2" if we select z. I have tried making showhidetargetvalue to String[] with multiple values [x, y], but it didn’t work. Any reference will be helpful.

The default implementation of showhidetargetvalue doesn't support multiple values, the code for the default implementation of this feature can be found in:
/libs/cq/gui/components/authoring/dialog/dropdownshowhide/clientlibs/dropdownshowhide.js
unfortunately you will have to create a customised version of this script to support it.

Related

Visio ShapeSheet ShapeData: keep two rows in sync

I have two Shape Data rows for a Shape's ShapeSheet:
Shape Data Label Prompt Type Format Value Invisible
Prop.Type "Type" "" 4 "Alpha;Beta;Gamma;Delta;Epsilon;Zeta;Eta;Theta;Iota;Kappa" INDEX(4,Prop.Type.Format) False
Prop.Abbrev "Abbrev" No Formula 4 "A;B;G;D;E;Z;E;T;I;K" INDEX(4,Prop.Abbrev.Format) True
The way I intent to use this is to have the user select the Type, say Epsilon, and then have the Abbrev automatically switch to the corresponding value in the Prop.Abbrev.Format.
Note: the values used here are placeholders for the actual values for my application, which are not shown here so they don't distract from the real answer I need, how to keep the selections in sync when the first one is chosen or changed.
Thanks for any help you can give!
I don't have Visio on this machine, so I am unable to copy and paste a working solution. The approach gets a little complicated, but extremely flexible.
Save your lists in the User section, rather than Prop - this then becomes underlying data for use in properties. If you are using a master stencil then this also helps with managing the fields.
You can now store an index in your data as well - this index points to the appropriate values in your arrays. You can use Actions and side menus to set the index which, when referenced properly, means you can have the full name and/or abbreviation in the side menu and the ShapeSheet does all the work underneath.
The functions you want to look at are:
Index (e.g. INDEX(1,User.Type) will return "Beta". (0-based)
Lookup (e.g. LOOKUP("D", User.Abbrev) will return "3". (0-based)
GetAtRef
SetAtRef
SetAtRefExpr
SetF
I had a similar business problem which relied on setting a background colour based on the value of shape data. Your final solution could end up including formulas like this: =SETF(GetRef(Prop.Type),"GUARD(INDEX(LOOKUP(Prop.X,Prop.X.Format),User.Type))").
For more in-depth discussion - check out https://superuser.com/questions/1277331/fillforegnd-in-shapesheet-using-wrong-data and the extended discussion at http://visguy.com/vgforum/index.php?topic=8205.15 - the latter link also includes an example file with working shapesheets (well, working to the extent that they exposed my problem).

yadcf autocomplete not working as in original examples

In the older examples of the AutoComplete filter, as soon as you typed in a letter the filtering was applied reducing the numbers of rows shown. For example, if I typed the letter "x", only rows with that column containing the letter "x" would be displayed.
{ column_number : 1, filter_type: "auto_complete" },
In the newer examples, the AutoComplete filter does not do this. I want the original functionality for my web page - how do I achieve this? Is there an option I need to pass to the AutoComplete plugin via the filter_plugin_options parameter? Or is there a different filter I should be using?
I can't recall that aytocomplete ever worked this way, you need to use the filter_type: 'text' instead, see the fourth column in the following showcase page
IMO triggering the filter on each keyboard type fits better the text filter rather then autocomplete

Custom content assist for default java editor in Eclipse

I'm currently trying to develop an Eclipse Plugin to support code replacement, like what the default content assist in Eclipse do. What I want to implement is something like "insert argument names automatically on method completion with visualized box around the argument" and I can "use the Tab key to navigate between the inserted names" and "while navigating, list of optional variables for current argument can be displayed and be chosen".
In short, it comes to two questions:
How to add the visualized box around the already existed variable or even Java keywords that need replacement? And at the meanwhile I can use Tab key to switch between these boxes.
How to display a list of candidates to select from when I trigger on the box?
By now I only figure out the extension point : org.eclipse.jdt.ui.javaCompletionProposalComputer may be useful, but I have no idea where to start at? Thanks in advance.
Oh, finally I've solved it myself...
For the 'box', it should be the LinkedModeModel, this class should work with LinkedPositionGroup and LinkedPosition to add mutiple boxes. And we should use LinkedModeUI to set it up.
For the content assistant, there's no need to use the extension point. There is a ProposalPosition class which extends LinkedPosition for you to add your proposals for the 'box' in its constructor. And we can simply use the CompletionProposal to construct a ICompletionProposal array as the argument of ProposalPosition's constructor.

Can you use Chosen with dynamically created form elements?

I've created a simple form containing two selectbox elements. I also have a button which dynamically adds these selectboxes at the user's discretion. The selectbox options will be quite long, so I've applied the jQuery Chosen plugin to be more useful.
Everything works fine until a new element is dynamically added using jQuery clone. I am unable to select any options in my new element selectboxes, and they also carry the prior results.
In searching the forum, others have 'reset' Chosen after a selection, by calling: $("#form_field").trigger("liszt:updated"); . I tried this as well, but it will just clear all the selections (which I don't want) and continue to freeze the dropdown action.
Anyone have experience with using Chosen (or any other autocomplete-type selectbox enhancement) with dynamic elements?
Found a solution that works - albeit without using the Chosen plugin.
I changed my dynamically created form elements by replacing the selectboxes with input fields tied to a basic jQueryUI autocomplete plugin. Here is a link to their implementation : http://jqueryui.com/autocomplete/#default.
The main difference is that the select "options" in this case, were listed as the source from which the box would look for autocomplete options. My list was 70 items long, so the initial setup took some time.
The jQuery text was generically as follows:
$("input#search").autocomplete({
source: [item1, item2, item3, item 4, ... item5]);

TYPO3 Extension Manager: Button "Only display updatable extensions" is not displayed

If I open the extension manager, switch to the tab Import Extensions and select the filter I get the following options:
Display all extensions (empty)
Only display installed extensions (working)
There should also be a Only display updatable extensions selection but this isn't displayed. What is the reason therefore?
I made a TYPO3 update to 4.7.2 and perhaps thats the reason why it isn't correctly displayed?
The repository is up to date.
The filter has been moved from the Import Extensions to the Available Extensions tab.
You do not actually want to import an extension, but update an existing one.
Just suggestion: I had similar issues with button displaying in EM before (4.6.x) (ie. Install ext button) and realised, that the button is available, but sprite image had wrong position which caused that the button was transparent,
Try to use ie FireBug to check it, and eventually fix the CSS (and report the bug)
Edit:
Some doom apparently, I just had identical situation just seconds ago ;) Fortunately found the reason: the ext list is displayed with ExtJS grid, which can contain custom filtering per column. Literally: when you for an example click on the column's dropdown arrow, you can in its filter set some value to narrow the search results.
Ie.: in the main filter field write news and additionally in the Extension Key column set other filter tt_news. (if you want to display only %tt_news% in result list of %news%)
In that case even if you'll clear the main filter, the one set on the column will stay active, so next time when you'll try to search for realurl in main filter, it will return empty list as Extension Key filter is still set to tt_news.
Weeeird, however helped me :)
You can recognize filtered columns as their names are written with cursive, finally you can just check every column and disable any filtering on each.