358 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
Running an XPages/Angular.js application on a Bluemix site
Wed, Sep 17th 2014 433
MWLUG 2014 Slide Deck – Write once, run anywhere: Angular.js in XPages.
Tue, Sep 2nd 2014 143
Going to MWLUG 2014? You need to buy these guys a beer as well….
Sun, Aug 24th 2014 206
Going to MWLUG 2014? Buy Dave Leedy a beer
Sun, Aug 24th 2014 367
Chart Directives and Dynamic Binding – MWLUG 2014 preview
Wed, Aug 20th 2014 224
Accessing the original element when using Select2-focus
Sun, Aug 17th 2014 167
Angular in XPages #8 – Directives (did someone say plugins?)
Sun, Aug 10th 2014 200
Top 10
Arguably the most dangerous thing you could ever do in XPages – let other people use your eval() in their SSJS
Tue, Jun 18th 2013 905
Running an XPages/Angular.js application on a Bluemix site
Wed, Sep 17th 2014 433
Going to MWLUG 2014? Buy Dave Leedy a beer
Sun, Aug 24th 2014 367
Angular.js in XPages #7 – Writing better code using Services
Sun, Aug 3rd 2014 355
Taking back productivity in Domino Designer (a NotesIn9 production)
Tue, Jul 29th 2014 324
Speaking at MWLUG 2014: Write once, run anywhere – Angular.js in XPages
Tue, Jul 8th 2014 323
Hi Chicago – what changed?
Wed, Jul 2nd 2014 315
EXTJS in XPages #13: Totaling your columns with a groupingSummary
Sun, Jun 30th 2013 279
The consummate Champion
Thu, Jul 24th 2014 279
Web Components – Entering the ShadowDOM….
Wed, Jul 9th 2014 267


x$ update for dojo
MarkyRoden    

Problem
dojo selector –  ”dojo.query” doesn’t work for elements generated by xpages

Background

This is a follow on to the jQuery selector function for xPages – x$(“#{id:inputText1}”) article I wrote previously.

Solution

Turns out that dojo.query suffers from the same problem:  dojo.query cannot understand elements with colons (:) in it. We have to convert the idTag of the element to escape the colons with a backslash.

  • dojo.query(“view:_id1:inputText1″).style(“border”, “1px solid red”) – will not work
  • dojo.query(“view:_id1:inputText1″).style(“border”, “1px solid red”) – will work and is converted using the function

So I have updated my x$ function to cover dojo and jQuery


function x$(idTag, param, jd){ //Updated 28 Feb 2012
      idTag=idTag.replace(/:/gi, "\:")+(param ? param : "");
      return( jd=="d" ? "#"+idTag : $("#"+idTag));
}

the param and jd parameters are optional (in fact jd is only necessary if you are using dojo)

Interesting Note

For the uninitiated you will note that jQuery returns a $() rather than a string – this is because it is actually returning a jQuery Object. That is a fundamental difference in the way that dojo and jQuery function as code libraries.

Examples

here is an example code of how it would be used in dojo or jQuery


//dojo
dojo.query(x$("#{id:inputText1}", "", "d")).style("border", "1px solid red")

//jQuery equivalent

x$("#{id:inputText1}").css("background-image", "1px solid red")

An example is shown below

<?xml version="1.0" encoding="UTF-8"?>

<xp:view xmlns:xp="http://www.ibm.com/xsp/core">

<xp:br></xp:br>
 <xp:scriptBlock id="scriptBlock1">
 <xp:this.value><![CDATA[
 function x$(idTag, param, jd){ //Updated 28 Feb 2012
 idTag=idTag.replace(/:/gi, "\:")+(param ? param : "");
 return( jd=="d" ? "#"+idTag : $("#"+idTag));
 }
 ]]>
 </xp:this.value>
 </xp:scriptBlock>
 <xp:inputText id="inputText1"></xp:inputText>
 <xp:br></xp:br>
 <xp:br></xp:br>
 <xp:button value="Change Border (Fail)" id="button2">
 <xp:eventHandler event="onclick" submit="false">
 <xp:this.script><![CDATA[dojo.query("#{id:inputText1}").style("border", "1px solid red")]]></xp:this.script>
 </xp:eventHandler>
 </xp:button>
 <xp:br></xp:br>
 <xp:br></xp:br>
 <xp:button value="Change Border X$" id="button1">
 <xp:eventHandler event="onclick" submit="false">
 <xp:this.script><![CDATA[dojo.query(x$("#{id:inputText1}", "", "d")).style("border", "1px solid red")]]></xp:this.script>
 </xp:eventHandler>
 </xp:button>
</xp:view>




---------------------
http://xomino.com/2012/02/28/x-update-for-dojo/
Feb 28, 2012
22 hits



Recent Blog Posts
433


Running an XPages/Angular.js application on a Bluemix site
Wed, Sep 17th 2014 7:48p   Mark Roden
In this article I will show you how to run an XPages application based on Angular data within a Bluemix based website. Introduction For background reading on this article please review my series on Angular.js in XPages starting here. I will be using the application described within that article as the starting point for this article. A little background on Bluemix Bluemix is IBM’s new Platform as a Service (PaaS) system which provides the end to end cloud based hosting of application [read] Keywords: domino ibm xpages application applications bug community database interface server skype
143


MWLUG 2014 Slide Deck – Write once, run anywhere: Angular.js in XPages.
Tue, Sep 2nd 2014 1:05p   Mark Roden
Here is the slide deck for those interested – thank you to everyone who attended the presentation and I look forward to talking more on the subject in the future. http://www.slideshare.net/MarkRoden/angularjs-in-xpages [read] Keywords: xpages
206


Going to MWLUG 2014? You need to buy these guys a beer as well….
Sun, Aug 24th 2014 8:07p   Mark Roden
—->>>> Richard Moy [read] Keywords:
367


Going to MWLUG 2014? Buy Dave Leedy a beer
Sun, Aug 24th 2014 5:37p   Mark Roden
Yeah I know I have rattled on about this before but it holds as true today as it does any other day before. Here is a list of reasons you should buy Dave Leedy a beer in case you were wondering… 1) really? You need a list?? Shame on you…. 2) NotesIn9 has helped you – One of those videos by Dave, John, John, Brian, Chris, Graham, Jeremy, Mark, Mark, Paul, Peter, Steve, Tim, Chris, Paul, Josh, Dan, Niklas, Michael, Russ, Serdar, Sean, Mark, Brad, Frederick, Steve, Richard, Kathy, [read] Keywords: ibm community
224


