|
Hi,
I have a screen in wich I set some variables:
<screen name="myScreen"> <section> <actions> <set field="myVariable" value="test_value" to-scope="user" global="true"/> </actions> <section> <widgets> <include-form location="component://myExample/widget/Forms.xml" name="myForm"/> </widgets> </section> </section> </screen>
and if I understand the field myVariable is accessible in context, but when I want to retrieve myVariable from service myJavaService using context.get("myVariable") I got null. Is it possible to access such a variable from my service and how?
Form myForm:
<form name="myForm" type="single" target="submitMyForm"> <field name="param_1"><text/></field> <field name="param_2"><text/></field> <field name="Do something"><submit/></field>
</form>
controller.xml:
<request-map uri="submitMyForm"> <security https="true" auth="true"/> <event type="service" path="org.ofbiz.myApplication" invoke="myJavaService"/> <response name="success" type="view" value="myScreen"/> </request-map>
Service definition:
public static Map<String, Object> myJavaService(DispatchContext ctx, Map<String, Object> context) {
Map<String, Object> result = FastMap.newInstance();
Delegator delegator = ctx.getDelegator();
Map<String, Object> myVariable= (Map<String, Object>) context.get("myVariable"); return result;
}
|