Customize Color Columns from Views on Web

Hi;

I have an embedded view on a form with some hiding color fields for backgroud, active link and for 3 columns from the embbeded view, i use that form to make a document and display taht document on a frame, what i need to do to apply the value of my colors fields on the web?

For your help and attention

Thank you

Daniel

Subject: Customize Color Columns from Views on Web

I use DIVs for that… see background and font colors in the definitions, then reference the ID name when I want to use it.

You’ll likely want to make another view (same selection criteria) to use for this… just to keep things separate… your new view is going to have html content within the column formula.

I use TopStyle to tell me which properties to set and what options are available. You will want to be familiar with DIV, CSS and STYLES as you start controlling fonts/colors for web pages.

Rarely can you use the same design element for Notes Client and Web… it’s just hard to manage because you might want to change the look for one without worrying about the impact for the other users… use alias if you need the reference the item by name and check/uncheck the show to Web or Notes client as appropriate.

If you would like an example, let me know via a response and if someone hasn’t provided this by Monday, I’ll grab a snippet off one of my production databases for you.

Subject: RE: Customize Color Columns from Views on Web

Hi:

With CSS can i access to the value of my fields to use it’s values to customize the colors of the elements of my form and embedded view? I thought that maybe i need javascript, if you have an example that you could provide me it would be great.

Thank you for your help

Daniel

Subject: RE: Customize Color Columns from Views on Web

Javascript would be used to change the property of the div.You can change any property you like… background color

For example, this snippet changes visibility:

//passthru html on the form (default value at launch)

//define two DIVS in css both start off hidden (display:none)

#div1 {display: none;} #div2 {display: none;}

// define two areas on form (each area can be paragraphs) the tags are passthru html

area1
area2

//make a radio button field with values: “First”:“Second”

//fieldname (for this example) is ‘location’ (case is sensitive)

//in the ‘onchange’ event put this command

displaydivs();

//in the JSHeader (WEB) section put in the commands that do the work

function getSingleSelectText( selObj ) {

/* Gets field text, not value - handy utility code*/

return ( selObj.options[selObj.selectedIndex].text );

}

function displaydivs() {

var f = document.forms[0];

if ( getSingleSelectText(f.location) == “First” ) {

document.getElementById(‘div1’).style.display = ‘block’;

document.getElementById(‘div2’).style.display = ‘none’;

}

if ( getSingleSelectText(f.location) == “Second” ) {

document.getElementById(‘div1’).style.display = ‘none’;

document.getElementById(‘div2’).style.display = ‘block’;

}

}

The javascript runs ‘onchange’ that command checks the value of the location field and changes the style (in this example, the display) to ‘block’ or ‘none’

1st thing to decide upon is what style you want, here is how I’d start.

  1. define the area with a div

  2. set the default style of the div to what you want it to be changed to. This might take a bit of experimenting but since you’re doing it as default, for now, you can just make the change and display it to see how close you are to perfect

  3. repeat this with all the areas you want to change

  4. decide what state for each div would be default

  5. decide how/when you want the change the divs… this example was w/radio ‘onchange’, but just as easily you could put it on something’s ‘onmouseover’ or whatever. Depending upon a field value isn’t your only option, but if it’s user driven then the code to get the field’s value is a bit different for multivalue/combobox/checkbox than I illustrated.

Subject: RE: Customize Color Columns from Views on Web

Thank you for your help

I’m going to check it on different ways.

Daniel