Try our conversational search powered by Generative AI!

Get Xform poll from another page

Vote:
 

We've got sort of a "Quiestion of the week" function on our page that I'd like to perfect. As it is today the question shows up followed by a link to the Xform page that contains the question and you can answer it there. I'd like to display the alternatives at the same place as the question is and also have the results of the poll to show up there. How do I do this? They way it is done today is that the question is fetched via LINQ but I don't think that's an alternative for getting the whole questionnaire.

#46787
Jan 05, 2011 8:57
Vote:
 

Ok, some progress made. I copied the code from the xform page in the public demo pages and in the Form function I changed the code string formGuid = CurrentPage[XFormProperty] as string; to instead use a reference of the page where my questionnaire is posted. This works fine! The votes are all registered.

The problem now is when I want to see the statistics. I get the error message "ExternalId may not be an empty guid". I assume this has to do with the statistics not being referenced to the same page the form itself is, right? Any ideas of how to fix this?

#46800
Jan 05, 2011 10:26
Vote:
 

Hi!

 

Are you using the XFormStatistics web control to show the statistics (as the example user control does). If so, have you tried setting the AllPages property to true?

Regards
Linus Ekström

#46801
Jan 05, 2011 10:35
Vote:
 

That was just the problem I was dealing with at the moment. Couldn't understand why the statistics were so strange. Thanks a million!!

#46803
Jan 05, 2011 10:51
Vote:
 

There's only one thing messing with me now and I can't see why it does what it does. Or should I perhaps say does what it doesn't.

I press the button to show statistics and the statistics show correctly. Then when I press the button to return to the form the statistics still show. The function for switching (SwitchView) still acts like the statistics aren't visible. I can't get it to switch back and even though I clearly see the statistics are showing the if-statement in the SwitchView function chooses to see it as not visible.

#46806
Jan 05, 2011 11:25
Vote:
 

Hard to say what it is without having your code. Since the switching logic lies in the templates you should be able to debug this to find the problem.

#46810
Jan 05, 2011 13:14
Vote:
 

I ended up removing the switch button. It wasn't really needed anyways.

#46811
Jan 05, 2011 13:16
Vote:
 

Try enable viewstate. There is a check for a panel if it's visible or not that will always be false otherwise.

Also add a line of code
 Statistics.PropertyName = XFormProperty;
Otherwise the property name is hardcoded to be xforms.

#55209
Nov 22, 2011 16:21
Vote:
 

Hi All,

 

I included the questionaire like three questions with two radion buttons each.When i click on submit the statistics are displayig but the issue is  for first question two statistics results are showing[fine bcoz my first question contains only two options] but for second and third questions three statistic results are displaying even thouh my 2,3 questions contains only two options.

Can anyone pls suggest me the way to come out?

Thanks in advance

@Murali

#57128
Feb 28, 2012 7:06
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.