Showing posts with label Apache ofbiz tutrial. Show all posts
Showing posts with label Apache ofbiz tutrial. Show all posts

How to use own JavaScript file in Apache ofbiz | implement own JavaScript function call in Apache ofbiz

In my Apache ofbiz project i have implemented own JavaScript in Minilang code

1. Add below line of code to give reference of JavaScript File in ogbiz Screen


           <actions>
                <set field="titleProperty" value="ProductFindFacilities"/>
                <set field="headerItem" value="facility"/>
                <set field="layoutSettings.javaScripts[+0]" value="/images/TestJavaScript.js" global="true"/>
            </actions>

2. by using Event and Action attribute as below to call javascript function from minilang form code

<field name="submitButton" title="Get Inventory Feed" widget-style="smallSubmit" event="onclick" action="javascript:return submitFormEnableButtonByNameTest(this,submitButton)">
                                                <submit button-type="submit" />

event  > it use for write javaScript event like onClick, onMouseOver etc
action > use for call funtion name of JavaScript