Using javascript as attribute

Hi,
is it possible to use javascript as an attribute value in a JSTL tag, e.g.
<fmt:formatNumber value="${some.value}" pattern="javascript:getPattern();" />so that the pattern can be determined in run-time?
Thanks.

No. Other way is to do it in Java.
What does the Javascript´s getPattern() do? You should undoubtely be able to do the same thing in Java.

Similar Messages

  • Fetching Manager Attribute For The User In PeoplePicker Control Using JavaScript/JQuery

    Hi Everyone,
    I need to fetch the Manager, Department and Title information for user listed in PeoplePicker control on SharePoint site and List them in textbox using JavaScript.
    Please suggest the JavaScript code.
    Regards~
    Deepak Arora
    If you Find the Answer | Article | Blog Helpful Please Vote As Helpful / Mark As Answer

    Hi,
    According to your post, my understanding is that you want to get the user’s manager, department and title.
    We can use the GetUserProfileByName operation of the SPServices to achieve it, you can download it in the
    CodePlex.
    You can first retrieve the user of the People Picker control.
    http://sympmarc.com/2012/04/22/working-with-sharepoint-people-pickers-with-jquery-a-new-function-called-findpeoplepicker/
    http://sharepoint.stackexchange.com/questions/80839/unable-to-get-user-name-from-the-people-picker-control-using-jquery
    Then we can retrieve the user’s information using the SPServices.
    I have made a simple code demo to retrieve the user’s manager, department and title as below, you can have a look at it.
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="http://sp/Shared Documents/jquery.SPServices-2014.01.min.js"></script>
    <script type="text/javascript">
    // When the body is loaded, the onload event handler executes each function whose name is contained in this array.
    $(function(){
    var managerName;
    var title;
    var department;
    $().SPServices({
    operation: "GetUserProfileByName",
    async: false,
    AccountName: $().SPServices.SPGetCurrentUser(),
    completefunc: function (xData, Status) {
    console.log($(xData.responseXML).find("PropertyData").parent().html);
    $(xData.responseXML).find("PropertyData > Name:contains('Manager')").each(function() {
    managerName = $(this).parent().find("Values").text();
    //alert("the manager is"+managerName);
    $(xData.responseXML).find("PropertyData > Name:contains('Title'):eq(0)").each(function() {
    title = $(this).parent().find("Values").text();
    //alert("the Title is"+title);
    $(xData.responseXML).find("PropertyData > Name:contains('Department')").each(function() {
    department = $(this).parent().find("Values").text();
    //alert("the Department is"+department);
    var obj1=managerName+title+department;
    $("#Test").text(obj1);
    </script>
    <span id="Test"></span>
    More reference:
    http://sympmarc.com/2012/04/22/working-with-sharepoint-people-pickers-with-jquery-a-new-function-called-findpeoplepicker/
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How to Read Variable Values in WAD 7.0 Using JavaScript

    I found a how to: How to Read Variable Values in WAD 7.0 Using JavaScript on SDN.
    I get a Javascript error:
    bics.getElementsByTagName is not a function
    vars = bics.getElementsByTagName("VARIABLES")[0]; // <VARIABLES>
    Thats my script:
    function currency()
    var varnm = "SFS_CP_CURR"; // Name of the variable to be read
    root = document.childNodes[0]; // <HTML>
    body = root.getElementsByTagName("BODY")[0]; // <BODY>
    xml = body.getElementsByTagName("XML")[0]; // <XML>
    bics = xml.childNodes[0]; // <BICS_VIEW>
    vars = bics.getElementsByTagName("VARIABLES")[0]; // <VARIABLES>
    varl = vars.getElementsByTagName("VARIABLE"); // gives no. of variable in DP
    for ( i = 0; i <= varl.length; i++ ) // Loop one by one
    vari = vars.getElementsByTagName("VARIABLE")<i>;
    varnam = vari.attributes[0].text; // get variable name
    mem = vari.getElementsByTagName("MEMBER")[0];
    varval = mem.attributes.getNamedItem("name").value; // read variable value
    if (varnam == varnm) //check varname in loop needs to be read
    if (varval == "ZMON") // check for value1 and fire command1
    SFS_CP_M();
    if (varval == "ZKON") // check for value2 and fire command2
    SFS_CP_K();
    break;
    Where's the mistake?

    I'm afraid I haven't made my question understood clearly.
    What I am looking for is a method to get the value of variable inside excel (e.g. put it into a cell / range of a worksheet, so that we can reference it and use it as an input for planning function execution).
    Please advice.
    Thanks in advance,
    Shady

  • Using javascript to detect JVM

    Hi all.
    I'm trying to use javascript to detect whether the JVM (either j2sdk or j2ee) has been installed and take the user to SUN web page if not.
    The original MS JVM is not useable for my purposes (does anyone use it?).
    I know how to detect browsers and plug-ins but not JVM.
    Can anyone help out please ?
    TIA :-)

    If you use the classid and codebase attributes of the <object and <embed tags, it will download automatically. Easiest is to use HTMLConverter. You can change codebase to point to somewhere on your network if not everyone has internet access. See [url http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/using_tags.html]here

  • Using javascript to change the "Overall Result" cell in WAD

    Hi experts,
    I am trying to use javascript to change the text of the "Overall Result" cell in my web template using BI 7.0. I am not familiar with javascript, but I this is what I have done so far.
    I dragged the web item "Script" into my web template and I inserted the following code:
    function change_overall_result_to_average() {
    var cell = document.getElementsByTagName("TD");
    var cellText;
    for (i = 0; i < cell.length; i++)
          cellText = cell<i>.innerText;
               if (cellText == "Overall Result")
                     cell<i>.innerText = "Average";               
    In the XHTML view I am using added the onload function to start the javascript every time the web template is loaded. The code works fine when the web template is first loaded and the cell text is changed to "Average". However, if I navigate in my web template, the javascript function is not triggered, and the cell is therefore changed back to "Overall Result". For example, this happens when I pick another selection from one of my dropdown boxes, such as changing the selection from year 2008 to year 2007.
    I don't really know how to solve this problem in an easy way, and the current solution is not good enough. I hope one of you guys can suggest an easy way of fixing this:-)
    Best Regards,
    Morten

    Woodstock apparently renders some Javascript/DOM with some homegrown widget framework which on its turn renders the HTML DOM tree instead of plain vanilla HTML. Correct me if I'm wrong, to confirm this, just view the generated HTML source of the page.
    After some Googling I found out that you need getProps() and setProps() to get and set element attributes respectively.
    [http://google.com/search?q=webuijsf+domnode+site:sun.com].
    If you stucks with this, I recommend you to post this question at a forum or mailinglist devoted to Woodstock, e.g at their own homepage at dev.java.net or the Netbeans forum at nabble.com. You're here at a Sun JSF forum, not at a Woodstock forum.

  • Using Javascript in a report region

    I have a text box that I need to populate with an amount for billing. There is also a field that shows the amount due. If the amount due is equal to the amount being paid, I want my user to click on the amount due, and it automatically populates the amount being paid. I am using the javascript:setValue('destination','origination'); command, but the problem is that I am unable to choose the text field in the javascript. I have tried using #value# aliasing, and htmldb_application.g_f0x and just f0x... nothing seems to properly alias the text box within the tabular form. Any ideas?
    Thanks,
    Scott

    Scott,
    I know a way to do this, but it is not an easy implementation and it is quite hard to explain. Carl is an Oracle guy so he may know of a better solution, but here is what I came up with on my own:
    First let's be familiar with the htmldb_item syntax (found in the html db documentation):
    HTMLDB_ITEM.TEXT(
    p_idx IN NUMBER, -- unique id
    p_value IN VARCHAR2 DEFAULT NULL, -- value of item
    p_size IN NUMBER DEFAULT NULL, -- HTML tag attributes
    p_maxlength IN NUMBER DEFAULT NULL, -- max length
    p_attributes IN VARCHAR2 DEFAULT NULL, -- HTML elements including where you incorporate the javascript for this item
    p_item_id IN VARCHAR2 DEFAULT NULL, -- id you can specify
    p_item_label IN VARCHAR2 DEFAULT NULL) -- labe you can specify
    I would create your report region using the following sql statement:
    select order_number "Order Number",
    name "Name",
    amount_due "Amount Due",
    lpad((ROW_NUMBER() OVER (ORDER BY order_number)),4,0) "Row Num",
    htmldb_item.text(7,amount_paid,null,null,null,'f07_'||lpad((ROW_NUMBER() OVER (ORDER BY order_number)),4,0) "Amount Paid"
    from tbl_orders
    where....
    order by order_number
    --i had to use an order by to get the ROW_NUMBER() to work
    This will create on every row an item that is specific to the row number. For example:
    Row # Amount Paid text box item ID
    1 f07_0001
    2 f07_0002
    500 f07_0500
    etc.
    This will allow you to reference items based on what row they are when using javascript.
    Next you need to create a link out of the the amount_due column. Go to the Report Region, then the Report Attributes tab. Click on the edit link for the amount_due column. Go to the Column Link section.
    Make link_text = to the value of amount_due column(#amount_due# probably)
    Make the Target = URL
    Make URL = javascript: setValues('#AMOUNT_DUE#','#ROW_NUM#');
    This will send the value of amount due and the row number.
    Here's the javascript you would put in your HTML Header on you Page Attributes:
    <script language="JavaScript1.1" type="text/javascript">
    function setValues(due, rownum){
    document.getElementById('f07_'+rownum).value = due;
    </script>
    Give that a shot. I just created a page and got that to work.
    Chris

  • Character encoding problems when using javascript client-sdk for remoting

    Hi,
    I have recently downloaded LCDS to try.  I was interested in using Javascript for remoting.  I have a Java-based web application on the server side, and use HTML + Javascript (dataservices-client.js) to send/receive messages asynchronously in AMF format.
    I can both send and receive data (not only simple types, but objects with several attributes), however when I receive data from the server side that contains special chars (e.g. á, ï), I get some gibberish in my javascript objects. This is not same when I send content to the server: All special characters are received (printed) correctly in Java (server side).
    I inspired my coding with the simple example shown in https://blogs.adobe.com/LiveCycleHelp/2012/07/creating-web-applications-using-html5javascr ipt-remoting-client-sdk-with-livecycle-data-services.html
    Is there any bug on the serialization?
    My software version is Adobe LiveCycle es_data_services_JEE_4_7_all_win
    Java container is WebLogic 11g.
    Thanks
    =======
    Edited Apr 11 2014
    In my attempts, I tried using AMFX serialization so that I could see the message in a more comprehensible format inside my browser (eg using firebug).  After configuring an HTTP channel and destination in the server side, and adjusting accordingly in the client side code, the Javascript API still sends binary!
    Sadly, I concluded that client-SDK isn't mature enough...
    By the way, if you send an String like "&aacute" from the server, in the client you get "á"... instead of the raw "&aacute" ... they forgot escaping.

    hey,
    I had a similar experience. I was interfacing between 4.6 (RFC), PI and ECC 6.0 (ABAP Proxy). When data was passed from ECC to 4.6, RFC received them incorrectly. So i had to send trimmed strings from ECC and receive them as strings in RFC (esp for CURR and QUAN fields). Also the receiver communication channel in PI (between PI and  RFC) had to be set as Non unicode. This helped a bit. But still I am getting 2 issues, truncation of values and some additional digits !! But the above changes resolved unwanted characters problem like "<" and "#". You can find a related post in my id. Hope this info helps..

  • How to use JavaScript in Dynamic commandLink

    Hi All,
    In my JSF application, I am able to get the dynamic CommandLink with the below mentioned code.
    commandLink.setActionExpression(createActionExpression("#{myBean.myMethod}", String.class));
    The above code is navigating to the page mypage.jsp properly (the page which is returned by method myMethod).
    My Question is: Instead of navigation (as mentioned above) I want to generate a popup window using JavaScript on click of commandLink.
    Please suggest me on how to proceed on this?

    Hers is my JavaScript:
    function showPopupWindow(action) {
    formId=action.form.id;
    //features="height=300,width=250,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes";
    features="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=900,height=500,top=80,left=80";
    winId=window.open('Mypage.faces','list',features); // open search window
    winId.focus();
    This works perfectly with the onclick attribute of the commandbutton as shown below:
    <h:commandButton value="Open Popup" onclick="showPopupWindow(this); return false;"></h:commandButton>
    {color:#ff0000}
    But I tried same thing with the onclick attribute of the commandLink, that did not work.
    <h:commandLink value="Open Popup" onclick="showPopupWindow(this); return false;"></h:commandLink>
    {color:#0000ff}As per my requirement, I tried using setOnclick attribute in the following manner, that failed to open the popup:
    commandLink.setOnclick("{color}{color}*{color:#0000ff}showPopupWindow(this); return false;{color}*{color:#ff0000}*{color:#0000ff}");{color}*
    {color}

  • How to validate an text field item using javascript for numbers only.

    hi,
    how to validate an text field item using javascript for numbers only.please help me on this urgent
    please mail me solun if posible on [email protected]

    Hi,
    Page HTML header
    <script>
    function onlyNum(evt) {
      // Usage: onKeyPress="return onlyNum(event)"
      evt = (evt) ? evt : window.event;
      var charCode = (evt.which) ? evt.which : evt.keyCode;
      if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        var status = 'This field accepts numbers only!';
        alert(status);
        return false;
      var status = '';
      return true;
    </script>Item HTML Form Element Attributes
    onKeyPress="return onlyNum(event)"Br,Jari

  • Detect the Popup blocker settings by using javascript is it possible? if yes can any one suggest how to implement?

    How can i detect the Firefox the Popup blocker settings by using javascript, so that i can show message to user, saying" popup settings are on, please turn off or allow the site". can any one help me out. Thanks in advance.

    Hi William,
    I am writting a sample code for you :
    go to code wizard, select your node VBAk (where you have the attribute VBLEN )
    and select the attribute. Now code will be automatically generated.
        DATA LO_ND_VBAk TYPE REF TO IF_WD_CONTEXT_NODE.
        DATA LO_EL_VBAk  TYPE REF TO IF_WD_CONTEXT_ELEMENT.
        DATA LS_VBAk  TYPE WD_THIS->ELEMENT_VBAk.
        DATA LV_VBLEN TYPE WD_THIS->ELEMENT_VBAk-VBLEN.
      navigate from <CONTEXT> to <VBAk> via lead selection
        LO_ND_VBAk = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX__VBAk ).
      get element via lead selection
        LO_EL_VBAk  = LO_ND_VBAk ->GET_ELEMENT( ).
      alternative access  via index
      lo_el_VBAk  = lo_nd_VBAk ->get_element( index = 1 ).
      @TODO handle not set lead selection
        IF LO_EL_VBAk  IS INITIAL.
        ENDIF.
      get single attribute
        LO_EL_VBAk ->GET_ATTRIBUTE(
          EXPORTING
            NAME =  `VBLEN`
          IMPORTING
            VALUE = LV_VBLEN ).
    Now based on the value LV_VBLEN select values from database table and fill the internal table.
    DATA LT_VBAk  TYPE WD_THIS->ELEMENTSVBAk.  " this the table to keep the values
    select VBLEN ERDAT ERNAM AUDAT from VBAK into table LT_VBAk where VBLEN = LV_VBLEN. 
    Now you can bind the table to appropriate node.
    Regards,
    Monishankar C

  • How to use JavaScript to supply a value for a MessageTextInput field

    With the text attribute you can supply a deafult value for text field. Is it possible to supply this field with a default value determined by javascript ?
    <messageTextInput name="startDate" text="..." ...

    Marcel,
    If you want to dynamically set a value for a text field, there are two approaches you can use:
    1. use javascript (the browser language) and then for your <body> element's onload handler, invoke a javascript method that sets your form value.
    2. use java (the compiled language) and databind the "text" attribute of messageTextInput to a dataobject that gives the current date. If all you're looking to do is bind to the current date, I'd recommend this approach.
    Hope this helps,
    Ryan

  • The name attribute on the img element is obsolete. Use the id attribute instead.

    When I valadate my page I get an error "The name attribute on the img element is obsolete. Use the id attribute instead." In DW CS5.5 I cannot seem to enter an ID without DW also adding the ID as a name attribute too. Aside from manually going in and removing the name attribute from the code.

    It won't hurt to leave the name attribute in your <img> tag.  In fact, it may be necessary if you are going to add an image rollover behavior, since DW's javascript relies on that name attribute's value to correctly identify the desired image on the page.

  • Consolidation of Descendant Selectors Using JavaScript

    QUESTION:  How does one use Javascript to apply a CSS rule to a descendant set of selectors?
    BACKGROUND
    With each <li> tag (shown) there is associated a unique <body> tag (not shown).  Further, each <li> tag is grouped together with other <li> tags under the same <div> tag (shown).  All tags involved in this rule are uniquely identified with an id attribute.  Obvious, perhaps, there will be a unique webpage for each <li> tag.
    By way of example, if I were writing the rule for the tag <li id="setting"> of a single page, I would write it as follows:
    body#bodysetting div#probablepast li#setting {
         background-color:#AAA;
         color:#000;
    Note that the id of the <body> tag in the above example was obtained by prepending the word body before the id of the <li> tag.
    OBJECTIVE: With there being so many <li> tags, I am thinking that I should write a JavaScript that would repeat the above pattern for each and every tag.
    PROPOSAL:  For the moment, I am considering placing the <div> tag identifiers in one array, the <li> tag identifiers in another array, and then creating still another array for the <body> tag identifiers by prepending the word body to each element of the <li> tag array. A set of loop statements would then concatenate the tags and identifiers for each <li> tag into a single set of descendant selectors such as I have provided above and generate the same CSS rule for each new page when it opens.
    DISCLAIMER:  I realize that it would be sufficient to simply use the id of each <li> tag, but I would like to preserve the above structure for the sake of logical coherence and in anticipation of other behaviors that I have yet to develop.
    THE SELECTORS
    div#probablepast
    li#setting
    li#resistance
    li#ideology
    li#containment
    li#reforms
    li#deception
    div#popularpresent1
    li#peaceful
    li#industrious
    li#studious
    li#polite
    li#difficult
    li#closed
    li#traditional
    li#unique
    div#popularpresent2
    li#authoritarian
    li#mercantilist
    li#hightrust
    li#collective
    li#ricevillage
    li#neurotic
    li#racialpurity
    div#bridgingthegap
    li#gap
    li#identity
    li#shadows
    li#dilemma
    li#moreunique
    div#contemporaryjapan
    li#auntmadoka
    li#chishiki
    li#instruction
    li#worldwithin
    li#pyrimidal
    li#gaijinsama
    div#overcomingthebarriers
    li#culture
    li#genes
    li#nationalidentity
    li#bordercrossing
    li#language

    Murray *ACE* wrote: I am confused as to why you would want to style each list element uniquely.  It obviously is something of great importance (although I cannot think of an instance where I would want to do such a thing).
    With a little help you probably can:
    body#bodysetting li#setting {style definition}
    and
    li#setting {style definition}
    are not the same when the page is constantly changing as it does with "persistent page indicators".
    Murray *ACE* wrote: In that case, using javascript to accomplish something of great importance is a risky thing to do....
    Yes and no.  My Google stats tell me that 97% of my viewers are using Javascript when they view my pages.  This is an extraordinarily high proportion that is well worth targeting.  I can dream about the luxury of 100% accessibility after I begin receiving my expected book royalties. 
    For some, being generous is a way of life.  For others, it is a way of making a name for themselves while engaging in legalized tax evasion.  For me, it is a feeling that ebbs and flows according to the behavior of those who stand to benefit from my generosity.
    Thank you for your continued interest.
    Roddy

  • How to set style !important using javascript??

    i can set an items width using js
    page_item.style.width = "400";
    how do i incorporate the "!important" flag in this statement?

    Hi Craig,
    Here's the only blurb I could find on this:
    http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties/important.asp
    Notice the "Scripting: N/A" bit at the top.
    I use this site a lot - not because I'm particularly keen on MS/IE but because at the bottom of each entry you get confirmation of whether or not the setting/attribute/etc is standard or not and the pages are kept up to date.
    I have to say that this is only the second time I've come across someone trying to use this. The first time we just decided to leave it. I can see the importance of using it to stop someone overriding styling, but as I mentioned above, it is possible to create an entire script tag using javascript and, therefore, you can override it. Seems silly to me, but there you go!
    It would also be better, in my view, if they had used a better word for this setting - something like java's "final" - as, the first time I saw it I took it to mean "make more bolder" or "highlight it" or somesuch thing.
    Regards
    Andy

  • How to set readOnly property using javascript

    Hi Folks,
    How do I make an inputtext readOnly using javascript?
    I have tried the following
    var textComp = AdfPage.PAGE.findComponent("textId");
    textComp.setProperty('readOnly', 'true');
    var textComp = AdfPage.PAGE.findComponent("textId");
    textComp.readOnly = true;
    var textComp = AdfPage.PAGE.findComponent("textId");
    textComp.setAttribute('readOnly', 'true');None of the above works. Any idea?
    Thanks
    Vishal

    http://docs.oracle.com/cd/E12839_01/apirefs.1111/e12046/oracle/adf/view/js/component/rich/input/AdfRichInputText.html#getReadOnly__
    Get function for attribute for 'readOnly'. This attribute is secured. You may get it, but you may not set it. Any changes to this attribute will not be transmitted to the server.
    Setting readOnly inputText value using javascript.

Maybe you are looking for

  • MS homeserver 2011 connector error in Win 8.1 Update 1

    Had dificulty in installing win 8.1 Update 1, which required the OS rebuild.  The Win Homerserver 2011 connect program fails to install.  Error message includes "-either another software installation is in progress, or, the computer has a restart pen

  • Nokia C3 Chat application wont work!

    I updated my phone to ver 8.70 now i cant open my Chat app. Help please!

  • Redirecting stdout of third party API?

    Good Morning (or afternoon), I have an interesting problem with an application that I am writing. I am using my own classes, as well as a third party package that somebody developed, in this application. I have developed a GUI for ease of use and in

  • Advice on photo storage options, library or referenced

    Hi. I am unsure what the best setup is for my photos and wondered if someone could help... I have a NAS drive that has all my photos on, in organised folders, so I can stream them to my tv and browse them by folders. So easy to find events, holidays

  • Upgrading from 10.6.8

    I have a Macbook 4,1 (can't find or remember exact date) running OS X 10.6.8 but upgraded to 4GB memory.  I want to use iCloud   Can I upgrade to Mountain Lion on this computer and will that do the trick for me?