Welcome Guest Search | Active Topics | Sign In | Register

Dialog Control Options
Versile Johnson
Posted: Tuesday, March 31, 2009 3:10:11 PM
Rank: Advanced Member
Groups: Member

Joined: 8/25/2007
Posts: 34
Since I seem to be good at using controls in ways they were not necessarily designed for - I have a new question. I have contenturl loading a page in my dialog. At some point in that page cycle I am calling response.redirect to a dynamically generated html page with embedded javascript. After all the page is complete I'd like to display a "Finish" button and get the value from the finish button, how can I do that?

Or to simplifier if it's easier, when I cancel the dialog I want all the HTML inside of it.
Versile Johnson
Posted: Thursday, April 2, 2009 1:50:12 PM
Rank: Advanced Member
Groups: Member

Joined: 8/25/2007
Posts: 34
To answer my question (if anyone else has it) and ask a new question.

From the contenturl page that I am dynamically generating I inject this javascript
Code: JavaScript
function finishQuiz() {
var dialog = document.body.createTextRange();
var newText = dialog.htmlText;
newText = newText.substring(newText.indexOf('<DIV id=quiz'),newText.indexOf('</DIV>') + 6);
newText = newText.replace(/</g,'{'); // Need to remove brackets to avoid page problems
newText = newText.replace(/>/g,'}'); // Add brackets back in on server side
parent.eo_GetObject('Survey_dialog').close(newText.toString());
}


then on the main page I add a clientclose script (and reference to it clientsideonend) and a callback item (not panel)
Code: JavaScript
function SendSurvey()
    {
        var contentLayer = eo_GetObject('Survey_dialog').getResult();
        eo_GetObject('callback_survey').execute(contentLayer);
    }


then add a code behind for the callback that executes code using e.Parameter

-- Only final problem is it works great in IE, but when I try it on google chrome it chokes and seems to fail at the close request
Code: JavaScript
parent.eo_GetObject('Survey_dialog').close(newText.toString());


Thanks,

Versile
eo_support
Posted: Thursday, April 2, 2009 2:29:44 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Thanks for the update. I believe this is an issue that not only occurs on Chrome, but also on certain version of FireFox. The following post has discussed this issue and possible solutions in detail:

http://www.essentialobjects.com/forum/postst2528_EO-Dialog-and-OnTextChanged-on-firefox.aspx#10657

Thanks
Versile Johnson
Posted: Monday, April 13, 2009 7:25:12 PM
Rank: Advanced Member
Groups: Member

Joined: 8/25/2007
Posts: 34
I have been unable to get this to work cross browser, any help you an provide besides just the above link would be muh appreciated.
eo_support
Posted: Tuesday, April 14, 2009 8:27:06 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Can you let us exactly know what you have tried and what part is not working? We have verified the sample code we provided works fine. So we simply do not know where to start when you do not provide any details.

Please keep in mind that the main goal of our tech support is to help our users to understand how to use a specific feature/function of the product. Beside that we can give solutions/workarounds for issues you run into while using our product. What we generally can not do is to provide custom solution for a particular business/application scenario you have encountered. We expect our users to rely on their own skills to solve such issues. In simple language, we neither code for our users nor troubleshoot our user's code.

Thanks!
Versile Johnson
Posted: Tuesday, April 14, 2009 8:46:37 AM
Rank: Advanced Member
Groups: Member

Joined: 8/25/2007
Posts: 34
well you did point me in the wrong direction. It has nothing to do with the previous firefox issue. This part here only works in some versions of IE and not in Mozilla or Chrome.

document.body.createTextRange();

When I change that to document.getElementById("quiz").innerHTML the entire function worked. Of course I spent considerable timetrying to figure out the above firefox bug before I realized that.
eo_support
Posted: Tuesday, April 14, 2009 8:56:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
You told us it chokes on eo_GetObject('Survey_dialog').close(). So our reply would be based on that. As explained in our previous reply, we do not troubleshoot your code. So when you run into an issue while using our dialog, we do our best to help you out on that particular issue. We do not review the rest of your code and tell you what's wrong.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.