Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 5 Jahren, 10 Monaten
Letzter Beitrag:
vor 5 Jahren, 10 Monaten
Beteiligte Autoren:
Chris du Toit, Pragma Tix, DerekT

!! [UNSOLVED] Looper control under AWP mode

Startbeitrag von Chris du Toit am 17.10.2012 03:11

Update: I marked this as solved to quickly. Please see my update to the post below (post #4).
Hi - All my WebDev development has been using Dynamic pages and letting the WebDev engine work its session state management.

I now have a need for a single page of my site to be an AWP page, to which parameters are passed when the URL is called. Everything works fine except for one behavior with the Looper control:

The Looper is bound to a query, and contains about 5 fields to display from the query. In otherwords it has five attributes (ATT_nnnn) and each attribute tied to a control.

The looper displays perfectly in both dynamic mode AND AWP mode. No problems there.

However, in the looper, I have a link which allows the user to perform an action.

The Click event of the link, references the value of a field in the looper for the row that was clicked. For sake of simplicity, lets say the code is this:

Click of Link_mylink (Loop_mylooper)

In Dynamic mode, ATT_filename contains the value for that attribute for the row of the looper that was clicked, as I would expect. However, when I change the page to AWP mode, the attribute returns "". Is this the correct behavior? And if so, how would I obtain the value of a field in a row of the looper in AWP mode?

Thanks as always for any and all help.



Re: Looper control under AWP mode

Do not do WB so just a guess...........

Click of Link_mylink (Loop_mylooper)

lnRowNum is int = Myself

I have found at times that the looper control (in WD) does not always seem to know which row (cell) it is

von DerekT - am 17.10.2012 09:04

Re: Looper control under AWP mode

Derek - Thanks for the thoughts...It didn't do the trick but it got me thinking and I went to go look at the Forum_AWP example and they also reference the ATT_ driectlly.

I debugged further and saw that a Info(ATT_) in the browser event showed the value, but it got lost on the server click event.

I then saw the link in the looper had its action set to None. I changed it to Send to Server and it started working.

I don't have a reason to explain why it works with action = none in Dynamic mode but not in AWP. I'm guessing its because the server maintained no state and you had to actually resubmit to the server...

von Chris du Toit - am 17.10.2012 10:26

Re: [SOLVED] Looper control under AWP mode

Ok I spoke to soon....I still have problems with Loopers under AWP. It's a little convoluted to explain but let me try. Sorry for the long explanation but I wanted to try explain this in detail. The summary of the problem is that in AWP mode, my looper is losing the value of the Attributes (ATT_nnnn) in the server code. I'll explain....

Picture the following scenario:

1. Looper on AWP page tied to a DB Query
2. Looper has a number of attributes (ATT_nnnn) linked to the query fields and connected to a control
3. One of the fields on the looper is a link

The server code for the link Click event does something with one of the attributes. For examples sake lets say it just is a trace:

Trace("value of attribute is: " + ATT_filename)

The browser code for the link Click event is the same, but uses the Info:

Info ("value of attribute from browser is: " + ATT_filename)

All is working fine as you would expect. Looper displays, you click the link in the looper, you get the info box and the trace output with the value of ATT_filename.

Here is where it gets messed up:

Same situation as above, but above the looper I have a input field with a submit button.So when the page loads, it displays the input field, with the populated looper at the bottom. NOW, if I enter text in the input field button and want to repopulate the looper based on some criteria from that input field, something is going very wrong.

In the server code for the button click I do:

HExecuteQuery(qryBlah, EDT_Text1) // rexecute the query tied to the looper with this param

Again, that part works. You type text, hit submit, the looper redisplays with the new data.

However, now when I click the link in the looper like I explained above, the "browser click" event (the info statement) shows the value of the Attribute, but in the server code of the button, the attribute is empty! ATT_filename returns "" in the server code, but returns the proper value in the browser code. Note that the looper is displaying fine, it just doesn't seem to have the values.

1. This works fine in full dynamic mode, just not in AWP, so I know its something related to that.
2. The looper displays correctly (so the attributes are populated), but then when you query the attribute in the server code, it is empty
3. This only happens after hitting a submit button, so it may somehow be related to the context or me calling LooperDisplay on the page and then it refreshes and the context is somehow messed up.

I know that is tricky to explain but if anybody has any pointers as to what I may be doing wrong or suggestions to try, I'd very much appreciate it.


von Chris du Toit - am 19.10.2012 17:55

Re: [SOLVED] Looper control under AWP mode

Hi Chris,
your problem describtion is rather long.. a screen-shot may help ;)

Like you, I guess it's AWP context related.
Two suggestions :
Call the Serverprocedure from the Browseprocedure using AjaxExecute() and see what happens.
Still no succes ?
Try DeclareAWPContext()

ctxATTnnn is string //(or whatever) type.. reference the Looper ATTnn that causes the trouble.

Well, I am not sure if this helps, but I think, it's worth a try...


von Pragma Tix - am 21.10.2012 12:50
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.