How to link label with an input field in data table?

I am curious if there is a nice way to link a label to input field in a data table directly in JSP? Data filling the table are dynamically bounded.
Sample, simplified code below. Values of "label" property are unique in the collection binded to dataTable.
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:jsp="http://java.sun.com/JSP/Page">
     <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" />
     <f:view>
          <html>
          <body>
          <h:dataTable value="#{screen$monitoring$errorlog$CorrectHopper.dataset}" var="DATA_ROW">
               <h:column>
                    <f:facet name="header">
                         <h:outputText value="Name" />
                    </f:facet>
                    <h:outputLabel value="#{DATA_ROW.label}" for="#{DATA_ROW.label}_id" />
               </h:column>
               <h:column>
                    <f:facet name="header">
                         <h:outputText value="Value" />
                    </f:facet>
                    <h:inputText value="#{DATA_ROW.label}" id="#{DATA_ROW.label}_id" />
               </h:column>
          </h:dataTable>
          </body>
          </html>
     </f:view>
</jsp:root>
returns:
17:39:01,390 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.IllegalArgumentException: #{DATA_ROW.label}_id
what is related to EL expression in h:inputText's "id" attribute.
Is there any other way to bind label with dynamically created input field in JSP? Do I really have to bind input field directly to component objects with "binding" and set IDs manually with setId() (what is ugly solution because it moves View related logic to Model layer)?

I've thought of using EL because I have to somehow
link a label to an input field dynamically. Somehow? Dynamically? Just use plain text :)Well... just look at my code snippet (notice: we want to join the pairs of labels and text boxes placed in a datatable [or any other repeater-like component rendering properties of objects from a collection]):
<h:dataTable value="#{screen$monitoring$errorlog$CorrectHopper.dataset}" var="DATA_ROW">
<h:column>
<f:facet name="header">
<h:outputText value="Name" />
</f:facet>
<h:outputLabel value="#{DATA_ROW.label}" for="#{DATA_ROW.label}_id" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Value" />
</f:facet>
<h:inputText value="#{DATA_ROW.label}" id="#{DATA_ROW.label}_id" />
</h:column>
</h:dataTable>
and what is your idea of using plain text as "id" attribute value in this case? :)
Regards,
Michal

