15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Parsemap for listbox contro

Derek Bernhart -- derek_bernhart@affymetrix.com
Monday, February 03, 1997

Environment: VC++ 4.2b / NT4.0

I have a CHttpServer derivative DLL that is supposed to take in =
information from a form. 
The form has several listbox controls.
The html code for the control looks like:



The parse map looks like:
	ON_PARSE_COMMAND(QueryResults, CMyExtension, ITS_PSTR)
	ON_PARSE_COMMAND_PARAMS("SelectType=3D~")


When I submit the form I get a BAD REQUEST was sent by the client =
response.
If I only allow single selection the request works great.

I think the CHttpServer::CallFunction is parsing the query string =
incorrectly.
When one item is selected the query string looks like this:
"...SelectType=3Dselect1"
When two items are selected the query string looks something like this:
"...SelectType=3Dselect1&SelectType=3Dselect2"

Why is there one 'SelectType' entry for every selection in the control?

How do I pass multiple selections to my ISAPI extension such that the =
query string gets parsed correctly?

Thanks,
Derek




Mike Blaszczak -- mikeblas@nwlink.com
Tuesday, February 04, 1997

[Mini-digest: 2 responses]

At 10:05 2/3/97 -0800, Derek Bernhart wrote:
>Environment: VC++ 4.2b / NT4.0
>
>I have a CHttpServer derivative DLL that is supposed to take in
>information from a form. 
>The form has several listbox controls.
>The html code for the control looks like:
>
>
>
>The parse map looks like:
>	ON_PARSE_COMMAND(QueryResults, CMyExtension, ITS_PSTR)
>	ON_PARSE_COMMAND_PARAMS("SelectType=~")
>
>
>When I submit the form I get a BAD REQUEST was sent by the client response.
>If I only allow single selection the request works great.

MFC's parse maps don't support multiple-selection list boxes, I'm afraid.
We'll probably add it to a future version.  For now

By the way, isn't this question covered by the ISAPI FAQ?

>Why is there one 'SelectType' entry for every selection in the control?

Because it allows multiple selection, and that's the way the HTML 
specification says multiple selection works.

>How do I pass multiple selections to my ISAPI extension such that
>the query string gets parsed correctly?

You're not worried about the way the query is posted: you can't change that
unless you start writing your own controls and do some client-side scripting.
Instead, you should override CallFunction() and write some code to special
case this one form.


.B ekiM
http://www.nwlink.com/~mikeblas/
These words are my own. I do not speak on behalf of Microsoft.
           This performance was not lip-synched.

-----From: Charlie Jursch 

Derek,

If you allow multiple selections for your list control you must allow the
maximum number of selections in your parsemap.  All the parse map does is
parse the HTML string that is passed to it from the browser.  You need to
have a place for every entry that may come across in the string.  Then, in
your function to handle the string, you can determine what you got from the
user.



At 10:05 AM 2/3/97 -0800, you wrote:
>Environment: VC++ 4.2b / NT4.0
>
>I have a CHttpServer derivative DLL that is supposed to take in
information from a form. 
>The form has several listbox controls.
>The html code for the control looks like:
>
>
>
>The parse map looks like:
>	ON_PARSE_COMMAND(QueryResults, CMyExtension, ITS_PSTR)
>	ON_PARSE_COMMAND_PARAMS("SelectType=~")
>
>
>When I submit the form I get a BAD REQUEST was sent by the client response.
>If I only allow single selection the request works great.
>
>I think the CHttpServer::CallFunction is parsing the query string
incorrectly.
>When one item is selected the query string looks like this:
>"...SelectType=select1"
>When two items are selected the query string looks something like this:
>"...SelectType=select1&SelectType=select2"
>
>Why is there one 'SelectType' entry for every selection in the control?
>
>How do I pass multiple selections to my ISAPI extension such that the
query string gets parsed correctly?
>
>Thanks,
>Derek
>
>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Charlie Jursch              "Be kind to your web-footed
Patotech Software, Inc.      friends for a duck may be
1-800-PATOTECH               somebody's mother."
mailto:cjursch@pacbell.net    
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%




| Вернуться в корень Архива |