What I want is to simply set a cookie header. In a page controller method this can be done with PageRequest.getResponse().addCookie(cookie);
But I’m not sure how to do that in a fragment action method. These are the allowed fragment action parameters mentioned on the wiki.
Fragment Action method parameters
Any public method in a fragment controller class is accessible as a fragment action.
Method parameters will be auto-set by type for these classes:
Any help is appreciated.
I’m not sure this is possible, given the current code.
You could try adding this feature to the UI Framework module, I guess starting from this line: https://github.com/openmrs/openmrs-module-uiframework/blob/master/omod/src/main/java/org/openmrs/module/uiframework/FragmentActionController.java#L143 (the response object is available, it’s just not passed along).
I’m pretty new here. May I create an issue in JIRA for this?
It seems it is already reported and is being fixed in UI Framework 3.7.
@gayanw the ticket you have linked to is about Fragment Controllers not about Fragment Actions, which is what I thought you were asking about.
You are welcome to create a JIRA ticket for this. But it’s most likely to get addressed if you work through it yourself. (We can help explain how!)
Fine I’ll create an issue and will work on it.