How to disabled the typeahead ng bootstrap control - typeahead

How can I apply the disabled attr to the ngb typeahead?
ifi use [attr.disabled] it complains disabled not part of element

Typeahead, as any other Angular control, can be disabled by binding to the disabled property (and not an attribute): [disabled]="expression".
You don't see the disabled property documented on the API documentation page, ad the disabled property is part of the ngModel.
Here is an example in a plunker: http://plnkr.co/edit/lSUB6lBEGKKyndlIibDp?p=preview

Related

Show Region which was hidden when the page loaded APEX

I need a region with a form to be hidden when the page loads and shown when the user is clicking on a button. I tried it with a dynamic action where I used "Show" an "Hide" but it is not working as planed. The region is displayed after loading the page.
Server-side conditions on a component are evaluated when the page is rendered. If the condition yields false, the component is not included in the rendered page so it is impossible to make it visible - simply because it is not in the DOM.
The way to show/hide a region is to:
Not set a server-side condition
use a dynamic action to show/hide

Is <liferay-ui:custom-attribute/> still recognized in Liferay portal 7.1.0 ga2?

Trying to display the below custom field on create_account.jsp in Liferay Portal 7.1.0 GA2. The permission for a guest user to view and update is already set to the custom field but it is not displaying.
<liferay-ui:custom-attribute
className="<%= User.class.getName() %>"
classPK="<%= 0 %>"
editable="<%= true %>"
label="<%= false %>"
name="address2">
<liferay-ui:custom-attribute/>
Edit:
The Breaking Changes for Liferay 7.0 document that the tag has moved to the liferay-expando taglib. Just follow that breaking change and use the new taglib instead of the old.
Longer, prior answer hinting at the above:
If the tag is still in there, it should. However, granting guest users the permission to update users is a great way to create a loophole and a security issue.
You might want to
Try non-editable display of the data first
Check the HTML source, if it contains <liferay-ui:custom-attribute ... - because if it does, either the tag is not supported or you're not importing the required taglib. Unfortunately JSP tags don't always fail gracefully, they'll just render as they are and the browser won't show anything.
Looking at Liferay's source, particularly ./modules/apps/users-admin/users-admin-web/src/main/resources/META-INF/resources/user/custom_fields.jsp, it uses <liferay-expando:custom-attribute-list> which is indeed a hint that you might want to look at a different taglibrary.

Route without page reload on bookmark or manual URL edit

If I'm on a page in my Ember app, and edit the URL manually or use a bookmark that identifies another route within the same app, by default the page gets reloaded, losing any transient state it had, rather than just transitioning as it would have if I'd followed an Ember-controlled link within the app. Is there a built-in feature of Ember that's well integrated into its routing features which can prevent that and just transition instead?
Details:
With Ember's default routing, the URL itself changes rather than just the fragment identifier ("hash"). E.g., in the Quick Start example, if you're on http://server/scientists and want to look at the list of programmers instead, you go to http://server/programmers.
If you do that by clicking a link handled by Ember, that works within the loaded page just fine (I'm assuming Ember uses the History API under the covers to replace state without page reload). No page reload is caused.
But if you're on http://server/scientists and click a bookmark to take you to http://server/programmers (or edit the URL manually), it reloads the page, losing any transient state the page contained.
In contrast, in an app that uses fragment identifiers for routing (like Gmail), the equivalent change of (say) http://server/#scientists to http://server/#programmers does not cause page reload, even if you manually edit the address bar or use a bookmark. (Of course; it's just a change to the fragment identifier, not the actual URL.)
Is there built-in handling in Ember that's well integrated into its routing features that can make it handle that use case without reloading? Either by using a fragment identifier instead of changing the URL, or with some History API feature? (Although I can't think of a History API feature that could do it.)
In config/environment.js file, include ENV.locationType= 'hash'; by default it would be set to auto.
For more information - http://emberjs.com/api/classes/Ember.Location.html

Sitecore - "Clean" package installation for RTE button

I am creating a Sitecore module which includes a new button within the Rich Text Editor.
In order to register the command for the button I had to append some code to the RichText Commands.js file.
I had hoped that I could create the installation package in such a way that it would be simple, without any additional manual intervention required.
So I have 2 questions:
Is there any way I can the add the javascript command registration code without amending an existing file?
Is there somewhere in the Sitecore tree I can put the button so it appears for all RTE profiles? - a sort of "global profile".
You can add your own client scripts by adding an entry into the config. Patch the following:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<clientscripts>
<htmleditor>
<script src="/sitecore modules/shell/Controls/Rich Text Editor/Custom RichText Commands.js" language="JavaScript"/>
</htmleditor>
</clientscripts>
</sitecore>
</configuration>
Here is a detailed blog post about it.
There is no setting that I know of so that all profiles display the button. You have to add it to the profiles you wish the button to show on. Either:
add it to the default profile
make a copy of an existing profile, rename it to Rich Text Default and add/remove whatever you want
Change <setting name="HtmlEditor.DefaultProfile" value="/sitecore/system/Settings/Html Editor Profiles/Rich Text Default"/> in web.config to your custom profile
If you set the DataSource of a rich text field to a different one then obviously the default settings will not take effect.

K2 comments + reCaptcha issue

I 've just installed reCaptcha public and private keys on my joomla 2.5 site and i found out that the K2 comments submission stopped working. All i see is a message: "Please enter the 2 words you see below" above the submit comment button but no words appear. Any ideas on this?
K2 version: 2.6.2
for some reason jQuery is not well loaded in your site.
Do the following:
Go to plugin, and ensure that K2 system plugin is enabled (i.e on the back end, go to Extensions, select plugin manager, check out k2 system plugin and ensure it is enabled).
Ensure that you setup correctly the jQuery handling options under K2 parameters. All you need to do is go to admin back end, click under components, go to K2 component. Once it is, click on k2 parameters. Check under 'layout & views'. Check jQuery library handling; set it to load v.1.8.2 local; also do the same under Backend jQuery & jQuery UI handling; set it to local copy.
Ensure your k2 comments are enabled and alas, everything will work.
If the above fails - I am dead sure it won't - do the following:
Make sure that there is no other javascript error on your page preventing reCAPTCHA from operating. Have in mind that you only need one copy of jQuery on your site. K2 namespaces jQuery with $K2.
Instead of the following:
$(document).ready ....
You can use the following:
$K2(document).ready ....
Make sure you have setup public and private key under k2 configuration into advance tab. Otherwise your captcha will not show.