i want to pass a string from my javascript-controller to apex controller so that it can be used as a global variable(string) in Apex controller below is the code
{.....user is selecting a group name from the list of groups and im passing the group id of the selected group to apex controller so that i can use the group id to do the further operations on the server side such as connect, disconnect, send message, get all the users from the group etc....}
i want to use the group id in more than one meethod in my apex controller
controller.js
connect:function(component, event, helper){
var selectedItem = component.get("v.selectedvalue");
var action = component.get("c.getGroupId");
// want to use selectedItem as a global variable (string) in apex controller
//action.setParams({postmsg1:selectedItem});
$A.enqueueAction(action);
}
any help will be appreciated