BlackBerry 10 Cascades app stuck affecting property - qml

I have an issue with a list/detail pattern. I have an Article class, inheriting from QObject, defining some properties (title, updated and content being the ones that matters for now). To populate my (QML) ListView, I have a C++ GroupDataModel, filled with some Article*. Here's my list's onTriggered:
onTriggered: {
if (indexPath.length > 1) {
currentArticle = dataModel.data(indexPath);
var page = articlePageDefinition.createObject();
nav.push(page)
}
}
As you can guess, the articlePageDefinition defines a page using the upper currentArticle property.
Now, when I display the articlePage once, it's working fine. I can go back, click on the same list item, display the same Article details, works great. But when I pick a second article, the app kind of freezes. I can go back in my navigation pane, but I can't click on list items anymore. I tried to add some logs, the onTriggered is stuck on currentArticle = dataModel.data(indexPath);. At this point, I can log every property of dataModel.data(indexPath) without any issue. I tried to not create/push the page, simply affect currentArticle and display some of its properties, it's working fine too. I really don't understand what I am doing wrong here, any help appreciated.
In case you need to see more code, everything is here: https://github.com/Kernald/tt-rss-bb10/tree/e29e3b616aa179dd42f66804ecc20a6a45b6bb22

Here what can cause the problem your are having:
You create the articlePage and bind it's data to the "currentArticle" global variable
When you go back the articlePage is not deleted.
You open an other instance of this same articlePage. The last one still bind its data to the same currentArticle instance.
When you go back and click another item: the previous articlePage still exists in memory. It binds to "currentArticle". The problem is, it's not the data of "currentArticle" that has changed but the object referenced by "currentArticle". The Qml binder just fails then.

I had a similar behavior of my app, but I did not inspect your github code if the reason can be the same. I think you can verify that more quickly than me.
When removing and adding a list item with the same index, the code gets stucked. I removed an entry on user action and added a new one at that place, and it got stuck. This is a known issue to BB10, I found here: https://developer.blackberry.com/cascades/download/releasenotes/#known

Related

Remove nodes from the graph without reloading the web page in cytoscape.js

I have a graph of molecular interactions that takes nodes and edges from a query to my database. I also have two buttons as node labels: "Remove" and "Add" (where "remove" should remove the selected node, while "add" should expand to first neighbors).
I would like to add a function that removes the selected node (on click) without reloading the web page, but just reloading the graph (I want the selected node to disappear from the graph). So, the problem is not the function cy.remove but rather the graph reloading.
I am new to cytoscape.js (let's say to javascript), so I have no idea on how to reload a graph and where to put the remove and reload functions. To date I am only able to pass the ID of the node I want to remove and/or expand via GET method using php. This actually works, but it reloads the web page making a new query to my database, and it becomes tricky when one wants to add and remove a lot of nodes.
Could anyone provide me some simple example code that explains how to reload a graph after a button click, keeping all nodes except the removed one?
Sorry if it is a stupid question
Thanks
$('#button_deleteNode').click(function(){
cy.remove(nodeID);
});

Xpages Scoped variable lost opening next page

I'm transitioning a corporate web page into a new xpage platform. It consists of a number of department-specific databases each with their separate ACL's with the old forms and docs, and one new xpage db front end presenting data from across the other db's read only. The content is regulations and resources for the rest of the organization to relate to.
The design consists of just a few custom controls which collects data sources dynamically via properties on the various department specific xpages. So like 30 xpages collecting data from separate db's utilizing the same handful of cc's
My scoped variable issue is related to my cc_dataViewLocal . This dataView presents the documents from the corresponding views in the source db's. To let the user know their present location in the application I pull in the name of the current view and display the name above the Data View as a headline on the DataView xpage:
<xp:text escape="true" id="computedField1" styleClass="ksHeading2">
<xp:this.value><![CDATA[#{javascript:getComponent("dataView1").getData ().getView()
}]]></xp:this.value>
</xp:text>
All documents from all databases are presented using the same documentDisplay xpage with a dynamic document data source. Thus this xpage does not have any properties but is referenced trough the data view xpage:
<xe:dataView id="dataView1" collapsibleCategory="false"
rows="50" style="font-size:8pt" rowStyle="font-size:8pt"
collapsibleDetail="true" pageName="/**ks_documentDisplay.xsp**"
var="rowHandle">
--
When I open a document from the data view in documentDisplay.xsp I want the same headline/name of the original view displayed there as well. To make that happen I try to catch the view name in a scoped variable in an afterPageLoad event in the data view xpage, to redisplay it on the documentDisplay xpage.
<xp:this.afterPageLoad>
<xp:setValue binding="#{sessionScope.ksView}">
<xp:this.value><![CDATA[#{javascript:getComponent
("computedField1").value}]] ></xp:this.value>
</xp:setValue>
</xp:this.afterPageLoad>
After all the view name is not part of the document data source, and I have no other handle to the parent view at this point as I can see.
--
When I display the scoped variable on the dataView xpage in a computed field it works fine:
<xp:text escape="true" id="computedField2"
styleClass="ksHeading1" value="#{sessionScope.ksView}">
However, when I try to display the same session variable in the documentDispay xpage using the same computed field coding it turns up empty. Like the sessionVariable is lost to the next xpage?
I started out with a viewScope, and tried both request and session with same results. What am I missing??
Any input greatly appreciated! Including workarounds but would like to get a grip on the scoped variables...:-)
Regards to all who read this somewhat long post and thanks in advance!
Vidar Solevag
Thanks again for pointing me in the right direction. The problem clearly was I wiped the sessionScope in some way or other, exactly how I still don't know.
But as often is the case the solution was to do something else to get the same thing done...
What I found not to work:
-Moving the event to onClientLoad didn't work it threw an exception "cannot handle". In addition my original approach afterPageLoad did't really work either as it didn't update properly as other dataViews were chosen via Navigator on the page. Also setting the variable via the "Set" option on the simpleAction list turned out to be a problem. I got several "Not allowed to set the value of a read only computed expression"
What I did that worked:
-I set the value not by "Set"Simple action but by "Excecute script" and code
sessionScope.ksView=context.getSubmittedValue(). This in the onClick event in Navigator that selects which Dataview to display On the DataView xpage Then the SessionScope remains alive all the way into the documentDisplay xpage and until a different Dataview is selected back in the Nav back on the DataView xpage.
Now using the same sessionScope as the viewName property on the xpage I also set the sessionScope initially on afterPageLoad to have a default value when page is first opened...
So thanks again, a lot of headbanging into the wall here but that's what you learn from I guess :-))

