Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Question events - possible bug when showing initially hidden fields along with filling w/SQL
Last Post 09-28-2010 04:10 PM by Chad Nash. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Sotiris FilippidisUser is Offline
skipping stones
skipping stones
Posts:14
Avatar

--
09-26-2010 08:04 AM
    Well, this problem is a bit complex, I'll try to describe it with simple words:

    My form has initial sql rendering / bind functionality, and thus I can use it to edit existing records. The problem appears when editing an existing record.

    I've got a combo box which gets values from the database. According to the value selected from the combo box, a check box list appears below. The contents of the checkbox list are coming from the db as well.

    The problem is that, when editing a record, the check boxes do not seem to retain their values. I've got an event in place in order to apply the correct values when the value of the "parent" combo changes, but I suspect that event either doesn't run at all or runs BEFORE the checkbox list is made visible (by another event hooked on the same combo).

    As a result, checkboxes always appear empty, even though the database does contains relative records. 

    Is there something more I could do about it that I haven't thought of so far?




    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    09-27-2010 11:01 AM
    Hi. I have run into this before, question events can get tricky when you start to combine SQL Binding, Rendering and so forth.

    1. Created a new question event so that when a hidden field such as 'DBUpdate' had a value of true it would also fire the question event, this way the field would show up and not be hidden.

    2. Does the data show up properly now? If not, we created a stored procedure that would pass in the value of 'DBUpdate' into the stored procedure. Then, if it was false it would use your original query (the one pulling from the combo box field) and if the answer was true then it would pull directly from the database for that combo box.

    I think that if you are running into this with SQL Binding and pulling that value back, firing the question event you can use the steps below to get around it. I realize its somewhat tricky but it does work.

    Thanks,

    Chad
    Sotiris FilippidisUser is Offline
    skipping stones
    skipping stones
    Posts:14
    Avatar

    --
    09-27-2010 11:50 AM
    Thanks for the answer Chad, but I'm not really sure I got what you mean. Maybe I wasn't very clear in my description.

    Let me explain again in simpler terms:
    There is a combo box (which shows main categories) and a checkbox list (which shows subcategories of the selected main category).

    The combo box gets its values during initial sql rendering/bind.
    The checkbox list gets its values via an event that gets questionoption,questionoptionvalue each time the combo box selection changes (i.e. the parent category changes).

    All of the above work well. The problem appears when I check some of the checkboxes and submit the form. When I load the form again (via sql rendering/bind) I have no way of showing the same boxes as checked. They all appear empty.

    I suspect there's more to do in order to show what values have been selected, but I don't know how to achieve it.
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    09-28-2010 04:10 PM
    Hi Sotiris,

    Thanks for your additional feedback. I do understand (and did from your original post as well) the complications you are running into and the limitations that the SQL Binding feature has when using:
    1. SQL Binding
    2. Question Events
    3. Dependent Lists

    Example situation: You have 'Car Models' pulling from the table 'Car Types', you save Car Type and Care Models to the database correctly but when binding Car Models doesn't pull in properly based on the Car Types within the SQL.

    There are some limitations within the module when using and combining these features and we are still researching these for future builds (currently this isn't supported but we hope it will be in the future as we are starting to run into more implementations where this is needed).

    So, what I described above DOES work as we have had to do it with other clients. Its somewhat confusing but ill describe it again:

    1. You need to create a 'trigger' field that you can use within a SQL Options query or stored procedure. Example, have a hidden field called 'DBUpdate' with a default of False.

    2. Create a stored procedure to reference your SQL Lists instead of using a query for your items referencing another field for its SQL Options.

    3. Pass in the parameter for DBUpdate into the stored procedure along with field 1 (in my example Car Types). Then if the value is false for DBUpdate in your stored procedure then use the query you are currently using to render that list as it always has been.

    4. Set the value over the querystring when you are in 'SQL Binding' or 'Update Mode' to 'TRUE'. I would have to know if this update is coming from an edit link or what but you can set this to True.

    5. In your stored procedure, check if the value is 'True' for DBUpdate and if it is then use a SQL Query which checks the record stored in the database table for the actual value, this way your query isn't actually needing the previous field which isn't stored in viewstate and causing a problem and is pulling from the database table. Please note, this could change your stored procedure slightly because this means you might also need to pass in maybe the same primary key you are using for your SQL Bind as well. So your stored procedure might pass in your primary key, DBUpdate, and the value for $(Field1) in case DBUpdate is false.

    6. The final 'trick' to this is to use a client side event so that when you have the page loaded and working / displaying properly in Edit mode you change the value of $(DBUpdate) = 'False' within field 1. This way if you are in Edit mode and you want to change the value for Field 1 (in our case Car Types) then you also change DBUpdate to false and therefore when the question event fires to go and populate the next field you end up pulling from $(Field1) in your query and not pulling from the database.

    So, confusing and requires some work but you can do it We do offer Premium Support if you need us to jump in at any time, you can pick hours up at http://www.datasprings.com/Premium-Support.

    Thanks!

    -Chad


    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi