I wanted to create a data entry form where I wanted to use text field, dropdown, radio, checkboxes or any other kind of fields. I do not want to connect these fields to a data provider. It is just for getting the input data from the the user and validate the input and create/edit record when the validation is succeeded.
Currently I do not have a property/method to get the text/media of a form object which is not connected to a data provider. I can get the text of a text object using a work around method as follows:
elements.text1.selectAll();
var textValue = elements.text1.getSelectedText();
This method cannot work on a drop down field and it is a bit weird.
So I would like you to add a method called
elements.text1.getText();
or a property called
elements.text1.text;
This feature is really a must for my solution since I wanted to use validation all over my software I am creating.
Hai Hameed, If I understand you correct it is a matter of creating global variables, attach them to the elements you need and attach a method to the events ‘onDataChange’ or ‘onAction’ to read the content of the variable…
I am aware of doing that using globals. I do not want to clutter global field definition window with many many fields. That’s why getting the text/content of a field I thought was simple. I think it is an extra property or method they need to do.
I have tried this bean already. But it never worked correctly for me.
I have placed a bean in the form and added the following method named “test” and attached it to a button.
a = elements.bean_136.getText(1, 1);
plugins.dialogs.showInfoDialog( "", a);
When I executed that method by clicking that button it gave me the following error:
The undefined value has no properties. in the first line.
Before this error the name of the bean (by default bean_136) was showing under the elements section of the form. After the error the name was dissappeard. Then I tried to give a name “text1” for the bean (name property) and found that it was not displayed under the elements section of the form.
It seems currently beans could not be used to their full capacity under servoy.
I think it should be very easy for you guys to add a method/property like getText()/.text and setText()/.text=
It worked. It seems that after adding a bean I had to re-open the solution for the bean to work properly. I have given the bean a name “text1”. It showed up in the elements section under the form only after I restarted the solution
The following codes also worked only after I restarted the solution.
a = elements.text1.getText(1, 1);
plugins.dialogs.showInfoDialog( "", a);
a = elements.text1.getText();
plugins.dialogs.showInfoDialog( "", a);
When I copy and pasted the bean “text1” the new bean was named “text1c” automatically in its name property. But the new name did not reftlect on the bean in the layout. I had to restart the solution for that.
I hope in the following versions we will have greater support for the beans.