I have this code in several repeat controls and computed values
#Unique(#DbLookup(database,view,key,columnnumber))
I can see that if "columnnumber" is a categorized column then DbLookup only return first Category.
Today my solution is create another view with this column Uncategorized, but this is bad solution for my customer, and more work for me.
Somebody knows if this is a bug? or is there another solution?
I have Lotus Domino 8.5.3 UP1 and same designer
Thanks a lot,
You can get the view entries this way:
var vc:NotesViewEntryCollection = database.getView("view").getAllEntriesByKey(key, true);
Then you can loop the collection with:
var ve:NotesViewEntry = vc.getFirstEntry();
ve = vc.getNextEntry();
In the loop, get the column value with:
ve.getColumnValues();
My understanding is that this will perform better than #DbLookup which - I believe - has similar code underlying it. Fastest way to loop a view is to use a ViewNavigator as Fredrik suggested:
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Fast_Retrieval_of_View_Data_Using_the_ViewNavigator_Cache
Try using #DbColumn instead or a viewnavigator.
Related
I am searching on an Xpage and the first column have these 4 values:
NAP
NAP/IFI
NVO
NVO Domestic
You probably see the problem. If a user searches for "NAP" they get both "NAP" and "NAP/IFI" as the = operator is really a CONTAINS! I didn't know that. In most universes = means exact match, not contains, but it is what it is.
The question is there any workaround for this?
You can set the Property searchExactMatch to the ViewPanel for ftsearches.
I feel like I'm just not understanding something about the XPages lifecycle here. I have an xp:text control, with a value of viewScope.count. Initially, that's null. After the xp:text, I have a repeat that's performing a calculation and returning an array of objects for its value. At the end of the repeat's value section, I'm trying to update the xp:text with a count of the things in the array:
viewScope.count = myArray.length;
The xp:text isn't being updated with that value, though. Should this work? Do I need to do a manual refresh of the xp:text when I modify viewScope.count? TIA!
You should be able to use the index of the repeat to give you a count.
Take a step back and rethink the approach. Inside the code you use for your repeat you update something outside.
Not looking at 'does it work' I would claim 'bad idea'. Such side effects make maintenance a nightmare (and are not very MVC).
The better approach (IMHO):
Create an object data source. AFAIK that can be a JSON object if you are not comfortable with Java. That object would have all the needed properties for your repeat and your counter display. It serves as your model.
Then bind the repeat and the text field to the model and you are good.
Makes sense?
Before describing the problem, I would like to add that I have looked for this problem on google and have found many solutions but none related to XPAGES. Since, Xpage have a unique method to generate the field id I am facing this problem. I have also posted the same question here on IBM forum and awaiting the reply there(http://www-10.lotus.com/ldd/ndseforum.nsf/xpTopicThread.xsp?documentId=EDEBB14BDF2E804F85257BE8001E4F76):
Problem:
I am trying to pass dynamic id to the default function getElementById with no success. To explain it clearly, I have a front end validation for specific fields. This fields are stored n database. So, I have a for loop running for all the fields. The problem here is that XPages generates the Id dynamically and hence for the same form if there is a hierarchical tabbed panel then the Id also included the tabbed panel Id in it.
Here is the code view of the problem:
The standard method to retrieve the value(CSJS) is:
document.getElementById("#{id:inputText1}").value;
However, if I try to pass in a dynamic id. It doesn't work. I have tried "n" number of approaches I found on Google but none regarding this problem. One solution I tried here was:
var x = "inputText1";
document.getElementById("#{id:"+x+"}").value;
Any help would really be appreciated. Really eager to hear some good suggestion.
The "#{id:inputText1}" part is computed at the server before the page is served so it's too late to set the ID in client side JS.
To set the ID in SSJS you can do this:
document.getElementById("#{javascript:var x='inputText1'; getClientId(x)}").value;
With getClientId you can also build a CSJS array of IDs in in SSJS. Then you can loop that array in CSJS. You would build the array this way:
var strIDs = ${javascript:'["a","b","c"]'};
I have a custom entity in CRM 2011 with a Closure Code(drop down list) and Solution(multiple lines text) fields.
Is weird what is happening, and this is that the next sentence, is not getting the actual field value:
var detailsSet = Xrm.Page.getAttribute("aux_solution").getValue();
Why this could happen?
As explained in the comments, my problem was that the field wasn't taking the actual value because the focus was on it. Moving to another field before checking the values is how I solve this. I hope could help someone.
That is because the object model does not get refreshed data while you have focus on the field. If you want to get the value without having to click outside you need to use the good old document.getElementById .
If it is an option set, you should use eiter getSelectedOption() or getText()
so try
var detailsSet = Xrm.Page.getAttribute("aux_solution").getText();
For more details refer this
Ok, between following documentation, posts and videos that use syntax and tools that are no longer used or available, I'm really lost as to how to go about even using Telerik's OpenAccess. So I thought I'd ask for some help and hopefully someone out there has done this before.
I want to simply bind my OpenAccess entities to a RadGrid, but I want to use TemplateColumn in my RadGrid (in editmode, I want to use other controls like datepickers, dropdowns, etc.) Therefore, like the old way of doing things, I want to fire off the RadGrid's ItemDataBound event, for example, find the controls and set the controls to the appropriate values.
Old way that we were used to (You know, like the old fashioned way of something like setting a RadTextBox to a value from the RadGrid's DataSource, which was a DataReader:):
string strID = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["campaignID"].ToString();
RadTextBox rtxtTitle = (RadTextBox)e.Item.FindControl("rtxtTitle");
rtxtTitle.Text = DataBinder.Eval(e.Item.DataItem, "title").ToString();
Does anyone have sample out there of how to do this? I would assume that I would also need to know how to bind the RadGrid in the first place, so an example of that would also be helpful (NOT using the actual OpenAccessDataSource control - I want to bind it in the NeedDataSource event of the RadGrid).
Thanks in advance...
The sample I found on the Telerik web site for DataBinding an OpenAccess result to a DataGrid looks like this:
IObjectScope scope = ScopeFactory.GetScope(HttpContext.Current);
string query = String.Format("SELECT * FROM {0}Extent", viewName);
IQueryResult result = scope.GetOqlQuery(query).Execute();
RadGrid1.DataSource = result.ToList();
This looks to be using OQL, but you could also use LINQ. I would toss this question to the OpenAccess team on the forums. They can probably point you to better resources.