Chart Directives and Dynamic Binding – MWLUG 2014 preview
Wed, Aug 20th 2014 7:13p   Mark Roden
Although not directly related to the purpose of the presentation I am going to demonstrate how to use an Angular.js chart directive to bind to the application service data and create dynamic charting within the application. Changing the Zip for 1 Marky not only updates the data displayed – but also because of the data bind – auto-magically updates the chart While this in itself does not directly relate to the write once and run anywhere nature of the presentation – it d [read] Keywords: application
167


Accessing the original element when using Select2-focus
Sun, Aug 17th 2014 7:36p   Mark Roden
In the application we are currently working on I wanted to add an ajax call to a JSON service, but only for certain fields. Rather than go through the application and add the code to every element I used a delegated focus event for the field with an attribute of  “help_fieldName”. The following HTML represents the code on the form: UK US Global First Name Last Name The following jQuery code makes it work. The getHelp function shows/hides [read] Keywords: ajax application xml
200


Angular in XPages #8 – Directives (did someone say plugins?)
Sun, Aug 10th 2014 8:08p   Mark Roden
In this article I will discuss Angular Directives and why they are near and dear to my heart Directives Directives in Angular are modular pieces of functionality which in some cases are very analogous to plugins in jQuery. According to the Angular documentation… “At a high level, directives are markers on a DOM element (such as an attribute, element name, comment or CSS class) that tell AngularJS’s HTML compiler ($compile) to attach a specified behavior to that DOM element or [read] Keywords: xpages application css




227


Working on my MWLUG2014 presentation
Wed, Aug 6th 2014 8:04p   Mark Roden
Just wanted to show a work in progress – screenshots of what I am working on for MWLUG2014. Part of the presentation is showing how to make your Angular applications portable. My sample app will be the one I created as part of the Angular in XPages series. I will walk through the code and demonstrate how I can take this stand alone application and insert it into this bootstrap demo dashboard application creating this fully functional component capability within the dashboard With [read] Keywords: xpages application applications
355


Angular.js in XPages #7 – Writing better code using Services
Sun, Aug 3rd 2014 6:01p   Mark Roden
In this article I will discuss a better programming practice for Angular.js than was demonstrated in the previous articles within this series. I have mentioned before, part of the purpose this blog is very much a “learning in progress” for me. Without going through the previous articles I would not have been able to get to this point and write “better code”. Hopefully with that understanding, those of you who have been along for the ride will appreciate this and grow w [read] Keywords: agent lotusscript xpages application twitter
324


Taking back productivity in Domino Designer (a NotesIn9 production)
Tue, Jul 29th 2014 3:27p   Mark Roden
Yeah it has been a while (over 18 months) since the last time I did a NotesIn9 video but it finally happened again. NotesIn9 149:  Database Resources and Design Definition Doesn’t sound very exciting does it? Dave needs to work on his attention grabbing heading show names. I would have called it something more like this – but then who am I to complain – it is not my show after all ;) NotesIn9 149:  Taking back productivity in Domino Designer  This video revolves around som [read] Keywords: domino notes xpages database eclipse




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