332 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Jobs | Twitter | Bookmarks | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
Pass-thru HTML in XPages
Thu, Jun 6th 2013 198
InViewEdit to change field names
Thu, Mar 21st 2013 129
We would like to understand why you were Very Dissatisfied with the the ease of opening this service/support request.
Mon, Mar 18th 2013 132
Open DocLink in Frameset
Tue, Feb 26th 2013 125
NotesViewNavigator - turn off AutoUpdate
Fri, Jan 11th 2013 135
Clear out "ghost" attachments
Fri, Jan 11th 2013 130
XPage onBeforePageUnload
Fri, Nov 30th 2012 143
Top 10
Get all attachment names for xPages
Sat, Aug 20th 2011 280
Pass-thru HTML in XPages
Thu, Jun 6th 2013 198
All MIMEs little children
Wed, Nov 14th 2012 187
Many RESTful documents all at once
Mon, Jul 16th 2012 150
Validate a Combobox
Wed, Nov 3rd 2010 148
XPage onBeforePageUnload
Fri, Nov 30th 2012 143
iText in XPages
Sun, Aug 14th 2011 139
NotesViewNavigator - turn off AutoUpdate
Fri, Jan 11th 2013 135
PDFs from XPages via iText - presentation at MWLUG 2012
Sun, Aug 19th 2012 132
We would like to understand why you were Very Dissatisfied with the the ease of opening this service/support request.
Mon, Mar 18th 2013 132


Validate a Combobox
Brian M Moore    

div Ive been working on validation for a Combobox on xPages. If there is something simple out there, Ive missed it, and Id love a pointer. However, what I want to do is put a default value in and have the user change it. But have an error message if they leave the default value in. After some work, I found how and its below. I used the helpfule quot;Do it and move itquot; method. I didnt find this exactly for comboboxes, but the method works for inputTexts, so I got an inputText to validate the way I wanted, then moved the relevant nodes to my combobox.  Its a great way to discover how xPages work./divdiv /divdivWell, heres my code:br /blockquotefont color=#0000cdlt;xp:comboBox id=quot;comboBox1quot; value=quot;#{sessionScope.combo}quot;/fontbr /font color=#0000cd        style=quot;width:177.0pxquot; disableClientSideValidation=quot;truequot;/fontbr /font color=#0000cd        defaultValue=quot;Otherquot;gt;/fontbr /font color=#0000cd        lt;xp:this.validatorsgt;/fontbr /font color=#0000cd            lt;xp:validateRequired/fontbr /font color=#0000cd                message=quot;There has to be something herequot;gt;/fontbr /font color=#0000cd            lt;/xp:validateRequiredgt;            /fontbr /font color=#0000cd            lt;xp:validateConstraintgt;/fontbr /font color=#0000cd                lt;xp:this.messagegt;lt;![CDATA[You cannot enter quot;Otherquot;]]gt;lt;/xp:this.messagegt;/fontbr /font color=#0000cd                lt;xp:this.regexgt;lt;![CDATA[^(?:(?![oO][tT][hH][eE][rR]).)*$]]gt;lt;/xp:this.regexgt;/fontbr /font color=#0000cd            lt;/xp:validateConstraintgt;/fontbr /font color=#0000cd        lt;/xp:this.validatorsgt;/fontbr /font color=#0000cd        lt;xp:selectItem itemLabel=quot;Firstquot; itemValue=quot;Firstquot;gt;lt;/xp:selectItemgt;/fontbr /font color=#0000cd        lt;xp:selectItem itemLabel=quot;Secondquot; itemValue=quot;Secondquot;gt;lt;/xp:selectItemgt;/fontbr /font color=#0000cd        lt;xp:selectItem itemLabel=quot;Otherquot;gt;lt;/xp:selectItemgt;/fontbr /font color=#0000cdlt;/xp:comboBoxgt;/fontbr //blockquote/divdiv br //divdivI actually wanted to put quot;--Other--quot; in, and it works (hey, Im new at RegEx):br /blockquotefont color=#0000cdlt;xp:this.regexgt;lt;![CDATA[^(?:(?![-][-][oO][tT][hH][eE][rR][-][-]).)*$]]gt;lt;/xp:this.regexgt;/fontbr //blockquote/divdiv /divdivCheers,br /Brianbr / /div

---------------------
http://www.bleedyellow.com/blogs/DominoHerald/entry/validate_a_combobox2
Nov 03, 2010
149 hits



Recent Blog Posts
198


Pass-thru HTML in XPages
Thu, Jun 6th 2013 4:16p   Brian Moore
In classic Notes/Domino development for the web, we used Pass-Thru HTML. XPages doesn't use this, but there are times when we want to put HTML directly into an Xpage. This has been covered before, notably here. But I had some trouble find it, so I'm hoping this blog post can be of service to someone looking. I wanted to do something slightly different than what is in the example - I wanted to include a value from a field on a Notes document. This field would have html formatted text, t [read] Keywords: domino ldd lotus notes xpages bleedyellow bleedyellow.com development javascript
129


