Create value Attribute

Hi,
I have a requirement to calculate some values and display them in web ui.
I enhanced component BT_CUSTOMER_I and displayed fields which I am using for calculation and enhanced view CustomerI.
In order to calculate fields i created value attribute CALCVALUE under context node BTCUSTOMERI.
When I created the attribute CALCVALUE  system automatically added methods:
GET_CALCVALUE
SET_CALCVALUE
GET_M_CALCVALUE
GET_I_CALCVALUE
I displayed the attribute in customer configuration.
In web ui I am getting exception for automatically generated code in GET_CALCVALUE
    TRY.
        dref = current->get_property( 'CALCVALUE' )."#EC NOTEXT
      CATCH cx_sy_ref_is_initial.
        RETURN.
    ENDTRY.
If I comment that part everything looks fine...
Can anyone tell me where should I set value for the attribute and how to do that?
Were I should do the calculation?
I tried in view class in DO_INIT_CONTEXT but I am getting null exception...
Thank you in advance

Hi Tanja,
  I answered a similar question in below thread, it should resolve your query as well:
[New field Within Contact Search Result List|Re: New field Within Contact Search Result List]
Basically, you need to populate the fields otherwise you will get exception or it will be displayed as not bound.
   As your current bol entity that is BTCustomerI does not hold that attribute - it will give exception in the GET_<attr> code.
1. Either you need to do append structure to its corresponding structure : CRMST_CUSTOMERI_BTIL, then write code anywhere such as in DO_INIT_CONTEXT or DO_PREPARE_OUTPUT
you can set value in any method of IMPL class as suitable by calling code similar to below:
lr_entity ?=  typed_context->BTCUSTOMERI->collection_wrapper->get_current( ).
lr_entity->set_property( iv_attr_name = '<name>'
                                          value = ... ).
2. OR, simpler way (but not good on performance) -- in GET method where you are getting exception - let the code remain commented - write your logic here directly to read value you want, do calculations as required and then finally write:
  VALUE = lv_calculated_value.
  A little better way would be do all calculations in IMPL class method, then put value in new IMPL class attribute that you can create. then in get method put value:
VALUE = owner->class_attr_name.
IF this doesn't work - create static attribute in IMPL class, populate value in DO_INIT_CONTEXT, then write code in GET method:
VALUE = classname=>attr_name.
I hope it resolves the query.
Thanks,
Rohit

Similar Messages

  • Automaticly create value attributes

    Hi,
    Is there a way to create automaticly value nodes and attributes in NWDS. The bapi only provides me the fieldname, -index en value. so it is only a table dumb of the r3 back-end.
    So I want the field values automaticly be created as an value attribute in a value node. So one way or an other I have to extract the data from the table into NWDS

    S.,
    Yes, this is possible.
    First, create empty value node in context, name it for example DynamicNode. Next, iterate over rows in table and dynamically add attributes:
    wdContext.getContext().reset(false);
    final IWDNodeInfo niDynamic = wdContext.nodeDynamicNode().getNodeInfo();
    for (int i = 0; i < rfcTable.size(); i++) {
      final <RfcStructureName> row = (<RfcStructureName>)rfcTable.get(i);
      niDynamic.addAttribute(row.getFieldname(), "ddic:com.sap.dictionary.string");
      /* above is string type used, other possible as well:
         integer, double, date, time, boolean etc
    Finally, iterate RFC table once again and create element:
    final IWDNodeElement entry = wdContext.nodeDynamicNode().createElement();
    for (int i = 0; i < rfcTable.size(); i++) {
      final <RfcStructureName> row = (<RfcStructureName>)rfcTable.get(i);
      entry.setAttributeValue(row.getFieldname, row.getValue());
    wdContext.nodeDynamicNode().addElement(entry);
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • Self defined type how to create value attribute

    Hello!
    How can I create a new context "value attribute" if its
    type is doesn't exist in the drop down list
    where you can choose either a primitive data types
    or a java Type. It is an self defined class.
    It's name is  "Notebook". I want to bind all the Notebooks
    with a value attribute. The method returns a  Notebooks-Array.
    How can I deal in such cases?
    Regards
    sas

    Hi,
    You need to put your java file inside src-->your package. As you said it is already there, then try to reload and rebuild your project. It must show in the java native types when you browse.
    Even check the package statement of your java file.
    thanks & regards,
    Manoj

  • Value attributes order in the table

    hi experts,
           i want to design a table as per the client specific.all i need is order is..after creating value attributes in the context,dragging from node to view,am not getting as required by the client.i want to set the table colums as specified in the requirements.Please guide me in this regard.
    thank's@regard's,
    Prashanth

    Hi
    Go to the outline view of your view for your layout. Right click the column and do 'Move up/down' based on your requirement.
    If your outline view is not open then go to Windows->Open View->General->Outline and open the outline view. Then open the View editor(designer) of your View and select the Layout tab. In the outline view you'll see all the UI elements of your view. Go to the table in question and move up/down the columns by right clicking them.
    Regards,
    Ajay

  • How to create a attribute to context node with the structure that is in DDIC

    Hi,
    I have created a 3 value attributes while creating a view.
    now i have changed the name of the one of the field in my own database table.
    now the problem is, when i open the webui and try to insert a row. i am getting error like "there is no field with that name(previous name) in collection".
    that is not showing the new name that i have changed. so i deleted the attribute from my view and tried to add the attribute again. and while adding a single attribute it is not taking the ddic structure. and one more problem is, when i open the ui it is showing an error like "  the attribute BaseEntityName is not defined or is still initial  "
    someone help me how to add the one more attribute from the same structure & how to provide BaseEntityName.
    Regards,
    Harry

    Hi Harry,
    If my understanding is correct you have added a attribute with name "ZX" and now you have changed the name of the field to "ZZX" and when you try to add the attribute it gives an error.
    In this case, if you are trying to add a attribute with the same name as you have used before. it will not allow so better to use a new name.
    If the attribute is there and if you are not able to get or set the value of it, Please change the attribute name in the getter and setter methods in the set and get property method call, because by default SAP generates a hard coded text for your attribute name in the methods and if you change the name of the field this will not change.
    Thanks,
    Ashok N.

  • All the steps involved in creating user attributes

    where is it documented on how to create user attributes that are stored in the ldap?
    I created a jspprovider channel, and I can get data out of the user attributes in the samplecontent.jsp by:
    JSPProvider p = (JSPProvider)pageContext.getAttribute("JSPProvider");
    SSOTokenManager mgr = SSOTokenManager.getInstance();
    SSOToken token = mgr.createSSOToken(request);
    AMStoreConnection dpc = new AMStoreConnection(token);
    String name = token.getPrincipal().getName();
    AMUser user = dpc.getUser(name);
    Map attMap = user.getAttributes();
    Collection valueCollection = attMap.values();
    Iterator valueIterator = valueCollection.iterator();
    int iSize = attMap.size();
    Set attKeySet = attMap.keySet();
    Iterator keyIterator = attKeySet.iterator();
    and then iterate through to display them all.
    I then tried to store a value using the sampledoedit.jsp file:
    JSPProvider p = (JSPProvider)pageContext.getAttribute("JSPProvider");
    SSOTokenManager mgr = SSOTokenManager.getInstance();
    SSOToken token = mgr.createSSOToken(request);
    AMStoreConnection dpc = new AMStoreConnection(token);
    String name = token.getPrincipal().getName();
    AMUser user = dpc.getUser(name);
    String aname = request.getParameter("attributeName");
    Object aval = request.getParameter("attributeValue");
    HashMap attMap = new HashMap();
    attMap.put(aname,aval);
    user.setAttributes(attMap);
    user.store(true);
    response.sendRedirect((String)pageContext.getAttribute("url"));
    For whatever reason, I get an error, and in the debug I just get couldn't set attributes.
    Then, when I try to retreive the list of attributes, the new name/value pair is created, but the value is blank.....
    Any ideas? Or a link on a step by step process on how to create user attributes?

    BTW, here is the error I get in the debug log:
    01/06/2005 12:43:47:232 PM AST: Thread[service-j2ee,5,main]
    ERROR: DesktopServlet.handleException()
    com.sun.portal.providers.ProviderException: JSPProvider.processJSPFile(): jsp=doedit.jsp, com.sun.portal.providers.ProviderException: JSPProvider.processJSPFile(): jsp=sampledoedit.jsp, com.iplanet.am.sdk.AMException: Unable to set attribute(s) com.sun.portal.desktop.taglib.DesktopTaglibException: JSPProvider.processJSPFile(): jsp=sampledoedit.jsp,
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:880)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:777)
    at com.sun.portal.providers.jsp.JSPProvider.processEdit(JSPProvider.java:673)
    at com.sun.portal.desktop.DesktopServlet.doGetPost(DesktopServlet.java:644)
    at com.sun.portal.desktop.DesktopServlet.service(DesktopServlet.java:320)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:586)
    com.sun.portal.providers.ProviderException: JSPProvider.processJSPFile(): jsp=sampledoedit.jsp, com.iplanet.am.sdk.AMException: Unable to set attribute(s) com.sun.portal.desktop.taglib.DesktopTaglibException: JSPProvider.processJSPFile(): jsp=sampledoedit.jsp,
    at com.sun.portal.desktop.taglib.provider.ProcessEditTag.doStartTag(ProcessEditTag.java:28)
    at jsps.etc._opt._SUNWps._desktop._AnyWarePortal_en_CA._JSPEditContainer._html._doedit_jsp._jspService(_doedit_jsp.java:193)
    at com.sun.portal.providers.jsp.jasper3.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
    at com.sun.portal.providers.jsp.JspServletWrapper.service(JspServletWrapper.java:182)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:863)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:777)
    at com.sun.portal.providers.jsp.JSPProvider.processEdit(JSPProvider.java:673)
    at com.sun.portal.desktop.DesktopServlet.doGetPost(DesktopServlet.java:644)
    at com.sun.portal.desktop.DesktopServlet.service(DesktopServlet.java:320)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:586)
    com.sun.portal.providers.ProviderException: JSPProvider.processJSPFile(): jsp=sampledoedit.jsp, com.iplanet.am.sdk.AMException: Unable to set attribute(s)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:880)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:777)
    at com.sun.portal.providers.jsp.JSPProvider.processEdit(JSPProvider.java:673)
    at com.sun.portal.desktop.taglib.provider.ProcessEditTag.doStartTag(ProcessEditTag.java:26)
    at jsps.etc._opt._SUNWps._desktop._AnyWarePortal_en_CA._JSPEditContainer._html._doedit_jsp._jspService(_doedit_jsp.java:193)
    at com.sun.portal.providers.jsp.jasper3.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
    at com.sun.portal.providers.jsp.JspServletWrapper.service(JspServletWrapper.java:182)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:863)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:777)
    at com.sun.portal.providers.jsp.JSPProvider.processEdit(JSPProvider.java:673)
    at com.sun.portal.desktop.DesktopServlet.doGetPost(DesktopServlet.java:644)
    at com.sun.portal.desktop.DesktopServlet.service(DesktopServlet.java:320)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:586)
    com.iplanet.am.sdk.AMException: Unable to set attribute(s)
    at com.iplanet.am.sdk.AMDirectoryManager.processInternalException(AMDirectoryManager.java:247)
    at com.iplanet.am.sdk.AMDirectoryManager.setAttributes(AMDirectoryManager.java:2151)
    at com.iplanet.am.sdk.AMCacheManager.setAttributes(AMCacheManager.java:867)
    at com.iplanet.am.sdk.AMObjectImpl.store(AMObjectImpl.java:1573)
    at jsps.etc._opt._SUNWps._desktop._AnyWarePortal_en_CA._WebFolders._html._sampledoedit_jsp._jspService(_sampledoedit_jsp.java:118)
    at com.sun.portal.providers.jsp.jasper3.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
    at com.sun.portal.providers.jsp.JspServletWrapper.service(JspServletWrapper.java:182)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:863)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:777)
    at com.sun.portal.providers.jsp.JSPProvider.processEdit(JSPProvider.java:673)
    at com.sun.portal.desktop.taglib.provider.ProcessEditTag.doStartTag(ProcessEditTag.java:26)
    at jsps.etc._opt._SUNWps._desktop._AnyWarePortal_en_CA._JSPEditContainer._html._doedit_jsp._jspService(_doedit_jsp.java:193)
    at com.sun.portal.providers.jsp.jasper3.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
    at com.sun.portal.providers.jsp.JspServletWrapper.service(JspServletWrapper.java:182)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:863)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:777)
    at com.sun.portal.providers.jsp.JSPProvider.processEdit(JSPProvider.java:673)
    at com.sun.portal.desktop.DesktopServlet.doGetPost(DesktopServlet.java:644)
    at com.sun.portal.desktop.DesktopServlet.service(DesktopServlet.java:320)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:586)

  • Dynamically building 'value' attributes with EL

    I'm trying to create an <af:inputText> component with a dynamic 'value' attribute. I'd like to generate something like this:
    <af:inputText value="#{myBean.myField}"/>
    Where 'myField' is a string stored in another var...#{myField}.
    Essentially I'd like to concatenate '#{myBean.', #{myField}, and '}' and use it to dynamically specify the value that the inputText is mapped to.
    Is there a way to do this with the JSF EL?
    Thank you.

    I'm almost positively sure that you cannot do what you want to do.
    But why do you want do do such a thing like that?
    If you want to do a reusable page, you can use the alias bean tag of Tomahawk (www.myfaces.org)

  • How to create numeric attribute using ABAP API

    Hi experts
    I'm trying to create a numeric attribute for a taxonomy table. In the how-to-examples there are only ways to create text attributes.
    Those who have tried, please let me know the steps.
    I have given below the code snippet which i tried to create numeric attribute. Please let me knw the missing link.
    ls_num_attr_val-rating = 500.
        APPEND ls_num_attr_val TO ls_ext_attr_info-characteristics.
      ls_ext_attr_info-attr_info-attr_id-id = lv_attribute_id.
           APPEND ls_ext_attr_info TO lt_ext_attr_info.
        GET REFERENCE OF lt_ext_attr_info INTO lv_data.
        ls_namevalue-value = lv_data.
        ls_namevalue-code = 'ACCT'.
        APPEND ls_namevalue TO ls_parameter-name_value_pairs.
        lv_string = 'Customer 12'.
        GET REFERENCE OF lv_string INTO lv_data.
        ls_namevalue-value = lv_data.
        ls_namevalue-code = 'CUST_NAME'.
        APPEND ls_namevalue TO ls_parameter-name_value_pairs.
        CALL METHOD lr_api->mo_core_service->create
          EXPORTING
            iv_object_type_code = 'ACCT_TYPE'
            is_parameter        = ls_parameter
            iv_parent_id        = 0
          IMPORTING
            ev_new_internal_id  = lv_key.
    Thanks
    SwarnaDeepika
    Edited by: SwarnaDeepika on Dec 19, 2009 4:38 PM

    Hello Ashok,
    [here|https://help.sap.com/javadocs/MDM/current/com/sap/mdm/examples/CreateField.html] is the Java API of the needed command.
    There is also an example of how to create a field. You can use the class by replacing the strings for the server, repository, table, etc. to your needs.
    If you want to create more than one field, simply use a loop, like the for-loop, while-loop, etc.
    Hope this helps.
    Best regards
    Dominik

  • SAP CRM MObility Activity Survey to create Marketing Attributes for a BP

    ATtrHi Gurus ,
    I have to create an Activity from IPAD ( CRM Mobility ) which will create a survey response,and the survey responses have to be captured and then create Marketing Attributes for the BP related to the Activity. I am not able to use the Callback Function given to IPAD Application.
    So my Approach so far has been :
    implement a badi that gets trigerred at Survey Response submission.
    in that call function module crm_svy_activity_pai.(Made a Z-copy of this to enforce COMMIT WORK )
    I am not able to pass the parameter lr_values for FM: CRM_SVY_ACTIVITY_PAI
    These are the 2 links that has been useful so far . Kindly add to this if possible.
    Regds
    Oindrila

    Hi Jacques,
    Once you click on Marketing in Web UI you will find "Marketing Attribute" in the Work Area.Click on that.
    You need to give ID No. and Attribute Set name.
    You need to mark Persons and Organisation checked also.
    Below that you will find 2 blocks " Attributes" and "Value"
    Under Attribute gve your Attributes Names you want to define ( e.g. Age,Salary or any client defined..) then select the Format ( Numeric or Chracter etc...)
    Once you have filled in all the Attributes you click on one attribute and below you need to fill the Values ( e.g 20-30 yrs etc...) . If you want to make that value a default one you can select default check box against each value.
    That way for each attributes you can define values. Hope this would help you.
    Regards...
    Edited by: akscrm akscrm on Sep 3, 2008 2:19 PM

  • Using "Update All Mapped Fields" with multi-value attributes

    Is it possible to update a value in a multi-value attribute through the import manager?  It appears that if a source value is different then it just gets added as another value to the record.
    For example, a product has an attribute of speed which is measured in revolutions/minute. Some products can be rated at two speeds (i.e. 1800/3600).
    I created a numeric attribute for speed and enable only nominal rating and selected multi-valued.
    In import manager, I set "/" as multi delimiter for source field.  This created two entries in destination attribute, 1800 and 3600. 
    However, if on subsequent imports the speed values changes for this record (i.e. 1200 and 1800) then I will now have 1200, 1800, and 3600 as values for this record.
    Would the proper solution be to create two individual numeric attributes that are single valued (i.e. Speed1 and Speed2)?

    Hi Aaron,
    in your example it would make sense to use two different attributes called "Speed1" and "Speed2". Using the multi value option, MDM allows you to store a list of values into a single field. This list is more or less unlimited, you can add as many values as you like. A change of an existing value is not possible. The reason is that Import Manager does not know, which value you've changed! So it simply adds the "new" record (which is the 1200 in your example) to your value list. This is the intended behaviour of the "update all mapped fields option". If you really want to replace the values, you can check if the "Replace" option is useable for you. But note, that the replace will replace the complete existing record with the incoming new one. This means if the product you want to import with the replace option is smaller than the existing one (maybe it does not contain values for all segments), you'll loose data in MDM.
    BR Michael

  • How to create an attribute

    Hi,
    I can create xml elements in designer, e.g. John Brinkman's example
      // Add a question datagroup with the right question type
      // then add a question subform to bind against it.
                                                      var vNewQ = xfa.datasets.createNode("dataGroup", "Question");
                                                      vNewType = xfa.datasets.createNode("dataValue", "QuestionType");
                                                      vNewType.value = vQDef.QuestionType.value;
                                                      vNewQ.nodes.append(vNewType);
                                                      vSection.dataNode.nodes.append(vNewQ);
    However, I would like to create an attribute (I'm working with an existing predefined schema) but I can't seem to find a simple way, e.g.
    I would like something like
    <Question QuestionType=""/>
    How can I do this? I tried loading the XML in like
                                                      var vNewType          =
                                                                                                          <Question QuestionType="">
                                                                                                          </Question>;
                                                      xfa.data.mForm.loadXML(vNewType.toString(), false, false);
    but unless I give it a child node, it bombs out. It will work with
      var vNewType =
        <Question QuestionType="">
           <dummyRow/>
        </Question>;
    Any help would be worth 5 gold medals.

    Hi,
    You need to set the contains property of the dataValue to 'metaData" to turn it into an attribute, but you can only do this once the dataValue has a parent, so your code should look like;
    var vNewQ = xfa.datasets.createNode("dataGroup", "Question");
    vNewType = xfa.datasets.createNode("dataValue", "QuestionType");
    vNewType.value = vQDef.QuestionType.value;
    vNewQ.nodes.append(vNewType);
    vNewType.contains = "metaData";
    vSection.dataNode.nodes.append(vNewQ);
    Regards
    Bruce

  • 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

  • How to create value request for screen field text box tt1

    How to create value request for screen field text box tt1
    i have a text box name tt1,
    i want f4 help for that .
    remember i am asking for screen i.e done from screen layout not selectio-screen.
    Thank you,
    Regards,
    Jagrut Bharatkumar Shukla,

    Hi,
    Create one Search Help in the SE11 for the particular Field that u want to display. In the Screen(Transaction SE51),For that Text Box in the Attributes,in Dict Tab ->Search Help Field give that Search Help Name.
    For Eg,
    If u want Purchase Order Numbers in that F4 Help.Create one <b>Search Help</b> by giving Table Name as <b>EKKO</b> & <b>Search Help Parameter</b> as <b>EBELN</b> with Lpos & Rpos as 0 & 1.Save & Activate it.
    Give this Search Help Name in Dict Tab ->Search Help Field of that Screen Attributes.
    Regards,
    Padmam.

Maybe you are looking for

  • Adobe Digital Edition Errors/Troubleshooting

    When installing Adobe Digital Editions, I  received a corruption error message." This occurs because the installation software coming from  Adobe's Web site is unable to communicate and pass information through  your companies Firewall or PC security

  • How to return the values of LOV to items in forms

    Hi, I have created an LOV based on a select statment that return 3 columns I want to return theses 3 values to 3 items in the form? I'll appreciate any suggestion. Imad.

  • Any help adding podcasts to my shuffle? New version causing probs

    I have a 2nd gen shuffle and a couple of days ago updated to latest version of itunes. Since then I cant add any podcasts to a playlist. Music I can add fine, but when I add a podcast, even when it shows in the playlist it just wont update into the s

  • Can't connect to internet via wireless

    I am unable to connect to the internet via wireless on a consistent basis I can ping my router every time though. When the internet works it seems to be completely random. I tried some fixes posted on the forums for problems similar to mine like, set

  • Error regarding

    hi can you please tell me that how could remove the duplicacy in the given error from the resoursce .duplicacy is basically 0ATY,0OPR it is benn repeated 4 time andalso i want to know what is basically IHS-AKtivitat,etc Co Account Assignment