How to bind a specific attribute of an element to an input field
HI,
in my web shop application I create an overview page of the items dynamically in the wdDoModify Method. Each item has it's own transparent container. I do not use tables or row repeaters, because they did not fullfill my requirements.
Now I have the problem to bind a specific attribute to an input field.
I bind the value with following code:
amountInput.bindValue(item.getAttributePointer("amount").getAttributeInfo())
item is the element of the item to display. amount is the attribute with type integer.
The problem is, that I have 4 Items on the screen. When I enter a value for amount, all amounts on the screen are the same. So I guess that the input field is not bound to the correct element.
Has anybody an idea what I have done wrong? Or which string for bindValue do I have to use for example for an attribute of the 5th element in a node?
Best regards,
Peter
Peter, you can set the context node to mutiple select, but you have to select it on item variable, like:
item = wdContext.nodeXXX.getElementAt(1);
amountInput.bindValue(item.getAttributePointer("amount").getAttributeInfo())
item = wdContext.nodeXXX.getElementAt(2);
amountInput2.bindValue(item.getAttributePointer("amount").getAttributeInfo())
Regards,
Edson Thomaz
Similar Messages
-
How to use one pop up window for multiple buttons and input fields?
Hi Experts,
I have created a pop up window that will be opened from multiple buttons in the same view. There are input fields that the data will be populated from a pop up window. How can I set up which button that a pop up window is opened from? I also would like to populate the data from a pop up window to the input field next to a clicked button. There are 6 buttons and 6 input fields that share the same pop up window. I would very appreciate your responses.
Thank you,
DonHi,
Try creating 2 context attributes, one in your component controller and the other in the pop-up view. Bind the attribute of pop-up view to the component controller attribute.
In the main view, on click of every button set a unique code in the controller's context which helps you in identifying the button clicked. Since u have created a binding to the pop-up view attribute the value flows from the controller.
In the init method of your pop-up view, check the value of the attribute and based on that display which ever UI elements are required.
Eg:
On Button 1 click set value "B1", Button 2 value "B2" etc. In the init() of pop-up view u can check the values and perform the required operation:
if(("B1").wdContext().currentContextElement().getButtonIdentifier()){
else...{
Hope this helps you.
Regards,
Poojith MV -
Hi All,
I am using the tab phtmlb:formLayoutInputField to define an input field. I need to restrict the end user from entering a maximum of 70 characters(can be any character/number) in the textbox.
I'll explain in another sentence:::: the end user should be able to enter only 70 characters in the textbox and 71st character should not be allowed to enter. Could anyone please suggest as to how I can achieve this?
Thanks a lot in advance,
Best Regards,
VarunHi,
We can limit the length of an inputfield by mentioning the maxlength properties of an inputfield.
<htmlb:inputField id= "get"
maxlength="6" />
This restricts the
Hope this helps you.
Regards,
Rajani -
How to bind dynamically created attributes
Hi all,
i hv created an appl where all the attributes hv been created dynamically..
wdContext.getNodeInfo().addAttribute("From","ddic:com.sap.dictionary.string");
wdContext.getNodeInfo().addAttribute("To","ddic:com.sap.dictionary.string");
wdContext.getNodeInfo().addAttribute("Subject","ddic:com.sap.dictionary.string");
wdContext.getNodeInfo().addAttribute("Message","ddic:com.sap.dictionary.string");
bt nw i am nt able to retrieve those.
For ex: if i hv to set the from field to null ,hw to do so?
( As we used to get it:
wdcontext.currentContextElement().setFrom(" ");
Plz help.
Thanks and Regards,
Ankita
Edited by: Ankita Padhi on Jul 14, 2008 8:48 AMHi,
here i m giving code for your reference of a dynamic checkbox:
IWDCheckBox checkBox =
(IWDCheckBox) view.createElement(IWDCheckBox.class,
"checkBox" + count);
IWDMatrixHeadData checkHeadData =
(IWDMatrixHeadData) checkBox.createLayoutData(
IWDMatrixHeadData.class);
IWDAttributeInfo attrInfo;
info= wdContext.nodeCheckBox().getNodeInfo().addAttribute(
"Check" + count, "ddic:com.sap.dictionary.boolean");
checkHeadData.setVAlign(WDCellVAlign.TOP);
checkHeadData.setWidth("6%");
checkHeadData.setColSpan(1);
this line used to bind the context to the element:-
checkBox.bindChecked(info);
checkBox.setEnabled(true);
TitleRow.addChild(checkBox);
Hope this may help you.
Regards,
Deepak
Edited by: Deepak Arora on Jul 14, 2008 9:09 AM -
Some users show that the sales docment external name is not printed completely in the form of delivery form printing, so I want to find how much length of the field is there through debugging. I am very expected to gain some suggestion from you.
for exploding the bom if you know header material use
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
CAPID = 'PP01'
DATUV = SY-DATUM
MEHRS = 'X'
MTNRV = P_MATNR
WERKS = P_WERKS
TABLES
STB = I_BOM
EXCEPTIONS
ALT_NOT_FOUND = 1
CALL_INVALID = 2
MATERIAL_NOT_FOUND = 3
MISSING_AUTHORIZATION = 4
NO_BOM_FOUND = 5
NO_PLANT_DATA = 6
NO_SUITABLE_BOM_FOUND = 7
CONVERSION_ERROR = 8
OTHERS = 9.
now check PLPO & PLKO table for routing or AFVC and AFVV for routing.
if production order created you have to check in afvc and afvv else check in plpo and plko.
for checking with plpo and plko you have to check MAPL table.
for bom and material link
MAST,STPO,STKO.
stlnr is the common field
regards
shiba dutta -
How to pass value from new pop up window to the input field
Hi,
i have a F4 help on a input type field and adjacent to that two more input fields, on clicking the help on the first input field a new pop up window opens, the value in this pop up window is to be selected to give the value in that field and the other two values should be appeared in the input type. suppose the pop up window has three fields "15 LIMA PLANT 45802 ", so on clicking it in input field only 15 should go to the firstinput fields and "LIMA PLANT" and "45802" should go to new window
do anyone know this?avoid duplicate threads
F4 help in dropdownlistbox and values in input fields
if you feel that the thread heading or content is not what you wanted, you can edit it and leave a note in the same thread that you have edited it.
Raja -
Hello Folks,
i have requirement of auto-search in ui5 project.For that i have used sap.m.input control and register in controller like below:
onInit : function() {
var g = this.getView().getController();
/*Input field defined in view.xml*/
var areaInpt = g.byId(sap.ui.core.Fragment.createId("photos",
"autoComplete"));
/*autoComplete Instance*/
autoText = new google.maps.places.Autocomplete($("#"+areaInpt), {
types : [ 'geocode' ]
But when page load it was showing undefined is not function.And when i commented above autoText line then error is not coming.
NS: i am using following api : https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places
Below is the screenshot for same:I have the same question. Anybody has an answer for this?
Grant -
How to bindi a UI element to 2 model nodes different in the same view
I want to know how I can bind a set of inputfields, in a form view, to 2 different model nodes ?
<u>example:</u>
Im working with 2 adaptional RFC, both working, in my Custom Context.
Ztest_Search
Ztest_Update
In my ResultView I have 2 Model nodes (one for each RFC) I show a set of inputfields in a form view, binded to the Ztest_Search_output of Ztest_Search. This works.
now I want to update the changes, but I can't find the ways of binding the same inputfields to my other Model node (Ztest_Update) in the context of ResultView.
Note: If I create a duplicate set of inputfields , one for Ztest_Search binded to the Ztest_Update_output and the other to the Ztest_Update_Input Works. But I wanna avoid this duplicated set of inputfields.
ThxRodrigo,
If I understood correctly, your problem is to get the data from the input fields which are bound to a
model node, Ztest_Search_output and set it to the model node of another RFC, Ztest_Update.
This can be done by getting the suitable values from the model attributes of Ztest_Search_output
and setting it to Ztest_Update.
<b>/**
* valueOne, valueTwo are the name of the model
* attributes that are bound to the Input fields.
*/</b>
String firstValue = wdContext.currentZtest_Search_outputElement
().get<valueOne>;
String secondValue = wdContext.currentZtest_Search_outputElement
().get<valueTwo>;
Ztest_Update_Input update = new Ztest_Update_Input();
wdContext.nodeZtest_Update_Input().bind(update);
<b>/*
*<b>Zstructure is the structure of the model node under
*Ztest_Update_Input to which the values have to be
*updated.</b>
*/</b>
ZStructure structure = new ZStruture();
structure.setValueOne(valueOne);
structure.setValueTwo(valueTwo);
update.addZStructure(structure);
try
update.execute();
catch (Exception ex)
wdComponentAPI.getMessageManager().reportException(ex.getMessage(), false);
wdContext.nodeZtest_Update_Output().invalidate();
Bala -
Customer-specific attributes (properties) for processes?
Hello community,
I already know how to define customer-specific attributes (properties) for documents stored in Solution Manager using the Document Modelling Workbench. For documents, everything works fine, so far.
But: I also want to define customer-specific properties for processes. Is this possible? If yes, how do I do that? I cannot find any related configuration options -- neither in SPRO nor in Solution Manager's own project configuration area.
Thanks in advance,
ThomasHi,
In SPRO, naviagete to SAP Solution Manager Implementation Guide -> SAP Solution Manager -> Scenario-Specific Settings -> Implementation/Upgrade -> Blueprint and Configuration -> Object Attributes -> Definition of Customer Attributes for Object Types
Best regards,
Jacques. -
How to bind the database?
How to bind the database and to place the data of a field in a EditBox and to modify the data of a table.
Hi,
Here got one example.
Private oUserDataSource As SAPbouiCOM.UserDataSource
oNewItem = oForm.Items.Add("ET_GUID", SAPbouiCOM.BoFormItemTypes.it_EXTEDIT)
oEditText = oNewItem.Specific
oUserDataSource = oForm.DataSources.UserDataSources.Add("U_GUID", SAPbouiCOM.BoDataType.dt_LONG_TEXT, 60)
oEditText.DataBind.SetBound(True, "TableName", "FieldName")
Hope this helps,
Bruce. -
Specific attributes for IDM implementation
I am trying to integrate webcenter with Oracle IDM environment, to do the same i required to know the specific attributes for oracle webcenter users
the input is required for the IDM team to create the schemas,
Can anybody enlighten me about the same,Read this link and around: http://docs.oracle.com/cd/E21764_01/webcenter.1111/e12405/wcadm_security_id_store.htm#CFHJEJID
Note, that you will not integrate "WebCenter", but rather "its LDAP". -
Root node contains specific attribute could make the XSLT transfrom fail
I have to convert EJB deploy desciptor in my project, but I found that XML format transfrom with Apache Xalan will fail when the root node contants some specific attribute.
Here is an example:
Input XML file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
version="2.1">
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
</catalog>
XSL transfer file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/>
<xsl:template match="/">
<html>
<body>
My CD Collection
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Title</th>
<th align="left">Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The XML transfrom will fail in this way.
But if I remove the attributes in the input xml's root node, such as this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
<cd>
The transform operation will succeed.
Does anyone know the reason?In your xslt you will have to make sure to reference the elements using the http://java.sun.com/xml/ns/j2ee namespace.
Change your XSLT to be something like this and it should work:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee">
<xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/>
<xsl:template match="/">
<html>
<body>
My CD Collection
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Title</th>
<th align="left">Artist</th>
</tr>
<xsl:for-each select="j2ee:catalog/j2ee:cd">
<tr>
<td><xsl:value-of select="j2ee:title"/></td>
<td><xsl:value-of select="j2ee:artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet> -
How to bind UI Element with Context Node Attribute Element
Hi,
I'm building my view dynamically in the wdDoModifyView method.
Is it possible to bind a "TextView" element to a specific element of an attribute node?
Scenario:
Node_Employees
|
+- Attribute_Code
|
+- Attribute_Name
Node Contents:
Employees
|
+- Code: 1, Name: Employee 1
|
+- Code: 2, Name: Employee 2
|
+- Code: 3, Name: Employee 3
I need to do something like binding a TextView UI element to the "Name" attribute of the element #2, what would result to show "Employee 2" on my view.
How can I do this?
Thanks in advance,
Geraldo.Hi Saravanan,
First I populate the context node and it won't change during view's lifecycle. After that, I build my view and bind the TextView UI elements to the node context attributes elements.
If the node has 10 elements, I will build 10 TextView UI elements and bind them to each attribute element.
Regards,
Geraldo Brígido. -
How to bind the attribute in the context to a dynamic created element?
Hi, experts,
There are some attributes in the node context(ee_node) that contained the attribute named "ANSSA" in the view(test_view) in the WDA for abap. In the method modifyview of the view(there is a transfered parameter that represent the name of "ANSSA")
I want to create a dynamic element(inputfield) in the test_view. The element need bind the context attribute (ANSSA).Through the transfered parameter(para), I only know the name of the attribute binded.
How can I bind the attribute of the context in the following code?
METHOD modifyview .
*importing para type string.
*importing m_view type ref to if_wd_view.
data wd_inputfield type ref to cl_wd_input_field.
create one element automatically in the view.
wd_inputfield = CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD(
view = m_view
id = para
BIND_VALUE = ???
ENDMETHOD.
I don't know how to replace the "???" in the method modifyview? Do you give me some hint for it?
You can reply back to me via e-mail if you think we should discuss this internally at [email protected] or [email protected]
Thanks.
Best regards,
taoHi, Suresh,
Thanks a lot for your help.
The last mail have some errors. Now, I modify my code error. The following is my new code in the wddomodifyview method in the ADDR_AUTO_DISP_VIEW view.
Now, I modify my code. The following is my new code in the wddomodifyview method in the ADDR_AUTO_DISP_VIEW view.
METHOD wddomodifyview .
importing view type ref to if_wd_view.
DATA transparent_container TYPE REF TO cl_wd_transparent_container.
DATA inputfield type ref to cl_wd_input_field.
transparent_container ?= view->get_element( `TRANSPARENT_CONTAINER` ).
transparent_container->set_visible(
EXPORTING
value = if_wdl_core=>visibility_visible ).
wd_this->SET_DYNAMIC_INPUT(
EXPORTING
inputfield_ID = 'ANSSA'
IMPORTING
INPUTFIELD = inputfield
**************The web page will occur error when running the WDA as soon as I write the code.***********
transparent_container->add_child( THE_CHILD = inputfield ).
ENDMETHOD.
The following is the code of the SET_DYNAMIC_INPUT method.
method SET_DYNAMIC_INPUT .
*importing
*INPUTFIELD_ID type STRING
*exporting
*INPUTFIELD type ref to CL_WD_INPUT_FIELD
Data binded_context type string.
concatenate 'ADDR_AUTO_DISP_VIEW.EE_ADDRESS.' INPUTFIELD_ID into binded_context .
inputfield = CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD(
id = inputfield_id
read_only = abap_true
BIND_VALUE = binded_context
endmethod.
When I run the WDA, The web page occuring the error information:
Note
The following error text was processed in the system DEV : Access via 'NULL' object reference not possible.
The error occurred on the application server devserver_DEV_00 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
But when I delete the code of the wddomodifyview, and create a inputfield in the layout of the view, and bind the "ANSSA" to the "value" property in the layout, the WDA is running correctly.
Do you give me some hints?
Thanks a million.
Best regards,
tao -
How to search XML file for specific attributes ...
Hi, Im trying to design a XML driven billboard. Is there an easy way to seach attributes of all elements using DOM parser and return the element with attribute that matched search criteria?
Yes. Are you using jsdk1.4? If true then look at the XPathAPI.
I wrote a package for working with XML vocabularies. If you are interested on it, here is an example that uses amic-util.jar to find nodes with the id-user attribute:
XmlReader xr = new XmlReader("vocabulary.xml");
NodeSet ns = new XPathFinder(xr).findNodes("*[@id-user]");
while(ns.hasNextNode()) {
XmlReader node = ns.nextNode();
}Send me an e-mail and I will send you back the amic-util.jar and the javadocs.
Maybe you are looking for
-
Edge Transport Attachment stripping based upon an emails Subject line.
I am running Exchange 2010 on-prem with a 2013 Hybrid (including a 2013 Edge Transport server for message handling between on-prem and the o365 tenant) connecting to an o365 tenant. I use EMC's SourceOne for archiving running on-prem. The o365 tenant
-
Glitch when adding video to a PDF
I've successfully added a video to a multi-page PDF using Acrobat X by linking to a URL as opposed to embedding the video file. My problem occurs when I navigate to the page immediately before or after the page that the video is located on. The first
-
I imported a video and when I play it back, the audio does not match the video. When I view the tape in my camera it looks fine. I've tried imported twice and each time it doesn't match. What can I do to fix this?
-
How to connect processes in Process chain
Hi, How to connect processes in Process chain. how to make it as black,green,red. Thanks, Madhu.
-
Transaction time out for an single ejb
Hi, I have one ejb which need to run for long time. Did a quick search on the forum and find out that you can modify data-source.xml and server.xml to increase the time out period. But this is a "global" setting which will affect all the ejbs in the