Adding javascript code into user actions assign task operation
Hi all,
I've a severe issue , i searched for a solution and nothing returned till my mind blown , i made a process and put a lot of assign task operations with user actions {"Approve","Reject"} what i want to do is when the user hits Reject action a pop-up window is opening to him to put his rejection reasons / justifications, till now i couldn't find a solution or an article writing about a solution for it, so your help is urgently required.
Thanks in advance & have a nice day.
Hi,
It will not easy to add actions to an OOTB ribbon button, there is a workaround that we can replace it with a custom button.
Here is a documentation about Replacing a Button on the Server Ribbon:
http://msdn.microsoft.com/en-us/library/ff407619.aspx
Another two links about create a custom ribbon button for your reference:
http://msdn.microsoft.com/en-us/library/office/ff407458(v=office.14).aspx
http://sharepoint.stackexchange.com/questions/20646/attach-a-javascript-function-to-an-ootb-ribbon-button
Best regards
Patrick Liang
TechNet Community Support
Similar Messages
-
Problems with Assign Task operation
I'm having a problem with the Assign Task operation. When I export an application of the LiveCycle ES2 environment and import into another environment LiveCycle ES2, my process get stalled in the all Assign Task operations, and the only way to solve the problem I found is to redo all the Assign Task operations. But in an application with many Assign Task operations, this solution becomes very complicated.
Anyone who has encountered this problem could help me better to fix it?
Thanks for any help!
Following is the error message:
StackTrace:
java.lang.NullPointerException
at com.adobe.idp.taskmanager.dsc.util.UserManagerUtils.getUserOID(UserManagerUtils.java:959)
at com.adobe.idp.taskmanager.dsc.userservicev2.UserServiceImpl.createTaskFromDialogPropertie s(UserServiceImpl.java:941)
at com.adobe.idp.taskmanager.dsc.userservicev2.UserServiceImpl.createLongLivedTask(UserServi ceImpl.java:1631)
at com.adobe.idp.taskmanager.dsc.userservicev2.UserServiceImpl.createLongLivedTask(UserServi ceImpl.java:1506)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.jav a:118)
at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor. java:140)
at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
at com.adobe.idp.dsc.interceptor.impl.DocumentPassivationInterceptor.intercept(DocumentPassi vationInterceptor.java:53)
at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(Transa ctionInterceptor.java:74)
at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTr ansactionCMTAdapterBean.java:357)
at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(Ej bTransactionCMTAdapterBean.java:227)
at sun.reflect.GeneratedMethodAccessor643.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta iner.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.java:169)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:378)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor. java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
at $Proxy378.doSupports(Unknown Source)
at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvi der.java:104)
at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(TransactionInt erceptor.java:72)
at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
at com.adobe.idp.dsc.interceptor.impl.InvocationStrategyInterceptor.intercept(InvocationStra tegyInterceptor.java:55)
at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(InvalidStateIntercep tor.java:37)
at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterc eptor.java:165)
at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
at com.adobe.idp.dsc.interceptor.impl.JMXInterceptor.intercept(JMXInterceptor.java:48)
at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(ServiceEngineImpl.java:121)
at com.adobe.idp.dsc.routing.Router.routeRequest(Router.java:129)
at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.routeMessage(AbstractMessage Receiver.java:93)
at com.adobe.idp.dsc.provider.impl.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:22 5)
at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat cher.java:66)
at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
at com.adobe.idp.jobmanager.execution.workadapter.AbstractExecutableJob.invokeRequest(Abstra ctExecutableJob.java:127)
at com.adobe.idp.jobmanager.execution.workadapter.PersistentExecutableJob.execute(Persistent ExecutableJob.java:60)
at com.adobe.idp.dsc.workmanager.adapter.UnManagedAsynchronousWorkAdapter.run(UnManagedAsync hronousWorkAdapter.java:39)
at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
at java.lang.Thread.run(Thread.java:619)Hi javier,
1. record = <DATOS>
If possible, try to use
a pre-defined strucure of type P9069
for putting data into this infotype.
2. Avoid using field symbols.
3. Try with P9069
regards,
amit m. -
Dynamic asset selection for assign tasks operations
Hi,
I have a default workflow which could be used by a lot of different specific workflows (every specific worklow has a part where the manager and the workers council has to approve). I would like to build this workflow part as a subprocess that could be used by all the other workflows.
My problem is that every specific workflow uses an own flex UI or PDF form to represent the process data. In the assign task operation I need to choose a specific asset. To be able to use the subprocess for all workflows I would need to choose the asset dynamically through a variable or xPath etc.
Is there an option or workaround to specify the asset by its name or a variable?
Thanks and regards,
LarsAnother way (might be simpler than other solutions):
You can update the TaskContext variable in Render Process.
I mean, you have to dynamically set the ResourceURL of the TaskContext variable just before rendering.
I applied this logic in my application and it works; (But I dint work with .SWF files)
Hope this may help you.
Nith -
How to Pre-Populate the user information during Assign Task operation
Hi ,
I have a requrirement to Pre-Populate the form fields (Name, Email, Phone etc...) when a task is assigned to a user. The users are dynamically assiged, so I am using the Find User and the Assign Task services to locate and assign the task to the user. Since I have a User variable that is a result from the Find User operation, I was hoping to retrieve the user information with the attributes of the User type.
I tried to use the Set Value service to set the form field (Email) with the email attribute of the User object type i.e.
/process_data/MyForm/object/data/xdp/datasets/data/Form/User/Email -> /process_data/facilityAuthority/object/@email
However I get the following error when I try to do this - com.adobe.idp.dsc.util.InvalidCoercionException: Cannot coerce object: [B@335d of type: [B to type: interface org.w3c.dom.Document.
Is it possible to retrieve the user information from the User object? If so how do I get the values for the User attributes (Name, Email & Phone etc...) so that I can populate them in the form?
Thanks,
SamanthapudiHi Han Dao,
If you are facing an exception of the form "com.adobe.idp.dsc.util.InvalidCoercionException: Cannot coerce object: [B@335d of type: [B to type: interface org.w3c.dom.Document.", It is because the system is trying to cast a Byte Stream into w3c Document and failing. To resolve this we can explicitly cast this byte stream to appropriate data type (String in previous example). To do so we can use a SetValue operation.
As an example
Setting
/process_data/MyForm/object/data/xdp/datasets/data/Form/User/Email -> /process_data/facilityAuthority/object/@email
results in the exception
so we can modify it to
/process_data/MyForm/object/data/xdp/datasets/data/Form/User/Email -> string(/process_data/facilityAuthority/object/@email)
Please let me know if this does not resolve your issue.
Thanks -
Ctrl-f - copy the code into an action
ctrl-f - apply last filter - can this code be easily formulated into an action or a script (analogous to a screen-grab perhaps?)
You can use Insert Menu Item to record the Last Filter command if you do it before using any filters in photoshop.
-
Adding JavaScript Code dynmically to a JSF page
Hi all;
I have a JSF page where I have a dropdown list (<h:selectOneMenu). on the cnahgeEvent of this menu a JavaScript code is called and another dropdown list is displayed with populated data (depending on the selection of the first drop down).
My quesiton is how I can inject the array (of data used by the first dropdown list) (dynamically) . This is because this data is read from the DB and then injected into the JSF page at run time.
any smart ideas ?If you are looking for a dependent dropdownlist you can use AJAX to accomplish your goal. the onChange event binded to the first list can trigger an ajax request to the server and get the list of data that can be used to populate the second list.
-
User with assigned task unable to open task to complete it
I have a SP 2010 custom list with an approval workflow attached.
I have set up permissions for a number of users to have access to the site.
A workflow was started and the task assignment email went to the first user.
When he clicks on the outlook message's "Open this task" button, he gets a popup that says "No such interface supported"
This works fine for me. It worked for others that I had try it.
What might cause this particular error to appear for a user?I tested with several other people, and of them all, only one other showed the same problem.
Then, one of the testers had a thought. It turns out that everyone that was successful in "Open this task" from Outlook 2010 also had InfoPath 2010 installed.
One of the testers who was failing to get the task to open installed InfoPath 2010 on his machine, and suddenly, he was able to open the task.
I have NO idea why something installed with InfoPath 2010 is required for an out of the box task approval that is initiated in Outlook 2010.
If that is a requirement, then I would have expected to find it listed as a dependency somewhere.
try this on someone who doesn't have infopath installed on their computer.
1. In outlook go to File>Options
2. click on "Mail" on the left bar
3. scroll down to the bottom and look for the section called "Other"
4. check the box for "Enable Microsoft InfoPath E-mail Forms"
5. then click Ok.
You may need to close out of outlook and reopen before the "Open This Task" button will work
Alex -
Add additional Javascript code on OOTB sharepoint ribbon button.
Hello,
We have SharePoint Ent and Project Server 2010 SP-2 environment.
So the requirement is like that we have 1 OOTB "Save" ribbon button for Project Server 2010 Project Detail Pages. Which actually Saves and Publishes the project updates into Project Server database.
Here I have to execute javascript code basically to refresh the page right after user click OOTB "Save" button and Projects gets saved into database.
But here I am not getting any pointer how to add this additional Javascript code into commandaction of existing OOTB "Save" ribbon button, so that my Project gets save and publish and also I'll be able to refresh the page right after the save and
publish.
Please help me let me know how can i hook into OOTB SharePoint ribbon button actions.
Thanks !!!
Sachin Vashishth MCTSHi,
It will not easy to add actions to an OOTB ribbon button, there is a workaround that we can replace it with a custom button.
Here is a documentation about Replacing a Button on the Server Ribbon:
http://msdn.microsoft.com/en-us/library/ff407619.aspx
Another two links about create a custom ribbon button for your reference:
http://msdn.microsoft.com/en-us/library/office/ff407458(v=office.14).aspx
http://sharepoint.stackexchange.com/questions/20646/attach-a-javascript-function-to-an-ootb-ribbon-button
Best regards
Patrick Liang
TechNet Community Support -
Show message popup when finish assigning task
Hi all,
I want to whenever user finish assigning task to other user, bpm will show popup window to confirm some information (i have just tried FaceMessage). Now, I am writing code in event TaskValidationCallback but it's not working.
Somebody help?
Thanks.Hello Nguyen -
CIL (Common Intermediate Language) is the code we are writing inside the activity as method.
It can be any one of BPL(Business Processing Language - is the common snippet using for OBPM) or .NET or Java code.
In the above case we are using BPL.This is the beauty of Oracle BPM.Its supports all the three :)
Each process activity references a method. Methods can have CIL code implemented or can be empty,
but associated methods must always exist for process activities.
Please check : http://en.wikipedia.org/wiki/Common_Intermediate_Language
BR,
Justin. -
Assign task with use a document variable
Hi,
if i'm assigning a pdf document in assign task operation with use a document variable instead of application asset, I see the same old blank form after user submits the form.
what ever typed in the form is not seen in the output variable assigned in Assign user task.
If I use application asset and provide input xml, then I could see the filled form as output when user submits.
What should I do to get the filled data in the form?
Note: Reason for using document variable is I want to dynamically assign the form created in the process to assign task instead of getting from repository.
Highly appreciate your assistance.
Thanks,
kcOk. So are you populating document with the values entered by user in process before assigning.
Best approach is to xml and application asset.
And do you have your pdf document binded with xml schema. If not then you wont have fields populated in any way.
Thanks,
Prashast -
Pasting javascript widgets into pages
is there any way yet to paste javascript code into pages using iweb 09?
i've tried pasting sharethis code using the insert html widget function, instead, it appears is it pasted into a separate html file (which includes headers and all) that is in the download_files folder...
all work-arounds i've seen so far include copy-pasting it into the actual html code outside iweb and having to re-do this everytime you make changes.
kinda clumsy to be honest....
any way around this?
\is there any way yet to paste javascript code into pages using iweb 09?
It's depend on how/what the javascript code is implemented.
i've tried pasting sharethis code using the insert html widget function, instead, it appears is it pasted into a separate html file (which includes headers and all) that is in the download_files folder...
That's how HTML Snippet widget works, it does not add the codes to the page but to another page called widget#_markup.html thru an iframe.
Most people do not know this (or ignore to) and make the common mistakes... have their StatCounter or Google Analytical codes track the wrong pages.
all work-arounds i've seen so far include copy-pasting it into the actual html code outside iweb and having to re-do this everytime you make changes.
kinda clumsy to be honest....
You know it... post editing after every publishing... is clumsy, old, oh so yesterday...
any way around this?
Yes, build your own iweb3 widgets, this pretty much answer your first question.
However... AFAIK, I am the only one (as far) builds iweb widgets (in iweb3 context), google my page (cyclosaurus.com)... you find sharethis widget is on upper left corner.
All javascript is linked to my page... sorry, I don't do tutorial nor how-to. -
Hello !
I have run into "funny" problem.
I have following workflow:
User is creating item in ListA. In new form he needs to put Manager which is User Field column type. From people picker he is choosing login name Domain\jo (Two letters seems to be important here). User is resolved correctly to John Doe. Item is saved and
added to list correctly. In list view John Doe is displayed in Manager column. In view item John Doe is in Manager field. In powershell Id;#John Doe is as a Manager field value.
Now the "funny" part:
After item is added to ListA workflow is started automatically. Workflow is assigning new task to user from Manager (CurrentItem:Manager) field using Assign task action. Now the new task is assigned to different person i.e. John Dimagio with login name DOMAIN\jod
! When I am logging value to wf history of the CurrentItem:Manager field I am getting sth like i;123#DOMAIN\jod . So value is completely different and wrong.
Can someone explain why is this happening?
My guess is that using two letters login name can cause such case but why ?
Regards,Hello !
I have run into "funny" problem.
I have following workflow:
User is creating item in ListA. In new form he needs to put Manager which is User Field column type. From people picker he is choosing login name Domain\jo (Two letters seems to be important here). User is resolved correctly to John Doe. Item is saved and
added to list correctly. In list view John Doe is displayed in Manager column. In view item John Doe is in Manager field. In powershell Id;#John Doe is as a Manager field value.
Now the "funny" part:
After item is added to ListA workflow is started automatically. Workflow is assigning new task to user from Manager (CurrentItem:Manager) field using Assign task action. Now the new task is assigned to different person i.e. John Dimagio with login name DOMAIN\jod
! When I am logging value to wf history of the CurrentItem:Manager field I am getting sth like i;123#DOMAIN\jod . So value is completely different and wrong.
Can someone explain why is this happening?
My guess is that using two letters login name can cause such case but why ?
Regards, -
JSP response into a Javascript code
Suppose I have a form that I submit, and its action is set to a JSP page that returns a series of elements <option>, for example:
<option>2005</option>
<option>2006</option>
Is it possible to GET that JSP response, inside the JavaScript code?
Or should I better state, inside the JSP code, to return ONLY the numbers and then I get it on the JavaScript and use the .add() funtion to add the item to a <select> ?
How do I save that response inside the JavaScript?
For example, I am trying with this Javascript function that handles the changes on a drop-down list:
function clickedOnPType(lista)
document.form1.action = "searchAvailableYears.jsp?pType=" + txtPType;}
document.form1.submit();
}...And I am getting, in return, a series of <option> with the correct data...
Thanking you in advance,
MMSOh hello... in one of my 1000 searches I found that
post days ago and I was already trying with your
code, but I was getting several errors like
"undefined is null or not an object" (in IE),
"xmlhttp.responseXML has no properties" (in
Firefox).... Well one thing i wanted to discuss here is is wat properties does in general a XmlHttpRequest Object contains
checkout the below interface which gives a clear understanding of the Object member properties.
interface XMLHttpRequest {
attribute EventListener onreadystatechange;
readonly attribute unsigned short readyState;
void open(in DOMString method, in DOMString url);
void open(in DOMString method, in DOMString url, in boolean async);
void open(in DOMString method, in DOMString url, in boolean async, in DOMString user);
void open(in DOMString method, in DOMString url, in boolean async, in DOMString user, in DOMString password);
void setRequestHeader(in DOMString header, in DOMString value);
void send();
void send(in DOMString data);
void send(in Document data);
void abort();
DOMString getAllResponseHeaders();
DOMString getResponseHeader(in DOMString header);
readonly attribute DOMString responseText;
readonly attribute Document responseXML;
readonly attribute unsigned short status;
readonly attribute DOMString statusText;
};therefore as you can see XmlHttpRequest.reponseXML returns a Document Object which has below set of properties.
http://www.w3schools.com/dom/dom_document.asp
http://www.javascriptkit.com/domref/documentproperties.shtml
and as said earlier one can send AJAX response in three ways
1).Plain text(with comma seperated values maybe): Which we can collect using XmlHttpRequest.responseText 2).XML: @ client side XmlHttpRequest.reponseXML create a DOM Object using which one can parse it get values
of attributes and values of different tags and then update the view accordingly.
3).JSON(Javascript Object Notation): It is a bit complicated thing to discuss at this moment
however it uses the first property(Plain text) and then
uses set of libraries to parse and update the view.
checkout below links to understand it
http://www.ibm.com/developerworks/library/j-ajax2/
http://oss.metaparadigm.com/jsonrpc/
> function handleOnChange(ddl)
>
var ddlIndex = ddl.selectedIndex;
var ddlText = ddl[ddlIndex].text;
var frmSelect = document.forms["form1"];
var frmSelectElem = frmSelect.elements;
if(ddl.name="pType")
txtYear = "";
txtDay = "";
txtTime = "";
unblock(document.form1.year);
block(document.form1.day);
block(document.form1.time1);
laProxLista = frmSelectElem["year"];
if (ddl.options[ddl.selectedIndex].text !=
txtPType = ddl.options[ddl.selectedIndex].text;
else if(ddl.name="year")
txtDay="";
txtTime="";
unblock(document.form1.day);
block(document.form1.time1);
laProxLista = frmSelectElem["day"];
f (ddl.options[lista.selectedIndex].text != "---")
txtYear = ddl.options[lista.selectedIndex].text;
else if(ddl.name="day")
{ txtTime = "";
unblock(document.form1.time1);
laProxLista = frmSelectElem["time1"];
(ddl.options[ddl.selectedIndex].text != "---")
txtDay = ddl.options[ddl.selectedIndex].text;
else //time1
laProxLista = null;
if (ddl.options[ddl.selectedIndex].text != "---")
txtTime1 = ddl.options[ddl.selectedIndex].text;
if ( txtPType != "---")
xmlhttp = null
// code for initializing XmlHttpRequest
Object On Browsers like Mozilla, etc.
if (window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest()
// code for initializing XmlHttpRequest
Object On Browsers like IE
else if (window.ActiveXObject) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP")
if (xmlhttp != null)
if(ddl.name = "pType")
// Setting the JSP/Servlet url to get
XmlData
url = "searchAvailableYears.jsp?pType="
+ txtPType;
else if(ddl.name = "year")
url = "searchAvailableDOY.jsp?pType=" + txtPType
PType + "&year=" + txtYear;
else(ddl.name = "day")
url = "searchAvailableTimes.jsp?pType=" +
e=" + txtPType + "&year=" + txtYear + "&day=" +
txtDay;
xmlhttp.onreadystatechange =
handleHttpResponse;
// Open the Request by passing Type of
Request & CGI URL
xmlhttp.open("GET",url,true);
// Sending URL Encoded Data
xmlhttp.send(null);
else{
// Only Broswers like IE 5.0,Mozilla & all other
browser which support XML data Supports AJAX
Technology
// In the Below case it looks as if the
browser is not compatiable
alert("Your browser does not support
XMLHTTP.")
} //else
} //if chosen
//function
//----------------------------Well as far as i can see i do not have any issues with it because your code looks
preety much involved with your business logic but one thing i would like to reconfim
here is the variable "xmlhttp" a global one.
if no declare xmlhttp variable as a global variable.
<script language="javascript">
var xmlhttp;
function handleOnChange(ddl){
function verifyReadyState(obj){
function handleHttpResponse() {
</script>
> function verifyReadyState(obj)
if(obj.readyState == 4){
if(obj.status == 200){
if(obj.responseXML != null)
return true;
else
return false;
else{
return false;
} else return false;
}I believe,this is preety much it.
> function handleHttpResponse() [/b]
if(verifyReadyState(xmlhttp) == true)
//-----------HERE!! ---- I GET "UNDEFINED" IN THE
DIALOG BOX
//------- BELOW THE CODE LINE....---
var response = xmlhttp.responseXML.responseText;
alert(response);
it is obvious that you would get Undefined here as responseText is not a property of Document Object or to be more specific to the Object what xmlhttp.responseXML returns.
you might have to use that as alert(xmlhttp.responseText);
and coming back to parsing the XML reponse you have got from the server we need to use
var response = xmlhttp.responseXML.documentElement; property for it...
and if you put as a alert message it has to give you an Output like"Object"
alert(response);
if that doesn't the browser version which you are using may not support XML properly.
var response = xmlhttp.responseXML.documentElement;
removeItems(laProxLista);
var x = response.getElementsByTagName("option")
var val
var tex
var newOption
for(var i = 0;i < x.length; i++){
newOption = document.createElement("OPTION")
var er
// Checking for the tag which holds the value of the Drop-Down combo element
val = x.getElementsByTagName("value")
try{
// Assigning the value to a Drop-Down Set Element
newOption.value = val[0].firstChild.data
} catch(er){
// Checking for the tag which holds the Text of the Drop-Down combo element
tex = x[i].getElementsByTagName("text")
try{
// Assigning the Text to a Drop-Down Set Element
newOption.text = tex[0].firstChild.data
} catch(er){
// Adding the Set Element to the Drop-Down
laProxList.add(newOption);
here i'm assuming that i'm sending a xml reponse of format something below.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<drop-down>
<option>
<value>1</value>
<text>label1</text>
</option>
<option>
<value>2</value>
<text>label2</text>
</option>
<option>
<value>3</value>
<text>label3</text>
</option>
</drop-down>and i'm trying to update both option's value and label which would be something like
<select >
<option value="1">label1</option>
<option value="2">label2</option>
<option value="3">label3</option>
<option value="4">label4</option>
</select>else where if you are interested in getting a format like the one below
<select >
<option>label1</option>
<option>label2</option>
<option>label3</option>
<option>label4</option>
</select> try the below snippet
var response = xmlhttp.responseXML.getElementsByTagName("text");
var length = response.length;
var newOption
for(var i =0 ; i < length;i++){
newOption = this.document.createElement("OPTION");
newOption.text = response.childNodes[0].nodeValue;
// or newOption.text = response[i].firstChild.data
laProxList.add(newOption);
Another thing...
I have tried to set the content type inside the JSP
to
response.setContentType("text/html");
AND to
response.setContentType("text/xml");
but none of the above is getting me results......use of response.setContentType("text/xml"); is more appropriate here.. as you are outputting XML or a plain text here...
make sure you set the reponse headers in the below fashoin while outputting the results....
response.setContentType("text/xml");
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 1);
response.setDateHeader("max-age", 0); and if you are serious about implementing AJAX i would advice you start learn basics of XmlHttpRequest Object and more about DOM parsing is being implemented using javascript.
http://www.w3.org/TR/XMLHttpRequest/#xmlhttprequest0
http://www.jibbering.com/2002/4/httprequest.html
http://java.sun.com/developer/technicalArticles/J2EE/AJAX/
http://developer.apple.com/internet/webcontent/xmlhttpreq.html
http://www.javascriptkit.com/domref/documentproperties.shtml
and then go about trying different means of achieving them using simpler and cool frameworks
like DWR,dojo,Prototype,GWT,Jmaki,Back Base 4 Struts,Back Base 4 JSF....etc and
others frameworks like Tomahawk,Ajax4Jsf,ADF Faces,ICE FACES and many others which work with JSF.
Please Refer
http://swik.net/Java+Ajax?popular
http://getahead.org/blog/joe/2006/09/27/most_popular_java_ajax_frameworks.html
Hope that might help :)
and finally an advice before implementing anything specfic API which may be related to any technologies (JAVA,javascript,VB,C++...) always refer to API documentation first which always gives you an Idea of implementing it.
Implementing bad examples posted by people(even me for that matter) directly doesn't make much sense as that would always lands you in trouble.
and especially when it is more specific to XmlHttpRequest always make habit of refering
specific Browser site to know more about why specific Object or its property it not working 4i
IE 6+: http://msdn2.microsoft.com/en-us/library/ms535874.aspx
MOZILLA: http://developer.mozilla.org/en/docs/XMLHttpRequest
Safari: http://developer.apple.com/internet/webcontent/xmlhttpreq.html
Opera 9+: http://www.opera.com/docs/specs/opera9/xhr/
Hope there are no hard issues on this...
REGARDS,
RaHuL -
Malicious Javascript code added to the bottom of my HTML
Hello,
Below is the code to my main page, called index.php. It is what shows when I type my domain into the browser. On a few occasions, when I open it in Internet Explorer, some malicious javascript code has been added to the bottom of the code. The malicious javascript code looks like: "<script type="text/javascript">eval(String.fromCharCode(118,97,114,32,120,101,119,61,57,56,55,49, 51,49,..."
It seems like this code then installs a fake anti-virus program on the computer of anyone who visits my site. How can I prevent this malicious javascript from getting written into my source code?
Thanks,
John
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
session_start();
unset($_SESSION['find']);
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Title</title>
<link rel="stylesheet" type="text/css" href="tablestyles.css">
</head>
<body>
<div class="mainlinks"><a href="about.php" class="links">About</a><a href="testpage.php" class="links">New Testpage</a><a href="tablecreate.php" class="links">Table Create</a></div>
<div class="line"></div>
<div class="smalllogo"><a href="index.php"><img src="images/logo.png" alt="Tywod" width="170" height="45" border="0"/></a></div>
<div class="searchbox">
<form action="tsearch14.php" method="post">
<label>Enter Topic:
<input type="text" name="find" size="55"/>
<input type="hidden" name="searching" value="yes" />
<input type="submit" name="search" value="Search" />
</label>
</form>
</div>
<div class="line2"></div>
<div class="copyright">©2009 Title</div>
</body>
</html>You may find this blog post valuable!
http://blog.cartweaver.com/index.cfm?newsid=56
Lawrence *Adobe Community Expert*
www.Cartweaver.com
Complete Shopping Cart Application for
Dreamweaver, available in ASP, PHP and CF -
Granting an admin rights to view and execute a task with user actions
I am trying to grant an admin the rights to view and execute a new task that i have created from the search results and user actions applet.
I have added an auth type to the authorization types configuration object with the following:
<AuthType name="terminateUser" extends="TaskDefinition,TaskInstance,TaskTemplate"/>
I created a new task and assigned it this auth type. I then created the new admin group and assigned the following permissions:
<Permission type='terminateUser' rights='View'/>
I then added this capability to the admin role to which the user has been assigned. This admin role also has the view user capability and has been assigned to the top level of this organization as a controlled organization.
I also added the task to the user actions configuration so that the menu item appears in the context menu and on the find users page.
The user can see all users but cannot see the new task. The only thing that is visible is the "view" menu item.
I have other users that have lots more capabilites that can execute this task with no problems. I am wondering if the view user capability is the problem or is there some other capability that anyone knows of that I must add in order to allow this admin role to view and execute this task.
Thanks,
RuthBTW, the answer is to restart the app server. Duh!
Ruth
Maybe you are looking for
-
My iphone 5, with iOS 7.0.2, is heating and consuming the battery very fast when 3G is on, even when I'm not using it. Any solution?
-
Myipone4s.version5.1.1(9b206)Can'tupdateios
Myipone4s.imei:*********,version:5.1.1(9b206),model:mc603th,carrier:12.0 Can't download,update.software,ios. Don't open safarifile,server.onmobilepone Error404 <Edited by Host>
-
Over the past few weeks, I have gotten multiple text messages that say: "You've got a PIX or FLIX message! To see it, visit..." . I go there, it makes me sign in. Then I get this... Sorry, it appears you do not have an active account. New Multimedi
-
Hi experts, I have a query regarding WM status of the delivery item, we are creating delivery with reference to project, material is warehouse managed material WM1 and WM2 views are maintained Material has stock in the storage bin which is maintained
-
IPad won't boot. Not stuck on logo. Can anyone help?
The apple logo appears for 5 seconds then disappears. Then does this cycle over and over again. Only when plugged into the wall though. When plugged into a laptop nothing appears and screen is black. I tried a restore and it gave me an error so it di