5 December 2008

CSS page-break-after property - empty pages

Additional empty page by using page-break-after:always

if there is no other elements or text in html after DIV element and in this DIV element page-break-after property with attribute always is used, then by printing an extra empty page will be added at the end of document.

4D GET WEB SERVICE RESULT return parameter

4th Dimension Web Services

The GET WEB SERVICE RESULT command is used to retrieve a value sent back by the Web Service as a result of the calling command CALL WEB SERVICE.

GET WEB SERVICE RESULT (returnValue{; returnName{; *}})

To get value of return parameter variable returnValue is used and it
should be declared as TEXT variable. Using of string return no value and no any error.

22 November 2008

Flex HTTPService - how to change character set of parameters

Adobe Flex Tipp: How to change character set of parameters submitted with HTTPService object's send() method.

By default, HTTPService send parameters as name/value pairs and they are converted to URL-encoded format using UTF-8 character set.

It is possible to use system character set by adding in application
System.useCodepage = true

public static function get useCodePage reference():

Additional information

You can get the Player to fall back on making a different character set guess by setting System.useCodepage=true. So do that before executing your http service, and then after the httpservice result comes back I'd recommend setting useCodepage back to false.

Matt Chotin


Why Flex change the CharacterEncoding of HTTPSer vice's result?

You can also try somewhere in your application setting System.useCodepage = true. Normally we only support UTF-8 character sets. If you set useCodepage to true it will attempt (and sometimes get right) using another character set.



It's possible that setting this for the life of the application will have negative consequences, you may need to narrow it down to set it to true before you send the HTTPService request and set it to false after the HTTPService returns.


flexcoders

useCodePage property can be used also in other cases:
escapeMultiByte () function
Returns an escaped copy of the input string encoded as either UTF-8 or system code page, depending on the value of System.useCodePage. Use of System.useCodePage allows legacy content encoded in local code pages to be accessed by the player, but only on systems using that legacy code page.

21 November 2008

Ajax GET request - caching problem

Caching problem with AJAX GET request, to solve it append random string to request:

objXmlHttp=new XMLHttpRequest();
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url+'?nocache='+new Date().getTime() , true)
xmlHttp.send(null)

29 October 2008

Market Data in Excel

Excel Help for Downloading Market Data in Building Market Trading Systems

25 August 2008

4D Server - using debugger with Stored Procedures

Trace point will be activated in running store procedure only after restarting of procedure.

1.Place TRACE in method Editor
2.Abort process with store procedure
3.Start a new process with store procedure

22 August 2008

fonts size - using of EM tag

There are two types of length units: relative and absolute. Relative length units specify a length relative to another length property. Style sheets that use relative units will more easily scale from one medium to another (e.g., from a computer display to a laser printer). - W3C Relative units are:

* em: the 'font-size' of the relevant font
* ex: the 'x-height' of the relevant font
* px: pixels, relative to the viewing device

The .em unit can be troublesome, though theoretically it is ideal. Read the following from the W3C specs and note the potential pitfalls: The 'em' unit is equal to the computed value of the 'font-size' property of the element on which it is used. The exception is when 'em' occurs in the value of the 'font-size' property itself, in which case it refers to the font size of the parent element. It may be used for vertical or horizontal measurement. (This unit is also sometimes called the quad-width in typographic texts.)


The 'em' unit is equal to the computed value of the 'font-size' property of the element on which it is used. The exception is when 'em' occurs in the value of the 'font-size' property itself, in which case it refers to the font size of the parent element. It may be used for vertical or horizontal measurement. (This unit is also sometimes called the quad-width in typographic texts.)


»em« nicht nur für Schriftgrößen!

Wie man sieht, muß bei verschachtelten Elementen die Abhängigkeit von den Schriftgrößen der Elternelemente beachtet werden. Darüber hinaus kann ein Bug bei manchen Installationen des Internet Explorers unter Windows dazu führen, daß unter 0.8em formatierte Schriften mikroskopisch klein dargestellt werden. Abhilfe schafft hier, wie bei Efa - Einfach für alle nachzulesen ist, die folgende Angabe:

body { font-size:100.1%; } (die empfehlenswerte Voreinstellung)


Формула конвертирования пикселей в емы (px to ems)

1 / parent font-size * required pixel value = em value

Под "относительнымы" размерами шрифта подразумевается:

1.Что em вычисляются основываясь на размерах родительского элемента. Например если размер шрифта для родительского контейнера 16px, то размер шрифта для вложенных элементов будет тоже равен 16px. Если относительный размер шрифта для вложенного элемента определить как 0.75em то точный размер шрифта для этого элемента будет равен 0.75 * 16px = 12px.

2. Если пользователь увеличивает или уменьшает размер шрифта в браузере, то текст растягивается или сжимается соответственно.

Эластичный интерфейс гибкий и доступный для пользователей и по своей точности почти не уступают пикселям (px) и Вы сможете легко использовать относительные размеры (em) как только полностью поймете разницу между em и px.

Нет ничего проще, чем em. Где нужны масштабируемые размеры, будь то шрифт, будь то бэкграунд, будь то поля и отступы, использую em. Где масштабирование не нужно или искажает верстку - px.
Приведение в body: если основной текст сайта 16px, то font-size:100.1%. Если 14px, то font-size:87.5% и т.д.
Господа, читайте Э.Мейера - все ваши вопросы и заблуждения разрешатся.

HTML form width of select element

By default select boxes expand to the size of their content.

Since Netscape 4 has only the proprietary attribute that will give the desired effect, it will not hurt anything to combine the use of CSS and the WIDTH attribute.

<select NAME="foo" WIDTH="300" STYLE="width: 300px">
<option>one
<option>two
<option>three
</select>

20 August 2008

FLEX: add arrays to ArrayCollection to use as DataProvider

Web Service call return in Flex two arrays (a_RowColumn and a_RowColumnProperties) , to use these arrays as source in DataGrid we can put them in ArrayCollection and then use this ArrayCollection as DataProvider for DataGrid.

Code example:

[Bindable]
private var arrCol:ArrayCollection = new ArrayCollection();

arrCol.removeAll();
var newRow : Object;
var i:int;
for (i = 0; i < a_RowColumn.length; i++)
{
newRow = new Object();
newRow.col1 = a_RowColumn[i];
newRow.col2 = a_RowColumnProperties[i];

arrCol.addItem(newRow);
}

dg_FieldList.dataProvider=arrCol;


<mx:DataGrid x="47" y="95" width="90%" height="90%" id="dg_FieldList">
<mx:columns>
<mx:DataGridColumn headerText="Field-Number" dataField="col1"/>
<mx:DataGridColumn headerText="Field-Description" dataField="col2"/>
</mx:columns>
</mx:DataGrid>

Is there any other way to use arrays from Web Service response as DataProvider for DataGrid?

using arrays as DataProvider

Converting an array of String objects to an array of Object objects in Flex

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/03/26/converting-an-array-of-string-objects-to-an-array-of-object-objects-in-flex/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">

<mx:Script>
<![CDATA[
private var arrayOfString:Array;
private var arrayOfObject:Array;

private function init():void {
arrayOfString = ["test", "test", "fork", "test"];
arrayOfObject = stringArrayToObjectArray(arrayOfString);
}

private function stringArrayToObjectArray(sourceArray:Array, key:String = "label"):Array {
var returnArray:Array = new Array();
var idx:uint;
var len:uint = sourceArray.length;
for (idx=0; idx<len; idx++) {
var obj:Object = {};
obj[key] = sourceArray[idx];
returnArray.push(obj);
}
return returnArray;
}
]]>
</mx:Script>

<mx:ApplicationControlBar dock="true">
<mx:Button label="Array of String"
click="list.dataProvider = arrayOfString;" />
<mx:Button label="Array of Object"
click="list.dataProvider = arrayOfObject;" />
</mx:ApplicationControlBar>

<mx:List id="list"
width="100"
rowCount="6"
initialize="init();" />

</mx:Application>

Arrays in ArrayCollection zusammenpacken

ArrayCollection aus Arrays

Sind es Arrays oder ArrayCollections? Wenn es normale Arrays sind, dann per concat:
Code:

var array1:Array = event.result[0] as Array; var array2:Array = event.result[1] as Array; var dp:Array = array1.concat(array2);

wenn es ArrayCollections sind dann so:
Code:

var array1:ArrayCollection = event.result[0] as ArrayCollection ; var array2:ArrayCollection = event.result[1] as ArrayCollection ; var dp:Array = array1.source.concat(array2.source);

das Array in dp kannst Du dann als dataProvider verwenden.