close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Greyed out 'Populate List From Array'

Thread began 3/21/2011 3:49 pm by Paul | Last modified 3/28/2011 3:40 pm by Jason Byrnes | 4128 views | 11 replies |

PaulBeta Tester

Greyed out 'Populate List From Array'

I've been following the .pdf help guide featuring step by step instructions for the dynamic drop-downs, however i have stalled at step 4 on page 8.

I have two drop downs; a parent and child.

I have prepared the parent list as per page 6 and have created a dynamic array using the server behaviour WA Dynamic Drop-downs option.

Then with the parent still selected, I attempted to select 'Populate List From Array' from the WA Dynamic Array Drop-downs, but its greyed out so I can select.

I have to say, the instructions are not at all clear as they appear to combine instructions for both lists and menus, so its difficult to pull out the important steps for the drop down menu functionality.

Screen-grab attached illustrating issue.

Ideas welcome.

Thanks, Paul

Sign in to reply to this post

Jason ByrnesWebAssist

at the top of the behaviors panel, what tag does it show as being selected? See the attached screen shot for an illustration of what I mean.

If you are still having a problem, please send a copy of your page.

Sign in to reply to this post

PaulBeta Tester

Hi, yes I have tag <select> present.

Page included as requested.

Thanks.

Attached Files
profile.zip
Sign in to reply to this post

Jason ByrnesWebAssist

hmmm, seams to be an issue with templartes, I'll log this as a bug.


for a workaround, move the create dynamic array code that is at lines 102 - 148:;


php:
<?php

if ($row_rsTowns)     {
  echo 
"<SC" "RIPT>\n";
  echo 
"var WAJA = new Array();\n";

  
$oldmainid 0;
  
$newmainid $row_rsTowns["Town_CountyID"];
  if (
$oldmainid == $newmainid)    {
    
$oldmainid "";
  }
  
$n 0;
  while (
$row_rsTowns)     {
    if (
$oldmainid != $newmainid)     {
      echo 
"WAJA[".$n."] = new Array();\n";
      echo 
"WAJA[".$n."][0] = '".WA_DD_Replace($newmainid)."';\n";
      
$m 1;
    }

    echo 
"WAJA[".$n."][".$m."] = new Array();\n";
    echo 
"WAJA[".$n."][".$m."][0] = "."'".WA_DD_Replace($row_rsTowns["Town_IDX"])."'".";\n";
    echo 
"WAJA[".$n."][".$m."][1] = "."'".WA_DD_Replace($row_rsTowns["Town_Name"])."'".";\n";

    
$m++;
    if (
$oldmainid == 0)      {
      
$oldmainid $newmainid;
    }
    
$oldmainid $newmainid;
    
$row_rsTowns mysql_fetch_assoc($rsTowns);
    if (
$row_rsTowns)     {
      
$newmainid $row_rsTowns["Town_CountyID"];
    }
    if (
$oldmainid != $newmainid)     {
      
$n++;
    }
  }

  echo 
"var rsTowns_WAJA = WAJA;\n";
  echo 
"WAJA = null;\n";
  echo 
"</SC" "RIPT>\n";
}
function 
WA_DD_Replace($startStr)  {
  
$startStr str_replace("'""|WA|"$startStr);
  
$startStr str_replace("\\""\\\\"$startStr);
  
$startStr preg_replace("/[\r\n]{1,}/"" "$startStr);
  return 
$startStr;
}
?>



to line 96 so it is just before the doctype tag so you can apply the populate list from array behavior. Move it back to line 102 after the populate list from array behavior is applied.

Sign in to reply to this post

PaulBeta Tester

Ok, so that workaround was successful.

The bug does seem to be connected with CS5 templates .dwt or dwt.php

The wizard works fine on plain .php pages. Would be interested to see if this can be fixed in next update.

Paul.

Sign in to reply to this post

Jason ByrnesWebAssist

Glad to hear it is working.

I have logged the bug in our bug base so it will be addressed.

Sign in to reply to this post

PaulBeta Tester

Just realised that my child value is not retrieving from mysql.
Both parent and child are saving to their respecitive values to my DB, but only parent is retrieving the value.

Here is code for Child

<select name="mem_town" id="mem_town">
<option value="" <?php if (!(strcmp("", (str_replace('"', '&quot;', $row_WAATKmembertbl['mem_town']))))) {echo "selected=\"selected\"";} ?>>Select town</option>
<?php
do {
?>
<option value="<?php echo $row_rsTowns['Town_IDX']?>"<?php if (!(strcmp($row_rsTowns['Town_IDX'], (str_replace('"', '&quot;', $row_WAATKmembertbl['mem_town']))))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsTowns['Town_Name']?></option>
<?php
} while ($row_rsTowns = mysql_fetch_assoc($rsTowns));
$rows = mysql_num_rows($rsTowns);
if($rows > 0) {
mysql_data_seek($rsTowns, 0);
$row_rsTowns = mysql_fetch_assoc($rsTowns);
}
?>
</select>

Am I missing something here?

Sign in to reply to this post

Jason ByrnesWebAssist

is this on an update page then?
Please provide more details.

Sign in to reply to this post

PaulBeta Tester

This is on an update page.

When loaded, both drop-down dependencies populate ok
Parent and child data saves to sql db.

When user returns to update, only parent value is retrieved and displays.
The child drop-down is empty

Filer attached.

Attached Files
profile.zip
Sign in to reply to this post

Jason ByrnesWebAssist

on an update page, you need to apply the Set Selected in list behavior for the parent list, and the populate list from array behavior for the child list to the body onlaod tag.

this can be problematic with a template though. with a template, you will need to apply the behaviors to another tag, then cut the code for the behavior and place it in a script tag at the lowest part of your page.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...