In XPages mobile app, how to avoid appending resetContent=false/true after pressing Done? - xpages

I've a mobile page developed with ExtLib mobile controls:
http://hostname/mydb.nsf/MobileTest.xsp
The page consists of two appPages (i.e. a "mainPage" appPage & a "subPage" appPage).
Click on an entry in the mainPage will move to the subPage. Click on the "Done" button in the subPage will move back to the mainPage. After moving back to the mainPage, the resulting URL will automatically change to: http://hostname/mydb.nsf/MobileTest.xsp#mainPage&resetContent=false
When this happened, if I press the browser's refresh button on my iPhone, instead of showing the mainPage, a grey blank page will be displayed. Then, if I manually remove &resetContent=false from the URL and press the refresh button again, the mainPage will be displayed properly.
So, is there any way to suppress appending &resetContent=false (or true) after clicking on a Done button?

I have found the cause of this and have put a fix into the ExtLib, it will be in the next release. I don't know when that will be at the minute but will update when I know

See answer:
http://www.openntf.org/internal/home.nsf/response.xsp?action=openDocument&documentId=0B41430C59FA242C862579D50034D72A

Related

Go back without pressing mobile back button

there are two fragments. first is main fragment and second is editprofile fragment. if we click on editprofile button then it navigate to editpeofile fragment. if we click save changes button then it will navigate to main fragment.
main fragment is fetching data again from server.
I need a method to go back without pressing mobile's back button.
link : https://developer.android.com/training/implementing-navigation/temporal#java
getActivity().getFragmentManager().popBackStack();

webview.findnext() start highlighting from the current position of touch in the screen

I'm new in android studio. I'm working on a simple project. It uses a webview which loads the html page. I also use an action bar for searching, refreshing , ... in the page bellow:
By pressing the search button, findAllAsync() method is used to find and highlight all the matches in the page (matches are shown in yellow color). The next button in the action bar uses the findnext(true) method and allows user to move between the highlighted matches. Using this method, the next one is highlighted in red color:
next.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
st = et.getText().toString();
if(!st.equals("")&& st!=null) {
ourBrow.findNext(true);
}//not null
}//on click
});// next Button click
If I only scroll or zoom in the webview everything is ok and the find next is continued from the previous one in the page. However if i touch somewhere in the webview and then click the next button, the red highlighting is not continued from the previous position in the page. For example if the previous red highlighted is at the first of the page and i touch the end of the page and when i click the next button, the middle yellow matches are escaped and the last one which is in end of the page is highlighted in red color and red highlighting is continued from this position.
Since i need the user can continue search from the previous position and touching the screen does not affect this order, i searched a lot. I tried to disable touch event of the webview but keeping zoom and scroll ability based on the Android disable WebView touch but keep zooming/scrolling. But my problem is still unsolved. Please kindly help me to solve this problem.
thanks.
Edit:
To solve this problem i tried to clear focus of the view(How to remove focus without setting focus to another control?). But it doesn't work:
View current = getCurrentFocus();
if (current != null) current.clearFocus();
ourBrow.findNext(true);
I would recommend the following not the best approach (and it depend on your web page) but it will work, render the content of your web page to html using :
webview.loadData(URLEncoder.encode(result).replaceAll("\\+", " "), "text/html", Encoding.UTF_8.toString());
Than do whatever you want with your text highlight the way you want and then render it back to web page like this:
myTextView.setText(Html.fromHtml("Your HTML Page"));
API after nugget:
myTextView.setText(Html.fromHtml("Your HTML Page", Html.FROM_HTML_MODE_COMPACT));
Hope it helps

SharePoint 2010 Publishing Page live preview... any thoughts?

I would like to collect your ideas on the following:
SharePoint 2010 (and 2007) does have a preview button... while you are editing a publishing page you can switch to the "Page" tab and hit the Preview button:
Clicking this button does some magic to save your data, and opens a new window where the preview page is displayed. Nice, but could be better. What I would like is live update on editing of field controls from the edit page on the preview page.
My thoughts on this is are as follows:
Field types have an ID. For rendering the field values on your preview page, subclass from the standard FieldValue control, and render a span with the same ID around the field value html. So if we have the text ABC in the content editable div of a RichTextFiled X, render the field value as ABC in the display output (for example using EditModePanels for Display and Edit)
Add key-stroke event handler on all fields for the edit mode page (using for example jQuery), on key press copy contents from edit browser window to preview browser window
Transfer can be done using http://www.sfpeter.com/2008/03/13/communication-between-browser-windows-with-jquery-my-new-plugin/.
Does this sound doable? Would be great to work dual monitor, edit on one monitor, preview page in its real rendering on the other monitor. Especially if the edit mode differs from the display mode.
Looking forward to your input!
I will answer my own question. It is not as easy as its sounds. Fields can use things like reusable content and render patterns. These features render at server side, and change the output. This would require postbacks, which renders the whole thing useless. Lets stay with the already available preview button.

UIWebView example code for in-app browser?

Anyone have some sample code for an in-app browser that they would like to share?
I am looking to add a browser view in my app that is pushed and includes a toolbar with four buttons: back, forward, stop/refresh and actions. However, I'd like to show somewhat transparent and none-tapable buttons when you can't go forward or back, and also have the stop/refresh button show the appropriate icon when it's loading and done loading?
My issue is currently that I cannot get "blanked out" back and forward that cannot be tapped if you cannot go back in the web history. Also, how do I change out the stop icon with the refreshing icon when the view is loading?
For tool bar items, simply set "item.enabled = webview.canGoForward;" (or canGoBack). To change the refresh/stop button you can set item.customView if you want to use a progress view or some such, otherwise if you just want to use a static image you can set item.image. All this is in the documentation as well.

How is "Are you sure you want to navigate away from this page? " generated in browsers?

I have a page where I open a "modal window". It is really just a DIV, with an IFRAME inside, where I load another page. When I want to refresh the page, the browser pops up a window saying "Are you sure you want to navigate away from this page? Reloading this page will cause the modal window to disappear. Press OK to continue, or Cancel to stay on the current page."
How does this message get generated? How does the browser figure out that I have a modal window there, because I don't use any window.open() call from JavaScript? Is there any way to disable this behavior of the browser.
It may be body.onunload in the source of the page loaded in the IFRAME.
As the modal window is essentially an IFRAME, then when you close (or refresh) the main window, the browser knows it is killing that IFRAME, hence any body.onunload in that IFRAME fires.
If you have a function that handel onbeforeunload, automaticaly the Firefox message is generated.
you can disable it by returning null at the and of your handler.
This could be caused by some script modifying all off-site links to display this modal window, and then return true, or return false based upon your interaction with the modal window.
If you want to strip that behavior, you could remove all click events for external links.

Resources