Using mojo's ColorSettings control

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
8/7/2009 1:56:52 PM
Gravatar
Total Posts 20

Using mojo's ColorSettings control

I am working on a custom module, and would like to include the ability to select a color for part of it.  I found the color settings module in the main project, and added it to the edit page for the module.  So far, so good.

However, when I attempt to read the selected color in my code-behind file, I am unable to do so.  From looking at the code for the ColorSetting control, it looks like I should be able to write something like this (where MyColorPicker is the ID of the ColorSetting control on the form):
string color = MyColorPicker.GetValue();

However, this doesn't work, as GetValue cannot even be found when I try to compile the code-behind.  Using ToString() allows everything to compile, but doesn't seem to contain the value I want.

So given this, I am stumped as to how to do two things:

1) Read in the selected color from the ColorSetting control, so I can store it in the Module Settings for my module.

2) Once I've stored a selected color in the Module Settings, make that color be initially selected when I go to the edit page for my module.

Many thanks in advance for your help!

8/7/2009 2:13:26 PM
Gravatar
Total Posts 18439

Re: Using mojo's ColorSettings control

You have to first cast it as ISettingControl before you can call GetValue() or SetValue(...)

Hope it helps,

Joe 

8/7/2009 3:04:52 PM
Gravatar
Total Posts 20

Re: Using mojo's ColorSettings control

Ah!  That did the trick!

However, I'm now seeing another problem.  My edit page has the little box you click to bring up the color picker, but when you click on it, the box it brings up is empty, rather than containing controls to pick a color.  I can enter hex values manually, and these are read fine, and this will cause the box to change to the color I enter, but nothing ever appears in the popup box.

JavaScript is enabled on the browser I am testing on.  I'm building from the latest version of the source code, although my skin files may be out of date. Any ideas how to get the color picker to actually show up?

8/7/2009 3:13:52 PM
Gravatar
Total Posts 18439

Re: Using mojo's ColorSettings control

Hi,

If your page does not inherit from mojoBasePage it will not inlcude the needed scripts and css automatically. It works on pages that inherit from mojoBasePage.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.