Wednesday, July 16, 2008

Flash Overlay Problem

There is a problem when embedding flash into a web page.
For example if you have dropdown, the dropdown values will be covered by the flash.
Hence you won't be able to view all the images like the picture below.



Here's what we need add

for Flash tag embed
<param name=WMode value=Opaque>

for Javascript
fo.addParam("wmode", "opaque");

and wala.. here's the result...



However, this apparently does not work in Linux.

Reference: here

Wednesday, July 9, 2008

Hide/Show FieldLabel in ExtJs form

This is an overriding function to enable hide/show fieldLabel in ExtJs field form.
The current release of ExtJs 2.1 does not support it.

You can use the function hideItem and showItem in order to show/hide the form field.

Put this function in a javascript file eg. ext-override.js
Then include this file into your html file containing ExtJs form.
Ext.override(Ext.form.Field, {
hideItem :function(){
this.formItem.addClass('x-hide-' + this.hideMode);
},

showItem: function(){
this.formItem.removeClass('x-hide-' + this.hideMode);
},
setFieldLabel: function(text) {
var ct = this.el.findParent('div.x-form-item', 3, true);
var label = ct.first('label.x-form-item-label');
label.update(text);
}
});

Thursday, July 3, 2008

Pre-populate combo values

This sample is to populate combo values in html form using javascript.

For manually insertion of the Option values into the combobox.
<script type="text/javascript"> 
function prepopulate(reportType){
document.form1.report_view.options.length = 0;
if (reportType == "Pie_Chart" || reportType == "Bar_Graph"){
document.form1.report_view.options[0] = new Option("Adobe Reader (.pdf)","pdf");
document.form1.report_view.options[1] = new Option("Open Office (.odt)","odt");
}else{
document.form1.report_view.options[0] = new Option("Adobe Reader (.pdf)","pdf");
document.form1.report_view.options[1] = new Option("Microsoft Excel (.xls)","xls");
document.form1.report_view.options[2] = new Option("Open Office (.odt)","odt");
}
}
</script>

In the html part:
<select name="report_type" id = "report_type" onChange="javascript:prepopulate(this.value)">
<option value="Consolidated_Comments">Consolidated Comments</option>
<option value="Pie_Chart">Consolidated Result - Pie Chart</option>
<option value="Bar_Graph">Consolidated Result - Bar Graph</option>
<option value="Individual_Results_Comments">Individual Results (Comments)</option>
<option value="Individual_Results_FreeText">Individual Results (Free Text)</option>
<option value="List_of_Questions">List of Questions</option>
<option value="Individual_Comment">Individual Result</option>
</select>
<select name="report_view">
</select>

Whenever the report type selected is bar graph or pie chart, it will not display the excel report view, else it will return all three report views.

reference: here

Format source code for blogging

Taken from here. Applicable only for the first 25 lines of codes.
Alternative reference: http://codeformatter.blogspot.sg/


Tab size: 2 4 8
Embed Stylesheet:

Copy the HTML below to your clipboard. Insert the HTML of your blog or wiki.


This is an example of what your text will look like.
    • Tabs are converted to spaces.
    • Quotes and other special characters are converted to HTML.
    • Everything is enclose in HTML's 'pre' and 'code' tags.
    • Style is set:
        • Fixed width font.
        • Shaded box.
        • Dotted line border.


the geek sista

geek Slang.
–noun
1. a peculiar or otherwise dislikable person, esp. one who is perceived to be overly intellectual.
2. a computer expert or enthusiast (a term of pride as self-reference, but often considered offensive when used by outsiders.)
3. a carnival performer who performs sensationally morbid or disgusting acts, as biting off the head of a live chicken.
[Origin: 1915- 20; prob. var. of geck (mainly Scots) fool < D or LG gek]

the geek refers to the second meaning.

this blog will contains anything related to programming languages, new technologies, to simple html, etc..

all for the programming knowledge only..