NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: bergsj on June 01, 2010, 01:22:48 AM
-
Hi,
I have a strange problem. Maybe a bug of some sort.
I have a browse (Country) with an EIP dropdown field. In this field I do a lookup to a table called Province. This Province table has a couple of fields. ID,CountryID and Description. The following is setup for the dropdown EIP:
FromFile: Province
Filter: 'PRO:CountryID=2'
Order: PRO:Description
Value: PRO:ID
Description: PRO:Description
When I open the browse the dropdowns on all rows of the Country browse contains all Province records, without using any filter.
When, as a test, I put this dropdown (with the exact same settings) on a form, the filtering works like a charm.
Why-o-why is this not working on the EIP inside the browse?
Anyone?
Greets!
Sjoerd
-
Hi Sjoerd,
In a simple test here the filter seems to be working ok.
So have a look at the generated code, and debug normally.
Cheers
Bruce
-
Bruce,
These are two snippets of the source of the generated code. Offcourse I used an example to explain the problem. In the real app the tables are called RegistratieVraagAntwoord (Country) and Antwoord (Province).
This is the generated code from the EIP dropdown on the browse:
open(RVA:AntwoordId_OptionView)
RVA:AntwoordId_OptionView{prop:filter} = 'ANT:VraagId=1'
RVA:AntwoordId_OptionView{prop:order} = 'UPPER(ANT:Antwoord_tekst)'
db.debugout(ANT:VraagID & '-' & RVA:VraagId)
db.debugout(RVA:AntwoordId_OptionView{prop:filter})
Set(RVA:AntwoordId_OptionView)
Loop
Next(RVA:AntwoordId_OptionView)
If ErrorCode() then Break.
packet = clip(packet) & p_web.CreateOption(ANT:Antwoord_tekst,ANT:Id,choose(ANT:Id = RVA:AntwoordId),p_web.combine(p_web.site.style.browseDropOption,),,) &'<13,10>'
End
Close(RVA:AntwoordId_OptionView)
When putting the dropdown on a form this is the generated code:
open(Reg:IngangId_OptionView)
Reg:IngangId_OptionView{prop:filter} = 'ANT:VraagId=1'
Reg:IngangId_OptionView{prop:order} = 'UPPER(ANT:Antwoord_tekst)'
Set(Reg:IngangId_OptionView)
Loop
Next(Reg:IngangId_OptionView)
If ErrorCode() then Break.
if p_web.IfExistsSessionValue('Reg:IngangId') = 0
p_web.SetSessionValue('Reg:IngangId',ANT:Id)
end
loc:rowstyle = choose(sub(' SelectList',1,1)=' ',clip(loc:fieldclass) & clip(' SelectList') & loc:even,clip(' SelectList') & loc:even)
packet = clip(packet) & p_web.CreateOption(ANT:Antwoord_tekst,ANT:Id,choose(ANT:Id = p_web.getsessionvalue('Reg:IngangId')),clip(loc:rowstyle),,) &CRLF
loc:even = Choose(loc:even=1,2,1)
do SendPacket
End
Close(Reg:IngangId_OptionView)
I cannot find the difference that could cause my filtering issue on the EIP dropdown.
-
It all looks good.
try posting the View declaration for the drop-down in the browse.
Perhaps that'll give us a clue.
cheers
Bruce
-
That's not going to be an eye opener, look at this;
Browse EIP:
RVA:AntwoordId_OptionView View(Antwoord)
Project(ANT:Id)
Project(ANT:Antwoord_tekst)
Form:
Reg:IngangId_OptionView View(Antwoord)
Project(ANT:Id)
Project(ANT:Antwoord_tekst)
[[code]
[/code]
-
nope, nothing springs out - I guess I need an app example to explore further.
cheers
Bruce
-
Bruce,
I will send you an example by email.
Greets,
Sjoerd
-
Hi,
I have found filters very unforgiving ( as they are in a desktop app). I have taken Kevin's suggestion and created a variable to hold my filter string and created my own filter strings and debugged them - I would never have gotten them right without debugging the filter string. I just shove a stop('filter ' & myfilterstring) and see what the filterstring is really looking like...
FWIW,
Ron Jolda
-
Or better, you can use TraceIt to debug your NTWS code!
Take a look at http://www.armi.com.ar/TraceItEN.html (http://www.armi.com.ar/TraceItEN.html)
It works like a charm with NTWS and even your users will be able to help you totrace server problems.
Cheers
Alberto
-
Bruce has investigated the code and there seems to be a minor bug. Should be fixed in a new build. Work-around was to have the lookup table as an Other table not as a secondary table.