Set form value from MyQuery
<cfif structKeyExists(MyQuery, "MyID")>
<CFSET form.MyID= MyQuery.MyID>
</cfif>
<cfif structKeyExists(url, "MyID")>
<CFSET form.MyID= url.MyID>
</cfif>
I use above code to check if query ID exists then assign value to my form variable.
It seems that it does not work, but it works for url.
Can you please help and advise are there any way to check value in query and assign to the form if it is defined?
Your help and information is great appreciated,
Regards,
Iccsi,
For assigning the value to form field you can directly use value="#MyQuery.MyID#"
For eg:<cfform><cfif structKeyExists(MyQuery, "MyID")> <cfinput type="text" Name="MyID" value="#MyQuery.MyID#"></cfif></cfform>
So the input text will be visible if value in query is defined else the correct data will be populated to form field MyID
Similar Messages
-
Set Form Values From Interactive Report Row
Using Apex 4.2.
I have two tables: T1 and T2
Table T1 contains five columns: CT11, CT12, CT13, CT14, CT15
Table T2 contains 4 columns: CT21, CT22, CT23, CT24
I have a page with two regions. Region 1 is a Form on a Table using table T1. Region 2 is an Interactive Report ( IR ) on table T2.
The SQL for region 2 is: select apex_item.RADIOGROUP(p_idx => 1, p_value => CT21) "Choose", CT22, CT23, CT24 from T2;
When the user clicks a radio button for a row in the Interactive Report, I would like the values in the IR cells CT22, CT23, CT24 to populate the CT13, CT14, CT15 fields in the table form in region 1. If a user clicks another row radio button, the values should update.
Any help is greatly appreciated. Thanks!Hi,
As per my understanding ur requirement is as below.
When the user clicks the 'Link Column' it should redirect to another page with the value of id, Day, Start Time, and End Time.
Hope all the cloumns are from the same table.
As Denes said, it is enought to pass the ID value to the link column as of below.
ie., u can modify ur query as of below.
SELECT Last Name,First Name,Day,Start Time,End Time, ID as "Link Column"
FROM t.
Now u can pass the value as #Link Column# which will pass the ID value to the next page.
Hope my understanding is correct. -
Get form values from an uploaded offline interactive form.
Hi,
I have created a simple offline interactive form with 2 text input elements Email and PhoneNumber.
I have created a button on the view. In the action, I have to get the values of the Email and PhoneNumber
How to capture input values from an offline interactive form.
Thanks
SrinivasHi Arafat,
I followed the how to do document https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20java/wdjava%20archive/offline%20interactive%20pdf%20form%20using%20download.pdf , and it mentioned what you just said. But I couldn't understand your suggestion "In second view you need to embed the IF element and create the required context attributs mapping for fields. Set the pdfMode as usePDF."
In the second view, I have created another interactive form for previewing the offline form.
I am able to preview the offline form. On submit action (submit button is on the view), when I print the context values, I get nulls.
Thanks
Srinivas -
Set atribute value from session bea while creating new record using ADF BC
hi,
i want to set the value of new record attribute from session bean while
using ADF BC using creation form. how can i set the value of a perticular arribute of a record to the value stored in session bean.Chapter 9 in the ADF Developer's Guide for Forms/4GL Developers (available on the ADF Learning Center at http://www.oracle.com/technology/products/adf/learnadf.html ) describes how to accomplish this along with other typical kinds of programmatic business logic.
-
Set item value from application level item
Hello,
I'm using Apex 2.2.1.00.04. I've modified the Page "No Tabs" template so that I can have my own Form (which is submitted to an outside website). On this form, I create some hidden items:
<form name="frmEPay" method="POST" action="some_website">
<input type="hidden" id="i1" name="userId" value=&G_ID. />
<input type="hidden" id="i11" name="timestamp" value="" />
<input type="hidden" id="i12" name="hash" value="" />
On this apex page, I have a javascript function which is called in the onload (basically, the ApEx webpage displays and then is redirected). Here's a snippet of that function:
var appProc = new htmldb_Get(null, html_GetElement('pFlowId').value,'APPLICATION_PROCESS=PrepEPay',0);
appProc.get();
appProc = null;
document.getElementById('i11').value = "&G_ECOM_TIMESTAMP.";
document.getElementById('i12').value = "&G_HASH.";
document.frm_infiNET.submit();
As you can see, the function calls an application level On Demand process (PrepEPay). That process sets the values of the application level items G_ECOM_TIMESTAMP and G_HASH. After those App level items have their values, I want to take those values and apply them to the hidden items on my custom form. Unfortunately, it doesn't work how I have things currently. I've verified that the On Demand process is running(by viewing the Session report on the page). So my problem seems to be this: 1. Retrieving the values from the Apex application level items
2. Setting those values to the values of my hidden items (on my custom form)
I think the biggest reason why I'm having difficulties is because I have to do a lot of this in the template, since that is the only way to have a separate Form. Maybe my problem is that I don't understand how to reference the Apex application level item value from a different form?
Thanks,
MartyMarty,
You are describing this as if you expect the substitution within "&G_ECOM_TIMESTAMP." and the other one to take place in some kind of lexical order, e.g., from the top to the bottom of the HTML. The replacements happen in the engine, before anything is sent to the page. Then the browser interprets language constructs such as javascript calls which in your case includes an ajax invocation of a server-side application process.
You need to re-think the machinery here.
Scott -
ComboBox - Setting Selected Values from data
I am running into a problem in Flex 3 that seems to be
different from Flex 2. Maybe someone can help.
I have a function for setting a combobox selected item for a
location for a value when the titlewindow completes loading. The
value is a prior value from a prior save. In other words to set the
combobox a value from a prior session.
The locations xml file is loaded from a remote object
oncreationcomplete of the titlewindow. The setselectedvalue
function worked perfectly in Flex 2 but now only works in Flex 2
after the titlewindow is loaded. We tested this by running the
setselectedvalue function from a button click after loading.
The dataprovider length is showing 0 in our debugging. After
titlewindow up on screen the length is showing correct ( 35 ) - in
this case. Our viewxmlobject function is showing no xml. Shows xml
correctly after up on screen.
I have set the creationpolicy to "all". That did not help
either.
Any suggestions? Anyone. This is killing me. Spent two days
now trying to get back to working state.
private function SetSelectedValue_cbLocation(): void {
var xLocID:String = eLocationID.text;
//viewXmlObject( cbLocation.dataProvider )
for (var i : int = 0; i < cbLocation.dataProvider.length
; i++) {
//Alert.show( cbLocation.dataProvider
.locid, 'Location DataProvider', Alert.OK);
if ( xLocID == cbLocation.dataProvider.locid ){
cbLocation.selectedIndex = i;
break;
The combobox has the dataprovider set at design time.
<components:is2ComboBox id="cbLocation" x="585" y="4"
width="196" dataProvider="{xmlLocations.Record}"
labelField="locname" dataField="locid"
change="changeLocation(event)" disabledColor="#004080" prompt="1.
Please select location"></components:is2ComboBox>Hard to say without seeing the code. Is the application
opening a pop-up window (the title window)? If so, where is the
combo box located? In the main app or the titleWindow? What calls
the SetSelectedValue_cbLocation() function? -
Can af:selectOneRadio initial selection be set to values from view object?
Using JDeveloper 11.1.1.4
Hi all. I have a selectOneRadio on a data entry page which works well. Now I want to (if possible) use the selectOneRadio on an edit page--setting the choice initially to the values that were stored in a database table's record (from the data entry page). I am able to retrieve the data selected in the data entry page, but I can't find anything referencing what I want to do on the edit page. Note that my selectOneRadio objects are actually on jsff's in a region on a page. I've supplied how I designed selectOneRadio on the data entry page in hopes that someone can gleen from it and tell me how to set one up on the edit page and set its initial value to the value combination stored.
There are two columns in the data displayed (example):
Short Format / Text
Short Format / Comma Delimited
Long Format / Text
<af:selectOneRadio value="#{bindings.Pay_File_Data_FmtVO1.inputValue}"
shortDesc="#{bindings.Pay_File_Data_FmtVO1.hints.tooltip}" id="sor1"
inlineStyle="text-align:left; font-size:2.0em;"
autoSubmit="true" showRequired="false" label="File Format">
<f:selectItems value="#{bindings.Pay_File_Data_FmtVO1.items}" id="si111"/>
</af:selectOneRadio>
public class FileTypesBean {
String fileFormat = null;
String dataFormat = null;
public BindingContainer getBindings() {
return BindingContext.getCurrent().getCurrentBindingsEntry();
public void getFileTypesSelection(ActionEvent actionEvent) {
fileFormat =
(String)resolveExpression("#{bindings.Pay_File_Data_FmtVO1.attributeValue}");
dataFormat =
(String)resolveExpression("#{bindings.Pay_File_Data_FmtVO1.attributeValues[1]}");
//System.out.println("dataFormat = " + dataFormat);
// now put in ParamsBean for use
AdfFacesContext afci = AdfFacesContext.getCurrentInstance();
ParamsBean params =(ParamsBean)afci.getPageFlowScope().get("paramsBean") ;
params.setFileTypeParam(fileFormat);
params.setFileDataTypeParam(dataFormat);
public Object resolveExpression(String el) {
FacesContext facesContext = FacesContext.getCurrentInstance();
ELContext elContext = facesContext.getELContext();
ExpressionFactory expressionFactory =
facesContext.getApplication().getExpressionFactory();
ValueExpression valueExp =
expressionFactory.createValueExpression(elContext, el,
Object.class);
return valueExp.getValue(elContext);
}Thanks in advance,
Troy
Edited by: Hoopestr on Apr 18, 2012 10:54 AMin the amimpl have an edit method, get the value you want to set and set that value for your af:selectOneRadio, row.setAttribute(PayFileDataFmtVO1, value);
-
Setting field value from antother field
I am having problems setting the value of a field depending on the entry of a previous drop down field.
I am creating some wizard pages. On one page i wish a drop down list to populate another field. The drop downlist is unbound. (I have tried doing this with bound field aswell). To do this I have the Depends on Item of the target field to depend on the dropdown list field, so that the appropriate values are updated. (i have tried with the target field being bound and unbound aswell not that it should matter).
I have then updated the VO (view object) adding transient fields when the fields are unbound. Then i updated the view row class. The setter of the drop down field was used to set the value of the target field. (Using the setter of target field). I added system.out.println and the fields are called and set accordingly. ie getters and setters are correct.
However when i run the screens the target field value is not set with the value within the getter of target field.
Could you advice if this is a bug or whether i should be coding this in a different manner. (if it is a bug and you tell me when it is likely to be fixed and any alternative work arounds).
Cheers
AlanAlan,
Not really a bug, but "missing functionality". The problem is that ADF Faces will only refresh a UI Component value from the underlying model binding value when you submit the request with immediate="false", OR when you explicitly call resetValue() on the component.
We have added a new boolean item-level property "Clear/Refresh Item When Depends-On-Item Changes" in the latest build.That property will do the trick for you: it will clear the value and call resetValue on the UI Components of the dependent items, BEFORE the depends-on-item model value is updated. So, in your case, the setter method of your depends-on-item attribute will update your dependent item after JHS cleared the item, and you will see the new value right away because UIComponent.resetValue() was called as well.
Steven Davelaar,
JHeadstart Team. -
hi there,
JDeveloper Studio 11.1.1.5.0.
i have a business object that has 3 element :
id from type int,
name from type string,
family from type string
and also i have a process data object of this business object(PDO)
how can i set values to this process data object from backbean by java code?
Thanks for any helpI am assuming that you have the bindings of the PDO in your padeDefinition file which is for a page referring to this BackingBean.
then you can use code like
ADFUtils.setEL("#{bindings.requestType.inputValue}",<value>);
where setEL is from reusable static class ADFUtils as below
* Sets a value into an EL object. Provides similar functionality to
* the <af:setActionListener> tag, except the from is
* not an EL. You can get similar behavior by using the following...
* setEL(to, evaluateEL(from))
* @param el EL object to assign a value
* @param val Value to assign
public static void setEL(String el, Object val) {
FacesContext facesContext = FacesContext.getCurrentInstance();
ELContext elContext = facesContext.getELContext();
ExpressionFactory expressionFactory =
facesContext.getApplication().getExpressionFactory();
ValueExpression exp =
expressionFactory.createValueExpression(elContext, el,
Object.class);
exp.setValue(elContext, val);
} -
Looping and setting cfset values (from a query)
Stuck on how to get this to work.
How would I go about looping and setting these values instead
of doing them individually?
The query this <cfset> references works fine and will
work but repeats...
<cfset ans1 = (qryGetPcts1.q1Ct / qryGetCounts.qID2) *
100>
<cfset ans2 = (qryGetPcts2.q2Ct / qryGetCounts.qID2) *
100>
<cfset ans3 = (qryGetPcts3.q3Ct / qryGetCounts.qID2) *
100>
<cfset ans4 = (qryGetPcts4.q4Ct / qryGetCounts.qID2) *
100>
<cfset ans5 = (qryGetPcts5.q5Ct / qryGetCounts.qID2) *
100>
So I'd like to loop and set them all instead...
<cfloop index="i" from="1" to="27">
<cfset ans#i# = (qryGetPcts#i#.q#i#Ct /
qryGetCounts.qID2) * 100>
</cfloop>
But it's responding with this...
Invalid CFML construct found on line 196 at column 19.
ColdFusion was looking at the following text:
I'm sure I'm missing something simple b/c this must be
possible? Can I use a cfset in a loop?
Help is appreciatedIn the main everything is in CF is in a struct. Armed with
this information you use array notation to help you.
<cfloop index="iCount" from="1" to="27">
<cfset variables["ans" & iCount] =
(variables["qryGetPcts" & iCount]["q" & iCount & "Ct"]
/ qryGetCounts.qID2) * 100>
</cfloop> -
Setting default values from a configuration file...how_to
Hi,
When we place controls in the front panel VI, there are default values
that we can set during design time. Is it possible to load up a VI and
read those default values from a file? I guess the point is that I want
to be able to store different control settings for different users with
one VI. Maybe possibly use the File I/O VI's to load up default control
values that way. Is it possible?
Thanks,
Steven_Steven Chang wrote:
>Hi,>>When we place controls in the front panel VI, there are default values>that
we can set during design time. Is it possible to load up a VI and>read those
default values from a file? I guess the point is that I want>to be able
to store different control settings for different users with>one VI. Maybe
possibly use the File I/O VI's to load up default control>values that way.
Is it possible?>>Thanks,>Steven>
After trying many various ways of storing configuration data, the way I use
the most is to set up a "configuration global", a global that consists of
basically a single cluster into which I place anything about the application
that I want to configure and store. I usually include the application's path,
DASQ settings, a
nd user preferences. You can then read/write this cluster
anytime during your test session. You can provide user access to specific
portions of the global through a tabbed dialog box and allow multiple records
in your config file which can be accessed at any time. -
Set lookup value from another item
Hi!
I add to my list in SP 2013 new column like type Lookup field and select item from another document library
and display field select "Title". How i can set this filed value for new item from document library item?Hi AllXander,
From your description, my understanding is that you want to set lookup field value with C# CSOM.
You could use method "FieldLookupValue()". Please refer to this code below to set lookup field value when add an new item to a list:
// replace your site URL
using (ClientContext context = new ClientContext("http://sp/sites/sp2013"))
// replace your user, password and domain
context.Credentials = new NetworkCredential("Administrator", "Access1", "contoso");
// the library that you get value for the lookup field
List list = context.Web.Lists.GetByTitle("Department");
context.Load(list);
context.ExecuteQuery();
CamlQuery query = new CamlQuery();
query.ViewXml = "<View/>";
ListItemCollection allContacts = list.GetItems(query);
context.Load(allContacts);
context.ExecuteQuery();
foreach (ListItem item in allContacts)
// replace the id that you want to set value to the lookup filed
if (item.Id == 1)
// replace the list title with your list that you want to add the item
List oList = context.Web.Lists.GetByTitle("Employee");
ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
ListItem oListItem = oList.AddItem(itemCreateInfo);
oListItem["Title"] = "My New Item!";
// set the lookup field value
FieldLookupValue lookup = new FieldLookupValue();
lookup.LookupId = item.Id;
oListItem["Department"] = lookup;
oListItem.Update();
context.ExecuteQuery();
You could refer to this article about creating/updating/deleting a new item with C# CSOM:
http://www.c-sharpcorner.com/UploadFile/sagarp/create-update-delete-a-list-using-client-object-model-cso/
You could refer to this article about updating multi-value lookup column:
https://sunbin0704.wordpress.com/2013/10/11/update-multi-value-lookup-column-values-in-sharepoint-2010-using-managed-csom/
Best Regards,
Vincent Han
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]. -
Want to set messageStyledText value from LOV (In a table)
Hi,
I want to set values in non editable fields. These values are being stored in database table (DML operations can be performed on the table).
The values for these fields is coming from a LOV and setting properly in the fields.
But on next click(i.e. by clicking any LOV or any button on the page) the values are disappearing from the page. Instead of using non editable fields, if editable fields are used (messageTextInput) then the values is staying on next click.
I have tried with messageStyledText, messageTextInput by making the fields readonly & disabled but in all the cases the result is same.
Thanks,
Arindam.Hi Bhowmick,
I had a similar problem, solve it with the following workaround:
- set the field read only property to true.
- add a controller to region page that contains the field and modify processFormRequest as follows:
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
String itemValue= pageContext.getParameter("itemID");
if(itemValue!= null && !itemValue.equals(""))
pageContext.putTransactionTransientValue("dummyParameter", itemValue);
OAMessageTextInputBean mti = (OAMessageTextInputBean)webBean.findChildRecursive("itemID");
mti.setValue(pageContext,pageContext.getTransactionTransientValue("dummyParameter"));
Regards,
Carlos C. -
Help needed in setting form values
I have following fields in the form
Radio boxes - Grant and Deny
Text Area - User comments
Buttons - Submit Cancel
I want the user comments field 'Required' only when we select 'Deny' option
For Grant- it should not be required.
If we select Deny option and click on Submit, it should say - Missing Value in the required field - User Comments.
Please guide.I added a validation on Subit button as -
If user commets are null and deny is selected - give error message..
It worked. -
Set Form Value and Submit Via Applet
Hi Friends,
suppose you have a form such as:
<form action="submit.jsp" method="post" name = emailForm>
<input type="text" name="emailField" size = 43>
</form>And an applet appears on the same JSP page that the form resides.
This applet is a simple one that takes email addresses and validates them and on clicking on a button labelled submit, the applet is to set the text field of the form to the email address provided and then submit the form. How can I achieve this?
Thanks and regards.Check out http://www.codeproject.com/jscript/javatojs.asp
You could use something like MainWin.eval("document.emailForm.submit");
Maybe you are looking for
-
I am trying to delete one entry in forms data by highlighting and deleting it but it is not working. Thank
-
When I try to restor my ipad mini I get the error message "Te ipad software update server could not be contacted. You do not have enough access privleges for this operation." Please help!!
-
Firefox won't recognize latest update HP simple pass
I have tried everything and about just to say the heck with it and go back to IE9. But, I will ask. WHY does Firefox refuse to recognize the latest upgrade to HP simple pass (Egistech) that is loaded onto my computer. It keeps saying the current 5.0
-
Create controls inside a container?
So I am now creating a checkbox at runtime with the following code: import mx.controls.CheckBox; createClassObject( CheckBox, "button2", 5, { label:"Test Checkbox" } ); Is there a way to create a button inside another object like a ScrollPane (or som
-
Where has my BT-Yahoo Email gone?
I know it's all changing over to BT-Mail soon, but the other day I tried to log into my BT-Yahoo email only to be greeted with this message: Sorry There isn't a BT Yahoo! Mail service associated with the username/email address you've entered. But whe