I have a form in share with multiple fields using category.ftl. I want to set default values in those fields dynamically. I can set default value by passing static path of category in share-config-custom.xml. But now my requirement is to read values stored in one file and than set those values as default in category.ftl.
For ex, On above screenshot I have set default language as English by passing English reference statically in share-config. So every time when a form renders it sets English as default language. I want this to be changed to set default language to value which is stored in file. So how to pass dynamic reference of category in share-config-custom.xml file?
Any help would be greatly appreciated!!!
You cant configure dynamic things in share-config-custom.xml.For that you need to workj on below things.
For each and every picker in alfresco ,alfresco share is using below javascript file.(This are YUI scripts)
1.generic-object-finder.js
2.object-finder.js
object-finder.js = >
This file is generally used when type of content is authority(users of alfresco).So i think this will be not used in your case.
generic-object-finder.js = >
This file is used for generic picker and using this you can set default values.
======================================================================
Below are steps to set value in picker.
1.Alfresco.util.ComponentManager.list("Alfresco.GenericObjectFinder")
Above method will return all object of picker , We need to pick one by one and set default value one by one in alfresco advanced search.It will return object in array form
2. X.options.defaultValue need to be set.
Where X will first element of Alfresco.util.ComponentManager.list("Alfresco.GenericObjectFinder") array
3.x.selectItems("workspace://SpacesStore/f73a4de7-7a45-412d-ac7d-56061fcf9d76")
Above will set default value.You must need to pass relevant value here.
Related
I have a php webpage that includes some graphical dials created with css and javascript (and an ajax call). Each dial is added to the webpage using:
$_SESSION['info'] = dial1 Specific info.
include 'dial.php';
$_SESSION['info'] = dial2 Specific info.
include 'dial.php';
Inside dial.php, there is a section that analyzes the SESSION variable to adjust an arm on the dial, and creates the dials circular shape with css. The problem I'm trying to solve is the second dial is a copy of the first dial, and not distinct.
How can I make the above code force each "include 'dial.php'" to operate independently from each other and not interact with each other (since the variables, function names, and css names are the same for each dial).
Best Regards
you can not add two different object into one variable !
make your session variable as an array like below :
$_SESSION['info'][1] = dial1 Specific info.
include 'dial.php';
$_SESSION['info'][2] = dial2 Specific info.
include 'dial.php';
for a better answer , put your dial.php code , I'll update my answer
The session variable can hold many types of data but you need to structure the session variable in a different manner to your initial code. If you were to assign an object as the value ( as below ) you can access the right piece of information easily using the object notation shown below.
$_SESSION['info']=(object)array(
'dial_1' => 'dial1 Specific info',
'dial_2' => 'dial2 Specific info'
);
then access the individual info by
$info=$_SESSION['info']->dial_1;
So I ended up using dynamic html tag ids, function names, and variables. It seems to be working out fine.
I need to use partialUpdateObject from the Algolia Javascript SDK to delete an attribute from an object that is already in the index.
My scenario is that I have a description field on my object that is optional. If the user originally sets a description and then later deletes it, I want to remove the description altogether from the object.
I do not want to overwrite the whole object (without the description attribute) because I have some count attributes on the object that I do not want to have to recalculate.
As far as I can tell in the documentation there isn't a way to do it and my workaround is to set the description as an empty string. Is that the recommended approach?
You're right: you cannot totally remove the attribute from an object with a partialUpdateObject operation. As a work-around you can set it to null, maybe that's enough for your use-case?
If you really want to delete the field you can :
Get your object with the search function
Store all fields values
Update (not partial update) your object without passing the field you want to delete
How can I extract values from Global picklist in crm 2013? I update some text fields based on the value of the option set. Usually in local option set we can use the following code to update the fields based on the value of option set.
var value = Xrm.Page.getAttribute("new_optionset").getText();
if(value=="ABC"){
Xrm.Page.getAttribute("new_field1").setValue("Value");
Xrm.Page.getAttribute("new_field2").setValue("Some Value");
Xrm.Page.getAttribute("new_field3").setValue("Some Other Value");
}
But this does not seem to work if I am using a global option set. Is there another way of handling them?
From JavaScript there is no difference how to get the text between a local and a global optionset.
The syntax is the one you already know:
var value = Xrm.Page.getAttribute("new_optionset").getText();
If you want a library to manage the optionsets you can check this one I wrote:
http://gallery.technet.microsoft.com/scriptcenter/OptionSet-JavaScript-76af41f5
I have a code like this:
<s:select id="s" list="list" listKey="id" listValue="displayValue">
When I get the value from the object I'll always get the id.
How can I change the "listKey" value dinamically so I could get for example, the name of the object (supposing other of my attributes besides id is name ) instead always de id?
I was trying some code in jQuery like this:
function changeListKey(){
var id = $("#s").val();
$('#s').attr('listKey','name');
var name = $("#s").val();
document.write(name); // Only to test if I could get the value
}
When I execute it it doesn't seem to change the "lisKey" value so I could get another one, what would be the solution?
Thanks a lot in advance.
John Smith.
Why would you want to mix up what's used as the key value? That would make a mess on the server side.
In any case, listKey isn't an HTML attribute, it's a custom tag attribute, and is meaningless after the HTML has been rendered and sent to the client. You would need to iterate over the HTML select element's options collection and change the values on the options.
All this said, you'd be much better off doing any bizarre manipulations like this in the action itself, and exposing only the desired key/value pairs to the JSP, either in a list, or more easily, in a map. Using a map eliminates the need to provide listKey/listValue attributes--just use the map's key as the option text, and the value as the option's value.
I can't seem to figure out how to set a particular value for the Silverlight Plug-in. Specifically, the splashScreenSource value. I'm able to get this working using the param (name/value) method, however, I'm injecting the Silverlight plug-in using JavaScript and therefore not sure how I can get the plug-in to recognize that I do in fact want to use a splashscreen.
It doesn't appear that I can set the value using the args list provided via the default Silverlight.js file.
Silverlight.createObject( source , parentElement , id , properties , events , initParams , userContext );
Any idea's will be greatly appreciated,
thanks much,
The properties parameter is expected to be a JavaScript object whose properties match the set of param names with a few additions such as width and height. So you can pass the following object to properties parameter.
var properties = {splashscreensource: "splash.xaml"};