How to set values in a CoreTable programmatically from a backing bean
Hi,
One of the columns in my CoreTable is "af:inputText" field, I need to set the value of inputText field in each row from a backing bean.
I have bound this table to a component in the bakcing bean and in the setMyCoreTable method I'm also preselecting certain rows. For all the preselected rows I need to set a value in the inputText field.
Can someone point me to some code samples or give me some ideas to solve this.
Thanks
Thanks dvohra,
I looked at the post you suggested yesterday, but I wasnt sure how I can implement that in my case.
Since Im programatically preselecting certain rows in the setMyCoreTable method(which is the accessor method), I was hoping I could prepopulate the input text field as well in the same method.
For your reference below is the code from jspx and the backing bean.
<af:table value="#{bindings.ProgramComponentList.collectionModel}"
var="row"
rows="#{bindings.ProgramComponentList.rangeSize}"
first="#{bindings.ProgramComponentList.rangeStart}"
emptyText="#{bindings.ProgramComponentList.viewable ? 'No rows yet.' : 'Access Denied.'}"
selectionState="#{bindings.ProgramComponentList.collectionModel.selectedRow}"
selectionListener="#{bindings.ProgramComponentList.collectionModel.makeCurrent}"
binding="#{backing_EditProgramBean.compsTableComponent}">
<af:column sortProperty="Name" sortable="true"
headerText="#{bindings.ProgramComponentList.labels.Name}">
<af:outputText value="#{row.Name}"/>
</af:column>
<af:column sortProperty="Description" sortable="true"
headerText="#{bindings.ProgramComponentList.labels.Description}">
<af:inputText value="#{row.Description}" simple="true"
required="true"
columns="30"/>
</af:column>
<f:facet name="selection">
<af:tableSelectMany id="tableSelectMany1"/>
</f:facet>
</af:table>
CODE FROM BACKING BEAN ---------
public void setCompsTableComponent(CoreTable compsTableComp) {
ManageProgramsServiceImpl serviceImpl =
(ManageProgramsServiceImpl)JSFUtils.get("#{bindings.ProgramDetailIterator.dataControl.dataProvider}");
ViewObject searchProgramView = serviceImpl.findViewObject("SearchProgramView");
Row currProgram = searchProgramView.getCurrentRow();
ViewObject view = serviceImpl.findViewObject("ProgramComponents");
view.setWhereClause("ProgramsComponents.PROGRAM_ID = " + currProgram.getAttribute("ProgramId"));
view.executeQuery();
view.setRangeSize(view.getRowCount());
view.executeQuery();
Row[] programComponents = view.getAllRowsInRange();
RowKeySet rks = new RowKeySet();
ViewObject compTypesView = serviceImpl.findViewObject("ProgramComponentList");
compTypesView.setRangeSize(compTypesView.getRowCount());
compTypesView.executeQuery();
Row[] compTypes = compTypesView.getAllRowsInRange();
for (int i = 0; i < compTypes.length; i++) {
String code = compTypes.getAttribute("Code").toString();
for(int j=0; j<programComponents.length; j++){
String programCode = programComponents[j].getAttribute("ComponentType").toString();
if(programCode.equalsIgnoreCase(code)){
rks.getKeySet().add(compTypes[i].getKey());
compsTableComp.setSelectionState(rks);
List li = compsTableComp.getChildren();
System.out.println("****** li : " + li.size());
//System.out.println("****** row count : " + compsTableComp.getRowCount());
//System.out.println("****** count : " + compsTableComp.getRows());
this.compsTableComponent = compsTableComp;
The table children size(li.size()) comes up as zero and [compsTableComp.getRowCount()] gives an exception. Can you please provide any help. Seems like Im off track with this whole thing.
Thanks
Similar Messages
-
How to read values of dynamic UI elements in a backing bean?
Hi, I have an ADF page where some of the UI elements (in this case, checkboxes) are dynamically rendered as such:
<af:forEach var="row" items="#{backing_testPage.userList}">
<af:selectBooleanCheckbox id="checkbox" value="#{row.id}"
text="#{row.name}" selected="#{row.userSelected}"/>
</af:forEach>
I am wondering how can I read the values of these checkboxes in my page's backing bean. It does not seem possible to specify a distinct binding value for the selectBooleanCheckbox elements in order to tie them to a CoreSelectBooleanCheckbox variable in my backing bean (so that I could check whether the checkbox is selected or not).
When the page gets rendered, I did see that the checkboxes get assigned distinct ids like checkbox_1, checkbox_2, checkbox_3, etc... Not sure if that would help with this.
Would appreciate any tips on this as I've been struggling with this for awhile. Thanks!You probably would do better with a SelectManyCheckbox. Here's how:
In your backing bean you need:
private String[] usernames;
public String[] getUsernames () {
return usernames;
public void setUsernames (String[] _usernames) {
usernames = _usernames;
}In your page:
<af:selectManyCheckbox value="#{backing_testPage.usernames}">
<f:selectItems value="#{backing_testPage.userList}"/>
</af:selectManyCheckbox>When the form is rendered any strings in the usernames array that are in the userList will be checked. When submitted, any checked items will be in the array. -
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 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 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 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 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 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 dynamic WHERE clause to VO from backingBean?
Hi,
Can any one let me know the best way to add the dynamic WHERE clause in to VO query.
I have created AM (with AMImpl.java) & VO (with VOImpl.java & VORowImpl.java) in my model project. I suppose to set the WHERE condition at runtime while the user click the search button. I am handling the user button click at UI layer backingBean. From the backing bean I could able to get the objct of the VO and set the where clause by below code.
ValueExpression valueExp = elFactory.createValueExpression(elContext, "#{bindings.UserSearchVO1Iterator}", Object.class);
DCIteratorBinding dcIter = (DCIteratorBinding)valueExp.getValue(elContext);
ViewObject userSearchVO = dcIter.getViewObject();
userSearchVO.setWhereClause("lower(usr_login) LIKE ':1' and usr_udf_suid like ':2' ");
userSearchVO.executeQuery();But as I fear this is not the right way to do it. So I am creating the cutom method inside the VOImpl.java and triggring that method by creating one more cutom method in AMImpl.java. But I dont know how to invoke this AM method from backingBean.
AMImpl method
public void initDetails()
UserSearchVOImpl vo = getUserSearchVO1();
vo.initQuery();
VOImpl method
public void initQuery()
setWhereClause("lower(usr_login) LIKE 'a%' and usr_udf_suid like '%1144%'");
executeQuery();
}Can any one guide me which is the best way to set the where clause to VO? How to call the AM method from backingBean?
Thanks
klni am new to oracle 11g i writing a stored procedure in which i have made use of case in where clause to pass my parameter value v_toStoreID
i have googled a lot regarding that i found that to use case in where clause it should be like this
where
case column_value
when 0
then value1
else
value2
end
this my query
SELECT ITMID as ItemId,
NVL(OrderDtl.PackageID, 0) PackageId,
OrderDtl.OrdDtlID,
(CASE NVL(OrderDtl.PackageID, 0)
WHEN 0
THEN 1
ELSE 0
END) as PackageFlag,
ivitem.Code ItemCode,
ivitem.ITMNAME AS itemName,
IvPatientIssueMst.IssueNo Issue_No,
to_char(Issuedate, 'DD/MM/YYYY') IssueDate,
OrderDtl.OrdQty,
NVL(OrderDtl.AllocationID, 0) Package,
OrderDtl.ServiceAmount MRP
FROM IvPatientIssueMst
JOIN OrderMst
ON IvPatientIssueMst.OrderId = OrderMst.OrdId
JOIN OrderDtl
ON OrderDtl.OrdID = OrderMst.OrdId
JOIN ivitem
ON ivitem.ITMID = OrderDtl.DrugId
LEFT JOIN IVPatientIndentMst
ON IVPatientIndentMst.IndentID = IvPatientIssueMst.IndentId
WHERE OrderMst.OrdVisitID = 395899
AND
*(CASE IvPatientIssueMst.StoreId*
when NVL(IvPatientIssueMst.StoreId, 0)=0
THEN v_toStoreID
ELSE IVPatientIndentMst.ToStoreID
END)
ORDER BY ivitem.ITMNAME;
it is not working please someone help -
How can I receive the value of a selected item in the backing bean
I have a table in a jspx file.
When I go to the detail page I want to do something with the value of the currentrow.
I want do a calculaction of the value of ClbId.
How can I receive the value of the selected ClbId in my backing bean
<af:table value="#{bindings.Searchteamlist.collectionModel}"
var="row" rows="#{bindings.Searchteamlist.rangeSize}"
first="#{bindings.Searchteamlist.rangeStart}"
emptyText="#{bindings.Searchteamlist.viewable ? 'No rows yet.' : 'Access Denied.'}"
selectionState="#{bindings.Searchteamlist.collectionModel.selectedRow}"
selectionListener="#{bindings.Searchteamlist.collectionModel.makeCurrent}"
rendered="#{backing_FirstFlag_Club_Club.searchFirstTimeClub_Club_AdresAndereClubs == false}">
<af:column sortProperty="Matricule" sortable="true"
headerText="#{bindings.Searchteamlist.labels.Matricule}">
<af:outputText value="#{row.Matricule}"/>
</af:column>
<af:column sortProperty="ClbId" sortable="true"
headerText="#{bindings.Searchteamlist.labels.ClbId}">
<af:outputText value="#{row.ClbId}">
<f:convertNumber groupingUsed="false"
pattern="#{bindings.Searchteamlist.formats.ClbId}"/>
</af:outputText>
</af:column>
<af:column sortProperty="Nom" sortable="true"
headerText="#{bindings.Searchteamlist.labels.Nom}">
<af:outputText value="#{row.Nom}"/>
</af:column>
<f:facet name="selection">
<af:tableSelectOne text="Select and">
<af:commandButton text="Submit"
action="club_AdresAndereClubsDetail">
<af:setActionListener from="#{row}"
to="#{processScope.row}"/>
</af:commandButton>
</af:tableSelectOne>
</f:facet>
</af:table>hi tde
Using an Expression Language helper class like this one from Steve Muench ...
http://radio.weblogs.com/0118231/stories/2006/12/18/sourceForMyFavoriteElHelperClass.html
... you could write something like this in your backing bean:
Integer vClbId = (Integer)EL.get("#{row.ClbId}");(Make sure to cast it to the correct type.)
success
Jan Vervecken -
How to set a cookie in the browser from an html page called via an Iview
How to set a cookie in the browser from an html page called via an Iview
Hello all,
I have an issue which is causing problems. I have a snap survey (html form with submit and cookie setting) which is embedded in a url iview.
Although the submit and the form work fine, the portal will not allow the cookie to be set it seems.
Is there a way to allow cookies to be set from an embedded page in a url iview??
You will make my day if you know!
System: EP7 SP13
Kind regards
AlexHi,
Check this:
http://www.oracle.com/technology/products/ias/portal/html/same_cookie_domain_with_pdkv2.html
Cookie Basics
Web browsers have built in rules for receiving and sending cookies. When a browser makes a request to a web server and the web server returns cookies with the response, the browser will only accept a cookie if the domain associated with the cookie matches that of the original request. Similarly, when a browser makes a subsequent request, it will only send those cookies whose domain matches that of the target web server.
These rules are designed to ensure that information encoded in cookies is only "seen" by the web server(s) that the originator of the cookie intended. These rules also ensure that the cookie cannot be corrupted or imitated by another server. By default, the domain associated with a cookie exactly matches that of the server that created it. However, it is possible to modify the domain at the time the cookie is created. Relaxing the cookie domain increases the scope of the cookie's visibility making it available to a wider "audience" of web servers.
For example, if a cookie is created by a.us.oracle.com, it's domain will usually be set to a.us.oracle.com. This means that the browser will only send the cookie to a.us.oracle.com. It will never send it to any other servers. However, if at the time of creation, the domain of the cookie is set to .us.oracle.com, the browser will send the cookie to any server whose domain falls within .us.oracle.com. such as portal.us.oracle.com, provider.us.oracle.com, app.us.oracle.com etc
Regards,
Praveen Gudapati
Maybe you are looking for
-
My daughter's Ipod Touch 8gb isn't recognized by itunes or my computer. It keeps asking for an install disc which I don't have and I have basic computer knowledge, but not advanced. What can I do to fix this problem?
-
How to send this command to RS232 Port
I want to use LV to control a label printer to print what I need. Following info is from printer user manual. From RS232 port: If Codex has been used with the controller then the simple serial protocol will need to be enabled by sending ESC Z SWITCH
-
Issue with DML statements in production
Hi all , We are using Oracle 11g. The issue is the following: We have to load some tables during the working day by selecting the data we need from another sources/schemas / and then to insert that data into the production environement. The problem i
-
Removing shadows from charts (both column AND pie)
I can see there is a ShadowBoxItemRenderer (that I have no idea from the help docs HOW to actaully implement to turn off shadows) hoever - when/if this works - it only works on my column chart? How can I turn off this nasty drop shadow beneath my pie
-
this is OT, but I don't know where to put it. If someone from apple is watching -- when I click on My Questions on the Apple Discussions page I get the following every time: 500 previousPageStart is undefined. Resin Professional 3.0.23 (built Mon, 22