Development of inputText readOnly using javascript.
I have a form in which some components of inputText values are calculated by javascript (these values are only available from JS, until someone gives thinking that I should do everything on the server side). If the inputText component is not readOnly, then the solution I have works. However, if the inputText component is read only, call setValue() on the AdfRichInputText JS object has no effect.Below is an example of a page with both cases. Any ideas on what I can do?
Barry
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
xmlns:trh="http://myfaces.apache.org/trinidad/html">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1" title="testdoc">
<f:facet name="metaContainer">
<trh:script id="js">
function testJS () {
replace('txtReadOnly','READONLY-NEW-TEXT');
replace('txtNonReadOnly','NON-READONLY-NEW-TEXT');
}
function replace(inputTextId,newValue){
obj = AdfPage.PAGE.findComponentByAbsoluteId(inputTextId);
obj.setValue(newValue);
}
</trh:script>
</f:facet>
<af:form id="f1">
<af:panelStretchLayout id="psl1">
<f:facet name="center">
<af:panelGroupLayout id="pgl1" halign="center" layout="scroll">
<af:panelFormLayout id="pfl1">
<f:facet name="footer">
<af:panelGroupLayout id="pgl2" halign="center"
layout="scroll">
<af:commandButton text="Run JS!" id="cb1">
<af:clientListener method="testJS" type="click"/>
</af:commandButton>
</af:panelGroupLayout>
</f:facet>
<af:inputText label="ReadOnly InputText" id="txtReadOnly"
value="readonly orig value" readOnly="true"
clientComponent="true"/>
<af:inputText label="Non-Readonly InputText" id="txtNonReadOnly"
value="non-readonly orig value"
clientComponent="true"/>
<af:spacer width="10" height="10" id="s5"/>
</af:panelFormLayout>
</af:panelGroupLayout>
<!-- id="af_one_column_stretched" -->
</f:facet>
<f:facet name="bottom">
<af:spacer width="10" height="10" id="s1"/>
</f:facet>
<f:facet name="end">
<af:spacer width="10" height="10" id="s2"/>
</f:facet>
<f:facet name="start">
<af:spacer width="10" height="10" id="s3"/>
</f:facet>
<f:facet name="top">
<af:spacer width="10" height="10" id="s4"/>
</f:facet>
</af:panelStretchLayout>
</af:form>
</af:document>
</f:view>
</jsp:root>
Hello
use an af:serverListener to call a bean managed since JavaScript method. Pass the value as the payload and set aside server. Here is an example of the use of af: serverListener
http://Oracle.com/technology/products/jdev/tips/fnimphius/clientListener/client-server-listener.html
Frank
Tags: Java
Similar Questions
-
How to get inputtext inputvalue using javascript
How to get inputtext inputvalue using javascript?
and how to judge if his being filled or a string emptyfunction method1 (event) {}
Event.Cancel ();
var value = event.getSource ().findComponent('inputTextID').getValue ();
} -
Development of the element using Javascript
Hello experts!
I have a problem with the setting of a value of element using javascript.
I have a button on my page which should regulate my point P1_SORT to the value 'test '.
I call the function with the following statement in the section my button URL:
The problem is that the item is not defined when you call the function.javascript:f_setItem('P1_SORT');
Maybe you can help me understand why the service is defective and how it should be like.
The code I have (in my head of page) is as follows:
Thanks for your help!<script language="JavaScript" type="text/javascript"> function f_setItem (P1_SORT) { get.add(P1_SORT,('test').value) gReturn = get.get(); get = null; ; } </script>
Sebastian'test' is a string? or the element name?
Try this:
function f_setItem (P1_SQRT) { var pValue='test'; $x(P1_SQRT).value = pValue; }
or
function f_setItem (P1_SQRT) { var pValue='test'; $x('P1_SQRT').value = pValue; }
but of course it is jquery
Edit: second work because the element name is P1_SQRT -, as a variable in the function definition. If U accept jquery U should combinate with this example and I think it should work fine
Edit2: Var initialized U get?
-
Hello
We tried the window. ResizeTo and window. Methods MoveTo using javascript. It doesn't seem to work in version 9.0.1. Please suggest any alternative.Thank you
AvinashThis is no longer allowed for security reasons (bug 565541).
See https://support.mozilla.org/nl/questions/880032
https://developer.Mozilla.org/en/DOM/window.MoveTo -
I want to export a report to several pages to CSV using javascript code... Please suggest
Hi SubhajitChakraborty,
If you are using Internet explorer as web browser, then confirm your request in Internet Explorer development Forums.
http://social.msdn.Microsoft.com/forums/en-us/iewebdevelopment/threads
If you use a Web browser to explore, then look for JavaScript communities to help.
-
How to change the title for the alert box using javascript in Blackberry Z10?
Hi all
I developed 10 Blackberry webworks using the emulator to ripple and Blackberry Webworks SDK 1.0.4.11.In I use box alert and drop-down list in Javascript... When you use those Blackberry Z10... It displays the title for the alert "JavaScript Confirm" box and the "Select"dropdown list... So I want to change the title for these controls. Please me... Thanks in advance...
Kind regards
Marimuthu_P
Alerts are native OS controls and you can not change the titles.
You can use the WebWorks dialog API to create custom if dialog boxes:
https://developer.BlackBerry.com/HTML5/APIs/beta/BlackBerry.UI.dialog.html -
How to get the code PIN Blackberry 10 using javascript for BB10 Webworks App?
Hi all
I have developed web application for blackberry 10 using the emulator to ripple and Blackberry 10 Webworks SDK 1.0.4.11.Here I put the automatic connection of my web application... So I want to get the Pin 10 of Blackberry number using javascript... Please help me... Someone knows... Thank you very much...
Kind regards
Marimuthu_P
Which is documented here for WebWorks 2.0: https://developer.blackberry.com/html5/apis/beta/blackberry.identity.html#jbo1385148789774
and here for WebWorks 1.0:
https://developer.BlackBerry.com/HTML5/APIs/gold/BlackBerry.identity.html
You want the uuid property.
-
How to get the Blackberry ID using javascript for Webworks App?
Hi all
I have developed a web application using Blackberry webworks SDK and emulator Ripple... Here, I need to get the Blackberry device ID using javascript... Please me... Thanks in advance...
With respect,
Marimuthu_P
HM... There is a sample to get the PIN with javascript.
https://developer.BlackBerry.com/HTML5/APIs/BlackBerry.identity.html#.UUID
-
How to generate QML objects using javascript?
Hello
I'm trying to generate new labels whenever the information is changed. I am aware of generate and load XML. However, I am looking for a way alternative simple generate labels or other objects using javascript. How to do this?
This page contains an example to create components dynamically:
http://developer.BlackBerry.com/Cascades/reference/bb__cascades__qmlcomponentdefinition.html
-
How to validate the field "Reason for change" in the commercial indications using JavaScript?
How to validate the field "reason for change" in the commercial directions Summary tab using JavaScript?
Current version of PLM4P: v6.1.1.5.2
Please help me to validate the fields using JavaScript.
Thank you
Nefertari
Developed using some of the Javascript predefined functions that we offer, it's just JavaScript and jQuery.
But here is an example.
(Use Internet Explorer F12 developer tools to find the IDS of the fields to work with.)
$(document).ready(function() { if (UI_Ext_isSpecInEditMode && UI_Ext_HasWorkflowBehavior('1005')) { //normally, we can use jquery to retrieve elements ($('#ifOfInput).val()), but it seems to fail when the id and the name attributes are the same. so we just use javascript document.getElementById instead. var reasonForChange = document.getElementById('ctl01$SpecSummaryctl1$ctlCollapsibleContentContainer$ctl00$txtChangeReason') if (reasonForChange != null) { if (reasonForChange.value == null || reasonForChange.value.length == 0) { UI_Ext_MarkFieldAsRequired('ctl01_SpecSummaryctl1_ctlCollapsibleContentContainer_ctl00_lblSpecSummaryReasonforChange'); alert('Reason For Change is required'); } } } });
However, not the user registration or workflow specification. If you were to do this, you must remove record them and workflow buttons and links, and this probably isn't the best practice. On the contrary, you would write validation server that would give you this error message if they try to save/workflow. (So most customers do not use Extensions of the user interface for this type of validation).
Kind regards
Ron
-
Pop - up using javascript in dynamics of the Actions
Hi all
Before you begin with the question, I want to share the below of the details on the application
Table creation script
create table status_dashboard (ID number, name varchar2 (10), varchar2 (10) State, varchar2 (1000)) URL;
Insert the script
insert into status_dashboard values 1, 'A1', 'up', 'www.ibm.com';
insert into status_dashboard values 1, 'B1', 'up', 'www.hp.com';
"insert into status_dashboard values 1, 'C1', 'up', ' www.msn.com";
insert into status_dashboard values (1, "D1", "low", "www.yahoo.com'");
insert into status_dashboard values 1, 'E1', 'up', 'www.oracle.com';
insert into status_dashboard values 1, 'F1', 'up', 'www.facebook.com';
insert into status_dashboard values (1, 'G1', 'down', 'www.twitter.com');
"insert into status_dashboard values 1, 'H1', 'up', ' www.google.com ';
insert into status_dashboard values 1, 'I1', 'up', 'www.apex.oracle.com';
Report query
SELECT max (case when mod (rn, 3) = 1 then end name) col1
, max (case when mod (rn, 3) = 2 then end name) col2
, max (case when mod (rn, 3) = 0 then end name) col3
, max (case when mod (rn, 3) = 1 then decode (status, 'down', 'red', 'green') end) The_color1
, max (case when mod (rn, 3) = 2 decode (status, 'down', 'red', 'green') then end) The_color2
, max (case when mod (rn, 3) = 0 then decode (status, 'down', 'red', 'green') end) The_color3
, ceil ((rn) / 3)
(select name, status, row_number() on rn (order by name) of status_dashboard)
Group by ceil ((rn) / 3)
order by ceil ((rn) / 3)
Report link on Oracle Apex
https://Apex.Oracle.com/pls/Apex/f?p=54850:1
I created a matrix report, enabled the conditional formatting. The only problem I have right now is to go to a link in the report.
I use 3 text elements Apex - P1_ID, P1_NAME and P1_URL.
I use also 3 dynamic actions
1. DEFINE NAME - will set the P1_NAME field with the value clicked in the report.
2 SET ID & URL - define the fields P1_ID and P1_URL of the DB using the P1_NAME field.
3-pop-up-appears the P1_URL using javascript.
Problem statement:
The pop up page is a blank page, although I can see that the value for the P1_URL field is defined using dynamic measurements.
Could someone please take a look at this example and help me with the same.
PS: The example was developed using sample data.
Hello
When you use the substitution in JavaScript string, the value is used when page and is pretty hard-coded in the document value.
Even if you change the value of the element or the element value in session state, it will not happen to the HTML document.
In dynamic action, try something like
popupURL($v("P1_URL"))
Who will choose the value of the item and pass it to the popupURL function.
Yes, you have created, sample, but how we can view source if we are unable to connect your workspace?
Kind regards
Jari
-
Addition of this paragraph textFrame using Javascript
Hello
I have a block of text that contains 4 paragraphs.
How can I add a paragraph 5 using Javascript and set some content in there?
I tried:
work \\Doesn't myTextFrame.contents += "\rNew Text."
Also, I couldn't find any available method to add a new paragraph as paragraph of the text block property seems readonly.
Help, please!
Examples of Javascript:
Add text at the end of the text in the text block.
To do this, we will use the last insertion point in history.
('\r' is a carriage return character).
myTextFrame.parentStory.insertionPoints.item(-1).contents = "\rThis is a new paragraph of example text.";--
Thomas B. Nielsen
-
How can we regenerated certificate of development mac for future use.
How can we regenerated certificate of development mac for future use.
Probably better off posting it here:
-
I can't go to the Java website to download the updates in the Firefox browser and it will not go to other sites that use JavaScript. I tried disabling my firewall, but this makes no difference.
I noticed with some sites I can enter them, but I cannot view items that have been created with JavaScript, for example. my own Web site at http://shaedandu.com.au... Some objects such as my Thawte security seals do not appear, and even other people tell me that they appear on the live version that they see in their browser.
I cleaned my internet cache several times in the last week... Return to Windows Internet Explorer help either, even though I prefer Firefox my default browser.
Can offer you a solution?
Adrian McG
[Melbourne - Australia]Ok... Looks like I'm tackling the problem from the wrong end!
I'll check my internet connections.
Thank you Tyler.
Adrian McG
-
How to change the language settings in firefox using JavaScript
My question is: how to change the language settings in the use of JavaScript in firefox:
I want to set the value of intl.accept_languages en using JavaScript.
How can I do?
EDIT: The reason mail, I want to do is to be able to run selenium for different languages test scenarios with manually change them rather progrmmetically
You will need to close and open the pref via user.js or prefs.js before restarting Firefox to perform the next test.
See:
Maybe you are looking for
-
How can I get Firefox by default in Unicode rather than Western?
It's the same question as the thread unanswered, archived https://support.mozilla.org/en-US/questions/989012?fpa=1 33.0 Firefox displays English instead of Japanese + English + mojibake. This should not matter if the web page is encoded in ShiftJIS,
-
How can I make the DVD of restoration for my new laptop 15-b129wm?
-
Why my iTunes library sound randomly cut during playback on my new Macbook Pro and the old Bose speakers?
-
copy a film and make an edited version
I created a movie that is 28 minutes. I want to make a shorter version of the same movie and keep the original. Can I just change the initial project and then save it under a new name, or something like that? Or I have to start over from scratch? I u
-
My Windows XP SP3 is very slow. It freezes often. This has happened since a year now. I tried the following: System restore Antivirus software sfc/scannow command. Disk Cleanup ScanDisk CCleaner Defrag C: Clean boot Last good known Configuration Can