The value attribute of outputText

Hi
I'm relatively new to JSF.
I want to something like:
<h:outputText value="<%= Translation.getTranslatedString("property",languageId) %>">.
Is this possible??
Best regards,
Birna

Hello,
If your Hashtable is static, couldnt'you declare a method like this one:
public class MyMessages {
public static String getTranslatedString(String key, String languageId) {
     // load and return String from your Hashtable....
     // (maybe from FacesContext ?)
Then, in your jsp, just one tag:
<h:outputText value="#{MyMessagesBean.getTranslatedString}" />
???

Similar Messages

  • Assigning a String Value to the value attribute of html:file

    Hi,
    we facing a problem while assigning a value to the VALUE attribute of file tag
    <html:file property="fileupload" size='25' value="sample.xls" onchange="callsheet()" />
    can anyone help me out plzzz,

    Two points -
    1) Java is not Javascript or HTML; you would do better to find a more appropriate forum.
    2) When you take this to a better forum, you need to describe the problem.

  • About passing the values attributes of UI components

    Hi,
    I have a question related to passing the values attributes of UI components from JSF to a baking bean.
    Assume I have inputText and I need to pass its value to the data model via an application module. So, this will be done as follows:
    <h:inputText value= "#{bindings.MyValue.inputValue}";
    I need also to pass this value to a managed bean. Therefore I used EL class prepared by Steve Muench available at:
    http://radio.weblogs.com/0118231/stories/2006/12/18/sourceForMyFavoriteElHelperClass.html
    So, in the JSF page will be as follows:
    <h:inputText value="#{myBean.myValue}";
    In managed bean:
    String myValue;
    public String get MyValue () {
    return EL.getAsString("#{bindings.MyValue.inputValue }");
    public void set MyValue t(String value) {
    EL.set("#{bindings.MyValue.inputValue }",value);
    Then when I want to use myVlaue in the managed bean just I use this line:
    myVlaue = get MyValue ();
    I tried to use the same steps to pass the value of selectOneMenu but I always get errors such as cannot be cast to java.lang.String.
    But I achived this by binding the value of selectOneMenu to a HtmlSelectOneMenu attribute in the managed bean as follows:
    In JSF page:
    <h:selectOneMenu value="#{bindings.TaskView1TaskName.inputValue}"
    binding= "#{projectBean.selectOneChoice1}">
    In managed bean:
    private HtmlSelectOneMenu selectOneChoice1;
    public void setSelectOneChoice1(HtmlSelectOneMenu selectOneChoice1) {
    this.selectOneChoice1 = selectOneChoice1;
    public HtmlSelectOneMenu getSelectOneChoice1() {
    return selectOneChoice1;
    Then I can used the selectOneChoice1 value as follows :
    somenu= getSelectOneChoice1();
    somenuValue = (Integer)somenu.getValue();
    task= taskName(somenuValue);
    this works with me. Now what is the different between this way and using EL class
    And how can I use EL class to pass the value of selectOneMenu to the managed bean
    Thank you
    Waheed

    they are look like:
    <list id="TaskView1TaskName" IterBinding="TaskView1Iterator"
    ListOperMode="0" StaticList="true">
    <AttrNames>
    <Item Value="TaskName"/>
    </AttrNames>
    <ValueList>
    <Item Value="value1"/>
    <Item Value="value2"/>
    <Item Value="value3"/>
    </ValueList>
    </list>
    and TaskName is String

  • Can not set the value attribute of a ContextNode

    Hi,
       I am trying to set the value Attribute in a value Node it is a simple way but it gives me java.lang.NullPointerException error on the given line:
    wdcontext.current(ValueNodeName)Element.set(AttributeValueName)
    Thanks in advance
    Best Regards
    Beata

    Like all above suggested do this:
    wdContext.node(ValueNodeName).add(
               wdContext.node(ValueNodeName).create(ValueNode)Element()
    wdContext.node(ValueNodeName).moveLast();
    wdContext.current(ValueNode)Element().setATTR(..);

  • Difference between the binding and the value attribute of an Oracle ADF com

    Can somebody please tell me the difference between
    the binding attribute and the value attribute of any oracle ADF component such as inputText and when would we use one over the other.
    THanks,

    Value represent the value that is going to be displayed by the item.
    Binding indicate the backing bean object that represents the instance of the component.

  • HOW to set the value attribute of FORM INPUT data to a variable in a JSP

    eg. Registration.jsp
    The data is accessed from an hidden field called course
    for example, if I have "Java programming" in the field course, and I use
    an expression to access the value from the hidden field.
    **My problem is that the data gets truncated to "Java" , I need "Java Programming"to display. The code looks like this
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <INPUT TYPE="text" SIZE=12 NAME="course"
    VALUE=<%=getParameter("course") %>
    IS there ANY OTHER WAY to set the value of VALUE to a variable?

    Instead of value=<%=request.getParameter("course")%>
    Use double codes
    value="<%=request.getParameter("course")%>"

  • t:dataTable does it need the value attribute?

    In this Post: http://forum.java.sun.com/thread.jspa?forumID=427&threadID=679591
    ..."jsweetland" writes this snippet:
    <h:dataTable var="item" value="#{myBean.items}" border="1">
       <h:column>
          <f:facet name="header">
             <f:verbatim>Name</f:verbatim>
          </f:facet>
          <h:outputText value="#{item.name}"/>
       </h:column>
       <h:column>
          <f:facet name="header">
             <f:verbatim>Description</f:verbatim>
          </f:facet>
          <h:outputText value="#{item.description}"/>
       </h:column>
    </h:dataTable>my question is why do we need another bean for the dataTable tag ---
    <h:dataTable var="item" value="#{myBean.items}" .....>
    Can't we directly create list items and use them as values inside the column tag? in other words in our example above can we make do with only the "item" bean and get rid of the "myBean" ?

    Hello,
    I don't see your point, I only see one bean, "myBean", where do you see "antother bean"? How do you want to iterate over items, rows in the dataTable? Where do you get information about current row from in actions?
    Regards,
    Thorsten

  • How to get a global string value to be the value of a JSF output box?

    im useing Jdeveloper 10 i have made a JSF, JSP page i have a backing bean for that page. in there i have made a global value:
    private string test = "TESTING"these codes have been generated:
    public void setTester(HtmlOutputText outputText6) {
    this.tester = outputText6;
    public HtmlOutputText getTester() {
    return tester;
    }now how do i put test as the output text?

    That wouldn't even compile. HtmlOutputText isn't a subclass of String (heck, java.lang.String is a final class).
    Two ways to solve this: 1) use HtmlOutputText#setValue() in the constructor or initialization block of the bean or even by lazy loading in the getter. Just create a String getter and use it in the value attribute of the outputText element in the JSF page.

  • Using the binding attribute within Tomahawk's t:dataList tag

    I am trying to create a .jsp page with a dynamic list of tables. Each table on the page has a dynamic number of columns. I read an excellent blog ([The BalusC Code - Using datatables|http://balusc.blogspot.com/2006/06/using-datatables.html#PopulateDynamicDatatable]) that taught me how to create dynamic tables using the binding attribute. I can now get the tables with dynamic columns working.
    What I would like to do next is nest the dynamic tables within a Tomahawk t:dataList tag:
    <t:dataList value="#{utilitiesTableSegBean.attributeTables}" var="attributeTable">
        <h:outputText value="#{attributeTable.title}"/>
        <h:panelGroup binding="#{attributeTable.dynamicTableGroup}/>
    </t:dataList>
    {code}
    When I run my app I get this error:
    javax.servlet.ServletException: javax.servlet.jsp.JspException: org.apache.jasper.el.JspPropertyNotFoundException: /s/UtilitiesTableSeg.jsp(57,56) '#{attributeTable.dynamicTableGroup}' Target Unreachable, identifier 'attributeTable' resolved to null
    Why do I get this error?
    If I remove the h:panelGroup tag then the h:outputText tag works just fine.  Why does 'attributeTable' resolve to null for the binding attribute of h:panelGroup, yet works for the value attribute of h:outputText?
    So then I thought that I might be able to make it work with an index into a bean property that returned the list of table objects.  So I tried to modify my panel group tag to:
    {code}<h:panelGroup binding="#{utilitiesTableSegBean.attributeTables[0].dynamicTableGroup}"/>{code}
    I was just doing a quick initial test and expected to see the first table repeated over and over because I had hard coded the value of '0' as the index.  But I was wrong.  It listed through all of the tables correctly.  Why?  This makes no sense to me!
    So I changed my jsp again so that it looked like this:
    {code}
    <t:dataList rowIndexVar="tableIndex" value="#{utilitiesTableSegBean.attributeTables}" var="attributeTable">
        <h:outputText value="#{attributeTable.title}"/>
        <h:panelGroup binding="#{utilitiesTableSegBean.attributeTables[tableIndex].dynamicTableGroup}"/>
    </t:dataList>
    {code}
    This is how I expected to code it so that the tables would all be shown correctly.  And it gives this error:
    org.apache.jasper.JasperException: An exception occurred processing JSP page /s/UtilitiesTableSeg.jsp at line 57
    (Line 57 is the line with the h:panelGroup tag.)
    Root cause:  javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.IllegalArgumentException: null
    I would really like to get the original version working, but any feedback and/or suggestions would be greatly appreciated.  I have spent a lot of time trying to figure this out and I just don't know where else to look.
    Thank you very much!
    Dave                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Yes, sorry about that - I started off trying to prove a potential solution.
    Aim:
    A user logs onto a weblogic application and is authenticated against OID. The application is making SOAP service calls to a proxy endpoint monitored by another vendors software which authenticates the user against the ldap and checks their roles to see if the user can call the service.
    Solution so far:
    The initial application gets the username from the JAAS principal, but the password is not supplied. I can easily supply the SHA password digest to it (but putting a cleartext password in the header will probably not be given the go-ahead). This would enable the application to make the SOAP call with a username and digest.
    The software protecting the services can be configured in a variety of ways to authenticate the user to the ldap. One involves using the wsse username token in the header (cleartext password or digest).
    This authentication is failing and I don't yet have the diagnostic tools available to see which stage is in error. I was trying to prove that you could actually authenticate with an SHA password digest by doing a bind.
    Regards

  • Getting rid of "value" attribute in f:selectItems?

    Hello,
    There is a simple problem I am facing at work that is actually hurting us significantly... we have a JSF 1.1 (yes, it's very old!) situation where we need to present a page that has a very long dropdown list, more than 5000 options in it. The problem is that the options are very long, and the entire page ends up being over 600Kb in the browser, and worse than that the application server gobbles up massive amounts of RAM just to generate the page.
    One optimization we want to do is to take advantage of the following fact: all of the options have values that match the labels. In other words, our options look like this:
    <option value="longString1">longString1</option>
    <option value="longString2">longString2</option>
    <option value="longString3">longString3</option>
    We'd like to reduce the page by 50% with a simple optimization: suppress the value attributes like the following:
    <option>longString1</option>
    <option>longString2</option>
    <option>longString3</option>
    We are generating these options in an ArrayList of SelectItems, and using an f:selectItems to generate the HTML... but we have NOT figured out how to suppress the value attributes. Try as we might, we are unable to remove them... Is there any way to get:
    <f:selectItems ...>
    to just display the labels???
    Or is there another approach we should use??
    Thanks in advance.

    Hi,
    Can't help specifically with JSF 1.1 I'm afraid, but in 2.0 you need to supply a custom renderer to achieve this. The default MenuRenderer will always write out the value attribute, as per the following code:
    // com.sun.faces.renderkit.html_basic.MenuRenderer
    protected boolean renderOption(...) {
      ResponseWriter writer = context.getResponseWriter();
      writer.startElement("option", component);
      writer.writeAttribute("value", valueString, "value");
      writer.write(curItem.getLabel());
      writer.endElement("option");
    }I achieved an option list with no value attributes by extending this class, overriding the renderOption method, commenting out the writeAttribute line, and setting that as the default renderer for the SelectOneMenu. Like I said, this was JSF 2, but maybe a similar approach would work for JSF 1.1?
    On a completely different approach, how often do the values in the list change? If they are infrequent, then maybe you could use something like the following:
    - dynamically create a javascript file that holds the data, plus a method to build an option list from this data
    - include a reference to this javascript file in the page header
    - create a custom tag in the page which uses the javascript to build the option tags
    The advantage of this is that you can let the browser cache the big javascript file with all the options in it, and only include a link to it and a call to the javascript function in the page data. If required, you can add a sequence number to the javascript link to force the browser to reload it when the data changes.
    Obviously, you still get the hit the first time you load the list (although the data here is much more concise, as you don't need to send the XML tags at this point and also you only need to send each value once), and it's not as useful if your data changes frequently. Also dumps some processing on the client side, but that sounds like it would be a good thing in your case!
    I've used this approach in other situations where I had to repeatedly push a lot of static data to the client. Never actually used it from JSF, but the principle is still valid. Let me know if you think it would be useful; sure I've still got the old javascript lying around somewhere
    Cheers,
    Barney
    @EJP / qimbal2: The OP asked a pretty specific question: "how to render a dropdown list without the value attribute", which is a perfectly valid question. Yes, we can all see that 5,000 items in a drop down list is not ideal, and I understand that anyone answering questions like these is generally doing so on their own time, but just stating that the design sucks isn't really helping.

  • Value attribute not visible in runtime collection

    Hi,
    I have created some 2-3 value attributes (display only) in a standard model node for BTDOCFLOW (which also contains some display only fields). Put in the logic in their Getter methods and fields are getting displayed in UI with the values.
    Now, my requirement is to display this table view (Assignment block) in default sorting based upon one value attribute and one model node attribute. But the problem here is, I am unable to find value node attribute at runtime in BTDOCFLOW collection at DO_PREPARE_OUTPUT. (Even display only standard context node attributes, which are not part of model node structure are not visible)
    I have re-defined method GET_TABLE_LINE_SAMPLE with the value attributes, resulting in enhanced rv_sample line, but still the value attribute is not visible at runtime in the collection.
    Can someone pl. tell me, how can I display my value attributes in collection along with model node attributes, so that I can do default sorting based upon one custom and one model node attribute.
    Thanks,

    Hi,
    Whne you define value attributes within the model attribute then the node becomes mixed instead of either value node or model node.
    So you need to access the mixed node and then should access model attributes and value attributes separately.
    Get your collection into a normal entity then assign the entity to mixed node
    DATA: lr_mixed TYPE REF TO cl_bsp_wd_mixed_node ,
                current TYPE REF TO if_bol_bo_property_access,
                 lr_current TYPE REF TO cl_crm_bol_entity.
         current ?= me->typed_context->entity name->collection_wrapper->get_current( ).
          lr_mixed ?= current..
          lr_current ?= lr_mixed->if_bsp_wd_ext_property_access~get_model_node( ).
    Best Regards,
    Dharmakasi.

  • Using text_input value Attribute - Prefill Entry

    I'm a newbie - I'm trying to prefill data entry on the Customer form of the CarDemo. I can add static values setting the value attribute, but I'd like to use request header or cookie values. Is that available through the implicit objects mentioned in the tutorial. I've tried a lot of combinations with no success:
    <h:input_text value="cookie["NAME"]" valueRef="CustomerBean.firstName" >
    Returns an error of:
    org.apache.jasper.JasperException: /Customer.jsp(89,39) equal symbol expected
         at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
         at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:363)
         at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:123)
         at org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:240)
    Any help here would be appreciated. Thanks,
    Matt

    Matt,
    First of all, you can use either the value property or the valueRef property, but not both. If your CustomerBean hasn't been created yet, you can used the managed bean facility and initialize the bean's properties via faces-config.xml:
      <managed-bean>
        <managed-bean-name>CustomerBean</managed-bean-name>
        <managed-bean-class>com.jeff.CustomerBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        <managed-property>
          <property-name>firstName</property-name>
          <value-ref>cookie["NAME"]</value-ref>
        </managed-property>
      </managed-bean>This way, the first time a component references the CustomerBean, it'll be created and the firstName property will be set to cookie["NAME"]. Of course this won't work if you create the CustomerBean some other way (like loading it from a database). In that case, you'll need to set up the values when you load the object (presumably in some Action). Also remember that this method initializes the value once -- it doesn't update it all the time.
    Kito D. Mann
    Author, JSF in Action
    JSF FAQ: http://www.jsfcentral.com
    I'm a newbie - I'm trying to prefill data entry on the
    Customer form of the CarDemo. I can add static values
    setting the value attribute, but I'd like to use
    request header or cookie values. Is that available
    through the implicit objects mentioned in the
    tutorial. I've tried a lot of combinations with no
    success:
    <h:input_text value="cookie["NAME"]"
    valueRef="CustomerBean.firstName" >
    Returns an error of:
    org.apache.jasper.JasperException:
    /Customer.jsp(89,39) equal symbol expected
    at
    org.apache.jasper.compiler.DefaultErrorHandler.jspErro
    (DefaultErrorHandler.java:83)
    at
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(Er
    orDispatcher.java:363)
    at
    org.apache.jasper.compiler.ErrorDispatcher.jspError(Er
    orDispatcher.java:123)
    at
    org.apache.jasper.compiler.Parser.parseAttribute(Parse
    .java:240)
    Any help here would be appreciated. Thanks,
    Matt

  • Exception while defining value attribute/View configuration issue

    Hello,
    I am facing an issue in view configuration. I have added value attributes to an existing context node in component BT116IT_SRVO, GenricItem view, BTADMINI context node. Now after adding the atrribute an exception is triggering as
    "Cannot display view BT116IT_SRVO/GenericItem of UI Component BT116IT_SRVO
    An exception has occurred Exception Class  CX_SY_MOVE_CAST_ERROR - Source type \CLASS=CL_BSP_WD_MIXED_NODE is not compatible, for the purposes of assignment, with target type \CLASS=CL_CRM_BOL_ENTITY 
    Method:  CL_CRM_UIU_BT_ITEMEOV_CN=>GET_QUANTITY 
    Source Text Row:  25 ".
    I have checked  source code of mentioned class, reference of CL_BSP_WD_MIXED_NODE class is coming after adding value attribute .
    Exception is triggering at statement: lr_entity ?= current. => In current ref of CL_BSP_WD_MIXED_NODE class is coming while lr_entity is type ref to cl_crm_bol_entity.
    I would really appriciate your reply on this as how can I avoid this exception? Do I need to redfine this method?
    Moreover the value attributes that I have added does not appear in Available Fields in View Configuration. Could you help me out in how can I make these fields available in configuration?
    Appriciate your replies on same.
    Regards,
    Rashmi

    The problem is solved.
    Thanks
    -Rashmi

  • Values not passing from form to context attributes (value attributes)

    Hi Experts,
    I have bound the properties of theadobe interactive form (WD-Java) to the context attributes but the values are not passing to the value attributes at runtime.
    For your information I have not bound the pdfsource binary attribute of the view to the custom controller pdfsource binary attribute.
    Please advise.
    Thanks,
    Shobhit

    Context
       GetData - ModelNode mapped to controller context (DataSource)
             Attribute1 - Value Attribute (Form Field)
    Is it allright to have the Data Source as a ModelNode (mapped to the controller context node) and then have Value Attributes under the ModelNode which are then bound to the adobe form input fields.
    I know its frustrating to advise on such questions without looking at the code actually. But I would definitely need your support.
    If possible could you mail me a project of yours where you have the form being PREFILLED with some values coming from a RFC FM and then the same form gets posted to SAP though another RFC FM.
    Thanks,
    [email protected]
    OK. When I create a Fresh Adobe Interactive Form application, it works fine.
    The problem Im facing is in the case, when Im using an existing PDF file created in the ABAP stack (TCode SFP). I am importing this PDF file into the WebDynpro Java Application and then binding the fields. So in this case the context binding does not work.
    You guyz are right, I need to check if there is any other script which exists. But still what are views after this update?
    Message was edited by:
            Shobhit Swarup Mathur

  • Model attribute binding to value attribute.

    Hi all,
          I have problem that i have used a model in my view. First i will me executing that model. Then i need to use the ouput parameter of that model to assign it to the value attribute present in the same view. And make it to be visible in the field to which that value attribute is assigned. Please help me out.

    Hi Selvakumar,
    Is it that, Your value attribute , say 'var' (which is bound to the view field) is
    the child of a value node(say this value node be 'MyNode')??
    Then give
    If only 1 record is needed for 'MyNode' set the cardinality of 'myNode' as 1..1 and then give
    wdContext.currentMyNodeElement().setVar(wdContext.<outputModelNode()>.<currentOutputmModelNodeElement>.getOutResult());
    Thanks
    Smitha
    Message was edited by:
            Armin Reichert

Maybe you are looking for

  • Macintosh HD not showing up in Disk Utility

    I know there have been many other threads related to this issue but I have not been able to find one that matches my situation. I was handed a mid 2012 intel based Macbook Pro from a cousin with "some issue" according to him. The computer was running

  • I want to transfer/sync my "favorites" from Internet Explorer 9 to Fire Fox, which only offers "Bookmarks." How do I import my favorites from Explorer to Firefox?

    I was unable to view Comcast videos, only, using IE 9, and a Comcast tech came out to my home to troubleshoot the problem. He could not resolve the issue within IE9 and I am operating from a Lenovo Laptop model type R500. The tech suggested that I us

  • Solution mnager - I m exploring SDTM

    Hi All, I m exploring SDTM but cud not understand the use of it.....as whenver a developer wants tester to test in CHARM flow the status is to be tested then why should a separate transaction type needs to be created ? Please Help me out.

  • Epson Stylus Pro and Epson Stylus Pro XL

    Dear Friends, I am looking for drivers for my two old Espon Printers "Stylus PRO" and "Stylus PRO XL". Unfortunately, I did not found anything on Epson Web portal and into the good packet "GIMP Gutenprint". On web is disponible just version for MAC O

  • XSLT counting error?

    I'm an absolute beginner with XSLT, and as a first test I'm trying to convert XML output from an SQL query to HTML. I've made it work, but I don't find it 100% logical. Here it is: The XML output from the SQL query: <ROWSET>   <ROW>     <customer_id>