list item tap issue - on single click two views gets added

When I single Tap on list item view gets added twice. Issue is I have to click back button twice to come back on the same page. Anybody knows what is exact issue.
If possible Provide some reference code.
Hi I was facing same issue use below code it will fix your issue.
if (this.getNavigationView().getActiveItem().xtype != "viewName") {
this.getNavigationView().push({ xtype: "viewName" });
}
Good Luck..

Clearing ISupportIncrementalLoading

I have created a search page in a Windows 8 Style App. I have implemented ISupportIncrementalLoading and when the user scrolls the paging works great.
The problem that I'm having is when a user does a second search. I apparently don't know how to get the LoadMoreItemsAsync to fire again. I've tried the following:
1) Clear the underlying collection that is Observable and supports ISupportIncrementalLoading. This clears all items from screen so I know it is bound properly.
2) Replace the underlying collection instance entirely that implements ISupportIncrementalLoading and raise INotifyPropertyChanged so the view knows the property was changed. This also, clears all the items from the screen.
However, the LoadMoreItemsAsync doesn't want to fire after clearing or replacing the underlying collection instance. My hunch is that the UI doesn't think it needs to Load any more, but since I've clear all the items it should want to load more.
I have verified that the HasMoreItems property is set to true.
If it would help, regrettably, you can see the error in production if you download FlixPicks from the Windows 8 store. The steps to reproduce are:
Search using windows search contract
Notice paging works From the Search page
Search again.
Notice all items are cleared. (At this point the LoadMoreItemsAsync is not firing)
Thanks for any advice you can provide!
This definitely looks like a bug. To solve this, add the following line after resetting your collection (in any of the cases):
gv.LoadMoreItemsAsync();
You can probably inherit from the control and create some overrides that will do this automatically:
I know this is an older issue, but I also encountered it and thought others may benefit from an MVVM approach to resolving it. My fix was, after resetting the collection, load a single item into the collection.
private async Task ResetCollectionAsync()
{
Clear();
await LoadMoreItemsAsync(1);
}
The collection is emptied and a single item is re-added. The GridView/ListView control detects the CollectionChanged event and re-queries HasMoreItems to determine whether to load additional data.
This behaviour is baked into IncrementalLoadingCollection (v1.0.1), which also supports filtering and sorting functionality out of the box.
I'm reviving an old question, but I found a solution when none of the previous answers worked for me.
myCollection = new MyIncrementalLoadingCollection();
myListView.ItemSource = myCollection; //This is what I was missing!
Since I wanted the list view to refresh every time the page was navigated to, this was my end result.
protected override async void OnNavigatedTo(NavigationEventArgs e) {
_logItems = new CommandLogIncrementalLoadingCollection();
logListBox.ItemsSource = _logItems;
}

Wiki Page Library issue in SharePoint 2010

I would really appreciate it if someone would help me out with this issue.
I'm using SharePoint 2010. I created a Wiki Page Library without changing any of the library settings, and created a new Wiki page, all that went fine but once I started adding text and then tried to save the changes on the page, this message appears:
"You must specify a value for this required field"
I don't know what to do, there is no required field and I can't really fix that... so please help me with that message!!
Fatima, I don't know if you ever got your question answered, but this is a known issue with Publishing features. There is a field that is marked as required, but is not displayed on the page. I beleive it's the column/field called "Name". If you look through the Site Content Types and find "wiki page", you'll see that status is marked as "Required". Changing that should fix the issue for you.
This was caused by a Place holder missing from the Main area of your master page.
Even if you’ve moved it to a asp:Panel and declared it as false at the bottom of your master page you’ll still get the error.
All you need is to move content place holder
<asp:ContentPlaceHolder id=“PlaceHolderPageTitleInTitleArea” runat=”server”></asp:ContentPlaceHolder>
within the s4-bodyContainer div , within the s4-ca div seems to work best. Save the master page and that’s it. that no more irritating message.
Reference: http://sharepointbrandingteam.wordpress.com/2012/05/25/sharepoint-2010-error-you-must-specify-a-value-for-this-required-field/
Alternatively, you can try the solution suggested here