InViewEdit to change field names
Thu, Mar 21st 2013 3:15p   Brian Moore
Now I've not dug deep into this, but I made an error today in classic Notes development. I've just installed Notes9 (named in honour of the great podcast Notes in 9 [joke]). I'm working on an InViewEdit. I have two of them in this view, and they have the programmatic names of "useFT" and "useWE". They display values from the "generateFT" and "generateWE" fields. What I did was this: If Colprogname(0) = "UseFT" Then Call doc.Replace [read] Keywords: notes development podcast
132


We would like to understand why you were Very Dissatisfied with the the ease of opening this service/support request.
Mon, Mar 18th 2013 2:13p   Brian Moore
I mostly get great support from IBM when I call into Domino support. Except now the phone is answered by what appears to be some outsourced call center that has no clue what they are supporting. I know outsourcing is all the rage, but this does not work in this case. As a programming professional, when I call into support, I expect the person on the line to be familiar with the product. I am not a consumer calling in wondering why I can't get to my email or why the internet is broken, I' [read] Keywords: domino ibm xpages email
125


Open DocLink in Frameset
Tue, Feb 26th 2013 12:09p   Brian Moore
I love have brilliant co-workers. I have been working on a project in classic Notes that sent out a view DocLink. I had a request for it to open the database in the frameset used for navigation. By default, a view DocLink will open the database to the default view tree. Workable, but not as nice as the frameset. I mentioned this to my work partner David Jones and he tole me that if you name the target frame "NotesView" the view DocLink will open in the frameset. I tried it and it worked. Da [read] Keywords: lotus notes database
135


NotesViewNavigator - turn off AutoUpdate
Fri, Jan 11th 2013 4:14p   Brian Moore
I'm a big fan of the NotesViewNavigator. I use it a lot since I can put a view together and see how data is supposed to act, then call from it. I make checklists, tables, documents, all sorts of thing out of it. One of the reasons I like it is because you can work on just a single category and inside the NotesViewNavigator "jump" from category to category if you want. I was using this today and I was getting an error that it couldn't find the next sibling. I know there where 5, the d [read] Keywords: ibm ldd lotus lotusscript bleedyellow bleedyellow.com
130


Clear out "ghost" attachments
Fri, Jan 11th 2013 10:12a   Brian Moore
For a project, I had to provide a way for users to select certain images to delete out of an XPage. Displaying and giving a checkbox to delete was easy - but then I had to actually delete the images. There could be any number of attachments (all images, so I don't need to worry about type), and the user should be able to delete any of the images. Here is where my problem came up. I could delete the embedded objects from the NotesDocument no problem - but this left "ghosts" in the rich te [read] Keywords: agent notes rich text richtext
143


XPage onBeforePageUnload
Fri, Nov 30th 2012 3:10p   Brian Moore
This is one of those "I've trooped all over the internet and found the answer sitting at my front door" posts. I'm working on an app, and I have a requirement that if the user tries to navigate away from the page without saving they will get a warning. It's a good idea, and it's something Notes does natively - not so in XPages. I cast around a bit and found onBeforePageUnload, a browser event that can be used in just this situation. So I did some digging trying to integrate it [read] Keywords: notes xpages apple application bleedyellow bleedyellow.com properties




187


All MIMEs little children
Wed, Nov 14th 2012 9:12p   Brian Moore
I've used a NotesStream to put a file in a Rich Text Field or MIME quite a number of times over the last few years. Recently, I've needed to expand on this and put multiple attachments in a field. I didn't find much on this, so I thought I'd post. The important trick seems to be setting a ParentEntity. In your typical MIMEEntity, which is "body" in all the examples (including this one) set body as a parent entity. Then create child entities for each file, and stream it in. Here [read] Keywords: lotusscript rich text java
99


Using the Custom REST Control: Notes in 9
Wed, Nov 14th 2012 8:10p   Brian Moore
I've just done a new Notes in 9 - on using the Custom REST Control - head over and watch it. Here is the full XPage with the control. And here is the script library I used to handled the input. I also mentioned the Chrome Advanced REST Client and the Firefox RESTClient. I would also suggest looking at JSONLint for checking the JSON format. A couple of big things to remember when using the REST control - be sure to add the pathInfo to your control, and to reference it in your URL. Set th [read] Keywords: notes script library xpages bleedyellow bleedyellow.com firefox google xml
98


Get the UNID for Custom REST service toGet method
Tue, Oct 30th 2012 7:15p   Brian Moore
I bypassed the out-of-the-box REST services to go directly into making custom REST services with the Extension Library. At the moment, I'm working on a couple, but for one I want to respond to a GET request. I've been doing POST, but this was new. The problem I found was how to determine what document I was acting on. The XPage didn't automatically (as far as I can tell) make a connection to the DominoDocument as a data source - even though I had the XPage set to this and to edit or [read] Keywords: notes xpages




Created and Maintained by Yancy Lent - About - Blog Submission - Suggestions - Change Log - Blog Widget - Advertising - Mobile Edition