Similar Messages

  • How to Change UI element from input Field to Date Picker

    Hi All,
    One Custom View is created in which we are pulling some fields from a custom context node created using the value Node.
    For one of the field which is already an input field we need to convert it to date picker.
    in the GET_P_METHOD
    CASE IV_PROPERTY.
    WHEN 'fieldType'.
    rv_value = cl_bsp_dlc_view_descriptor=>field_type_radio.
    WHEN 'radioCols'.
    rv_value = '1'.
    ENDCASE.
    We can change the attribute to clbsp_dlc_view_descriptor_ and bring
    checkbox,radiobutton,hyperlink and all but not finding anything for Date picker.
    Can anyone suggest a method by which we can convert a UI element to Date Picker.
    Any suggestions will be highly appreciated.
    Regards,
    Sijo

    The technical data type for that field should be DATS then input help will automatically come.
    Also in get_m method of that attribute should have
      metadata = cl_crm_uiu_bt_date_tools=>get_m_date( ir_model_binding  = me
                                                      iv_attribute_path = attribute_path ).
    Regards,
    Shobhit

  • How to prepopulate value in webapps input fields or for any custom fields in for any other forms?

    How to prepopulate value in webapps input fields or for any custom fields in for any other forms?

    What do you want to populate the form with?

  • How to link asset with purchase order and PO Item.

    Hello,
           I have to generate a report which contains columns
    Asset No , po no(ebeln) ,PO Item(ebelp),Material no etc
    My query is how to link asset with purchase order and      PO Item.
    I am selecting asset and po no. from anla  but how to get
    po item no(ebelp)?
    po line item is important in this report because every line item has differrent asset and material no.
    i tried to match asset no in mseg table but i am not getting asset no in mseg .
    how should i proceed ?

    Thanks Thomas & Srimanta for the quick response.
    When I checked EKKN table by entering PO there is no asset no. in anln1 field.
    Also I would like to add that, In me23n for a PO, account assignment category we are entering 'F' for internal order settlement.
    Where can i find the link between asset and po no(ebeln) and po item(ebelp)?
    Regards,
    Rachel
    Edited by: Rachel on Aug 11, 2008 7:23 AM

  • How to  adjust the text in input field

    Hi Expert,
    New in VC development. Can someone guide how to adjust the text in input field? Because of  long text length it  is not displaying fully in visual composer iView so user are not able to see the entire text in input fields

    HI Kundan,
    I assume that you have already tried different options perent in Label Postion for the field.
    If none of these options meet your requirement then you can try the following workaround:
    In the display properties, select label position as no label.
    In the form view add a new UI Control for Plain Text or HTML text and change its Label to "Material Number".
    Now place this new UI Control in before your actual Input field such that it appears as the field label.
    Hope this helps.
    Regards,
    Rk

  • How to restrict the length of input field

    Hi,
    How to restrict the length of input field. That is we should not be able to enter more thatn 10 charecters.
    Regards,
    H.V.Swathi

    Hi swathi,
    For this you have to create a simple data type. No need of writing a code.
    Go to Dictionaries -> Local Dictionary -> Data Type - > Simple Type - > Right click and "Create Simple Type".
    Here you should create a Simple type with String as built-in Type. Here you will also see the Length Constraints option.
    Set the value of maximum length and minimum length. In your case set the value of maximum length to 10. At runtime this will not allow the user to enter more than 10 characters.
    Now create an attribute and bind it to this newly created simple type. Bind the value of the input field with this particular attribute.
    Regards
    Manohar

  • How to do ICON_EXPAND and ICON_COLLAPSE input fields in module pool screen?

    hi frnds.
    My problem is in module pool screen how to do ICON_EXPAND and ICON_COLLAPSE input fields in module pool screen?And how to do GUI STATUS and GUI TITLE? IN SE80.
      ITS URGENT.POINTS WILL BE REWADED.THANKS  IN ADVANCE.

    Hi,
    Go through this thread.
    [expand and collapse|expand and collapse]
    Cheers,
    Simha.

  • PPR Report ,How to display Label with TOTAl

    Hi,
    How Can i display PPR Report ,How to display Label with TOTAl like
    [http://apex.oracle.com/pls/apex/f?p=267:30:]
    Thanks
    Edited by: 805629 on Jan 6, 2011 3:34 AM

    Hi,
    For PPR Report:
    Select "Yes" in "Enable Partial Page Refresh" item of "Layout and Pagination" region in Report Attributes of that report.
    For display Label with TOTAL:
    Use "Break Formatting" region in Report Attributes of that report.
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • How to link ODI with ESB???

    Hi,
    I need to know how to link ODI with ESB(Enterprise Service Bus)....
    should i expose ODI as a web service or is there any other way to link these two...
    please reply me asap its very urgent...
    Regards,

    I'm also interested on this.
    I don't know very much about ODI, but could point the following:
    1 - Your datasource could be exposed as a web service, as you suggested, and be exposed for ESB to consume.
    2 - ESB can connect to your data source (not ODI, but the datasource the ODI act on) using a DBAdapter.
    3 - ESB can send a JMS message that can be consumed by an ODI JMS based datasource (I'm not sure)
    4 - ODI can have a Web Service based datasource that points to a web service exposed by ESB.
    When I see ODI Topology Manager, I can identify these options.
    Denis

  • Dynamic filling of input fields in a table

    Hi,
    There are input fields in a two tables these are to be filled parallely at run time. the no of entries depend on the entires in internal table.
    If internal table has more entries, then a certain entries is filled up; say 9 times the control should be given to a new tables and the remaining entries should be filled in the input fields of other table .
    I appreciate help.

    Hi,
    Actually there is two HTML tables, each table has nine rows. if the no of entries in the internal table exceeds nine then the second table should be filled after the first HTML table has filled with all the nine entries.
    Both tables contains same input fields. How to fill both tables dynamically. I think now it makes sense.

  • How to link bindvariable with ViewAccessor to make it ADF Input with LOV

    I have create a view object by sql query in which i have two bind variables. I want to create a search form by these two bind variables as search criteria so i drag "Execute with Params" operation from Viewobject Data Control to a jspx page as a ADF Search Form. Now i want to create these two parameters as a ADF Input LOV so i changed control type in view Object for these two bind variables but i am not able to fine how to attach viewaccessor with it for data source. Kindly help me.

    Hi,
    in this case - if th ebind variables are not based on an attribute that has a LOV defined - you replace the components in the input form. To do this, remove the input text field and drag the attribute (the argument) onto the form again. Choose select one choice to create a drop down and then map it to the VO that providesthe values. Note that this doesn't create a LOV binding so you use lists for this.
    Frank

  • Please Help. How to access to an input field in a table with javascript

    Hi
    i�m trying to access to the content of an input field that is in an table with a javascript function in this way
    function Valida_Tabla()
    var centro = document.getElementById("form1:idcentro").value;
    alert("Centro es ["+centro+"]")
    var des = document.getElementById("form1:table1:0:textField2").value;
    alert("des ["+des+"]")
    The fisrt alert is ok and displays the value of a field that is in a table.
    The second alert is not displayed.
    Is the syntax wrong?
    what i�m doing wrong
    Please help

    The best bet is to look at the source of the generated HTML and then use the exactly generated ID in the HTML source. When I looked at the HTML source I see the ID of a textfied inside a table as
    form1:table1:tableRowGroup1:0:tableColumn1:textField1
    - Winston
    http://blogs.sun.com/roller/page/winston?catname=Creator

  • How to implement SEARCH HELP for input field in WDA

    Hi All,
    I am doing a tool for my team. in this tool there are 4 input fields to show different processes. I implemented the 4 input fields and also bind the respective tables to these fields successfully. Actually I want to filter the data between 2 fields . Means the data in the 2nd input field should be based on the 1st input field. Means when I'll select for example 'CHI' (code for CHINA) in the 1st input field the 2nd field meant for country name should show all country name with value 'CHINA'. But the problem is that all values related to each field are in different table with no foreign key relationship and also some combinations are in single table..
    I have tried the import and export parameter method for search help but no luck till now.
    Can anyone please suggest me how to implement this scenario..
    Thanks in advance...
    sekhar

    Hi sekhar,
    Your Requirement can be implemented by OVS(Object Value selector) This is the custom search help .So that you can define on what basis the value has to be fetched.
    Look at the below link
    http://wiki.sdn.sap.com/wiki/display/WDABAP/ABAPWDObjectValueSelector(OVS)
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    You need to use the component WDR_OVS.
    It has 3 phases
    In phase 1
         You will fetch the value from input field to F4 help dialog box.
    In phase 2
         You will generate the search results , in this phase look for the input value given in field 2 and accordingly generate search result for the field 3.
    In phase 3
         The selected value will be returned to the original screen.
    Regards
    Karthiheyan M

  • How can I create a Text-Input Field in BexAnalyzer for a Planning Function

    Hello,
    i want to create a pre calculation(contribution accounting) for Materials in BI-Integrated Planning. These Materials aren't in the master data. So I create a new Info Object for pre calculated materials with only a material-number as key and a text-description.
    Now I want to write a Exit-Function, which creates new materials in these Info Object. The user should start this function in a planning application in BexAnalyzer. There the user should have the possibility to enter a text-description for the new material. How can I create such a Text-Field in BexAnalyzer and how can I read this text filed in a planning function (exit).
    Thanks in advance

    Hi Jürgen,
    you can create a parameter for this in the exit function and a variable for the parameter. In BEx Analyzer then create a button for the planning function; in the button parameterization use VAR_NAME = , i.e. use an Excel formula here to get the value from an Excel input field.
    The command range should be some 'hidden area' in your Excel sheet.
    But may be you don't need this. Use a characteristic without master data. Then ensure that that the query uses the option 'key' as display. In new lines you can then enter the key, the system creates a SID on the fly (but the text table will not be updated). In this scenario you may take text also from the key. May be you can update the text table (online or in batch) by simply using function modules from function group RSNDI_MD (not released by SAP).
    But observere that the system in BI Planning reads only the active version, i.e. if you change something on the fly the changes may not be visible.
    Regards,
    Gregor

  • How to set focus on invisible input field?

    Hi Guys,
    I need an invisible input field and have to set an input focus on it. My problem is that if I set input field’s property visible=blank, I get my invisible field <b>BUT</b> the function call doesn’t work (setInput.requestFocus()).
    I suppose that I can’t set a focus if an input field is invisible.
    Does somebody know how can I solve my problem? Is there a possibility to do this input field invisible with java script? If yes, how does it work in Web Dynpro?
    Thanks
    Marita

    Hi
      Setting a focus on invisible input field will not work even if you follow the method what sowjanya has suggested. The method wdThis.wdGetAPI().requestFocus() will not work for read-only and disabled fields.
    By the way why do you want to set the focus on a invisible input field. If you can tell us the requirement maybe we could think of an alternate solution. But i guess for the current scenario setting focus on invisible input field does not work.
    regards
    ravi

Maybe you are looking for

  • VER 3.6.10 WHEN I BID ON EBAY FIREFOX CRASHES

    JUST STARTED TO USE EBAY. SITE IS UN RELIABLE IE: WHEN I BID ON SOMETHING FIREFOX CRASHES. I HAVE TO RE OPEN FIREFOX AND SIGN BACK INTO EBAY.

  • [NAND ] _FindFlashMediaAndKeepout :601 physical nand block offset 1

    Hi! I Need help! Can anyone help me? My phone crashd very hard on the floor... everything at the Display was destroed.. I've changed the Display an now Shows me an error... I dont understand what this means! Can anybody read this error and tell me, w

  • IPad seen in iTunes can only unmount

    Hello After updating itunes, installing IOS 5 I have the following issue. Itunes detects the device but I can only unmount it. What can i do about this problem. First I was able to synch over wifi. But I could still not change any synch option throug

  • Printer misfeeds constantly

    Hi all, I have a Photosmart D7460 printer that is constantly (I'd say at least 75% of the time) misfeeding the first page when I print.  As soon as I clear the jam by removing the rear panel and pulling out the paper that's halfway fed, it always pri

  • Intriguing Data Dictionary Query

    Database table column names are limited to 30 characters (as verified by ALL_TAB_COLUMNS Data Dictionary table). Why, then, is the COLUMN_NAME column of the ALL_CONS_COLUMNS defined as a VARCHAR2(4000)? This is neither urgent nor business-critical to