Set the value of a non database field in forms
hai friends ,
Have been struggling a lot with the problem now . Could anyone suggest me how to go about it.
I want to set the value of a field in a form . I know the function set_value and set_value_as_(data type ) does the work . But then is there any constraint on the position where it is called.
My requirement is on querying a form the data from the tables mut be populated( which the portal handles) and I want to populate the non database bound fields with certain values.
Could any one help me out with this ..
null
I need to set value to one of the object attributes if that attribute is blank.This is some kind of a default value that you want, then? If so then just take care of that when you output it. Use <c:if>, and if the attribute is blank then output the default value, otherwise output the attribute.
Or have the servlet that created that request attribute take care of that requirement.
Similar Messages
-
Passing url parameter values to a non database field
Hi,
How do I pass values from the url to a non database field ?
The following works for a database field:
http://host:7777/pls/portal/PORTAL.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=1892460035&p_arg_names=_show_header&p_arg_values=YES&p_arg_names=deptno&p_arg_values=20
but if I use the same for a non database field item20 it doesn't do anything.
http://host:7777/pls/portal/PORTAL.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=1892460035&p_arg_names=_show_header&p_arg_values=YES&p_arg_names=item20&p_arg_values=2003
Thanks,
Sonal.Hi,
Are you trying to query on this field? It wont work because only database fields can be queried on.
Thanks,
Sharmila -
Update of non-database fields mapped to database fields
I have two columns start month and start year which
are non-database columns and which map to one database
field start date in the database.
I have a post-query trigger on the start month and
start year fields to derive the value from the
database field start date when the form is queried.
When I try to update the form, the update does not
work - if I remove the post-query trigger then the
update works but, the month and year non-database
fields do not get queried.
Any help will be greatly appreciated.
Thanks,
Suzannesince those 2 fields are not connected to the database field you need to code the update to the database.
Use the pre-insert trigger and set the value of the date item according to the values of the 2 fields. -
How to set the value to non enabled UDF fields
Dear All,
I created a UDF at titile level of PO and that UDF item always disabled (i.e oItem.Enabled=false). Now how can set a value through coding.
I wrote like this:
oForm = SBO_Application.Forms.GetFormByTypeAndCount(-142, 1);
oItem = oForm.Items.Item("U_Poap");
if (oItem.Enabled == false) { oItem.Enabled = true; }
oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
oEdit.Value = "1";
oItem.Enabled = false;
But system throws an error at : oItem.Enabled=true statement.
How to solve issue.
Thanks in advance
Suresh YerraHi,
You can set the values using datasource object
oDBs_Head = objForm.DataSources.DBDataSources.Item("@TableName")
oDBs_Head.SetValue("U_FieldName", 0, "Value")
regards:
SANDY
Sandeep Saini | Roorkee | India on Dec 26, 2008 11:01 AM -
How do I get a value from a portal form for a non database field ? HELP!!
I have a form based off of a table that I added a field to. The form is to allow the user to change abbreviation for a
department field ie. BIO to BIOL. for a biology department. I have a pl/sql procedure for validation using the custom option
on the update button to verify the user and update the data. I have tested to code at the sql prompt and it works.
They only difference between the prompt and the form is the non-database field new_dept_abbr was added to the
form. I don't know how to capture the value of the user input into a variable that can be used in the pl/sql.
Any help would be appreciated.
I have tried this approach
v_new_dept_abbr := p_session.get_value_as_varchar2(
p_block_name => 'default',
p_attribute_name => 'new_dept_abbr'
have tried using p_attribute_name as 'a_new_dept_abbr' but this does work and does not exist in the body of the form.
Have also tried setting the p_block_name to _session - still doesn't work.
Any ideas??
Thanks
Debbie BrennanThanks for the info. I tried that and it still doesn't pull the value. I have opened a TAR via metalink, but I'm not getting any
satisfactory answers. I ran across an note - 137172.1 that has this snippet of information in it.
Unfortunately, at this time (portal 3.0.7.6.2) , a non-table item cannot be
referenced in a plsql event handler, only in client side JavaScript code. This
is a known limitation and will be fixed in a future release.
I don't know how to get the value from the client side JavaScript code to a pl/sql variable. Do you?
I've been trying to get them to tell me if the 'known issue' has been addressed in 3.0.9.
I'll keep at it. Thanks so much for your suggestion I appreciate it.
Deb -
Using Auto Suggest To Set The Value Of Multipe Form Fields
I would like to use the Spry 1.5 Preview Auto Suggest widget
to provide the value for multiple form fields based on the row the
user selects in the auto suggestion data set. I've placed an
example of what I want to do here:
http://www.brucephillips.name/spry/Spry_P1_5_Preview/autosuggest/autosuggestMultipleFields .cfm
It appears that when the user clicks on one of the rows in
the auto suggestion data set, the current row for the data set is
not updated but remains the default (first row in the data set).
Therefore, if you have a spry:detailregion that uses that data set,
the values for that detail region are from the first row in the
data set and not the row the user selected.
Is it possible to set the current row of the auto suggest
data set to the row the user clicked on in the auto suggestion data
set so that the spry:detailregion will have the values from the row
the user clicked on?
I had previously modified the Spry 1.4 Auto Suggest widget to
do this. See:
http://www.brucephillips.name/blog/index.cfm/2006/11/6/Modifing-Sprys-Auto-Suggest-Widget- to-Bind-Users-Selection-to-A-Form
Thank you for any assistance.Cristian: thank you for the reply. I understand your concern
about the user changing the auto suggest field after updating the
complimentary fields. I think that could be handled through user
instruction. Additionally, instead of using form fields to hold the
complimentary data I could use non-editable paragraphs.
I hope the change is not too difficult. I think this
modification would make the auto suggest widget even more useful.
For example think about a product auto suggest. User starts to type
in the name of the product, selects the full product name from the
auto suggestions, and now the page can immediately show in a
spry:detailregion all the product details.
Thanks again for considering my request. I really appreciate
all the work the Spry team is doing. I'm looking forward to the
official release of Spry. -
How do I set the value of a dynamic row text field
I have a repeated row form which contains a button and multiple text fields. There is a text field (Input Data Field) further up with some information I want to place in the table and multiple buttons that I want to read the value of and set to the table. I apologize there are multiple questions I have and I am using pseudocode to describe it.
Top form looks like
InputField
| ButtonX1 | ButtonY1 | DescriptionX1 (read only Text Field)
| ButtonXn | ButtonY1 | DescriptionXn
OutputRow looks like
| ButtonOutput | OutputField1 | OutputField2 | OutputField3 |
So I would like it to do
ButtonX1.click
OutputTable.OutputRow.addInstance(true) //this works - everything else I have questions on
OutputTable.OutputRow.OutputField1.rawValue = DescriptionX1.rawValue
Question 1
How do I address the location in each table to set a value
Question 2
How do I get the value of the description field in the same table and row as the button
I would like to say something to the effect of OutputTable.OutputRow[??].OutputField1.rawValue = this.parent.DescriptionX
OutputTable.OutputRow.OutputField2 = InputField.rawValue
Same question as above - how do I specify a dynamic row - is this the proper syntax for getting the value from the input field?
OutputTable.OutputRow.OutputField3 = this.ButtonLabel
Question 3
How can I get the value of the button's label to set in the field
There should be very many of these buttons and buttons will be added - I would prefer to set the value based on the button's label to make the value easier - not requiring changing the code
Question 4 - unrelated to those above.
Is it possible to build the first table
| ButtonX | ButtonY | Description |
from an XML File. I have seen examples of how to build if it is just data, but can the XML be pushed into a form with code to do the above actions?Each object in a form must have a unique name. I doing so it is not neccessarily the name but the path or SomExpression associated with that object that must be unique. In your case you have a Table.Row.object configuration. The Row is the part that is repeating so to give each object a unique name an instance number is placed on the repeating part. So objects in the 1st row woudl be Table.Row[0].object...objects in the second row woudl be Table.Row[1].object etc .....You can see this by adding a debug instruction on the Enter event of the description field. Put the code app.alert(this.somExpression) and when you enter the field you will see what the somExpression is. Do this for a few rows and you will see the pattern (don't forget to remove the debug code from the enter event). Now you know what you have to use to address the fields. If no instance is given it is assumed to be 0 ..that is why only the 1st row is being affected.
So now to answer your questions:
Question1: The square bracket notation is an issue for javascript (this is the notation for an array) so we have to use a different means of addressing the field to include the instance number. So to address the Description in the 3rd row we woudl use:
xfa.resolveNode("Table.Row[2].Description").rawValue = "This is my new description";
Note that the instance number is 2 for the 3rd row because the instance numbers are 0 based.
Question2. The resolveNode notation allows you to pass a string so you can also concatinate expressions to make the string. If you are writing code on a button in the same row you can get the instance that you are on by using the expression this.parent.index. The "this" portion refers to the current object (the button) and the parent.index gets you th eindex of the Buttons parent. If the button is embedded deeper in a hierarchy then you can continue to add parent indicators until you get back to the node that you want. So rewriting your expression from Q1 it woudl be:
xfa.resolveNode("Table.Row[" + this.parent.index + "].Description").rawValue = "This is my new description";
Question3: The buttons caption can be retrieved by using ButtonName.caption.value.text.value
Question4: When you say build from an XML file. What are you expecting to come from the XML file? The caption that goes on the button? Typically the XML file carries data (not to say that it cannot carry other things). Just need a bit of clarification on this one first.
Hope that helps
Paul -
How do you set the system MESSAGE_ID to an XML field value?
Hi experts,
I need to set the value of the system MESSAGE_ID to a field that an external company will send in the XML file. What I could gather thus far is that it should look something like this:
//externalRef and container are passed as parameters:
GlobalContainer globalContainer;
String headerField;
java.util.Map map;
globalContainer = container.getGlobalContainer();
globalContainer.setParameter("MessageId", externalRef);
map = globalContainer.getParameters();
headerField = (String) map.get(StreamTransformationConstants.MESSAGE_ID);
return headerField;
The problem is the setParameter() function - not sure how it is supposed to work. The GETting of the MessageId works though but I need to SET it while mapping the file. Any ideas?use the sample code as provided in the link - http://help.sap.com/saphelp_nw04/helpdata/EN/78/b4ea10263c404599ec6edabf59aa6c/frameset.htm
in your case it will be MESSAGE_ID - http://help.sap.com/saphelp_nw04/helpdata/EN/b3/9a2aeb24dc4ab6b1855c99157529e4/frameset.htm -
Setting the value of a field based on a dropdown list
I am using the latest production release of JHeadstart 10.1.3.0.91. I am trying to set the value of a field based on selecting the value of another field (drop down list). The drop down list field has the following attributes set autoSubmit="true" immediate="true" valueChangeListener="#{jhsPageLifecycle.updateModelValue}".
The other field has the partialtrigger set to the first field. ie "depends on" selection from JHeadStart file. The value of the second field is set in the setter of the VO RowImpl java file.
The value of that field is only populated on the screen if it is set to disabled="true". This seems a bit bizzare behaviour. Can you explain why it cannot set the value of the field when it is not disabled.Worked out that if i set the "Clear/Refresh value" attribute on the field that i want updated then it will work ok
Alan -
How to set the values to a field?
I have created a page which is used to create the records by using "Add Another Row" button.
If i click on "Add Another Row",a blank row will be created.
The requirement is,after clicking the "Add Another Row" , a default value should be set to one of the fields of the blank row.
Can anybody help me !!!!.
Thanks,
SrinivasIn processFormRequest write the below code
if("addRows".equals(eventName) && "<AdvancedTabldID>".equals(pageContext.getParameter("source"))){
am.invokeMethod("populateValues");
In AMImpl write the below code:
public void populateValues(){
XyzVOImpl vo = getXyzVO();
XyzVORowImpl row = (XyzVORowImpl ) vo.first();
while ( row != null )
if( identify the new ly added row here using some unique id or someother condition etc..)
row.setFieldxyzvalue("set the value here");
row = (XyzVORowImpl ) vo.next();
} -
How do I set (or auto populate) the value of a modal dialog field using javascript?
I have a Modal Dialog on my SharePoint 2010 page the following fields: Your Name, Subject, Priority, Message.
It links to a list I have on the site. The second field, Subject, I want to auto populate it when the window opens, so the user can leave it as is or modify the subject. I want to set the field value using javascript.
I've tried setting the field with this code:
document.getElementById('Subject').value = "Test";
and also, this:
setFieldValue('Subject','My custom value');
Neither work.
How do I set the value of the subject field when the user first opens the dialog using javascript?
Please help.I am sure, you are looking at default field value of a list column(single line) in a modal window, if so please try below code
<script src="https://code.jquery.com/jquery-2.1.0.min.js" type="text/javascript" abp="397"></script><script type="text/javascript" abp="398">
$(document).ready(function(){
$('input[name*="Subject"]').val("Test");
</script>
Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply. -
Setting the value of a single attribute for multiple line items
Hi all,
I am working on a Web Dynpro application, I have created this applicaion for an accounting document so it has header data and multiple line item data. As per the requirement I have to put the following logic:
1. When a user enters a value in the field KBLNR on the line item, all the other fields like cost centerm fund, functional area should populate from a database table based on the value of the KBLNR. to get this I have put the following code:
TYPES: BEGIN OF t_kblp,
fipos TYPE kblp-fipos,
kostl TYPE kostl,
END OF t_kblp.
DATA lv_kblnr TYPE wd_this->element_t_bseg-kblnr.
DATA: lt_kblp TYPE STANDARD TABLE OF t_kblp,
wa_kblp LIKE LINE OF lt_kblp,
lt_bseg TYPE STANDARD TABLE OF bseg,
wa_bseg TYPE bseg.
DATA lo_nd_t_bseg TYPE REF TO if_wd_context_node.
DATA lo_el_t_bseg TYPE REF TO if_wd_context_element.
DATA: ls_t_bseg TYPE wd_this->element_t_bseg,
lo_api_controller TYPE REF TO if_wd_controller,
lo_message_manager TYPE REF TO if_wd_message_manager,
lo_nd_tbseg TYPE REF TO if_wd_context_node,
lo_el_tbseg TYPE REF TO if_wd_context_element,
lt_el_tbseg TYPE wdr_context_element_set,
lv_bseg TYPE bseg.
lo_nd_t_bseg = wd_context->path_get_node( path = `ZDATA.CHANGING.T_BSEG` ).
lo_api_controller ?= wd_this->wd_get_api( ).
CALL METHOD lo_api_controller->get_message_manager
RECEIVING
message_manager = lo_message_manager.
lo_nd_tbseg = wd_context->path_get_node( path = `ZDATA.CHANGING.T_BSEG` ).
lt_el_tbseg = lo_nd_tbseg->get_elements( ).
LOOP AT lt_el_tbseg INTO lo_el_tbseg.
lo_el_tbseg->get_static_attributes(
IMPORTING static_attributes = lv_bseg ).
IF lv_bseg-kblnr NE ' '.
SELECT belnr
fipos
kostl
PSPNR
geber
saknr
fkber
grant_nbr
gsber
FROM kblp
inTO corresponding fields of wa_kblp
WHERE belnr = lv_bseg-kblnr and
saknr = lv_bseg-saknr.
ENDSELECT.
lo_nd_t_bseg = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG` ).
* get element via lead selection
lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
lo_el_tbseg->set_static_attributes(
EXPORTING static_attributes = wa_kblp ).
CLEAR: lv_bseg, wa_kblp.
ENDLOOP.
everything is working fine but now the problem is couple of fields that I have in wa_kblp are with different names in bseg table and hence they are not updating... I tried putting the following logic within the loop :
lo_el_t_bseg->set_attribute(
name = `PROJK`
value = wa_kblp-pspnr ).
but it's only setting the value of the first line item and not working for the multiple line items, can you please tell me how can do this?
Thanks,
Rajat Garg
Edited by: rajatg on Jun 24, 2011 5:09 PMHi Chris,
I tried your code and it worked fine but after I put this code I am getting another issue. within the loop I had a code to make the fields non modifiable on the screen and was working fine but now what's happening is it's making the all the lines uneditable except the one with data on it (which is completely opposite), this is what I have coded:
LOOP AT lt_el_tbseg INTO lo_el_tbseg.
lo_el_tbseg->get_static_attributes(
IMPORTING static_attributes = lv_bseg ).
IF lv_bseg-kblnr NE ' '.
SELECT belnr
fipos
kostl
PSPNR
geber
saknr
fkber
grant_nbr
gsber
FROM kblp
inTO corresponding fields of wa_kblp
WHERE belnr = lv_bseg-kblnr and
saknr = lv_bseg-saknr.
ENDSELECT.
move: wa_kblp-belnr to wa_bseg-kblnr,
wa_kblp-fipos to wa_bseg-fipos,
wa_kblp-kostl to wa_bseg-kostl,
wa_kblp-pspnr to wa_bseg-projk,
wa_kblp-geber to wa_bseg-geber,
wa_kblp-saknr to wa_bseg-saknr,
wa_kblp-fkber to wa_bseg-fkber,
wa_kblp-grant_nbr to wa_bseg-grant_nbr,
wa_kblp-gsber to wa_bseg-gsber,
lv_bseg-dmbtr to wa_bseg-dmbtr.
append wa_bseg to lt_bseg.
lo_nd_edit_property = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG.EDIT_PROPERTY` ).
get element via lead selection
lo_el_edit_property = lo_nd_edit_property->get_element( ).
lo_el_edit_property->set_attribute(
name = `EDIT_FIELD`
value = 'ABAP_TRUE' ).
lo_el_edit_property->set_attribute(
name = `EDIT_WBS`
value = 'ABAP_TRUE' ).
endif.
endloop.
o_nd_t_bseg = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG` ).
get element via lead selection
lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
CALL METHOD lo_nd_t_bseg->bind_table
EXPORTING
new_items = lt_bseg.
Can you please see what I am doing it wrong here.... -
Xml file, non database field etc..
Hi,
There is a requirement for putting a non database field in an
infobus grid control and populating it with some value at the
runtime. As this is not directly available in gridcontrol, many
have tried using a join query as I could see from the
postings.(Like select deptcode,desc from emp, dept where
emp.deptcode = dept.deptcode). This works well when the data is
queried from the database. But when a new deptcode is entered, it
is not possible to get the corrosponding value from the database
and show it on this field, as u get readonly attribute error.
Even if u explicitly change the attribute to updateable the error
will remain as such.
The cause of this problem, I have tracked down to the xml file.
The entity for the updateable table (in this case EMP) does not
have the attribute for deptdesc. If this is manually added, it is
possible to add values to the deptdesc column. The catch is when
inserting a row to the database. All the attributes in the
entity
will appear in the insert statement and u end up with an invalid
column name error for the deptdesc column.
Seeing this consistant behaviour, I assume that the insert
statement is created by parsing the xml file. Had there been an
attribute value in the xml file for insert into database (just
like IsNotNull etc.. perhaps IsUpdateable which can be set
manually), while parsing this attribute can be removed.
To do this I would like to know where this xml parser is
implemented in jdev. Is it possible for me to change its
behaviour or can I expect to get a patch for this? This
functionaliy is very much essential for me, as I am in the middle
of a very large project using jdev2.0. I don't mind implementing
it, if the source is available.
Any helpful suggestions, comments are welcome. Sorry for the long
post and thanks
--Gopal
nullI don't think it will work with a non-db-item. But you could create a separate block based on your image_tb-table, use read_image_file on the then db-based-column and then simpy issue a commit_form.
-
Insert Image to table from a Non Database Field
Hallo,
db- 9i EE R2
forms - 6i R2
OS - W2003
I have a requirement to upload Images to the database from forms.
I planned to keep the transaction data and the Images separately in different tables with a reference.
So, I created the Image field (BLOB) with a Non Database Field in the Form and use a button to upload the Image. (using READ_IMAGE_FILE).
I tried to insert the Image to the Actual Image table in PRE-INSERT Trigger at block level.
But I was not able to Insert the using reference method. (Cannot compile the PRE-INSERT)
INSERT INTO IMAGE_TB (ID,IMAGE)
VALUES (IMAGE_SEQ.NEXTVAL, :ITINERARY_MAP.IMAGE);
So, Please help me to insert a image to different table from a Non Database Field?
ThanksI don't think it will work with a non-db-item. But you could create a separate block based on your image_tb-table, use read_image_file on the then db-based-column and then simpy issue a commit_form.
-
HOW to set the value attribute of FORM INPUT data to a variable in a JSP
eg. Registration.jsp
The data is accessed from an hidden field called course
for example, if I have "Java programming" in the field course, and I use
an expression to access the value from the hidden field.
**My problem is that the data gets truncated to "Java" , I need "Java Programming"to display. The code looks like this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<INPUT TYPE="text" SIZE=12 NAME="course"
VALUE=<%=getParameter("course") %>
IS there ANY OTHER WAY to set the value of VALUE to a variable?Instead of value=<%=request.getParameter("course")%>
Use double codes
value="<%=request.getParameter("course")%>"
Maybe you are looking for
-
How to hide % measure column Grand Total value in Pivot View in obiee 11g?
Hi , I am facing a issue in obiee 11g .I am using a Pivot table to display the grand total of 3 metric columns eg: A , B, C out of which B is percentage so I need to remove the grand total value of the percentage column. We have to stick to Pivot V
-
Problem processing JSP document
Hi, I'm new to JSP and got such a problem: I have the following JSP document named JSPdoc.jspx <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> <jsp:text> <html> <head> <title> Simple JSP Document </title> </head>
-
Hi I've install Oracle on Redhat Linux 4 every thing i seems it's working fine but when I'm trying to connect to oracle on my laptop I'm able to get to the login page to when i login it return with PAGE CANNOT BE DISPLAYED I'm not sure if it's Oracle
-
Whenever I use the Adobe Elements 10 Organizer to make a greeting card, a message pops up saying, "Valid size not available for this creation". This happens no matter what type of photo I'm trying to use.
-
How can I sort the Firefox Tools menu dropdown list alphabetically?
The Tools menu has a dropdown list, but entries are not in alphabetical order. Options and some individual add-ons/extensions show up in the list, but not alphabetically. It would be helpful to have them in alphabetical order in the list, however, I