Salesforce lightning:carousel - salesforce-lightning

I am using the in the code the Html class name are not viewable.
but if I use inspect element I can find the HTML class name that it uses such as slds-carousel__content etc.
My problem is i cant access those class name on my client side controllers.
Is there a way to get those class name ?

Here is a link to that describes how to change the class. You can get the component by using component.find("insertnamehere").getElement(); It's not always reliable unless you are specifying a render attribute on the controller though.
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_show_hide_markup.htm
as a side note: as sanctimonious as some of the mods on the Salesforce stackoverflow might seem, it is still a more likely place to find such content. Good luck.

Related

Get bean->id when in _headerModuleList.tpl (suiteCRM, SugarCRM CE)

I'm trying to adjust the nav bar at the very top when inside a specific bean, but I can't figure out how to read the current module name/bean->id
(or if it's even possible).
As a workaround I thought of indicating a custom header, but in meta we can only put custom headerTPL, example
$viewdefs[mod][DetailView][templateMeta][form][headerTpl] => 'custom/themes/SuiteP/tpls/headerModuleList_c.tpl',
But we can't indicate a custom headerMODULELIST it seems
Would appreciate your help
You can USE Jquery as well with ajax enabled or even ajax disabled modules. This is beneficial for you only if you need these values at Browser Side.
Anyhow,
Try these
$("input:hidden[name='record']").val()
$("input:hidden[name='module']").val()
For going more specific you can access it by Parent Form ID
$("form#formDetailView input:hidden[name='module']").val()
$("form#formDetailView input:hidden[name='record']").val()
For Server Side you can try this thing to get URL and you can parse it accordingly
$url = "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
In the end the only thing that worked for me is disabling the AjaxUI which loads the page partially and makes any sort of complex modification to the header navigation pretty difficult
Once disabled you can just call $_REQUEST in _headerModuleList.tpl to get all the details you need

Not able to call form in AEM6

I have copied the Forms from the /libs/foundation/components/form to /apps/mywebsite/components/form, I made some changes to the copied form files but still the default form is getting called.
Could you let me know or provide some documentation for the forms.
Thanks in advance
The problem is that you moved things to:
/apps/mywebsite/components/form
Instead, you need to copy them to:
/apps/foundation/components/form
apps overrides libs ONLY if the path is otherwise the same
so:
/apps/something/something/somethingelse
will override:
/libs/something/something/somethingelse
if ANY part of that path is different, that overlay won't work.
In addition, if something calls a component/resource/whatever under /libs using the fully qualified name (e.g. actually including /libs/ at the beginning) then it will still use that. But this is rare.
Let me know if you have more issues.
BTW, you can change this search approach (apps before libs) in the resource resolver settings in OSGI. It comes this way by default but can be changed.
If you didn't want to overrride but extend the foundation forms, you need to make sure that you copied everything or have the inheritance to foundation right. Most important is the cq:editConfig/cq:formParameters, where you need to have sling:resourceSuperType="foundation/components/form/defaults/field". If you use a cq:template instead, you need to set the supertype parameter there.
Then you would have to use your components on the page instead of the foundation ones.

IoC, MVC4 Web API & HttpParameterBinding/ParameterBindingAttribute

I'm using ASP.Net MVC 4 RTM Web API. I have a controller action with a parameter that I'd like to populate via custom model binding. To achieve this, I created a class that derives from System.Web.Http.Controllers.HttpParameterBinding that sets the value of this parameter. I then created an attribute class that derives from System.Web.Http.ParameterBindingAttribute which I use to decorate the parameter on my controller action.
This is all working great, my HttpParameterBinding class is populating the action parameter correctly. The problem I have is that my custom parameter binding class has a dependency that I'd like resolved via my IoC container (Unity). Is there a way to override how Web API creates HttpParameterBinding instances so that I can build up my custom binding class dependency from Unity? I was able to do something similar for a filter attribute by creating a custom filter provider that uses Unity's BuildUp method to populate dependencies, however I'm not seeing anything similar for Web API's HttpParameterBindings.
In general: to use IoC / Unity in the Web API you need to set it up seperately.
Try downloading the nuget package Unity.WebApi and see if that helps!
Take a look at this article: Parameter Binding in WebAPI
It walks through a couple different options from Converters to Binders to BinderProviders. It sounds like you may be able to write a custom ModelBinderProvider which knows how to provide your dependency. If that isn't high enough in the chain you can look at replacing the default IActionValueBinder service. It's a DefaultActionValueBinder instance, which you can extend or simply re-implement.
I also highly recommend downloading the WebAPI source code, as it's been an incredible help for these issues as I've run into them. Here's the WebAPI source code. I recommend downloading it so you can open it in VS for easy navigation.
Feel free to check out FlitBit too (It's very modular, don't let the number of packages scare you off)! I'm working on a WebAPI package for supporting FlitBit, specifically FlitBit.IoC and FlitBit.Dto. I'll add an update if I work out my IoC issue, since it's very similar to yours.

Migrate custom Facebook util library to Yii framework

I have a facebook app developed in plain PHP, I'm migrating the app to YII framework.
The thing is that I use a class call "utilsFacebook" where I have the object facebook(of the fb sdk) and all the methods that I need to get data from facebook, getUserId, getUserFriendList, etc.
I don't know how to handle all the operations that I do in utilsFacebook with Yii.
Create a controller with the functions of utilsFacebook is the correct think to do?
Every time that I instance the controller would create a new Facebook object, Should I store that object in a SESSION to get a better performance or is a bad idea?
Q. Create a controller with the functions of utilsFacebook is the correct think to do?
Having done a facebook app using yii as the framework, i would recommend you to make this library either a component, or an extension.
But definitely don't put these functions in the controller directly. Whenever a controller needs them call the functions using your custom facebook util class.
Components can be put in the folder: projectrootfolder/protected/components
Extensions can be put in the folder: projectrootfolder/protected/extensions
If you don't believe that either of these make semantic sense, you can always create a new folder within protected, say utils and put the class there. However i think extensions is the best way to go.
Q. Should I store that object in a SESSION to get a better performance or is a bad idea?
I don't think it's necessary to store the object in a session, because there will be no visible performance gain. Further you'll complicate your code unnecessarily.
What i had done was, created an app level component and used this component throughout the app, in any controller.
Example:
In your application's config, protected/config/main.php :
'components'=>array(
'fbHelper'=>array( // gave the component this name
'class'=>'ext.utils.FacebookHelper', // had stored the helper class in extensions/utils folder
'parameter1'='somevalue',
// more parameters
),
// standard yii app components
),
This will allow you to use the component like this: Yii::app()->fbHelper->getFriends();
Take a look at the facebook-opengraph extension, which could help you, on the way.

How to get request properties in routeStartup plugin method?

I'm developing a multilanguage application, and use routes with translated segments. For multilingual support I created special Multilingual plugin.
To use translated segments I need set translator for Zend_Controller_Router_Route before routes init. So only possible place for this in my plugin is routeStartup method, but there is one problem here - for determine right locale I need to use properties of request (Zend_Controller_Request_Abstract), like module, controller and action names, but they are not defined yet here in routeStartup method. They are already defined, for example, in routeShutdown - but I can't set translator for route there, because it have to be done before routes init.
So what can I do:
can I get request properties somehow in routeStartup
or can I re-setup translator later in routeShutdown
P.S: there is a question with exactly the same problem Zend_Controller_Router_Route: Could not find a translator, but proposed answers is not the option for me, because I can't just retrieve language code from url with Regex, I have much more complicated code to define right language code.
Thanks.
What about putting your code in preDispatch? That's what I personally do when I need to check if the person is logged in. Maybe you can move your code there too?