Question T653
Visible to All Users

Image picker question type

created 7 years ago

Hello team,

I am trying to display image picker type question into my survey. So i followed this approach https://surveyjs.io/Examples/Library?id=custom-widget-image-picker.
But the image picker type question is not displaying.

Here is the json:
json:
{
startSurveyText: "Start Survey",

firstPageIsStarted: true,

pages:
[
  {
    "elements":
    [
      {
        "type": "html",

Code
"html": "<p>This is C programming section.</p>"

}
    ]
  },
  {
    "elements": [
      {
        "name": "hello",
        "title": "hello image picker",
        "isRequired": true,
        "type": "imagepicker",
        "choices": [
          {
            "imageLink": "imagelinkcomeshere",
            "value": "image1"
          },
          {
            "imageLink": "imagelinkcomeshere",
            "value": "image2"
          },
          {
            "imageLink": "imagelinkcomeshere",
            "value": "image3"
          }
        ]
      }
    ]
  }
]
}

When i click on start survey button, this message is rendered instead of showing the image piker question "There is no visible page or question in the survey."
Can you please help me…

Thanks,
Sagar.
--

Invanto

Answers

created 7 years ago

Hello,
Do you insert all required libraries into your page? Please take a look at html code of this example.

Thank you,
Andrew
SurveyJS Team

    Show previous comments (1)

      Hello,
      Could you make an example with the issue. It hard to say what is going on.
      Very likely - there is no "imagepicker" type is registered in SurveyJS Library, as result this question is not loaded and there is no any question on the main.
      The only reason of this - the custom widget library or image picker library are not on the page or they are in the wrong order.

      Thank you,
      Andrew
      SurveyJS Team

        Hello Andrew,

        Now the image picker type question is working properly, after including the required js and css files at proper place. But i've encountered another problem here, when i load the survey using AJAX call, the entire survey is rendered as required, except images. I mean the question title, progress bar all are shown, but the question answers(images) are not rendered.

        And when i hit the url directly(not the AJAX call) in the browser, then all the survey is rendered including images. When i compare the rendered div elements in both cases, the failed case don't have "li" elements part inside the "ul" element. Can you please guide me, why the "li" elements are not rendered while survey is loading from AJAX call. Both screenshots are attached.

        Thanks,

        Sagar.

        On Fri, May 11, 2018 at 5:26 PM, Sagar Babu <sagar@invanto.com> wrote:

        ---------- Forwarded message ----------
        From: Sagar Babu <sagar@invanto.com>
        Date: Fri, May 11, 2018 at 5:18 PM
        Subject: Re: Image picker question type [T653]
        To: Arpita Rana <arpita@invanto.com>

        Hello Andrew,

        Now the image picker type question is working properly, after including the required js and css files at proper place. But i've encountered another problem here, when i load the survey using AJAX call, the entire survey is rendered as required, except images. I mean the question title, progress bar all are shown as expected, but the question answers(images) are not rendered.

        And when i hit the url directly(not the AJAX call) in the browser, then all the survey is rendered including images. When i compare the rendered div elements in both cases, the failed case don't have "li" elements part inside the "ul" element. Can you please tell me, why the "li" elements are not rendered while survey is loading from AJAX call. Both screenshots are attached.

        Thanks,

        Sagar.

        On Fri, May 11, 2018 at 10:48 AM, Sagar Babu <sagar@invanto.com> wrote:

        ---------- Forwarded message ----------

        DK DK
        Dmitry Kurmanov 7 years ago

          Hello! Could you please tell how do you load the survey by AJAX. Do you use surveyId and our service or your own service ?