cancel
Showing results for 
Search instead for 
Did you mean: 

Custom action with Form Dialog

vkpatel
Champ in-the-making
Champ in-the-making
I have created an UI Action. The action type is Javascript and the function is OOTB function named onActionFormDialog.
I am have configured itemKind=type as itemKind=action is not working for me as described in several tutorials. I am able to open the form using the form Service after configuring the itemKind=type.

I want to call custom developed webscript to change the owner of the node which is written using Javascript. The input to the webscript is nodeRef and the newOwner. (which I want to pass from the Diaglog).

How to call the webscript on the click of the OK button of the Dialog/form ?

I have tried to pass "submissionUrl" as a param of action definition but it is not working.

Thanks

My Share-config custom file



<action id="ipr.doclib.action.changeOwner"
            icon="document-view-original-16.png"
            type="javascript"
            label="Change OwnerForm">
        <param name="function">onActionFormDialog</param>
        <param name="itemKind">type</param>
        <param name="itemId">ipr:nodeOwner</param>
        <param name="mode">create</param>
        <param name="destination">{node.nodeRef}</param>
        <param name="successMessage">success</param>
        <param name="failureMessage">failure</param>
  </action>


  <actionGroups>
   <actionGroup id="document-browse">
                <action index="401" id="ipr.doclib.action.changeOwner"/>
   /actionGroup>
      <actionGroup id="document-details">
                <action index="401" id="ipr.doclib.action.changeOwner"/>
       >
      </actionGroup>
       <actionGroup id="folder-browse">
                
       <action index="401" id="ipr.doclib.action.changeOwner"/>
      
      </actionGroup>
      <actionGroup id="folder-details">
       
       <action index="401" id="ipr.doclib.action.changeOwner"/>
      
      </actionGroup>



<config evaluator="string-compare" condition="ipr:nodeOwner">
         <forms>
             <form>
                 <field-visibility>
                     <show id="ipr:to"/>
                 </field-visibility>
                 <appearance>
                     <field id="ipr:to" label="to">
                 <default-controls>
                  <type name="mltext" template="/org/alfresco/components/form/controls/textarea.ftl" />
                 </default-controls>
               
                  </field>
                 </appearance>
            </form>
        </forms>


I have also created custom node type ipr:nodeOwner.


1 REPLY 1

art99trash
Star Contributor
Star Contributor
Did you ever figure this out?
When I have used anActionFormDialog, the <config condition=
value was always the same as the <action id=
value. The itemKind was always ="action".


<action id="ipr.doclib.action.changeOwner"
            icon="document-view-original-16.png"
            type="javascript"
            label="Change OwnerForm">
        <param name="function">onActionFormDialog</param>
        <param name="itemKind">action</param>
        <param name="itemId">ipr:nodeOwner</param>
        <param name="mode">create</param>
        <param name="destination">{node.nodeRef}</param>
        <param name="successMessage">success</param>
        <param name="failureMessage">failure</param>
</action>

<actionGroups>
  <actionGroup id="document-browse">
    <action index="401" id="ipr.doclib.action.changeOwner"/>
   </actionGroup>
  <actionGroup id="document-details">
    <action index="401" id="ipr.doclib.action.changeOwner"/>
  </actionGroup>
  <actionGroup id="folder-browse">
       <action index="401" id="ipr.doclib.action.changeOwner"/>
  </actionGroup>
  <actionGroup id="folder-details">
    <action index="401" id="ipr.doclib.action.changeOwner"/>
  </actionGroup>
</actionGroups>

<config evaluator="string-compare" condition="ipr.doclib.action.changeOwner">
  <forms>
    <form>
      <field-visibility>
        <show id="ipr:to"/>
      </field-visibility>
      <appearance>
        <field id="ipr:to" label="to">
          <default-controls>
            <type name="mltext" template="/org/alfresco/components/form/controls/textarea.ftl" />
          </default-controls>
        </field>
      </appearance>
    </form>
  </forms>
</config>