RichCommandMenuItem with parameter - oracle-adf

I added up a RichCommandMenuItem on my jspx, but I have no idea about passing URL parameter.
Here is my source code for the Menu.
RichCommandMenuItem menuPage1 = new RichCommandMenuItem();
menuPage1.setId("page1");
menuPage1.setText("Page 1");
menuPage1.setActionExpression(getMethodExpression("page1?par=123"));
I would like to send a parameter with my RichCommandMenuItem.
if you have any ideas or suggestions, let me know.
Thank you.

Command controls are for navigation within ADF applications in 11g. Go controls are for navigation to external URLs. As such you're using the wrong type of component, use RichGoMenuItem instead, and it's setDestination method.
http://jdevadf.oracle.com/adf-richclient-demo/docs/apidocs/oracle/adf/view/rich/component/rich/nav/RichGoMenuItem.html

Related

NetSuite / Suitescript - Focus on field on Page Load

Is there a way through workflow or suitescript to focus to a specific field when the page loads? I don't want a hack.
Thanks!
Unfortunately there is no way to access to the NetSuite UI using SuiteScript because it doesn't support direct access through the DOM. You need to use javascript.
You can use a client script to define the cursor location. In my example I use the field change but you should be able to apply the same logic to the pageinit.
function clientFieldChanged(type, name, linenum){
var nextElement = document.getElementsByName('inpt_custrecord_bathroom1_typeofbathroom');
nextElement[0].focus();
}

Backbone view based on model from collection, how to update view?

I am looking for a bit of direction I am still fairly new to Backbone and am currently creating a test application to learn more.
My problem is this, I am populating a backbone view with a underscore template. I load a collection of models, then I find the model I need and populate these values into the template. There can be many pages based on the template so I have a dynamic route that accepts an id.
My problem is I want to add a next feature, that would change the current page and reload the template with the new model.
I have tried a crude method along the lines of :
Backbone.history.navigate(newLocation)
However this did'nt work, please note newLocation is actually populated with the route and the id I want to navigate to.
I will add some code from my view below, I won't include the full code however if it is needed please ask.
Any help or a push in the right direction would be great.
Thanks in advance
You need to use your router object's navigate method rather than than history's class method, and you need to pass it the option `{trigger: true} in order to invoke the corresponding route function.

Episerver nested master page from EPiServerUI.master

I want to have my custom master page for all GuiPlugIn reports. As we know, by default GuiPlugIn referes to EPiServerUI.master page which is part of installation. I want to create a nested master page for my GuiPlugIn instead of default.
Please share your thoughts.
Thanks,
Kris
I think the reason that you cannot change master page for a plugin is for visual consistency. You could try to change the master page through code like this (assuming your plug in is a user control:
protected override void OnInit(EventArgs e)
{
this.Page.MasterPageFile = "~/NewMaster.master";
}
Maybe there is a better way to do what you want, if you provide more detail?
You can always access the Page object if you want to inject custom css or scripts to use with your plugin like this:
HtmlGenericControl js = new HtmlGenericControl("script");
js.Attributes["type"] = "text/javascript";
js.Attributes["src"] = "mylibrary.js";
this.Page.Header.Controls.Add(js);

CakePHP - Render a view that is actually plugin's view from Component

Morning guys,
So this is my first time developing a plugin for CakePHP. Here's what I am doing in startUp of the component.
//component
function startUp(&$controller){
//....
if($render){
$controller->render("return", "ajax");
}
}
By default render will look at app/views/<controllers>/return.ctp and app/views/layouts/ajax for this render call.
Is there anyway that I can give a directive to render from app/my_plugin/views/awesome_stuffs/return.ctp and app/my_plugin/views/layout/ajax.ctp instead?
I believe the third param of Controller::render($file, $layout, $file) could do the job, but is there any better Cake way of doing things?
Plus, is that considered a good practice to take over controller's rendering function like that?
One way is to call the PLUGIN controller/action URL in your AJAX call, instead of the main app controller/action URL.
ex:
instead of:
http://domain.com/controller/action
you call:
http://domain.com/my_plugin/controller/action
When you do it this way, the plugin views & layouts are called automagically. See:
http://book.cakephp.org/view/1118/Plugin-Tips
http://book.cakephp.org/view/1115/Plugin-Views
Otherwise, the only way I know of is manually setting paths as you mentioned or controller-wide via:
var $viewPath = 'path/to/plugin/views/';
var $layoutPath = 'path/to/plugin/layouts/';
You might want to try setting $this->view to the plugin dotted view file you want to render.
add to your source
$controller->plugin = "pluginname";

Passing Query string to silverlight

I have a silverlight project that has many xaml pages. i have an external website that will call the silverlight website so e.g. http://mysilverlightproject:1230.com?queryString1=Page1.xaml.
i want to change the page by passing the values from query string.
is it possible to change the main xaml page to be another page from the query string?
Thanks
string val = string.Empty;
if (HtmlPage.Document.QueryString.ContainsKey(”foo”))
{val = HtmlPage.Document.QueryString["foo"];}
As far as I know you can't change Main page after it is assigned from App class. But you can use Navigation framework and navigate to needed page. In this case you also will be able to use browsers back/forward button.
This post is about navigating from code behind.
Take a look at how a Silverlight Navigation Application works. It will give you the functionality you request.
you can pass pageId to SL application by initparams specific to different URLs and load required page inside SL application instead of default start page
Init params are placed in html and are passed inside SL app, like the following
<param name="InitParameters" value="queryString=Page10" />
Inside you can use SilverlightHost class to get them
SilverlightHost host = new SilverlightHost();
if (host.InitParams.Count > 0)
{
foreach (var c in host.InitParams)
{
if(c.Key == "queryString")
RedirectToUIPage(c.Value) // your method
}
}

Resources