× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi again Lupe,

I took a bit of time to change the current project that I was working with
to demo the solution. It looks like a simple typo, isn't that always the
case ? Basically "classname" should be "className". Here is an updated
JavaScript function. I also changed it to maintain the current class
settings so the font and stuff does not change.

function myFunction(myObj, myStyle)
{
myObj.className = myObj.className + " " + myStyle;
}

Let us know how it works out for you

Mike


Mike Hockings, P.Eng.
System i Application Development Tools - CODE/Designer & WebFacing !
IBM Canada Ltd. Laboratory
hockings@xxxxxxxxxx
voice 1-905-413-3199 T/L 313-3199 ITN 23133199



Mike Hockings/Toronto/IBM@IBMCA
Sent by: wdsci-l-bounces@xxxxxxxxxxxx
07/04/2008 09:27 AM
Please respond to
Websphere Development Studio Client for iSeries <wdsci-l@xxxxxxxxxxxx>


To
Websphere Development Studio Client for iSeries <wdsci-l@xxxxxxxxxxxx>
cc

Subject
Re: [WDSCI-L] WebFacing subfile selected record/field color chg






Hi Lupe,

I'm not sure off-hand why it would not work. You won't need the
appearance setting since you want the change to be dynamic rather than
static so I'd make sure that Web Setting is not checked. Or at least you
don't need it set for what you want to do.

Just in case it is the style class or JavaScript function definition that
isn't quite right (case sensitive) you could try setting the background
colour directly with something like this:

this.style.backgroundColor='red';

And you can check and make sure that I was steering you in the right
direction. I found this article in MS's knowledge base, what I was trying

to do is similar to their second example
http://support.microsoft.com/kb/278386

When I get some free time I will have a go at trying to reproduce this and

see why it does not work for you but with my current workload that
probably won't be until next week some time. However don't hesitate to
put an update here if you figure something out !

Mike


Mike Hockings, P.Eng.
System i Application Development Tools - CODE/Designer & WebFacing !
IBM Canada Ltd. Laboratory
hockings@xxxxxxxxxx
voice 1-905-413-3199 T/L 313-3199 ITN 23133199

wdsci-l-bounces@xxxxxxxxxxxx wrote on 07/03/2008 05:44:16 PM:

Mike,

I followed the instructions and did not get a color chg.



1. for the WF 'Appearance and Text' I have these values;
wf_default wf_field


2. added file myFunctions.js into the
WebContent/webfacing/ClientScript/usr
folder and it includes only these lines of code;
function myFunction(myobj,mystyle)
{
myobj.classname = mystyle;
}
I noticed that file webface7002.ja is in folder
WebContent/webfacing/ClientScript/



3. value for the HTML Inside Web Setting is;
<onFocus="myFunction(this,'myRed');">

also tried this code
onFocus="myFunction(this,'myRed');"



4. I added these two lines of code to the end of
WebContent/webfacing/styles/apparea/apparea.css file;
.myRed{background-color:red;}
.myNormal{background-color:white;}





Is any of this incorrect?




Lupe Galvan

////////////////////////////////////////////////////////////////////////
///////////////////




-----Original Message-----
From: wdsci-l-bounces@xxxxxxxxxxxx [mailto:wdsci-l-bounces@xxxxxxxxxxxx]
On Behalf Of Mike Hockings
Sent: Thursday, July 03, 2008 4:55 AM
To: Websphere Development Studio Client for iSeries
Subject: Re: [WDSCI-L] WebFacing subfile selected record/field color chg

Hi Lupe,

So what you are telling me is that it is working exactly as I had
intended
;-) I misunderstood what you meant by "selected", you are talking
about
the end user clicking on the field at runtime whilst I had been thinking

that you meant the field that you selected in Code/Designer.

If that is the case you could simply use the HTML overrides and set a
value for the HTML Inside Web Setting. Something like the following.
This adds JavaScript function calls when the field gets focus and looses

focus. If you want it to be one-way (i.e., gets set when the field gets

focus then remove the onBlur() call.

onFocus="myFunction(this,'myRed');"
onBlur="myFunction(this,'myNormal');"

Then define the myFunction() function in a file. For simplicity you
can
create myFunctions.js in the WebContent/webfacing/ClientScript/usr
directory of your project and in that file put something simple like
this.
Your WF app will need to be stopped then restarted in WAS to pick up
this
change. If you want to get real fancy you can use a myFunctions.jsp and

dynamically generate content in it.

function myFunction(myobj,mystyle)
{
myobj.classname = mystyle;
}

Then finally add a couple of style classes to the
WebContent/webfacing/styles/apparea/apparea.css file. These will need
to
match the style names that you use in the HTML Inside

.myRed{background-color:red;}

.myNormal{background-color:white;} // or whatever you want

Keep in mind that I have not tested all this so it may have undetected
typo's but I think it should all work.

Let us know how it goes

Mike


Mike Hockings, P.Eng.
System i Application Development Tools - CODE/Designer & WebFacing !
IBM Canada Ltd. Laboratory
hockings@xxxxxxxxxx
voice 1-905-413-3199 T/L 313-3199 ITN 23133199



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.