xpages dojo text area binding to a dialog list field - xpages

I have a Dojo Text Area control binding to a field from a form, the field is a Dialog list which uses a simple #DBColumn formula:
_view := "vwAuthor";
#Unique ( #DbColumn( "" : "NoCache" ; #DbName ; _view ; 1 ) )
I have saved one doc. with the Dojo text area control = Name1, but when I create another new doc. is there any chance to have that "auto-refresh" from Clasic Lotus Notes so that When I just type N the Name1 should be displayed?
Thanks for your time!

Create instead of the value picker for your Dojo Text Area a dialog box with an input text field with type ahead.
Feed the type ahead with the first column of your view "vwAuthor":
<xp:inputText
...>
<xp:typeAhead
mode="full"
minChars="1">
<xp:this.valueList><![CDATA[#{javascript:
#Unique(#DbColumn("", "vwAuthor", 1))
}]]></xp:this.valueList>
</xp:typeAhead>
</xp:inputText>

A text area by default does not offer any data entry assistance. Switch to a regular input box and use the type-ahead support build into XPages. Check the basic workshop, especially Exercise 7.

Related

Getting the q-item-label text

I have this code using Quasar/VueJS. What I want to do is update the dropdown text label (keyDropDownLabel) based on the selected <q-item-label>.
So in this example below, I want the newLabelGoesHere part to be Key 1/2/3, depending on which was clicked.
<q-btn-dropdown stretch flat :label="keyDropDownLabel">
<q-list>
<q-item v-for="n in 3" :key="`x.${n}`" clickable v-close-popup tabindex="0">
<q-item-section #click="keyDropDownLabel = 'newLabelGoesHere'">
<q-item-label>Key {{ n }}</q-item-label>
<q-item-label caption>1234567890</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
Anyone help please??
Just modify the q-item-section click method like below:
<q-item-section #click="keyDropDownLabel('Key'+n)">

Adding a badge to an xpages applayout title bar node item

Is it possible to add a simple badge to a title bar node item? Each tab in my layout represents a separate application. My users would like to see a number next to the name on the tab to indicate whether there are documents in that application needing their attention. If no documents, then no badge, just the application name by itself. If there are documents, then display the application name and a badge for the number. I'm not finding a way to include the span tag in a PageLinkNode or BasicLinkNode.
PageLinkNode (xe:pageTreeNode) label can only be plain text.
You can use the image property though:
<xe:this.titleBarTabs>
<xe:pageTreeNode
page="..."
label="Application A"
image="#{javascript: var nr = 5;
nr > 0 ? ('badge' + Math.min(nr, 10) + '.gif') : ''}">
</xe:pageTreeNode>
Add to Resources/Images ten pictures badge1.gif, badge2.gif, ... badge10.gif with the numbers as pictures. badge10.gif would be a 9+ picture.
As an alternative, you could provide the number of documents as part of the label (e.g. "Your Application Name [23]") and convert it on client side onClientLoad event to HTML label + badge-span.

SharePoint Hiding fields in newform, dispform, editform

I have a task here when I need some assistance. what I am trying to accomplish is the follow..
Hide some fields on the newform, editform and dispform with in SharePoint (2013)
The field I am trying to hide is ONLY the input/textbox field not the whole column/heading associated with it. Basically I have a form with a heading and an associated textbox(single line of text) next to it, what I would like to do is hide the textbox only.
I have used the F12 IE tools to select the text box to which displays the following souce code:
<input title="Travel" class="ms-long ms-spellcheck-true" id="Travel_f6801fb9-c4ff-4109-acb9-f7dd63c1d98a_$TextField" type="text" maxlength="255" value="">
(the textbox is associated with my "Travel" column)
Now when I use the F12 tools while selecting this, I added some css(from that I can tell) under the "inline Style" top heading which was "display=none" and bingo it works!.
Now what I cant do here is add this to the forms permanently. I have tried to google this by adding a Content web part to the form and try some CSS/Java script but I simply do not have the skills in this area.. does this make sense?
examples:
any help would be great
Cheers!
In SharePoint 2013 was introduced Client Side Rendering (aka CSR) which is used for rendering list views, list forms and search results. For a more details follow SharePoint 2013 Client Side Rendering: List Forms article.
The following JavaScript template demonstrates how to hide field controls in List Form pages:
SP.SOD.executeFunc("clienttemplates.js", "SPClientTemplates", function() {
SPClientTemplates.TemplateManager.RegisterTemplateOverrides({
OnPostRender: hideFieldControls
});
});
function getFieldControlId(field){
return field.Name + '_' + field.Id + '_$' + field.Type + 'Field';
}
function hideFieldControl(field){
var fieldControlId = getFieldControlId(field);
var fieldControl = document.getElementById(fieldControlId);
fieldControl.style.display = "none";
}
function hideFieldControls(ctx){
var fieldNamesToHide = ['JobTitle','WorkPhone']; //<- set field names to hide here
if(fieldNamesToHide.indexOf(ctx.ListSchema.Field[0].Name) > -1) {
hideFieldControl(ctx.ListSchema.Field[0]);
}
}
How to apply changes
Open List Form page in edit mode
Add Script Editor web part on the page
Insert the specified JavaScript template by enclosing it using
script tag Note: specify field names to hide via fieldNamesToHide variable
Save page
Results
Pic 1. Original New Form page
Pic. 2 Customized New Form (field controls for Job Title and Business Phone are hidden)

