NullPointerException getting attribute value
Hi friends,
Apps R12.
In Projects Setup screen , I've extended both CO and AM (TabSetupLayoutCo and TabSetupAMImpl) to xxTbSetupLayoutCO and xxTabSetupAMImpl.
In the page, there's a VO (visible for the AM) that contains Project Information: ProjectBasicInfoVO.
In the AM , I want to get the value of attribute ProjectStatusCode (It's in ProjectBasicInfoVO)
So I do:
(myprocedure is called from CO)
public String myprocedure(){
ProjectBasicInfoVOImpl projectbasicinfovoimpl = (ProjectBasicInfoVOImpl) findViewObject("ProjectBasicInfoVO");
ProjectBasicInfoVORowImpl projectrow = (ProjectBasicInfoVORowImpl)projectbasicinfovoimpl.getCurrentRow(); //this works, it shows current Project previously searched
String pProjectStatusCode;
pProjectStatusCode = projectrow.getProjectStatusCode(); // <<--------- THIS DOES NOT WORK . Line 45 of xxTabSetupAMImpl
Error that appears is :
java.lang.NullPointerException
* at mycomp.oracle.apps.pa.setup.server.xxTabSetupAMImpl.rendersubmitprocedure(xxTabSetupAMImpl.java:45)*
getProjectStatusCode exists in xxProjectBasicInfoVORowImpl
public String getProjectStatusCode() {
return (String) getAttributeInternal("ProjectStatusCode");
And attribute ProjectStatusCode exists in the VO
So.. how could I get this info?
Thanks for any help
Regards,
Jose.
Hi John,
How to enable log in R12?Since there is no Jserv as in 11i, there is no more dependency on jserv.properties file for enabling of log.Here are the details how to enable log on R12:
In R12,
Goto $ORA_CONFIG_HOME/10.1.3/opmn/conf
take the backup of opmn.xml
edit opmn.xml for data id="java-options" and add the following:
-DAFLOG_ENABLED=true -DAFLOG_LEVEL=statement
-DAFLOG_MODULE=fnd%
-DAFLOG_FILENAME=/tmp/aflog.txt -Djbo.debugoutput=console
The log message should get written in,
$INST_TOP/logs/ora/10.1.3/opmn/oacore_default_group_1/oacorestd.out
Please refer to http://mukx.blogspot.com/
Thanks
--Anil
Similar Messages
-
How to get attribute value from standard page ?
Hi,
How to get attribute value from standard page ?
String str = (String)vo.getCurrentRow().getAttrbute("RunId");
But this value is returning a null value ....
Can anyone help me to get this attribute value which is actually having a actual value .getCurrentRow() would always return null if no setCurrentRow() is used.
Please check the page design and understand how many rows of VO are there. You can also use the following to get the row:
vo.reset();
vo.next();
Regards
Sumit -
Not getting attribute values in IPC routines Scenerio R/3 B2B using AP 7.0
Hi,
Our Scenerio is using ISA R/3 B2B using AP 7.0. I have developed IPC routines but when i debug my routines in SM53 I notice that I'm not getting any attribute value except for VKORG.
I'm pasting the code below. Please help me if I have to implement some BADI or do something more to get the attribute values.
I have defined the attributes properly in Routine assignment in tcode /n/sapcnd/ueass
userexitlogger.writeLogDebug("*requirment 901*" + "Plant = "plant"||ANZ_MONATE ="+ item.getAttributeValue(ANZ_MONATE_STR).toString()"||ANZ_JAHRE="item.getAttributeValue(ANZ_JAHRE_STR).toString()"||MATKL="item.getAttributeValue(MATKL_STR).toString()"||PSTYV="item.getAttributeValue(PSTYV_STR).toString()"||VKORG="item.getAttributeValue(VKORG_STR)"||PRSFD="item.getAttributeValue(PRSFD_STR)"||MVGR2="item.getAttributeValue(MVGR2_STR).toString()"||PRSDT="item.getAttributeValue(PRSDT_STR).toString()"||AUDAT="item.getAttributeValue(AUDAT_STR).toString());
I would reward points for help
Many Thanks n regards,
DipenderI would like to go through each Value of the xml file and give each Value a name
e.g. from the xml file <VentCount Value=1> Retreive the value above and giving it the name VentCount. Then I would beable to use the name vent count as follows:
setVentCount() //My own method can use as follows: setVentCount(VentCount); I would like to do his for ever value, each value with a specific name -
How to get attribute value from an object inside an object in Xpress
Does anyone know how to get an attribute value from an object in Xpress in a workflow? I have an object structured as follows:
<ResourceInfo accountId='mj628' tempId='3483372b787ce7dd:-5d99a0c5:130cb238483:-3600'>
<ObjectRef type='Resource' name='Google Apps'/>
</ResourceInfo>
I need if possible to get the name='Google Apps', which is inside the ObjectRef, so I guess its an attribute value of an object inside an object.If the ResourceInfo object is accessible in a variable, i.e. named "myResInfo", you just have to check the Java API and call the relevant method:
<invoke name='getResourceName'>
<ref>myResInfo</ref>
</invoke> -
How to get attribute values from one view to another
HI all,
Thx in Advance..
I have 2 view like v1,v2.In v1 i used one attribute values from "get single attribute" method.And i need the same values in v2 screen.For this i did in v1 outbound plugs , i mentioned the parameter name . How can i get the same values in v2.Hi chandru ,
you said you declare the parameters in the Outbound Plug of V1. now go to view V2 inbound plug Tab and creat one inbound plug
double click on the plug name .it will navigate you to the event handeler method . Now add the outbound parameter variables in the
parameters
For example : V1firing the navigation plug
a type string " defined in parameter
wd_this->fire_out_to_view2_plg(
a = 'ABCD' " string
you can retrive the value freely in v2 inbound event handeler
a type string " defined in parameter
* set single attribute
lo_el_context->set_attribute(
name = `TEXT`
value = a )." here you will get the 'ABCD'.
regards
Chinnaiya P
Edited by: chinnaiya pandiyan on Jun 23, 2010 7:12 PM -
How to get attribute value of a node
Hi experts
I have a mapped node in my view context from component controller context. This node consists of 2 value attributes inside
Example:
NODE1 -
> Cardinality 1..1, seleciton 1..1
-- x_date -
> type DATS
-- x_years -
> dec3
How do I get the attribute value attr1 and attr2 ??
Here is my code in my view method
DATA: lr_node_info TYPE REF TO if_wd_context_node_info,
l_date TYPE dats,
l_xyears TYPE i.
lr_node_info = wd_context->get_node_info( ).
lr_node_info = lr_node_info->get_child_node('NODE1').
l_date = lr_node_info->get_attribute( name = 'X_DATE' ).
l_xyears = lr_node_info->get_attribute( name = 'X_YEARS' ).
It does not seems to work since it says < the result type of the function method can not be converted into the result type L_DATE>
I try to understand why but not sucessful, please help and thank you for your kindnessHi Dean,
Regading uour problem of reading the attributes value of the context node, you have to use the code wizard. that ia avaliable on the top toolbar when you are inside the View Method
There is option to read context select that radio button option and then thru F4 help
if you can select the node then Code is automatically generated with variable declaration.!!
Like this :
DATA lo_nd_node1 TYPE REF TO if_wd_context_node.
DATA lo_el_node1 TYPE REF TO if_wd_context_element.
DATA ls_node1 TYPE wd_this->element_node1.
DATA lv_x_date LIKE ls_node1-x_date.
DATA lv_x_year LIKE ls_node1-x_year.
navigate from <CONTEXT> to <NODE1> via lead selection
lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).
get element via lead selection
lo_el_node1 = lo_nd_node1->get_element( ).
get all declared attributes
lo_el_node1->get_static_attributes(
IMPORTING
static_attributes = ls_node1 ).
lv_x_date = ls_node1-x_date.
lv_x_date = ls_noe1-x_year.
if you can select the attribute then Code is automatically generated with variable declaration.!!
DATA lo_nd_node1 TYPE REF TO if_wd_context_node.
DATA lo_el_node1 TYPE REF TO if_wd_context_element.
DATA ls_node1 TYPE wd_this->element_node1.
DATA lv_x_date LIKE ls_node1-x_date.
navigate from <CONTEXT> to <NODE1> via lead selection
lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).
get element via lead selection
lo_el_node1 = lo_nd_node1->get_element( ).
get single attribute
lo_el_node1->get_attribute(
EXPORTING
name = `X_DATE`
IMPORTING
value = lv_x_date ).
Hopes this will helps you.
Regard
Manoj Kumar -
JAXB: not able to get Attribute value
Hi there,
I am using oracle JAXB for XML processing. I am not able to get the value of an attribute. I ran the same code in SUN JWSDP 1.3, which worked correctly. I am not able to get the "foo" attribute for <Table> element using oracle JAXB.
The XML schema follows:
<?xml version='1.0' encoding='UTF-8' ?>
<schema targetNamespace="http://www.oracle.com/iAS/aggregator"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:ag="http://www.oracle.com/iAS/aggregator"
xmlns="http://www.w3.org/2001/XMLSchema"
jaxb:version="1.0"
elementFormDefault="qualified">
<annotation>
<appinfo>
<jaxb:globalBindings fixedAttributeAsConstantProperty="true"
/>
<jaxb:schemaBindings>
<jaxb:package name="oracle.dms.aggregator.adml"/>
</jaxb:schemaBindings>
</appinfo>
</annotation>
<complexType name="Adml_T">
<sequence>
<element name="Table" type="ag:Table_T" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="Version" type="token" fixed="10.1.3"/>
</complexType> <!-- Adml -->
<complexType name="Table_T">
<attribute name="foo" type="Name"/>
</complexType> <!-- Table -->
<element name="Adml" type="ag:Adml_T"/>
</schema>
The XML file is:
<?xml version='1.0' encoding='UTF-8' ?>
<Adml xmlns="http://www.oracle.com/iAS/aggregator">
<Table foo="foosailor">
</Table>
</Adml>
The java file is:
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import java.io.File;
import java.util.List;
import java.util.Iterator;
import oracle.dms.aggregator.adml.Adml;
import oracle.dms.aggregator.adml.TableT;
public class JaxbQA
public static void main (String[] args)
throws Exception
Adml adml;
String fileName = "aggregator.xml";
String instancePath = "oracle.dms.aggregator.adml";
JAXBContext jc = JAXBContext.newInstance(instancePath);
Unmarshaller u = jc.createUnmarshaller();
u.setValidating(true);
Object obj = u.unmarshal(new File(fileName));
adml = (Adml)obj;
List tables = adml.getTable();
for (Iterator iter = tables.iterator();
iter.hasNext();)
TableT admlTable = (TableT)iter.next();
String name = admlTable.getFoo();
System.err.println("table foo=" + name);
c:\oracle\jdk\bin\java.exe -classpath .;c:\oracle\xdk\lib\xmlparserv2.jar;c:\oracle\xdk\lib\xml.jar JaxbQA
table foo=nullI tested in both 10.1.0.2.0 and 10.1.0.3, which both showed the same problem. A bug #3621204 has been filed.
-
Problem when getting attribute value.. pls respnd
Hi friends,
I have a table with one field drop down. I created a node and subnode(for dropdown, and assinged a supplyfunction), and binded the table.
When WDA loads, the data is populating correctly.
When i click ADD new ROW, i am reading the current(row of table) values and storing in a table.
to read dropdown, im using the below code:
node_serv_prod = wd_context->get_child_node( name = wd_this->wdctx_serv_prod ).(main node)
node_prod = node_serv_prod->get_child_node( name = wd_this->wdctx_prod ).(subnode).
node_prod->get_static_attributes(
EXPORTING
index = prev_line
IMPORTING
static_attributes = stru_prod )
WHen the control goes to get_static_attribute, and when i hit F5 in debuggin, it is going to supplyfunction of subnode dropdown. which i dont want. because it is not giving the current row's value of drop down.
Basically i want to read the current row's drop down value, when i click add new row button.
Kindly pls tell me how can i do this.
pls respnd.
thanks in advance.. friends
Niraja.Hi Niraja,
Am not clear as to why you have created a subnode just for populating some values for your dropdown. You could have just created a normal attribute under the same node which you are binding to your table. You could have then typed this attribute with a domain having your desired values as its fixed values or else you could have coded within the WDDOINIT method like something shown below:
data: lr_node_info type ref to if_wd_context_node_info,
wa_value_set type wdr_context_attr_value,
lt_value_set type table of wdr_context_attr_value.
lr_node = wd_context->get_child_node( name = 'NODE' ).
lr_node_info = lr_node->get_node_info( ).
wa_value_set-value = '1'.
wa_value_set-text = 'One'.
insert wa_value_set into table lt_value_set.
wa_value_set-value = '2'.
wa_value_set-text = 'Two'.
insert wa_value_set into table lt_value_set.
wa_value_set-value = '3'.
wa_value_set-text = 'Three'.
insert wa_value_set into table lt_value_set.
lr_node_info->set_attribute_value_set( name = 'TEMP'
value_set = lt_value_set ).
Your control does rightly enter into the supply function. When you are trying to add a new row you are basically trying to add a new blank entry to your internal table which is bound to your table. Now for this dropdown you have bound it to a subnode & this node has a supply function attached to it. You should keep it in mind that the supply function does get automatically triggered when:
1) The node collection is initial.
2) The lead selection in the parent node collection is changed.
3) The node collection is invalidated programmatically.
If you had used the approach of binding your dropdowns to an attribute created directly under the same node which you are using to bind to your table then even any newly added rows would automatically get the set of values populated inside them.
Regards,
Uday -
Get Attribute values from a page and procedure exception handling?
Hi All,
I have created new page with two input attributes not based on any VO. This page is created to capture two values and pass these to an AM method upon pressing OK button. The method in AM will call a procedure with two in parameter expecting the two values captured from the above said page.
I have two questions, first one how to capture the values entered by the page in the controller class and advises me how to handle exceptions when my procedure fails.
I can not use something like this since this page is not based on a VO
String fromName = (String)vo.getCurrentRow().getAttribute("FromName");
Do I have to create a dummy VO like select '' name1, '' name2 from dual?
Thanks for the help.Hi,
Actually you can capture the parameters on the page like this way
String test = (String)pageContext.getParameter("id of the text input bean");
Now in procedure you can take an out parameter which stores the error messages on exception
and return that out parameter in java.
and then you can throw exception on page using OAException class.
Thanks
Gaurav Sharma -
Which master data table to be used to get attribute value
Hi all,
I am writing routine in update rule to get data for one master data attribute of master data 0customer.
But I am cofused in choosing master data table to get data.
There are two master data table in master data tab of 0customer characteristics.
1. View of MstrDtaTbls :- /BI0/MCUSTOMER
2. Master data tab :- /BI0/PCUSTOMER
Suggest me which one to take .
Although I have tried with 2 one and it is working fine.Hi,
If the attribute is not time-dependent please use /BI0/PCUSTOMER, else use /BIC/QRCOSTCTR.
Just remember P table and Q table.
Regards,
Frank -
Passing attribute value in session variable
Hi All
I need to store one field value from my SIM form as a session variable and pass them to the next page along with my session, using some jscript stuff or else. Does this make sense?
If it is possible or anyone have any prior experience please reply.
Thanks in advanceWe have tested a code-snippet that 'gets' attribute-values from the session:
<invoke name='getAttribute'>
<invoke name='getHttpSession'>
<ref>:display.state</ref>
</invoke>
<s>attribute_name</s>
</invoke>You can try 'setAttribute' in the similar way.
Thanks,
Adi -
CS4-JS : Read XML file and getting Attributes
Dear All,
How to get the Attributes based on the RootElements.
For Example:
//========================== XML File : Start ================================//
<stag>
<cust>
<custname>120</custname>
<atagst name="alpha" attributename="1" attributevalue="2" sty="First"/>
<atagst name="beta" attributename="1" attributevalue="5" sty="Second"/>
<atagst name="gama" attributename="1" attributevalue="2" sty="Third"/>
<atagst name="theta" attributename="1" attributevalue="5" sty="Fourth"/>
<cust>
<cust>
<custname>121</custname>
<atagst name="A.alpha" attributename="1" attributevalue="2" sty="First"/>
<atagst name="A.beta" attributename="1" attributevalue="5" sty="Second"/>
<atagst name="A.gama" attributename="1" attributevalue="2" sty="Third"/>
<atagst name="A.theta" attributename="1" attributevalue="5" sty="Fourth"/>
<cust>
<cust>
<custname>122</custname>
<atagst name="B.alpha" attributename="1" attributevalue="2" sty="First"/>
<atagst name="Bbeta" attributename="1" attributevalue="5" sty="Second"/>
<atagst name="B.gama" attributename="1" attributevalue="2" sty="Third"/>
<atagst name="B.theta" attributename="1" attributevalue="5" sty="Fourth"/>
<cust>
</stag>
//========================== XML File : End ================================//
Here I want to check through Java Script Code [InDesign]
//======================== Script : Starts ====================================//
var myEveryName = new Array();
traverse(roots);
for(var Element_name=0; Element_name<myEveryName.length; Element_name++)
if(myEveryName[Element_name] == "customername")
custname.push(myEveryContent[Element_name]);
if(myEveryName[Element_name] == "applytagstyle")
Aname.push(myEveryAttributes[Element_name][0]);
Aattributename.push(myEveryAttributes[Element_name][1]);
Aattributevalue.push(myEveryAttributes[Element_name][2]);
Asty.push(myEveryAttributes[Element_name][3]);
function traverse(tree) {
myEveryName.push(tree.name());
if(tree.elements().length() > 0) {
for(var i=0; i<tree.elements().length(); i++) {
traverse(tree.elements()[i]);
//======================== XML File : End ====================================//
Everything working fine, but I couldn't get attribute values. Please check the below example
For Example:
If you check first root element in above xml code
i need the output like
custname=120
name=alpha,beta,gama,theta
attributename=1,1,1,1
attributevalue=2,5,2,5
sty=first,second,third,fourth
custname=121
Please any one can help me and give me the solutions.
Thanks & Regards
T.R.Harihara SudhaNFew questions:
1. Your XML is not well formed.
2. Secondly, I do not see any relation of XML with script. For instance, I do see any elements "customername", "applytagstyle" in input.
3. Either you have not provided the complete source or either your dummy XML is incorrect.
Anyways, having a quick look, I guess you are trying to get specific attributes values from XML tree. I will try to give you a kick start though you will be required to customized the script as per requirement (for instance rearranging the attribute values in array and so forth). Otherwise please try to post complete inputs.
#include "glue code.jsx"
//Get the attribute values of all elements
main();
function main(){
if (app.documents.length != 0){
var myDoc = app.activeDocument;
var myRuleSet = new Array (
new findObjAttribute("//*")
with(myDoc){
var elements = xmlElements;
__processRuleSet(elements.item(0), myRuleSet);
else{
alert("You have no document open!");
exit();
function findObjAttribute(XPATH){
this.name = "findObjAttribute";
this.xpath = XPATH;
this.apply = function(myElement, myRuleProcessor)
var elmName=myElement.markupTag.name;
with(myElement){
try {
var Name=myElement.xmlAttributes.itemByName("name").value;
var AttName=myElement.xmlAttributes.itemByName("attributename").value;
var AttValue=myElement.xmlAttributes.itemByName("attributevalue").value;
var AttSty=myElement.xmlAttributes.itemByName("sty").value;
$.writeln("Name: "+Name);
$.writeln("AttributeName: "+AttName);
$.writeln("AttributeValue: "+AttValue);
$.writeln("Sty: "+AttSty);
} catch(e){};
return true;
This will just print the values JavaScript console.
HTH,
Pankaj Chaturvedi -
Extract XML attribute value for multi-item sequence
Guys,
I have already posted this in the XML DB forum, but am relying that some of you might help me.
I have been searching for a solution for this and couldn't quite get it. I'm trying to get attribute values from multiple entries in a Node. It workes for a single node, but for multiple nodes, it fails. Could you please give me a solution?
SQL> select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
2 ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@NAME') CITY_NAME
3 ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@POPULATION') POPULATION
4 from xmltable('WORLD' passing xmltype('
5 <WORLD>
6 <COUNTRY NAME="INDIA">
7 <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
8 </COUNTRY>
9 </WORLD>'
10 ));
COUNTRY_NAME CITY_NAME POPULATION
INDIA MUMBAI 10000When I execute the same for multiple nodes, it fails, please guide me. Please also let me know how to handle if I have an XML file containing this data.
SQL> select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
2 ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@NAME') CITY_NAME
3 ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@POPULATION') POPULATION
4 from xmltable('WORLD' passing xmltype('
5 <WORLD>
6 <COUNTRY NAME="INDIA">
7 <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
8 <CITY NAME="CHENNAI" POPULATION="2000"></CITY>
9 <CITY NAME="BANGALORE" POPULATION="13000"></CITY>
10 <CITY NAME="HYDERABAD" POPULATION="14000"></CITY>
11 </COUNTRY>
12 </WORLD>'
13 ));
select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
ERROR at line 1:
ORA-19025: EXTRACTVALUE returns value of only one nodeCheers
Sarma.So, this is the first step:
SQL> with test as
2 (select xmltype('<WORLD>
3 <COUNTRY NAME="INDIA">
4 <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
5 <CITY NAME="CHENNAI" POPULATION="2000"></CITY>
6 <CITY NAME="BANGALORE" POPULATION="13000"></CITY>
7 <CITY NAME="HYDERABAD" POPULATION="14000"></CITY>
8 </COUNTRY>
9 </WORLD>') resp from dual)
10 select country
11 , cities
12 from xmltable('WORLD/COUNTRY' passing (select resp from test)
13 columns country varchar2(50) path '/COUNTRY/@NAME'
14 , cities xmltype path '/COUNTRY/CITY') world
15 /
COUNTRY CITIES
INDIA <CITY NAME="MUMBAI" POPULATION="10000"/><CITY NAME
="CHENNAI" POPULATION="2000"/><CITY NAME="BANGALOR
E" POPULATION="13000"/><CITY NAME="HYDERABAD" POPU
LATION="14000"/>two columns, one varchar2 and one xmltype.
Then do the same thing with the second column, pass the XML to an XMLTABLE function
SQL> with test as
2 (select xmltype('<WORLD>
3 <COUNTRY NAME="INDIA">
4 <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
5 <CITY NAME="CHENNAI" POPULATION="2000"></CITY>
6 <CITY NAME="BANGALORE" POPULATION="13000"></CITY>
7 <CITY NAME="HYDERABAD" POPULATION="14000"></CITY>
8 </COUNTRY>
9 </WORLD>') resp from dual)
10 select country
11 , cit.name
12 , cit.population
13 from xmltable('WORLD/COUNTRY' passing (select resp from test)
14 columns country varchar2(50) path '/COUNTRY/@NAME'
15 , cities xmltype path '/COUNTRY/CITY') world
16 , xmltable ('CITY' passing cities
17 columns name varchar2(50) path '@NAME'
18 , population number path '@POPULATION'
19 ) cit
20 ;
COUNTRY NAME POPULATION
INDIA MUMBAI 10000
INDIA CHENNAI 2000
INDIA BANGALORE 13000
INDIA HYDERABAD 14000 -
Using groovy expressions to get a value of the current row
Hi,
I have a bounded task flow. The first step in the flow is calling an ExecuteWithParameters on one of my views. Based on the result of this query, I want to go to either Page1 or Page2.
So I have a router. I first tried to route based on whether or not the result of the query contained only one row. That worked fine. But I want to add a condition to that.
Basically, if the query returns one row AND that row has an attribute named 'Noc' == 1, then I want to go to Page2. Otherwise, go to Page 1.
Right now to get the estimatedRowCount I am getting the iterator from the pageDef file created for my ExecuteWithParams object. To see if 'Noc' == 1, I tried this:
#{data.rcl_view_reimbCode_search_results_task_flow_reimbCode_search_results_task_flow_ExecuteWithParamsPageDef.ReimbCodeSearchView1Iterator.currentRow.getAttribute("Noc") == 1}
But it is complaining of grammar issues.
What is the best way to go about getting the value of my attribute in a groovy expression?
Thanks,
JoelHi,
the best way is to use a managed bean reference
1. create a binding for the router
2. Expose the queried iterator in the PageDef file
3. write a managed bean that accesses the binding
BindingContext bctx = BindingContext.getCurrent();
BindingContainer bindings = bctx.getCurrentEntry();
DCIteratorBinding iter = bindings.get("NameOfIterator");
// i) get estimated row count
// ii) get attribute value
//iii) evaluate
// iv) return true/false
Reference the managed bean from the router
Frank -
Runtime error to get the attribute value of an element
mydoc.xml
=========
<?xml version = "1.0"?>
<persons>
<person name="Joe" age="22" />
</persons>
In mydox.xml, I want to get the attribute values of element person. Of course,
in the actual XML file, it is more complicated.
However, I get the following run-time error,
Exception in thread "main" java.lang.NullPointerException
at ParserTest.main(ParserTest2.java:18) on line element.hasAttribute("name")
import java.io.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import org.xml.sax.*;
public class ParserTest2
public static void main(String[] args) throws ParserConfigurationException, SAXException
String xmlFile = "mydoc.xml";
doc = getDocumentFromFile(xmlFile);
Element element = doc.getElementById("person");
//Exception in thread "main" java.lang.NullPointerException
if (element.hasAttribute("name"))
{ System.out.println("attribute = " + element.getAttribute("name"));
public static Document getDocumentFromFile(String xmlFile)
try
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(new File(xmlFile));
return doc;
catch(IOException e)
{ e.printStackTrace();
return null;
catch(SAXException e)
{ e.printStackTrace();
return null;
catch(ParserConfigurationException e)
{ e.printStackTrace();
return null;
private static Document doc;
any ideas? Thanks!![url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/NullPointerException.html]java.lang.NullPointerException
Thrown when an application attempts to use null in a case where an object is required. These include:
Calling the instance method of a null object.
Accessing or modifying the field of a null object.
Taking the length of null as if it were an array.
Accessing or modifying the slots of null as if it were an array.
Throwing null as if it were a Throwable value.
You know what line it happens on, so you know which of these cases applies. So you know that variable "element" is null at that point. How could it come to be null? You assign to it only once, two lines above. How could that assignment be null? Check the documentation for [url http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/Document.html#getElementById(java.lang.String)]org.w3c.dom.Document.getElementById().
Repeat every time you get one of those exceptions.
Maybe you are looking for
-
How to Track the valuation for IC Stock Transfer
Hi Folk, I have a requirement for Intercompany Stock Transfer Where Plant "A" place PO to Plant "B" and Plant "B" does the Stock Transfer to Plant "A". Both the plant belongs to differnet company code. But both the company code share the same Chart o
-
Position table in different browsers is not correct
Hi, Again I have a problem with making my website compatible with IE7 & Firefox. I have created a gallery page with a table containing thumbnail photos. It looks as it should in Firefox but when viewed in IE7 its not in the centre. The page can be fo
-
VAT Identification Exchange System (VIES) 394
Hello, This is a new report based on legal request in Romania. I run this report (transaction /CEECV/ROFI_VIES ) but the column "Amount" is filled in with zero. It means that the value in this report is only tax base amount without VAT amount. I need
-
I am trying to open my emails in my cable account, but I cannot. It gives me an error: Object does not suppot this property or method. What can I do stop this error? I can see my list of emails but I can't open it. help!
-
Re: Dowloading SAPScript Output into excel
Hello Experts, Could anyone let me know how to download the SAPScript output to Excel? Rgds, Pavan