Server side javascript to replicate the moveto function in mobile applications - mobile

I'm sure I am missing something obvious, but How do you provide the moveTo functionality like a djxmLineItem has in javascript in the case where I need to use a button to set fields in addition to switching mobile pages?

You can't use server side to execute the mobile moveTo as these actons are handle by dojo client side code.
One option I've used in the past is to use a document "postSaveDocument" to call the moveTo.
e.g.
<xp:dominoDocument .....>
<xp:this.postSaveDocument>
<xe:moveTo ...>
</xe:moveTo>
</xp:this.postSaveDocument>
</xp:dominoDocument>
In my example I needed to maually add some data to a document with server side code ad faced the same issue, I found this to be a good solution as it won't run until the document has been saved, meaning all validation will run fine.

You can compute the moveTo property and thereby set fields before moving to the desired XPage.
Have a look at the answer here: XPages Mobile Controls - how to program the Back button

Related

AngularJS: Triangular three way binding -- Project Structure

I am currently working out an admin interface with a Live Preview and I am still not 100% on how to structure it properly.
My page basically consists out of two parts. The Admin Interface and the Live Preview. Obviously, the Admin Interface fills some variables with data and the Live Preview displays this.
Therefore, the Admin Interface needs to bind variables, that the Live Preview will bind for reading.
Furthermore, the Live Preview in the end (if possible) should be re-used as the final product that displays a set of information. All it does is display a single JSON file that is received from the server (when in product mode) and in case of the Live Preview it will need to update the data Live as its edited.
One more note: Both, the Live Preview and the Admin Interface consist of elements like directives again and parts of the Admin Interface need to be loaded dynamically by having a user add a page with a certain type of content.
After researching how modules are handled I came up with the following:
Live Preview is a Module
Admin Interface is a Module
My page includes both modules
Both of them should be connected to something central that provides the ability of editing the data (bound variables?) and reading the data so its updated live.
Ideally, this would be a service, so later on when loading the "Live Preview" as an actual product, can just use the same kind of service which in this case provides the information from our Database instead of a variable in its scope.
Is this a good approach? Is there a way to have a service that on the one hand side can be edited lively like in a two way binding so that my live preview can also pick it up? Is there something I can use instead of the services, like a controller? How should I go on about this?
You are doing everything right. I don't think that it is relevant as to whether the preview and admin panel are their own modules or contained within one. You will find people using module seperation in a wide variety of ways within their Angular apps.
What I think you said that is important and correct is to connect the preview and admin panel via a Service. Other methods of connecting these two (i.e. $rootScope) are costly and bad practice.
If you will be re-using live preview in many locations of your application I would wrap it in a directive.
You should feel confident in your approach, it's a good one.

mvc post list with number of record not working

