AnsweredAssumed Answered

How to render different form fields of selected Content type in Alfresco Advanced Search Screen

Question asked by riya.soni42 on Mar 29, 2017

Hi,

 

I am using alfresco 5.2.

 

I want to change in form fields when it is rendering after clicking on Cotent Type from menu button in alfresco advanced search screen.

 

For example, if I have select cm:content from menu button then form is rendered.

 

I have refered the code which is there in advsearch.js file at path Alf-installation-folder\tomcat\webapps\share\components\search\advsearch.js.

 

When it is called webscript which contains url "YAHOO.lang.substitute(Alfresco.constants.URL_SERVICECONTEXT + "components/form?itemKind=type&itemId={itemId}&formId={formId}&mode=edit&showSubmitButton=false&showCancelButton=false" " .

 

 Alfresco.util.Ajax.request(
            {
               url: formUrl,
               dataObj: formData,
               successCallback:
               {
                  fn: function ADVSearch_onFormTemplateLoaded(response)
                  {
                     // Inject the template from the XHR request into the child container div
                     formDiv.innerHTML = response.serverResponse.responseText;   
                     containerDiv.appendChild(formDiv);
                     visibleFormFn.call(this);
                  },
                  scope: this
               },
               failureMessage: "Could not load form component '" + formUrl + "'.",
               scope: this,
               execScripts: true
            });

 

In this code, formDiv.innerHTML contains whole html of the form template like form tags, div tags, input tags according to selected content types,

 

now I want to get id of div tag or input tags which is there in above object.

 

But I don't know how can I get each tags value and id from formDiv or formDiv.innerHTML.

 

Please give the suggestion or any link or code, so I can achieve this.

 

Thanks in advance.

Outcomes