I am very new to WPF and have what appears to be a simple question:
I have a Frame and I set the Source to the Uri of one of my pages. I want to pass some query string parameters to the page, but I am not sure how to access them in the Loaded event of the Page.
Found it:
NavigationService.CurrentSource will give you the Uri of the current page that you are on and you can grab the query string parameters from that.
You should check out this related StackOverflow question:
Passing parameters to a WPF Page via its Uri
Paul Stovell's answer explains a better approach for passing data than using a query string.
Related
I am looking to create a feature whereby a User can download any available documents related to the item from a tab on the PDP.
So far I have created a custom record called Documentation (customrecord_documentation) containing the following fields:
Related item : custrecord_documentation_related_item
Type : custrecord_documentation_type
Document : custrecord_documentation_document
Description : custrecord_documentation_description
Related Item ID : custrecord_documentation_related_item_id
The functionality works fine on the backend of NetSuite where I can assign documents to an Inventory item. The stumbling block is trying to fetch the data to the front end of the SCA webstore.
Any help on the above would be much appreciated.
I've come at this a number of ways.
One way is to create a Suitelet that returns JSON of the document names and urls. The urls can be the real Netsuite urls or they can be the urls of your suitelet where you set up the suitelet to return the doc when accessed with action=doc&id=_docid_ query params.
Add a target <div id="relatedDocs"></div> to the item_details.tpl
In your ItemDetailsView's init_Plugins add
$.getJSON('app/site/hosting/scriptlet.nl...?action=availabledoc').
then(function(data){
var asHtml = format(data); //however you like
$("#relatedDocs").html(asHtml);
});
You can also go the whole module route. If you created a third party module DocsView then you would add DocsView as a child view to ItemDetailsView.
That's a little more involved so try the option above first to see if it fits your needs. The nice thing is you can just about ignore Backbone with this approach. You can make this a little more portable by using a service.ss instead of the suitelet. You can create your own ssp app for the function so you don't have to deal with SCAs url structure.
It's been a while, but you should be able to access the JSON data from within the related Backbone View class. From there, within the return context, output the value you're wanting to the PDP. Hopefully you're extending the original class and not overwriting / altering the core code :P.
The model associated with the PDP should hold all the JSON data you're looking for. Model.get('...') sort of syntax.
I'd recommend against Suitelets for this, as that's extra execution time, and is a bit slower.
I'm sure you know, but you need to set the documents to be available as public as well.
Hope this helps, thanks.
I have been trying to create a component like the Bakery's Paginator Recall that would allow me to save pagination data for CakePHP 2.4 and run into the following issue.
All solutions involve saving the Paginator parameters in the session and then retrieving and applying them upon returning to that same page without specifying any.
This approach would have worked if only the Paginator helper functions like numbers(), first() and previous() would include the page:1 named parameter in the links that they generate for moving to the first page like the corresponding function of the 1.3 version.
Unfortunately all of these functions create URLs without the page parameter when they refer to the first page, so when users click on the first page link, the component does not find any paging info and hence it returns them to the previous position.
There must be some way to work around this, but for the moment I am completely stuck.
NOT including the page number in the link to the first page is by design.
Read the reason on the CakePHP 2.4 Migration guide.
I would suggest to use the same convention. When you do not have pagination information assume is page one, and do not add it to your URLs.
So all you have to do is code this special case when then pagination is missing. And in this special case your "recall" component will simply not add that page.
I believe that I have managed to create a working solution. Thanks to the advice I have received I have now created a working component like the original PaginationRecallCompoent.
I have written all the details in the following blog post.
I want to pass a url parameter in salesforce, but it shouldn't be visible to the end user in the url. Is it possible? Please suggest if there are any other alternatives? Thanks in advance.
In my scenario, I am dealing with 2 pages with individual controllers. In one of the page I am dealing with apex tabs. So I want to get the current tab name. I found the solution for this as passing it into to the url.
You don't have to pass parameters between pages using the URL, you can do this using form parameters which will "hide" the values from the user (nothing displayed in the URL) like this:
<apex:param name="contIdParam" value="{!cont.id}" assignTo="{!contIdChosen}"/>
This article may be helpful: http://bobbuzzard.blogspot.co.uk/2011/07/passing-parameters-to-apex-method-from.html
I am trying to create a custom lookup page on Salesforce: from a first Visualforce page, I open a second one in which there are a series of available choices; then I click on one of those choices and then I expect the latter page (the custom lookup) to close and the value of my choice to appear in the first page's lookup field.
I am unsure on this very last point: how do I make my choice appear in the earlier page?
As described in this awesome Jeff Douglas post you need to call function lookupPick2 in following manner
top.window.opener.lookupPick2('{!FormTag}','{!TextBox}_lkid','{!TextBox}','{!a.Id}','{!a.Name}', false);
Please read the entire post to get the full picture.
Where is LookupPick2 documented? When I google for it all I find is code examples and blog posts. Is there any documentation for it? I'll keep looking, but wherever it may be doesn't rank very high...
I have an xPages form editing a document, which can be edited automatically (as a datasource) coming frme a view. But you can also input directly (in an input field) the key of the document; then (if it exists) it will be searched in the database (converting the key in an UNID).
The matter is that in this case it is not the currentDocument and custom controls tests (for example for displaying buttons) do not work.
So my question is how to "convert" a programmatically searched document in the database (by UNID) to the normal datasource currentDocument, so normal controls can be apply to it too ?
Thanks if you know.
Store the Unid in the session and compute the data source from there - or open the Form with the matching URL parameter
Your problem is in the URL: it does not contains params to initialize default data source. This is IMHO the simplest way to fix it: native Domino links and XPages.
I am not sure whether it will help, it depends on actual value of context.getUrl(). If it doesn't, you need to redirect to URL you compute from UNID, as Stephan suggested.