List Info

Thread: very weird dynamicdata problem... "selection" error




very weird dynamicdata problem... "selection" error
user name
2006-10-05 22:19:40
What might this error message mean?

-------------------------------------------


      Bad Data

selection


      Problem:

The value provided during this operation could not be
validated, or was 
not accepted for other reasons.

-------------------------------------------

I'm getting the error when I try to submit a 'modify
article' form, but 
only if I set one of my dropdowns to an option pulled from
the database 
and then click 'update' in the 'modify article' form. The
dropdown 
property uses an API function to set the validation by
getting an array 
of ids and names from the db.  The API function is working
fine and 
indeed is one that I use in many places in the same website
(and even in 
the same pub type, although with different arguments) to set
validation 
for other dropdown properties, and I don't run into this
problem 
anywhere else.  The HTML that is being generated looks fine:

<select name="dd_156" id="dd_156"
tabindex="0" >
                <option value="0"
selected="selected">-Select-</option>
                <option value="402">New
Test</option>

                <option
value="408">Testtttttt</option>
</select>

If I edit the API function so that the id part of the array
that it is 
generating is NOT pulled from the db, then there's no
problem.  In other 
words, the 402 and 408 ids in the above HTML are pulled from
the db, but 
if I set up the function so that no key is set and let it
number itself 
like 0,1,2 etc, then there is no problem.  Also, if I edit
my function 
so that the first few ids are 0,1,2 and then pull the other
ones from 
the db, so the HTML looks like...

<select name="dd_156" id="dd_156"
tabindex="0" >
                <option value="0"
selected="selected">-Select-</option>
		<option value="1">Test1</option>
		<option value="2">Test2</option>
                <option value="402">New
Test</option>

                <option
value="408">Testtttttt</option>
</select>

...and then I set the dropdown to any of the first three
options and hit Update, there is no problem.

Meanwhile, if I don't use the API function for the property,
and just specify the validation like...
0,-Select-;402,New Test;408,Testtttttt
...there's no problem, even though the HTML generated is
identical to the first sample above.

Meanwhile I'm using the same API function to set the
validation for another property in the same pub type --
 it appears in the exact same 'modify article' form -- and
it works fine for that property and generates this HTML...

<select name="dd_59" id="dd_59"
tabindex="0"
onChange="document.post.title.value=this.value + '-' +
document.post.dd_53.value">
                <option
value="0">-Select-</option>
                <option value="319"
selected="selected">(319) 25% Energy for
Tomorrow</option>
                <option value="377">(377)
50% solar</option>
                <option value="318">(318)
BEF 100% Solar</option>
                <option value="320">(320)
Cooler Future</option>
                <option value="375">(375)
Ice</option>
                <option value="393">(393)
National Envelope</option>
                <option value="379">(379)
No. 10 Envelope</option>
                <option value="373">(373)
Sempron x64</option>
                <option value="331">(331)
Unspecified resources test</option>
                <option value="317">(317) We
Energies 100% Wind</option>
                <option value="371">(371)
White & Green Paper</option>
                <option value="382">(382)
Wind-e RECs</option>
</select>

For the dd_59 property, I do not get an error when I set the
option to 
something other than the first one and then submitting the
'modify 
article' form. (It generates different HTML only because I
have 
different arguments for the function for the dd_59 property
than I do 
for the dd_156 property.)

I thought this might be a case where the type
(string/integer) might be 
an issue but HTML doesn't know the difference, right?

So basically, given two identical blocks of HTML, one
generates an error 
and one doesn't, depending on how I went about setting the
validation.   
I don't know if the error message I reference at the top of
this email 
offers any clues about what's happening.  Or if there's some
problem in 
that HTML up there that I'm just not seeing.  It doesn't
seem to matter 
where I pull the ids from -- whether I pull them from the
article id or 
from the item id of my dedicated dd table -- either way I
get the 
error.   In the dd_59 example -- which does not cause an
error -- the 
ids happen to be article ids.  Again, I wouldn't think it
would matter 
because HTML is HTML, and once the ids get pulled from the
db 
successfully and are there in the HTML, all they are is
numbers.

versions:  xaraya 1.1.1, php 4.4.3
There are three separate properties for this pub type where
I'm getting 
the error if I set options to a value pulled from the db...
all three of 
the database fields for those properties are in a dedicated
table that 
has otherwise been unproblematic, and all three are
varchar(254).

-Ryan

-- 
Ryan Walker
www.WebCommunicate.net:
Insights and resources for effective websites.

_______________________________________________
Xaraya_devel mailing list
Xaraya_develxaraya.com
http:
//xaraya.com/mailman/listinfo/xaraya_devel
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )