Web client .""element" name problems

Forum to discuss the Web client version of Servoy.

Web client .""element" name problems

Postby mmcmanus » Fri Mar 17, 2006 4:46 pm

I've come to a new issue while working with the web client. Working with a validation of named fields. I'm using the standard loop through a from to get element names.

Like:
var checkName = forms.GD_entryDB.elements[i]getName();
var check = checkName.slice(0,3);
if (check == ' fld')
---etc
On the web client I have major problems getting the first line to generate checkName. So I modified it as follows
var checkElement = forms.GD_entryDB.elements[i];
var checkName = checkElement.getName();
var check = checkName.slice(0,3);
if (check.equalsIgnoreCase('fld'))

Even with this I am still getting Javascript erros in the webclient Usually:

TypeError: undefined is not a function. (validateWebFormDB; line 10)

And since I can't use popups, I am mailing myself the var info. In Developer I get what I expect.
like: "fld_entry_marital_status"
In web client I get a different return
like "fld_entry_marital_status_element_3660"
... of and in many case an empty string if I attempt to mail myself every named element, which cause problems of course.

So I guess the question is. Is this expected operation? And how much code modification will be expected to get something like this working in the web client?

I guess I will have to rap for null in the element nam at this point.
mmcmanus
 
Posts: 41
Joined: Thu Feb 23, 2006 7:28 pm
Location: Cincinnati, OH

Postby jcompagner » Mon Mar 20, 2006 4:32 pm

i tried to reproduce this with our current beta

just have a script that does this:

for(var i=0;i<elements.length;i++)
{
application.output(elements[i].getName());
}

The webclient output:

WebClient: course
WebClient: label
WebClient: button
WebClient: portal_course_pages_to_course_pages_70
WebClient: sadf

The smartclient:

sadf
portal_course_pages_to_course_pages_70
bean_1010
button
label
course

This output is by the way a feature that hasn't made it into beta1. After beta1 you can just do application.output and it the output of the webclient will be in the console of the developer method editor.

I hope we can improve that even further that you also can debug through code via the webclient.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Web client .""element" name problems

Postby mmcmanus » Tue Mar 21, 2006 4:28 pm

Not sure if I understand correctly. Though for some reason I have completely missed the whole application.output thing. So thanks for that!

What I get is 2 list. In developer every named item is listed. In WebClient only data entry fields are listed, all other named items are listed as null. The matching lists then break down as I said before:

Servoy( like this):
fld_entry_news
fld_entry_address_line3
fld_entry_address_line2
fld_entry_address_line1
fld_country_id

web Client (like this):
fld_country_id_element_3642
fld_entry_address_line1_element_3644
fld_entry_address_line2_element_3646
fld_entry_address_line3_element_3647

They are in reverse order also. Also the field "fld_entry_news" is a checkbox which errors as undefined in web client and runs fine in Servoy.

I''ve simply parsed out the whole "_element_####" thing for now. And that seems to solve the problem pretty well. Now for the checkbox.
mmcmanus
 
Posts: 41
Joined: Thu Feb 23, 2006 7:28 pm
Location: Cincinnati, OH

Postby jcompagner » Tue Mar 21, 2006 4:40 pm

is this 3.0beta1?
Can you make a case and send in a sample solution?
http://crm.servoy.com/servoy-webclient/ ... oy_support
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 12 guests

cron