hi,
I have the code as shown below and a form with only a portal element with two columns. All three elements (the portal and it’s two elements) are named). When I run the code below, the forms[form].elements.length returns only 2, instead of three.
var form = arguments[0];
//Get an Array with all named elements on the previously selected form
var elementsArray = new Array();
application.output(forms[form].elements.length)
for ( var j = 0 ; j < forms[form].elements.length ; j++ )
{
elementsArray[j] = forms[form].elements[j]
}
return elementsArray;
The code works fine on other forms, returning the right number of elements.
Paul
PS: See topic http://forum.servoy.com/viewtopic.php?t=3614&start=15 for a request to get a function getNamedFormElements(String formname), returning a JSDataset
elements.length when portal on a form bug is fixed.
that getNamedElements functions is not needed.
you have: forms[formname].elements
and then you have them.
Tnx for fixing.
Regarding the getNamedElements: You told me that looping through all forms and then all their elements with a combination of:
- forms.allnames;
- forms[formname].elements.lenght
- forms[form].elements[j] etc..
wasn’t a smart idea, because it means all forms are loaded into memory. Therefor, I requested the getNamedFormelements function.
Also, I would like to retrieve the type of element (TabPanel, Portal, Datafield, Calenderfield etc). This is not really possible now.
So, hence the request I did. will you consider it?
Paul
if you would call that
and you would get all the elements
that you have the same problem
Before i know the elements. The forms must be there. There is no other way.
Ok, if there is no way in Servoy internally, to get the elements for a form, without loading the form into the Servoy Client’s memory, then I guess it makes no sense to add the requested function, because it would hold the same disadvantage.
But I would think that Servoy Client could request the required data from Servoy Server, where all solutions, their forms and elements are in the memory.
Anyway, if not possible, so be it. But then the request to get an elements type still stands.
Paul
elements are data/form things.
What you want is somekind of plugin or interface where you can walk over the completel solution. So no displayable things.
Que?!?
“All” I would like to be able to do is:
1- get all forms without them being loaded into memory: allready possible
2- get all named elements on a form (possible) without loading all forms (not possible)
3- get the type of an element (not really possible) without loading all forms (not possible)
Paul
yes thats what i said
you want meta data of the complete solution.
Well, if you want to call it that…
Yes.