Saturday, January 23, 2016

Polling System - Component Using Lightning Design System and Challenges with RemoteObjects


Hi All,

My today’s post is related to Polling System - Component, I made this polling system component using Lightning Design System so that we could display multiple polls together on a single page based on our design like vertically or horizontally or as this is a component we could use it on multiple pages by using the same component [As you all must know the use of Visualforce Component].

Challenges with RemoteObjects:

While developing this component, I face some challenges which I want to share with you all, like as I have just started using RemoteObjects in this month so it’s a new experience and fun for me. I tried to use RemoteObjects in Components but I was not able to do that as we could use that only in the page.

So I built the component by using Apex and tried to use the RemoteObjects on the page to the get the list of polls and pass the ids [User-Id, Poll-Id and Serial-Number or you should say Record-Number to manage the unique DOM element ids] to the component through that list in the RemoteObjects callback but that is also possible.



Reason: The reason is RemoteObjects are page centric so anyhow we could not use the RemoteObjects with the Visualforce Components; it was my finding for this week. Let me know if I am wrong somewhere, I will be more than happy if you rectify my mistake if I am making any.

Let’s come back to polling component which I made:

I have built the 4Options and 2Options polling for my Demo, if you have any more or less options requirement than you could modify the implementation based on that as well. Here is screenshot of the Polling-Page on which I have used the Polling-Component.


You could use this component with content at any place in section or could display the multiple polls on a single page vertically or horizontally, that is all based on your design like Grid or Table whatever you need to apply.

After selecting the option, you will need to click on the Submit button to poll. After submitting the Poll with display the result the result like in the following screen:


I am planning some more changes to display the results in more meaningful and efficient way, let me know if you have some idea on this.

If you are having some requirement or planning to try this or need help to know the technique or guidance, feel free to put your suggestions/comments/ask questions or connect with me.

Happy Coding J

Thanks,
Amit Goyal
Email: amitgoyal09@gmail.com
Skype: amitgoyal09

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.