Hi,
i am implementing xforms in my application. I am new to xforms. i have to set javascript return value into xform model when page is loading. can any one please give suggestion how to do it Thanks & Regards Ramesh k |
Hi,
I am working on a custom component for form builder and I have been beating my head in trying to figure out how to pass out of the control the value structure: <lat_long> <lat_degree>12</lat_degree> <lat_minute>24.212</lat_minute> <long_degree>89</long_degree> <long_minute>56.001</long_minute> </lat_long> I am aware that this is a complex structure that has basic integer and decimal values. Is there a way to define the Schema definition or to create a xs:anyType = to like dm:latLong??? Any suggestions would help on this scenario. --Kristopher Stice Technology Consultant Digital Maelstrom LLC Email: [hidden email] IM: [hidden email] Work: 816-277-7353 -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
In reply to this post by rameshkancherla
hi
can we bind javascript returned value into modal instance? if any one know about this can you please give me suggestion. thanks & regards ramesh k
|
You can't directly set the instance data with
javascript. Instead, you must add an <xforms:input/> which is
bound to the instance node you want to set, and then use
ORBEON.xforms.Document.setValue(controlId,
value) to set the value of the input. You can
put the input inside a span or div which has style="display: none;" if
you don't want the user to see the input control. See
http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-javascript-get-set-value
for more.Cheers, Dave rameshkancherla wrote: hi can we bind javascript returned value into modal instance? if any one know about this can you please give me suggestion. thanks & regards ramesh k rameshkancherla wrote:Hi, i am implementing xforms in my application. I am new to xforms. i have to set javascript return value into xform model when page is loading. can any one please give suggestion how to do it Thanks & Regards Ramesh k --
This
e-mail and any attachments are intended only for the person to whom it
is addressed
and may contain privileged, proprietary, or other data protected from
disclosure
under applicable law. If you are not the addressee or the person
responsible
for delivering this to the addressee you are hereby notified that
reading, copying
or distributing this transmission is prohibited. If you have received
this e-mail
in error, please telephone us immediately and remove all copies of it
from your
system. Thank you for your co-operation.
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Hi Dave,
this example is working fine in orbeon form. when I am integrating it into liferay portal I am getting exception as Exception in client side code. do you have any idea about it. can you please give me suggestion. Thanks, Ramesh K
|
In reply to this post by rameshkancherla
Hi Rameshkancherla,
I hope you are working with liferay portlets. We can set the value of a node by using it's id only. But when you are using portlets the id value is get's changes by adding portletname also for every new portlet added. We can easily find it by giving id like myinputid and check in browser View Source. So when we are setting we have to do as follows. <xforms:trigger> <xforms:label>Execute JavaScript</xforms:label> <xxforms:script ev:event="DOMActivate"> ORBEON.xforms.Document.setValue(('_MYPORTLETNAME_WAR_orbeon_INSTANCE_W6S8_myinputid'),'newvalue'); </xxforms:script> </xforms:trigger> as already documented in orbeon we have to hide if we don't want to display that control. als refer http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-javascript-get-set-value for more. |
Hi subrahmanyam,
I have seen in view source as _firstPortlet_WAR_orbeon_INSTANCE_Nt6U_city_name$xforms-input-1 you have given as '_MYPORTLETNAME_WAR_orbeon_INSTANCE_W6S8_myinputid' I understand here firstPortlet is MYPORTLETNAME ... but i am not understanding how to get w6s8 value can you please give me suggestion. Thanks Ramesh
|
Hi Ramesh,
As I said the id will be changed automatically so use that id only. Example> ORBEON.xforms.Document.setValue(('_firstPortlet_WAR_orbeon_INSTANCE_Nt6U_city_name$xforms-input-1'),'newvalue'); whenever you add a port let it' id again changes, so it is a disadvantage.
|
In reply to this post by rameshkancherla
**** SETTING xforms node value using JavaScript in liferay portlets ******
PROBLEM: For portlets a dynamic value is getting added to the controls id which creates problem while setting the values using javascript SOLUTION: I found WAR_orbeon_INSTANCE is common for all the dynamically created unique id for every control when new portlet is created / new node is created / users are navigated from one portlet to other, So 1) get the dynamically created id string using javascript and add that to our controlid to setvalue. Example: id changes as _PORTLET1_WAR_orbeon_INSTANCE_W6S8_MYINPUTID1 _PORTLET2_WAR_orbeon_INSTANCE_W8S5_MYINPUTID1 then my javascript code is as follows. function mySetValue{ var allChildNodes=document.getElementsByTagName("input"); var portletUniqueId; for(var i=0;i !=allChildNodes.length ;i++){ var uniqueIdIndex=allChildNodes[i].id.indexOf("WAR_orbeon_INSTANCE"); if(uniqueIdIndex != -1){ portletUniqueId=allChildNodes[i].id; break; } } var indexOfUniquePart= portletUniqueId.indexOf("WAR_orbeon_INSTANCE")+20; var lastIndex = portletUniqueId.indexOf("_",indexOfUniquePart); var finaluniqueId =portletUniqueId.substring(0,lastIndex+1); ORBEON.xforms.Document.setValue(finaluniqueId+"MYINPUTID1",'newvalue1'); ORBEON.xforms.Document.setValue(finaluniqueId+"MYINPUTID2",'newvalue2'); ORBEON.xforms.Document.setValue(finaluniqueId+"MYINPUTID3",'newvalue3'); } regards subrahmanyam.
|
Free forum by Nabble | Edit this page |