0

I am in a complex situation here. I want to pass a map attribute defined lightning component(which is a map of maps as shown below) to apex controller.

Map Attributes

<aura:attribute name="settingsFieldMap" type="Map" default="{}"/> <!-- Map of maps with key as a custom object and value as the map below(fieldValuesMap): -->
<aura:attribute name="fieldValuesMap" type="Map" default="{}"/> <!--this is a map of String to String-->

like

settingsFieldMap[key]=fieldValuesMap;

It shows me all values properly when I iterate throug it in component controller, but when I pass it in Apex controller, it shows null.

definition of Apex controller method:

public static void updateEditedValues(Map<customObject__c, Map<String, String>> settingsFieldMap)
2
  • are you getting any errors in java script console or debug logs Commented Nov 18, 2016 at 19:41
  • Doesn't show any error in console or debug logs Commented Nov 21, 2016 at 4:47

1 Answer 1

1

Figured out better way to pass data rather than this complex logic. Hence, closing it.

NOTE: I used a list of list custom settings records , stringified them, de-serialised them in apex and then used them. Related question to this was:

How to pass LIST custom setting list(array) from client side to server side controller in lightning?

2
  • Now I am in a situation where I have to pass map, list won't do. This time it is map of String to String. Please help! Commented Dec 9, 2016 at 6:26
  • Had to pass again using JSON Commented Dec 13, 2016 at 10:01

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.