XPages ftsearch results for combobox fields

I created on my previous applications a simple FTsearch module, displaying the results inside a viewPanel1.
But, now in other app it gives me a headache. The search code from the view:
var tmpArray = new Array("");
var cTerms = 0;
if (sessionScope.searchFurnizor) {
tmpArray[cTerms++] = "(Field txt_particontractcv_1 = \"*" + sessionScope.searchFurnizor + "*\")";
}
if (sessionScope.searchStare) {
tmpArray[cTerms++] = "(Field txt_stadiucontrcv = \"*" + sessionScope.searchStare + "*\")";
}
qstring = tmpArray.join(" AND ").trim();
sessionScope.queryString = qstring;
return qstring
The txt_particontractcv_1 is a simple inputText and txt_stadiucontrcv is a checkbox:
<xp:checkBoxGroup id="checkBoxGroup1" value="#{Contr.txt_stadiucontrcv}" defaultValue="In derulare">
<xp:selectItem itemLabel="In derulare" itemValue="In derulare"
id="selectItem1">
</xp:selectItem>
<xp:selectItem itemLabel="Finalizat" itemValue="Finalizat"
id="selectItem2">
</xp:selectItem>
</xp:checkBoxGroup>
The button which submits the search is doing a partial refresh to viewPanel1. Still, it returns 0 results even there are documents respecting the filter criteria inside the search.
LATER EDIT: After deleting one by one fields from the FTsearch module, I think I found the issue: the problem is at the fields which are comboboxes ( my case ) in the document content but also inside the FTsearch modulo. The code for the combobox from the FTsearch:
<xp:checkBoxGroup id="checkBoxGroup1" value="#{sessionScope.searchStare}">
<xp:selectItem itemLabel="In derulare" itemValue="In derulare" id="selectItem1">
</xp:selectItem>
<xp:selectItem itemLabel="Finalizat" itemValue="Finalizat" id="selectItem2">
</xp:selectItem>
</xp:checkBoxGroup>
Also, I noticed that the inputField(s) must be inputText, I try with some comoboboxes as input fields, but not working.
Are you refreshing the view in the partialrefresh or a panel outside of the view?
because if you are refreshing the view you probably never update the search query. If so add an xp:panel or xp:div out side of the view and do the partial refresh on that.
Whenever a full text search is not working how you expect it to, my recommendation is always to print out the search string. Then try performing the search in a view in the Notes Client.
If it doesn't work in the view in the client, trying to resolve it in your XPage will not get it working. The Notes Client will tell you why, usually "Query is not understandable" and you can troubleshoot why using the buttons in the search bar in Notes, which tells you which fields are available and what data type the UNK table thinks they are.
If it does work, there's a problem somewhere in your XPage.
As ever, break it down to try to identify where the problem is - in this case the full text search functionality or the implementation of it in XPages.

ExtJs layout + Window

While adding component dynamically, 'this.container is null' is displayed in firebug.
I have a window with some combo boxes say combo1, combo2, combo3 and a label. Based on the selection value of combo3 the 'label' field is removed and replaced with combobox or text field. i do this my using
form.items.removeAt(4);
form.items.insert(4, newItem); #here newItem can be combox/textfield
form.doLayout();
The form resides inside a panel.
When above lines are execueted. 'this.container is null' is displayed and component fails to insert/add in appropiate position.
Any suggestions?
You should not be modifying the underlying items collection. Use the remove/insert methods on the container.
Try to comment those lines line-by-line to see which one produces error like
form.items.removeAt(4);
//form.items.insert(4, newItem); #here newItem can be combox/textfield
//form.doLayout();
form.items.removeAt(4);
form.items.insert(4, newItem); #here newItem can be combox/textfield
//form.doLayout();
form.items.removeAt(4);
form.items.insert(4, newItem); #here newItem can be combox/textfield
form.doLayout();
Your problem could take place because of inserted/replaced object is no yet prepared when you try to insert it. Give us your newItem initilization code.
Upd
Or you can wrap your changing components (label, combobox, textfields) in a panel with card layout. And on change of combo3 simply select exact card in that panel.

Resources