Pergunta

I have a ContentPane defined as follows:

<div id="searchResultsContentPane" data-dojo-type="dijit.layout.ContentPane" data-dojo-props='splitter:false, region:"center"'></div>

I am trying to dynamically set the href when a button in another ContentPane is pressed:

var searchResultsContentPane = dijit.byId("searchResultsContentPane");
searchResultsContentPane.set("href", "modules/content_panes/callrecords.php");

For some reason this doesn't seem to be working. The content pane flashes loading then goes back to white and FireBug doesn't give me usable info. This is all it shows:

enter image description here

If you cant read that it says in red:

GET http://cdr.homelinux.net:10001/Mike/modules/content_panes/callrecords.php

callrecords.php loads just fine if I set it with html as a data-dojo-props property.

Thanks

Foi útil?

Solução

Page was refreshing. Used the following code to properly load the content pane.

function sendSearchForm() {
            // format taken from http://dojotoolkit.org/reference-guide/1.7/dojo/xhrPost.html
            var form = dojo.byId("search_form");

            dojo.connect(form, "onsubmit", function(event) {
                dojo.stopEvent(event);

            var xhrArgs = {
                form: dojo.byId("search_form"),
                handleAs: "text",
                load: function(data){
                    loadAdvancedSearchResultsTable();
                    //var searchResultsContentPane = dijit.byId("searchResultsContentPane");
                    //searchResultsContentPane.set("href", "modules/content_panes/test_module.html");
                },
                error: function(error){
                    // TODO Handle errors
                }
              }
              // Call the asynchronous xhrPost
              //dojo.byId("response").innerHTML = "Form being sent..."
              var deferred = dojo.xhrPost(xhrArgs);
            });
        }
        dojo.ready(sendSearchForm);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top