How to set values in a JSP from DTO
My requirement is to print matrix report of students and their subject markets
Student Name | Sub1 Sub 2 ...........
Std Name1
Std Name 2
That is printing subject names horizontally and student names vertically.
<c:forEach items="${dto.subList}" var="item" varStatus="count">
td><c:out value="${item.sub_name}"/> </td>
</c:forEach>
<tr>
<c:forEach items="${dto.StudentsList}" var="item" varStatus="count">
<c:set value="${count.count}" var="totalstudents"/>
<tr class="odd">
<td><c:out value="${item.student_name}"/> </td>
<c:forEach items="${dto.subList}" var="item" varStatus="count">
<c:set value="${dto.marksList}" var="item"/>
</td>
</c:forEach>
</tr></c:forEach>
i have done upto this part. wat i need is for each student it needs to check sub1 and soon and put that marks in that sub place
public DTO GenerateMatrixReport(DTO params) throws DAOException
DTO resultDto = new DTO();
int totalstudents = new Integer(params.get("totalstudents").toString()).intValue();
int totalsubjects = new Integer(params.get("totalsubjects").toString()).intValue();
for(int i=1;i<=totalstudents;i++)
List list = new ArrayList();
for(int j=1;j<=totalsubjects;j++)
list = new ArrayList();
list.add(params.get("email"+i));
list.add(params.get("subject_name"+j));
list.add(changeDateToDBFormat((String)params.get("start_date")));
list.add(changeDateToDBFormat((String)params.get("end_date")));
DTO tempDto = super.get("SQL QUERY",list);
if(null != tempDto.getDataList());
List l1=new ArrayList();
l1 = tempDto.getDataList();
if(l1 != null)
for(int k=0;k<l1.size();k++)
Map m =(Map)l1.get(k);
m.put("marks",""+new Double(m.get("marks").toString()).doubleValue());
tempList.add(m);
else
System.out.println(0);
resultDto.put("ubjectList",getAllSujectNames());
resultDto.put("studentsList",getAllStudents());
resultDto.put("marksList",tempList);
return resultDto;
public Collection getAllSujectNames() throws DAOException
Collection list = new ArrayList();
DTO resultDto = super.get(Utility.getSQL("getallsubjectnames"),new ArrayList());
if(null != resultDto.getDataList())
List tempList = resultDto.getDataList();
for(int i=0;i<tempList.size();i++)
Map m = (Map)tempList.get(i);
m.put("subject_name",m.get("subject_name"));
list.add(m);
return list;
public Collection getAllStudents() throws DAOException
Collection list = new ArrayList();
DTO resultDto = super.get(Utility.getSQL("getallstudents"),new ArrayList());
if(null != resultDto.getDataList())
List tempList = resultDto.getDataList();
for(int i=0;i<tempList.size();i++)
Map m = (Map)tempList.get(i);
m.put("student_name", m.get("first_name") + " " + m.get("last_name"));
m.put("email",m.get("email"));
list.add(m);
return list;
These are the methods iam using ,can u set me the solution to print the values in matrix format
Similar Messages
-
How to set values to bpel variables from Java
I have a java class to create files and populate some contents into it. On success it returnes "File Created"
I used the following code to achieve it :-
WriteFiles objWriteFiles=new WriteFiles();
String para=((oracle.xml.parser.v2.XMLElement)getVariableData("inputVariable","payload","/client:FileTestProcessRequest/client:HO_ORG_ID")).getFirstChild().getNodeValue();
String result=objWriteFiles.writeHeaderInfo(para);
(writeHeaderInfo is a method in my java class)
addAuditTrailEntry(result);
I works fine..Now I want to assign this reult value to a bpel variable .. I tried doin it like below:-
setVariableData("outputVariable","payload","/client:FileTestProcessResponse/client:result" , result)
but its not working...I get a fault ...
Can anyone help me out...
Thanks,
Githa.R.SIn this example :
<!-- Invoke the EmployeeStatus Java class instead of web service -->
<bpelx:exec name="invokeJavaExec" language="java" version="1.4">
<![CDATA[
EmployeeStatus e = new EmployeeStatus();
String firstName = ((Element)getVariableData(
"EmployeeTravelStatusRequest", "employee",
"/employee/FirstName")).getNodeValue();
String lastName = ((Element)getVariableData(
"EmployeeTravelStatusRequest", "employee",
"/employee/LastName")).getNodeValue();
String empStatus = e.getTravelStatus(firstName, lastName);
addAuditTrailEntry("Employee status is: " + empStatus);
setVariableData("EmployeeTravelStatusResponse", "travelClass",
"/travelClass", empStatus);
]]>
</bpelx:exec>they dont use namespaces in the xpath-expression, can you try that ? -
How to set value in combox by code
how to set value in combox by code
Dear
You can use the following code to set the values in combobox by a query
strQuery = "select ItemCode,ItemName from OITM"
oRecSet = Me.SBO_Company.GetBusinessObject(BoObjectTypes.BoRecordset)
oRecSet.DoQuery(strQuery)
oCombo = Me.oForm.Items.Item(encontrolName.colEmpType).Specific
If oRecset.Fields.Count > 0 Then
While oRecset.EoF = False
oCombo.ValidValues.Add(oRecset.Fields.Item(0).Value, oRecset.Fields.Item(1).Value)
oRecset.MoveNext()
End While
End If
Regards
Rupinder -
How to set value for trim and bleed using jsx script?
I have tried using bleedoffsetRect but somehow it is not working. Can anybody please help me on how to set value for trim and bleed using jsx script? Any example will be highly appreciated.
Following is the code I am trying with:
var _saveName = new File ( root_path +_strFileName+".pdf");
var _saveOpts = new PDFSaveOptions();
_saveOpts.printerResolution = 300;
var bleedarray = new Array();
bleedarray[0] =9.00;
bleedarray[1]=9.00;
bleedarray[2]=9.00;
bleedarray[3]=9.00;
_saveOpts.bleedOffsetRect = bleedarray;I would expect although I've not actually tried this for the bleed off set box to be larger than the artbaord and the first two values to be negative or 0…
var bleedarray = new Array(-9,-9,artboard.width+9,artboard.height+9);
Where 'artboard.width' & 'artboard.height' you will have calculated from your file. An Array(9,9,9,9); would not constitute any boxes bounds. -
How to set value to dimension1,2,3 column in AP Invoice?
Dear All,
I have a problem when creating AP Invoice using SAP B1 2005 B DI/API. The problem is when i can not find dimension1, dimension2, and dimension3 properties in oDraft.Lines. (oDraft is my variable for object oPurchaseInvoices).
How to set value to dimension1,2,3 column in AP Invoice using DI/API ?
Regards,
Herfin J.Hi! Yatsea,
I am working with 2007B, In the order reference of B1WS, I found only CostingCode and COGSCostingCode provided:
OrdersService.DocumentDocumentLine.CostingCode() As String
OrdersService.DocumentDocumentLine.COGSCostingCode() As String
Where are the rest 4 dimensions for both of them?
Plus, I also got the XML from DI server, with only one CostingCode exposed.
Thanks
Constantine -
How to set value for radio button in sap crm survey suite
Hi ,
I created a survey in CRM Service, in which I added a question with answer as '10 Selection Button Group ('radio button'). And answer has 11 answer options (which means 11 radio buttions). Now when we test the survey, the value for the radio buttons is appearing like 'id_0050569b03091ee480a29d8ee61e953c'. But i want to set a specific value for each radion button (from 1 to 11). So, how to set value for radio button in sap crm survey suite???.
Thanks & Regards,
SeshuHi,
I found solution myself. Click on Goto -> Editing Mode -> Expert Mode. Now you can set value for radio button.
Regards,
Seshu -
How to set value on MRU insert Tabular Form
This post refers to the forum article found How to set value on MRU insert Tabular Form
I have included the problem and proposed solution below. My problem follows
Problem
Hi,
I am using a Tabular Form. I used the wizard and it created all of the items (Cancel, Submit, Add, Multidelete buttons, etc.). I have a table that is like an FK table. For instance, we could have a customer table, and then a customer address table. Each customer could have multiple addresses. In the address table, the first ID column is the customer ID. So in using the tabular form for the addresses, I need to make the first column the same when I insert. But when I choose add row, everything works fine except it tries to insert a null into customer id. The uniqueness of the row is determined by customer ID and address string.
Any time I make it to this screen, all new rows will have the same ID with I have in a variable that I can reference from the page called :P0_ITM_CUST_ID.
How do I set the first value for all inserts? My guess is I need to do this in Computations. I'm also guessing I need to do this with a replace statement. I'm just not sure how to reference the first column of the new row.
Thanks!
Tim
Solution
The way to do this is by using the "Default" value for that Column. Go to
Home>Application Builder>Application xxx>Page yyy>Report Attributes>Column Attributes
Set the default value for newly added rows as in
http://img237.imageshack.us/img237/5758/screenshot012di2.jpg
Hope this helps.
Un-resolved problem
have also tried to do this but the fields I see are not the same.
Please see screenshot=http://krisjones.freewebspace.com/apex.JPG
I am using the Oracle hosted environment, so 2.2.1.
To my knowledge I have done the same as the user in the first post. Am I doing something incorrectly or should I have created the tabular form differently?
Many thanks. KrisKristian - You see a different version of the form depending on whether the selected column is the primary key column or not.
Scott -
How to set value in selectOnemenu using binding
hi all.
i have bind htmlSelectOneMenu. it contains some value. I want to set or display a value after a process.
How to change value
i have tried using setValue method of both binding property and value property of htmlSelectOneMenu.
Same issue is with InputTextArea. how to set value in it via code(RowSelectionListener of icefaces)Balaji wrote:
hi all.
i have bind htmlSelectOneMenu. it contains some value. I want to set or display a value after a process.
How to change value
i have tried using setValue method of both binding property and value property of htmlSelectOneMenu.
Same issue is with InputTextArea. how to set value in it via code(RowSelectionListener of icefaces)The html SelectOneMenu is bound to a value of a backing bean. You have to change the value of that backing bean, not the JSF component directly. JSF takes care of updating the model, you shouldn't be touching it unless you know what you are doing. -
How to set value of a column in report region
Hi,
I have a report region based on a query.In this my first column is selectlist "select row" having to values "yes" & "No".
I have two buttons on top of the region "Check all" and "uncheck all".
My requirement is when I click check all button all rows corresponding to "select row" column gets selected to Yes and when I click No all rows gets selected to "No".
Thanks
VikramActully I want to set the value of a column in report region.
There are replies in the forum but in those the item is in form but not in the report region.
I am generating report region by using htmldb_item.selectlist and i dont know how to set value in these type of items. -
How to set values to the structure containing a node with cardinality 0..n
Hello.
I 'm trying to set values for the node with cardinality 0..n. The node type is "Fields".
<xsd:complexType name="Field">
<xsd:sequence>
<xsd:element name="fieldCode" type="xsd:string"></xsd:element>
<xsd:element name="displayValue" type="xsd:string" minOccurs="0"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Fields">
<xsd:sequence>
<xsd:element name="field" type="tns:Field" minOccurs="0" maxOccurs="unbounded"></xsd:element>
</xsd:sequence>
</xsd:complexType>
I need to set several values for the element "fieldCode" but it has cardinality 0..1 and BPM does not allow it but I did not find any option about how to set values for the structure of type "Fields". Could you help me?
Best regards,
Timur SemenchukHi Marcus,
If there is no way you could change the cardinality of the node, and thus it can contain 0..n items, I think you should create-and-add a new element programmatically.
Since the collection can contain zero elements, I would add a 'new' button, which upon clicking adds one new element via:
IYourNodeElement yourNodeElem = wdContext.nodeYourNode().createYourNodeElement();
wdContext.nodeYourNode().addElement(yourNodeElem);
Hope this explains a bit!
Best,
Robin van het Hof -
Help on how to set value on LinkButton type column
Hello,
Can I programmatically set a value on Item No. in matrix on Sales Quotation which is of type SAPbouiCOM.LinkedButton?
This code helped me set values to an edittext type column
Dim et As SAPbouiCOM.EditText = oMatrix.Columns.Item(matrixColumnID).Cells.Item(rowNumber).Specific
et.Value = value
Dim et As SAPbouiCOM.LinkedButton = oMatrix.Columns.Item(matrixColumnID).Cells.Item(rowNumber).Specific
How can set value for the Item No.?
Thanks and Regards,
SheetalJust treat the Item No. column as an EditText for purposes of setting its value.
Dim sboEdit As SAPbouiCOM.EditText
Set sboEdit = sboMatrix.Columns("1").Cells(lngRow).Specific
sboEdit.Value = "XXXXXX"
John. -
How to set value for selectOneChoice
Hello,
How to set value for selectOneChoice defined as:
<af:selectOneChoice label="Label" id="soc1" binding="#{DepositorMergingBean.socSurnameComponent}">
<f:selectItems id="si1" value="#{DepositorMergingBean.socSurnames}"/>
</af:selectOneChoice>
where socSurnames is List<SelectItem> - manually filled list of SelectItem(SomeObject, (String)text_description), so - SOC is filled manually (no binded iterators, etc..)
Neither socSurnameComponent.setValue( new Integer(0) ) nor socSurnameComponent.setValue( socSurnames.get(0) ) do not help.
Thanks in advance.this.selectOneChoice.setValue(selectItems.get(2).getValue());Try as per the following sample:
SelectOneChoiceTest.JSPX:
<af:form id="f1">
<af:selectOneChoice label="Select One Choice" id="soc1"
binding="#{SelectOneChoiceTestBean.selectOneChoice}">
<f:selectItems value="#{SelectOneChoiceTestBean.selectItems}"
id="si1"/>
</af:selectOneChoice>
<af:commandButton text="Set Selected Value" id="cb1"
actionListener="#{SelectOneChoiceTestBean.onClick}"/>
</af:form>
SelectOneChoiceTestBean.java:
import java.util.ArrayList;
import java.util.List;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
import oracle.adf.view.rich.component.rich.input.RichSelectOneChoice;
public class SelectOneChoiceTestBean {
private RichSelectOneChoice selectOneChoice;
public SelectOneChoiceTestBean() {
super();
private List<SelectItem> selectItems;
public void setSelectItems(List<SelectItem> selectItems) {
this.selectItems = selectItems;
public List<SelectItem> getSelectItems() {
selectItems = new ArrayList<SelectItem>();
selectItems.add(new SelectItem("One", "One"));
selectItems.add(new SelectItem("Two", "Two"));
selectItems.add(new SelectItem("Three", "Three"));
return selectItems;
public void setSelectOneChoice(RichSelectOneChoice selectOneChoice) {
this.selectOneChoice = selectOneChoice;
public RichSelectOneChoice getSelectOneChoice() {
return selectOneChoice;
public void onClick(ActionEvent actionEvent) {
this.selectOneChoice.setValue(selectItems.get(2).getValue());
Thanks,
Navaneeth -
How to set value from one view to other view's context node attr b4 save
HI all,
My requirement is as below:
There are two views in component BP_CONT.
BP_CONT/ContactDetails IMPL class
BP_CONT/SalesEmployee SALESEMPLOYEE STRUCT.SALESEMPLOYEE
I want to set value from first view to second view's context node's attribute.
i get Sales Employee BP number in ContactDetails view, from here i want to set that value in to STRUCT.SALESEMPLOYEE
of second view in the same component.
please send me code snippet for doing the same.
Thanks in advance.
seemaHi Seema
You can access the fields from different views by either using custom controllers or by using component controllers, in your case you can access the Sales employee BP number from the Component controller.
first access the component controller as below in BP_CONT/SalesEmployee (in do_prepare_output method) or in (specific setter method)
lv_compcontroller type ref to CL_BP_CONT_BSPWDCOMPONENT_IMPL,
lv_partner type ref to cl_crm_bol_entity,
lv_role type string,
lv_partner_no type string.
lv_employee TYPE REF TO if_bol_bo_property_access,
lv_compcontroller = me->COMP_CONTROLLER.
lv_partner ?= lv_compcontroller ->typed_context->-partner->collection_wrapper->get_current( ).
lv_role = lv_partner->get_property( iv_attr_name = 'BP_ROLE' )
IF LV_ROLE = 'SALESEMPLOYEE'
lv_partner_no ?= lv_current->get_property( iv_attr_name = 'BP_NUMBER' ).
endif.
now set the value
lv_employee ?= me->typed_context->salesemployee->collection_wrapper->get_current( )
CHECK lv_employee IS BOUND.
lv_employee->set_property( iv_attr_name = 'SALESEMPLOYEE' iv_value = lv_partner_no )
Thanks & Regards
Raj -
How to set value from LOV only as a default reference not enforce validate check?
In jdev 11.1.2.3,
By creating List of Value(LOV) for an attribute of a VO, I can get default value for the current VO's attribute from the lookup table, but it will also enforce a validate check for that value.
If I input a value which is not in the lookup table, then errors will raised.
Now I hope I can get default value from LOV, and can also input some new value (and this new value can be insert into the lookup table by a database trigger) for the attribute/field without failure to pass the check.
Any one can help?
Thanks!Hi, Arun
Your suggestion let me get to know how to create a new record in the customeActions facet of inputComboBoxListOfValues, which I donot know before. It's great. and thank you very much.
However, my current issue is a different requirement, let me describe it clearly as:
I have a formlayout to input a field value which can be from a lookup table, or if this value is not in the lookup table then it can also be input without raising value validation check failure.and this new value can be added to the lookup table at the same time.
for example, there is a FK attribute deptno in the EMP table, in a form for editing EMP attributes, user can input deptno value which is already in the DEPT lookup table by selecting from a LOV. also can input some new value which cannot be selected from the LOV, and this new deptno value will be posted to database both in EMP and DEPT table.
The issue is, after create a LOV for deptno attribute in EMP VO, there will be a enforced value validation check, so new values cannot be input in EMP unless it is input into DEPT first.
(http://docs.oracle.com/cd/E37975_01/web.111240/e16182/lists.htm#BABBJFBB)
List of values are designed to return valid values only. As a result, validation rules defined on data source view object attributes will be suppressed.
My question is: how to disable this enforced value validation for a LOV-enabled field?
(There is other means to ensure user will input valid value for this field, for example ask him to double input.)
Thanks again!
bao -
How to set values of a parameterized message in ADF Faces?
Hi all,
i've got the following problem: I want to set the values of a parameterized message before i add the message to the FacesContext.
Contents of the message resource bundle:
testPage.successMsg.create=The device {0} was created successfully!
Code within backing bean method:
String message = getStringFromBundle("testPage.successMsg.create");
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(message));
In Struts/ADF UIX the following code did the job:
protected void setUIXInfoMessage(HttpServletRequest request, String key, Object[] args)
MessageData msgs = new MessageData();
MessageResources mr = this.getResources(request);
String msg = "";
if (mr != null)
msg = mr.getMessage(request.getLocale(), key, args);
msgs.addMessage(null, msg, null, UIConstants.MESSAGE_TYPE_INFO);
request.setAttribute(UIX_MESSAGE_KEY, msgs);
Can anyone help me with this problem? I have searched a lot in the Oracle ADF Development Guide and within forum, but did not find any solution.
Another interesting thing is, how to set the parameters from jspx-Code.
How can i achieve the same results in ADF Faces corresponding to the following UIX-Code:
<boundAttribute name="title">
<messageFormat format="${nls['deleteTip.confirmation']}">
<dataObject source="${bindings.TipName}"/>
</messageFormat>
</boundAttribute>
Resource Bundle:
deleteTip.confirmation=Do you really want to delete the tip {0}?
Another question:
What are the corresponding elements in ADF Faces corresponding to <concat> and <if> in UIX or what possibilites exist in ADF Faces to dynamically concatenate strings depending on certain conditions?
I know, these are many questions. I am familiar with UIX, but now i have to start developing applications with ADF Faces and there are some things i don't find corresponding equivalents.
Thanks in advance!
Regards,
StefanHi,
SRDemo shows you how to do this declratively
<h:outputFormat value="#{res['srcreate.confirmPanel.message']}"
escape="false" id="nextButton">
<f:param value="#{requestScope.SRDEMO_CREATED_SVRID}"/>
</h:outputFormat>
where the <f:param ...> element sets the value of the variable
To programmatically access internationalized strings, SRDemo uses
private static ResourceBundle getBundle() {
FacesContext ctx = getFacesContext();
UIViewRoot uiRoot = ctx.getViewRoot();
Locale locale = uiRoot.getLocale();
ClassLoader ldr = Thread.currentThread().getContextClassLoader();
return ResourceBundle.getBundle(ctx.getApplication().getMessageBundle(),
locale, ldr);
public static String getStringFromBundle(String key) {
ResourceBundle bundle = getBundle();
return getStringSafely(bundle, key, null);
You take it from there and put it to a FacesMessage, If it uses parameters I guess you will have to parse the string
Frank
Maybe you are looking for
-
How to get music and playlists back on iTunes after reinstalling Mavericks?
My macbook pro (from 2010) had a problem today. Whenever starting up, a grey screen would appear and after the screen would shut off immediately. So after sitting all day trying to fix the problem I decided to reinstall Mavericks (which worked). Howe
-
Hello, When i create a package body, and change the user to the default and save... It continually switches back to 'User3'. If I open the 'properties', I see the correct user is set, however when I 'edit' the body, in the declaration it always rever
-
Firefox freezes for up to a minute when I have two tabs open, one playing a YouTube video, the other with a flash game running, and the screen shows the contents of both tabs, one superimposed on the other. If I have other tabs open, they also appear
-
IPhone Syncing Problems (Windows Vista)
I've ran into a problem, where I can't sync any of my photos, i've seen problems but not like this, almost all the time when i sync my photos it gives me a blue screen error (windows vista) sometimes it will sync some of them but they arent viewable
-
SAP Upgrade : No Framework Program For Include
Hi, I am getting the Syntax error as mentioned while upgrading system from 4.6C to ECC 6.0 Please provide some solution. Regards; Parag