I am using MVC architecture for my application.
Now, I have more than 1000 record which i am binding on Listbox.kindly check below screen shot.
Here, Left side list have more than 1000 records and my functionality is, User should select any record and move it to right side ListBox.
it;s work on my local system but when i deploy on iis6 web server it's giving me error. kindly check below image for error.
and also suppose i use less than 500 records.same functionality working properly.
so, i have to make changes on IIS or code or any limitation to post record on mvc?
Check Stack Trace
Looks like you are doing DoS attack on yourself. I think that you have 2 options:
alter web config(ref. http://geekswithblogs.net/renso/archive/2012/01/19/operation-is-not-valid-due-to-the-current-state-of.aspx):
<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="2000" /></appSettings>
dont post whole form, just the part with data you need(carriers to be added). Either using jquery, or adding only fields to be posted inside form tag.

WP7 WebBrowserTask without url entry textbox

This might not be possible but I thought I'd check with everyone.
Is it possible to load a WebBrowserTask on WP7 but to have the url entry box collapsed? I'd also like to set IsHitVisble to false?
The reason I want to do this is to load a url (through databinding) but ensure that the user can't browse to other links on the page. I also need to keep the phones share control in the tool bar so I can't just use a webbrowser control and set the source to the url.
Does anyone have any ideas?
Not possible. You can use a WebBrowserControl inside your own app, but it's not recommended.
Basically such odd/weird limitations as this, don't belong in any modern day craftsmanship. And thus why it isn't a possibility (thanks Microsoft!)

Is there any way to handle silverlight deep linking without '#' showing in the url?

I want to have two separate interfaces to my website, one that is silverlight, and one that is normal html for people who don't have Silverlight, and for search engines. They would have exactly the same content, the Silverlight one would just be a richer experience.
If someone with Silverlight copies the URL to a certain page, it will have a '#' in it (app#page1). If they then want to link to that page on their blog or something, it will have the # in it, and a search engine probably wouldn't consider it as a separate page from app#page2.
Is there any way to make the navigation from within Silverlight update the URL with a '/' instead of a '#', without actually loading a separate page? This way the URLs in the address bar appear like a normal websites' URLs ('app/page1', 'app/page2').
Is there any way to make the navigation from within Silverlight update the URL with a '/' instead of a '#', without actually loading a separate page? This way the URLs in the address bar appear like a normal websites' URLs ('app/page1', 'app/page2').
Unfortunately, no. The reason that Silverlight navigation URLs use # is that you can move around within a page by moving to an anchor location. If you used a full URL with '/' separators, it would cause the browser to navigate to a new page, which would reload your Silverlight application. This would basically unload your Silverlight application, and load a new one with the new URL.
The reason they use the # sign is because this is interpreted by the browser as moving to a location in the page, otherwise would reload the page.
As far as search engine implications I'm not sure either way. Maybe someone more experienced with SEO can chime in on that.
However I'm sure you can get the behavior you're looking for, just may take some trickiness on your end. Another way pass information to the Silverlight client runtime is using Query String parameters. You can access query string params using the System.Windows.Browser.HtmlPage.Document.QueryString collection, you could then load the Page or User control with the content you desire based on that parameter.
As far as mimicking a folder structure using '/'s. I know there are ways to do this using custom web server settings / HTTPModules. I assume you're using IIS/ASP.Net, I would look into this from Guthrie:
http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx
Takes a bit of hackery, but if you're really set on doing it I'm sure you could. You will also face the things the above poster mentioned, if you attempt to do use the same logic during a session. This may work though for just the deep linking aspect you're looking for.

Is there a "Browser Control" to host a website inside Flash/Silverlight?

I'm looking for something similar to the VB6 / .Net Winforms "Browser Control", that let's you show a browser inside your application.
I don't want to just render a page, I want it to be a fully-functional browser, in which people can click links, will run Javascript, etc.
In essence, what I want is an IFrame, only that it runs inside a Flash app, or a Silverlight app.
The ultimate reason for this is that I want to defeat IFrame busters. I'm making a web app that lets you see other sites inside of it, and I'm running into a bunch of sites that have this code:
var t=top.location,w=window.location;if(t!=w) t.replace(w);
(that's from eBay BTW)
which essentially pops the user out of my site and into theirs.
My hope is that by using a "browser control" of some sort, inside a plugin sandbox, "top", will be top for that browser control, and not for my site.
Of course, if you have any other ideas to achieve the same, they'll be more than welcome.
Edit: I've tried the Component One control suggested by Bill, but it didn't work for these purposes, because it's creating an IFrame outside of the SilverLight control, so it executes in the same context as the page hosting Silverlight, which is what I'm trying to avoid.
Northcode SWF Studio allows you to add browser window on the stage in Flash. I personally use SWF Studio as a third party SWF2EXE tool to extend the power of Flash projectors. It's quite stable and powerful. As far as browser control is concerned here is the example you can download and test if it serves your purpose. Check the Browser APT here.
We've not built a component to enable folks to do this but we're open to suggestions here. That being said, easiest solution is an iFrame, but word of caution in that when you overlay an iFrame over the the top of Silverlight we've seen customers experience perf issues as a result (mostly due to alpha transparency of the iframe etc).
This isn't isolated to Silverlight, Flash suffers the same issue as it has to do with browsers and rendering within the given operating system.
HTH.
Scott Barnes / Rich Platforms Product Manager / Microsoft.
I use the HTML control created by Component One. It has the limitation that the Silverlight object in the page should be set to windowless, but otherwise it works very well.
It's an old post but I'll add my tupence answer. I used the DivElements free control for Silverlight link text and it works quite nicely. It just positions the div accurately so that it looks like it's on top.
As for the other such controls, you've got to set the windowless property of the Silverlight container to true.
It works really well for me and I'm able to seemlessly have Google maps and the Acrobat plugin displayed side by side with my Silverlight application.
PS: because the component just adds a <div> to the page, you can't do stuff like having it load dynamically Javascript file like in the <header> tag.
PPS: when setting the HTML code "by hand", be sure to hook up on the DocumentReady or Loaded event before playing with the HTML DOM.
Hope that helps someone.

Resources