Hi Rahul_Bhardwaj, JK Kendall, aponnusa
1. I need to add a combo box in the 'New Post' creation form of Forum. This combo box is same as "Follow" button in Forum.
The combo should by default have all drop down values selected, user can change the state though.
2. I need to create a relation node in the custom ForumOperationExtension class, afterAction() method depending on the node selected in the combo box. This will reflect in the "Follow" button of the post created.
For (1), I am extending the Forum Model and view in the custom Forum.js file. In ForumView's toggleComposer event function, I am calling model function as below to set default states for combo box values.
toggleComposer: function(e) {
this.model.setDefaultState();
SCF.ForumView.prototype.toggleComposer.call(this, e);
}
Model's setDefaultState function is as below:
setDefaultState: function() {
var _states = ['activities', 'notifications', 'email subscriptions'];
this.set("states", _states);
this.set("subscribed", true);
},
However, {{states}} and {{subscribed}} values are not available at the forum.hbs. I even created CustomForumComponent and CustomForumComponentFactory to add getStates() and isSubscribed() along with its setter call in constructor of component class. Still there is no effect. I do not see these entries in "content/sitescommunity/en/forums/jcr:content/content/primary/forum.social.json" either.
Please let us know the correct approach to achieve this.
For (2), I am using a custom ForumOperationExtension class where I am creating relationship node in the afterAction() method of Forum create operation.
But how do I get the user input combo box values into this operation extension class.
Please suggest an approach to achieve this.
Solved! Go to Solution.
Views
Replies
Total Likes