Checkbox Forums

Help
+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15
  1. #11
    toolbox Guest

    Default

    Quote Originally Posted by ncushing View Post
    Toolbox,

    Rather than paste bits of code into the message, I created a sample web application that shows a list of surveys and responses. Upon selection of a response, all answerable questions are displayed on a single page along with their current answers. The user can then change the answers and save those changes.

    To run the application, extract the files to a folder, then create a virtual directory in IIS to point to the folder . Then you'll need to update the connection string in the web.config and will need to update the web.config and all config files to replace [APP_PATH] with the physical location of the folder containing the application (e.g. C:\WebRoot\OnePageSurvey\) so that the various configuration files are referenced by their full paths.

    Hopefully this will be a good start for you to adapt to your needs. If you have any questions, please let me know.
    I have been using the sample website, but have noticed that the save feature isn't working quite right. When I click the save button, the page says that answers have been successfully updated, but when I leave and then come back to the survey, or view the results in the checkbox app, the answers have not been changed.

    Any idea what I need to update/change in the same app to get that to update correctly?

    Thanks

  2. #12
    toolbox Guest

    Default

    Here is the code in the app for saving the new results:

    //Reload the current response, which is necessary because the response object does not have a lifecycle
    // beyond the a single postback in the application. This will eventually change, but for now the
    // response must be reloaded to prevent item IsValid states from getting confused.
    LoadCurrentResponse();

    bool valid = true;

    if (_itemRenderers != null)
    {
    foreach (ItemRenderer renderer in _itemRenderers)
    {
    //Update the model
    renderer.UpdateModel();

    if (renderer.Model is ResponseItem)
    {
    valid = valid & ((ResponseItem)renderer.Model).Valid;
    }

    //Rebind the renderer to the model to cause the validation errors to show
    // current state of the Model.
    renderer.BindModel();
    }

    _answersUpdatedLbl.Visible = valid;
    _validationErrorLbl.Visible = !_answersUpdatedLbl.Visible;

    //Save the response state
    CurrentResponse.SaveCurrentState();
    }

    After trying several things, I found that if I commented out the LoadCurrentResponse(); the new answers were saved correctly, and everything else still appears to work.

  3. #13
    pkreipke is offline Junior Member
    Join Date
    Jan 2009
    Posts
    11

    Default

    Dusting off this thread...
    - the fix above of commenting out LoadCurrentResponse() also worked for me.

    - I find some settings in the config folder's XML files confusing, they conflict with settings in our running version of Checkbox Server.

    - in particular, I wonder if the settings in Cache.XML where the security, text, response and template cache managers are set to 'true' (in our live system they're false) are causing some behavior I can't understand:

    * if I change the template style to use numbered questions, CurrentSurvey in the OnePage application still shows the setting as false.

    * if I change the template style's title or next/back labels to anything else, they never change in the OnePage app.

    Suggestions?

    Thanks,
    Per

  4. #14
    ncushing is offline Administrator
    Join Date
    Mar 2007
    Location
    Prezza Technologies
    Posts
    227

    Default

    I'm pretty sure the one-page app replicates the functionality of the ViewResponseDetails screen, which does not use a survey's style template or style settings for rendering the page. You would have to modify the application if you wanted it to use those settings.

    Settings that control display of page numbers and the like are properties of the ResponseTemplate object, and the actual style definitions are part of the StyleTemplate object associated with the survey. The StyleTemplateManager class can be used to load a style given it's database id.

  5. #15
    pkreipke is offline Junior Member
    Join Date
    Jan 2009
    Posts
    11

    Default

    I'll take another look at the Style stuff.

    But I don't think that the app replicates the ViewResponseDetails page because it shows the response in edit mode , not view mode. E.g. all the HTML controls are shown, not the values of the answers.

    Per

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO 3.5.0