Hi!
Diese kurze Anleitung werde ich auf englisch posten, da ich in diversen (englischen) Foren nach einer Lösung für dieses Problem gesucht, aber nichts gefunden habe, bis ich selbst drauf gekommen bin wie man die Rahmen um ein Objekt einzeln bearbeiten kann. Um jetzt aber unseren nicht deutschsprachigen Mitmenschen die Möglichkeit zu gewähren diesen Post zu "finden" eben das ganze auf englisch. Ich wollte mich dazu aber nicht bei einem andern Foren anmelden und hoffe, dass dieser Post hier gefunden und evtl. auch weiterverlinkt wird.
(Ich hoffe auch ohne all zu viele Rechtschreibfehler)
I will post this short how-to in english for all to find who are not able to understand german. I've searched many adobe specific forums but couldn't find a way to individually edit the borders around an object. Cause I didn't want to subscribe to another forum I decided to post my findings here. I hode that this will be found by others and also being linked to.
(I hope that I didn't make to much spelling errors)
When you look at the resulting XML-file created by Adobe Live Cycle Designer you will see if you set up individual borders or corners for your object that this results in exactly four nodes named "edge" and "corner" respectivly. After a little bit of research I discovered, that they are ordered in the same way as the borders in HTML: top, right, bottom, left
Wherever I searched for a solution it was mentioned that it is NOT possible to edit the borders individually. WRONG!
First I tried to utilize the "instanceManager", but this only works on form-nodes.
Than I pretty much gave up until I stumbled across the "all" collection attribute which allows to select all nodes with a specific name. Sadly this didn't work on "edge" or "corner" cause they don't have a "name" attribute BUT the error message in the console log mentioned the alternative attribute "classAll".
This works the same way as "all" but selects the nodes by their tag name. (= class in ALCD terms)
The rest was easily found:
Code: Alles auswählen.
function applyBorder(object,top,right,bottom,left) {
function applyBorderInternal(corner,edge,thick) {
if (thick != 0) {
edge.thickness = thick + "cm";
edge.presence = "visible";
corner.thickness = thick + "cm";
corner.presence = "visible";
} else {
edge.presence = "hidden";
corner.presence = "hidden";
}
}
var cornerList = object.border.corner.classAll;
var edgeList = object.border.edge.classAll;
for (var i = 0;i < 4;i++) {
if (cornerList.length <= i) cornerList.append(cell.border.corner.clone(true));
if (edgeList.length <= i) edgeList.append(cell.border.edge.clone(true));
}
applyBorderInternal(cornerList.item(0),edgeList.item(0),top);
applyBorderInternal(cornerList.item(1),edgeList.item(1),right);
applyBorderInternal(cornerList.item(2),edgeList.item(2),bottom);
applyBorderInternal(cornerList.item(3),edgeList.item(3),left);
}
(Syntax-highlighting is based on ABAP but it is in fact javascript code)
As you can see, first I append up to 4 "edge" and "corner" nodes to the collection to get the border to behave "individually" and set them in the next step. EASY!
with kind regards
ADT