[ 2 posts ]

steve coleman

  • Username: SteveC72
  • Joined: Tue Dec 20, 2011 2:02 pm
  • Posts: 1
  • Offline
  • Profile

yuiloader in portlets

Post Posted: Tue Dec 20, 2011 2:16 pm
+0-
Hello this is my first post here.

I am a YUI rookie, and have a question.

I am using YUI 2.9 and Oracle WebCenter IDE.

When my portal page first loads, the yui loader successfully loads my requested widgets into the DOM and executes the onSuccess functions which loads the widgets with data linked to divs I have marked up on the page.

When I execute an action method, (which does a round trip back to the server for some functions, and then a GET to the page), I find that the onSuccess functions are not executed, and hence my widgets functions are not executed, and only the base markup is appearing on the page. The YUI widgets are still loaded into the DOM though.

Is this because a separate instance of the Yui loader is created on the page GET and since everything was already loaded the first time it did not get to the onSuccess callback?

Any help or solution recommendation would be appreciated.

Thanks!
SteveC72, YUI rookie

here is the js i have written...
-------------------------------------
(function() {
// Instantiate and configure YUI Loader:
var loader = new YAHOO.util.YUILoader({
base: "http://yui.yahooapis.com/2.9.0/build/", // location of YUI build directory
require: ["datatable","logger","menu","yuiloader-dom-event"],
loadOptional: true, // load any optional dependencies
combine: true, // don't combine files into a single request; requires special server-side file
filter: "RAW", // use the minimized version of the files: also valid are "RAW" and "DEBUG"
// force: ["yuiloader-dom-event"], // force loader onsuccess after portlet event steve
allowRollup: true, // rollup files, e.g. (yahoo.js, event.js, & dom.js can be combined into yahoo-dom-event.js)
onSuccess: function() {
// YAHOO.log('onSuccess start');

console.warn('onSuccess: function() start');
// code for DataTable, using markup html as the data source
var myColumnDefs = [
{key:"casenumber",label:"casenumberl",sortable:true},
{key:"lastname",label:"lastnamel", sortable:true},
{key:"casetype",label:"casetypel",sortable:true},
{key:"caseservice",label:"caseservicel",sortable:true}
];
// console.debug('you are inbetween myColumnDefs and myDataSource');
this.myDataSource = new YAHOO.util.DataSource(YAHOO.util.Dom.get("testtable"));
this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
this.myDataSource.responseSchema = {
fields: [{key:"casenumber"},
{key:"lastname"},
{key:"casetype"},
{key:"caseservice"}
]
};

this.myDataTable = new YAHOO.widget.DataTable("markup", myColumnDefs, this.myDataSource,
{caption:"Example: query result from Markup",
sortedBy:{key:"casenumber",dir:"asc"}}
);

// end of data table code
//********************** menu
var oMenu;
YAHOO.util.Event.onContentReady("basicmenu", function () {
oMenu = new YAHOO.widget.Menu("basicmenu");
oMenu.render();
oMenu.show();
// console.debug('basicmenu render and show');
});
//******** end of menu
//******** menuButtonID open and close

var fnCallback = function(e) {
// alert ("menuButtonOpenID was clicked");
oMenu.show();
// console.debug('omenu.show()');
};
YAHOO.util.Event.addListener('menuButtonOpenID','click',fnCallback);

// console.debug('onSuccess done');



// end of data table code

} // end of onSuccess

});
loader.onFailure = function (o) {
alert ('error: '+YAHOO.lang.dump(o));
}
// Load the files using the insert() function.
loader.insert();

}());


-----------------------------------

Todd Smith

YUI Contributor

  • Username: stlsmiths
  • Joined: Thu Nov 05, 2009 10:03 am
  • Posts: 675
  • GitHub: stlsmiths
  • Gists: stlsmiths
  • IRC: t_smith
  • Offline
  • Profile

Re: yuiloader in portlets

Post Posted: Thu Dec 22, 2011 2:58 pm
+0-
Hi Steve,

What is the "action" method that you refer to?
( The only handler I see defined is the click handler on menuButtonOpenID )

Are you using HTML Forms with an 'action="URL?....."' or something similar?

Does your DataTable render properly?

Are you trying to load some information via Ajax or some other remote method?

For example, are you trying to reload the DataTable remotely?

If we get some more information we might be able to help get you moving forward.

Thanks,

Todd
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum