03-20-2012 01:25 PM
03-21-2012 04:46 AM
03-21-2012 08:21 AM
03-21-2012 08:42 AM
03-21-2012 11:01 AM
03-21-2012 11:24 AM
05-04-2012 05:16 PM
Hi Prpontes,
Unfortunately I don't follow exactly what you want to do, right now I'm guessing you are trying to create a form that shall appear in Share when you create new content of your custom model, and that that form shall contain a custom control shall be a combo box that shall load data from a "database table" in the repository?
If so please make sure you have read the forms documentation on how to create a custom form "control":
http://wiki.alfresco.com/wiki/Forms
Then make sure there is a json webscript available in the repo that can make the table data available through the proxy. Then use the Alfresco.util.Ajax.jsonGet javascript method from your custom form control to load the table data from the repo.
Hope this is at least close to what your looking for, If not you have to be a bit more specific, providing some of the code you already have might help.
Cheers, Erik
05-07-2012 02:50 AM
<select id="${fieldHtmlId}"></select>
var getSelectFieldData = function(fieldId)
{
// First make sure the select element is found in the dom…
YAHOO.util.Event.onContentReady(fieldId, function()
{
// …found it, now ask your custom repo webscript for the data…
var selectEl = YAHOO.util.Dom.get(fieldId);
Alfresco.util.Ajax.jsonGet(
{
url: Alfresco.constants.PROXY_URI + '/your/custom/webscript',
successCallback:
{
fn: function loadWebscript_successCallback(response, config)
{
// …data is now received, now populate the select element
// todo: Add <option> elements to "selectEl".
}
});
});
}
// Call your function
getSelectFieldData("${fieldHtmlId}");
05-07-2012 03:09 PM
Hi,
If your new to this its probably easiest to start by creating it inline, inside the template just to get it working…
First create a combobox and assign it the unique guid that the forms runtime gives you, i.e.:<select id="${fieldHtmlId}"></select>
Then inside a <script> tag do something like this:var getSelectFieldData = function(fieldId)
{
// First make sure the select element is found in the dom…
YAHOO.util.Event.onContentReady(fieldId, function()
{
// …found it, now ask your custom repo webscript for the data…
var selectEl = YAHOO.util.Dom.get(fieldId);
Alfresco.util.Ajax.jsonGet(
{
url: Alfresco.constants.PROXY_URI + '/your/custom/webscript',
successCallback:
{
fn: function loadWebscript_successCallback(response, config)
{
// …data is now received, now populate the select element
// todo: Add <option> elements to "selectEl".
}
});
});
}
// Call your function
getSelectFieldData("${fieldHtmlId}");
Once it works move the code to a separate .js file in which you can create a proper javascript class so it can be documented and reused etc.
03-13-2013 07:16 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.