[gen] Pod field: added param 'getChecked': if you specify there the name of a Ref field of the same gen class, within the pod template you will be able to know what linked objects are currently selected in the user interface.
This commit is contained in:
parent
25f0e8184e
commit
1c2936d76d
3 changed files with 60 additions and 17 deletions
|
@ -656,7 +656,8 @@ function toggleCookie(cookieId) {
|
|||
}
|
||||
|
||||
// Function that allows to generate a document from a pod template.
|
||||
function generatePod(uid,fieldName,template,podFormat,queryData,customParams) {
|
||||
function generatePod(uid, fieldName, template, podFormat, queryData,
|
||||
customParams, getChecked) {
|
||||
var f = document.getElementById('podForm');
|
||||
f.objectUid.value = uid;
|
||||
f.fieldName.value = fieldName;
|
||||
|
@ -666,6 +667,18 @@ function generatePod(uid,fieldName,template,podFormat,queryData,customParams) {
|
|||
if (customParams) { f.customParams.value = customParams; }
|
||||
else { f.customParams.value = ''; }
|
||||
f.action.value = 'generate';
|
||||
f.checkedUids.value = '';
|
||||
f.checkedSem.value = '';
|
||||
if (getChecked) {
|
||||
// We must collect selected objects from a Ref field.
|
||||
var node = document.getElementById(uid + '_' + getChecked);
|
||||
if (node && node.hasOwnProperty('_appy_objs_cbs')) {
|
||||
var uids = [];
|
||||
for (var uid in node['_appy_objs_cbs']) uids.push(uid);
|
||||
f.checkedUids.value = uids.join();
|
||||
f.checkedSem.value = node['_appy_objs_sem'];
|
||||
}
|
||||
}
|
||||
f.submit();
|
||||
}
|
||||
|
||||
|
|
|
@ -139,6 +139,8 @@ class ToolWrapper(AbstractWrapper):
|
|||
<input type="hidden" name="podFormat"/>
|
||||
<input type="hidden" name="queryData"/>
|
||||
<input type="hidden" name="customParams"/>
|
||||
<input type="hidden" name="checkedUids"/>
|
||||
<input type="hidden" name="checkedSem"/>
|
||||
<input type="hidden" name="action" value="generate"/>
|
||||
</form>''')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue