Problem in onClick attribute of the netui:anchor tag

Hi,
I have a String object to be passed to the javascript function with onClick attribute.
eg: <%String st = new String("helo");%>
<netui:anchor action="display" onClick="display()">
I want to pass the object st to the java script so that I can do some validations. how can I do that. If I say,
onClick="display('<%=st%>')" it is not working. can you please suggest me a solution.
Regards,
Satish.

I haven't tried this with the netui:anchor tag, but it works with the netui:button tag.
<%
String onCl = "display('" + st + "')";
%>
<netui:anchor action="display" onClick="<%=onCl%>">
Apparently, you can place a scriptlet inside the onClick attribute, but you cannot intermingle the scriptlet with plain text.
Also, the onclick attribute appears not to support XScript ({request.whatever}). I find that weird.

Similar Messages

  • Netui: anchor tag with target attribute.

    I am using the netui:anchor tag inside an iframe to post to an action. But the
    resulting page is displayed within the iframe. Will the target attribute of the
    netui:anchor tag help solve the problem. What is a valid value of the target
    attribute.
    thanks,
    Shankar

    does the action have a formSubmit = true? If not then your modal dialog should be shown via the onclick and you have to javascript the link click (based on your modal dialog options)
    If you do have a formSubmit=true, then you'd have the onclick show the modal dialog and you would have to write additional javascript to submit the form (Along with setting its action)
    regards
    deepak

  • Netui Anchor Tag

    Can we use href and action attribute in netui:anchor tag both at a time...*href* is for opening a modal dialog and action is page flow action

    does the action have a formSubmit = true? If not then your modal dialog should be shown via the onclick and you have to javascript the link click (based on your modal dialog options)
    If you do have a formSubmit=true, then you'd have the onclick show the modal dialog and you would have to write additional javascript to submit the form (Along with setting its action)
    regards
    deepak

  • Netui anchor tag in netui:form

    I have some code like following:
    <netui:form action="action1" >
    <netui:anchor action="action2">Check</netui:anchor>
    </netui:form>
    Action1 and action2 willl be finally redirected to the same JSP(for example one.jsp).
    The weird thing is that: according to log output, it seems that one.jsp has been hit twice when user click "check" link.
    Is it possible that when user click "check" link, weblogic not only trigger action2 but also trigger action1? forsubmit attribute is not set to true explicitly for netui:anchor tag.
    Thanks in advance

    hi
    verify from a browser trace tool (e.g. livehttpheaders, fiddler or firebug) how many requests your browser is making. (or you can inspect the code that portal generates in the HTML). Once we have determined whether its the browser making the two requests or something on the server, we can see if there are workarounds.
    regards
    deepak

  • Problem with optional attribute caching on a custom tag

    Hello,
    I've created a tag by extending TagSupport. I have one attribute that is optional. I'm having a problem with this attribute since the tag is cached. If the value is not specified in the tag, it is always using the previous value from the past request.
    I understand why this is happening, but I wonder if there is anyway to reset this value besides doing it at the end of the doStartTag or in the doEndTag methods? I simply want it to be an empty string if it is not in the request.
    Thanks,
    Tim

    Thats abit overkill in my opinion.Probably yes, but its a cleaner option. In case your doEndTag handles custom exceptions, you would anyhow need to put this code in a finally block, right ?
    public int doEndTag() throws JspException {
    try {
    call some methods that throws other checked exceptions;
    }catch(Exception1 e){
    throw JspException(e);
    }catch(Exception2 e){
    //log and ignore
    }finally{
    //clean up here
    return an int;
    Having said that, different containers implement the spec a bit differently. For example, in our project, we use weblogic and for wl, we put our clean up code in the release() method which according to the spec, needs to be called only before gc. Weblogic implementation is a bit different - its called after doEnd() for every use of the tag.
    This is from jsp spec regarding tag life cycle especially with reuse
    Some setters may be called again before a tag handler is reused. For
    instance, setParent() is called if it�s reused within the same page but at a dif-ferent
    level, setPageContext() is called if it�s used in another page, and
    attribute setters are called if the values differ or are expressed as request-time
    attribute values.
    �Check the TryCatchFinally interface for additional details related to exception handling and resource management.
    cheers,
    ram.
    }

  • Extending netui Anchor tag

    Has anyone extended netui anchor tag and created custom tag?
    I am considering writing a custom pagination tag extending the anchor tag.
    Appreciate any suggestions ..sample code
    Thanks

    Just need to provide a caveat with extending the 8.1 NetUI JSP tags...
    Unfortunately, the Workshop 8.1 JSP tags did not provide a supported extensibility API. If the 8.1 JSP tags are extended, BEA / Workshop do not make any guarantees about the forward compatibility of these APIs in future releases. A NetUI JSP tag API will be available in the 9.2 GA release of Apache Beehive, which will be included in Workshop 9.2.
    Hope that helps...
    Eddie

  • Error in form submit through netui:anchor tag onClick event

    Hello,
    I am working on a portal application. Below is my jsp code of a simple search screen. The search parameter is customername.
    <netui:form action="searchCustomer" style="form" tagId="myForm">
    <netui:textBox dataSource="{actionForm.customerName}"></netui:textBox>
    <netui:anchor onClick="sayHello(); return false;" styleClass="button" action="searchCustomer" formSubmit="true"> Search</netui:anchor>
    </netui:form>
    I have an onClick event as I want to implement some customer logic on click of the anchor tag.
    function sayHello(){
    // customer implementation here
    document.forms[getNetuiTagName("myForm",this)].method="POST";
    document.forms[getNetuiTagName("myForm",this)].action="/searchCustomer.do";
    document.forms[getNetuiTagName("myForm",this)].submit();
    In the searchCustomer method of the controller, the form has zero parameters. The customerName has null value.
    Can anyone tell me what am I doing wrong here.
    Any help is appreciated.
    Thanks
    Manju

    I also want to add a confirm() dialog before submitting. However, setting the onClick handler overrides the one generated when formSubmit="true". I worked around this by calling the generated function directly:
    <... onClick="if (confirm('[msg]')) { anchor_submit_form(getNetuiTagName('[formName]'), this.href) } return false;">
    Where [msg] is the message to display and [formName] is the name of the form containing the anchor.
    Hope this helps someone.

  • Where the netui:anchor is translated by a portal?

    I’m just wondering… How it’s possible, that I can use existing page flows as a portlets, without any changes to the existing JSPs. In those JSP I’ve got links created by <netui:nachor action=”actonName”>, but those are beehive tags, not connected with the portal implementation.
    Of course, when I deploy this flow as a portlet, created URL are different, to accommodate portal context. So, where the magic takes place? In other words, where the default output of the netui:anachor is overridden?
    I just like to know, how things are working…
    Brgds,
    Pawel Kozlowski

    This is done via a URL rewriting framework within WLP. We use this
    mechanism for all URLs generated portlets as long as portlets use some
    known tags/APIs to create URLs.
    For instance, when you use an anchor tag, depending on how it is used,
    the following will happen:
    a. Use the page flow directly: The anchor tag generates a URL based a
    page flow specific URL rewriter.
    b. Use a page flow as a local portlet: The anchor tag delegates URL
    generation to a URL rewriter deployed by the portal framework.
    c. Use a page flow as a portlet deployed on a WSRP producer: The anchor
    tag delegates URL generation to a URL rewriter deployed by the WSRP
    producer.
    In each case, the output will be different, and is specific to how the
    page flow is being used. The same approach applies to struts apps
    deployed as portlets.
    This is the reason WLP always requires you to use some known tags (like
    pageflows, struts, or WLP's render tags, or the JSR168 API) to create
    links. If you create links directly without using these tags, the
    generated URLs may or may not work.
    Subbu
    Pawel Kozlowski wrote:
    I???m just wondering??? How it???s possible, that I can use existing page flows as a portlets, without any changes to the existing JSPs. In those JSP I???ve got links created by <netui:nachor action=???actonName???>, but those are beehive tags, not connected with the portal implementation.
    Of course, when I deploy this flow as a portlet, created URL are different, to accommodate portal context. So, where the magic takes place? In other words, where the default output of the netui:anachor is overridden?
    I just like to know, how things are working???
    Brgds,
    Pawel Kozlowski

  • How to keep the defaultValue in the netui:select tag at the beginning of the dropdown values?

    Hi,
    I am using <netui:select dataSource="{actionForm.xyz}" defaultValue="Any" optionsDataSource="{actionForm.someMap}"
    />
    Now I am getting the values from database to populate the dropdown using the optionsDataSource.
    As I am using the defaultValue, it is being added to the end of the dropdown and
    selected by default when I a mopening the page on browser.
    In my dropdown, the values are as follows:
    apple
    orange
    banana
    Any
    Now my requirement is, the defaultValue, Any, must be there at the top of the
    list instead at the bottom of thge dropdown values. i.e., In the above list, "Any"
    must be above apple option.
    How can I achieve this using netui:select tag?
    Thanks & Regards,
    Murthy

    Murthy,
    Unfortunately, though a very reasonable requirement, there is no option for
    placing the default item.
    - john
    "Murthy" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hi,
    I am using <netui:select dataSource="{actionForm.xyz}" defaultValue="Any"optionsDataSource="{actionForm.someMap}"
    />
    Now I am getting the values from database to populate the dropdown usingthe optionsDataSource.
    As I am using the defaultValue, it is being added to the end of thedropdown and
    selected by default when I a mopening the page on browser.
    In my dropdown, the values are as follows:
    apple
    orange
    banana
    Any
    Now my requirement is, the defaultValue, Any, must be there at the top ofthe
    list instead at the bottom of thge dropdown values. i.e., In the abovelist, "Any"
    must be above apple option.
    How can I achieve this using netui:select tag?
    Thanks & Regards,
    Murthy

  • How can one use one specific security realm per application ? The realm-name attribute of the login-config tag of web.xml does not make any difference

    Hi,
    I have different sets of users coming from different databases and using different
    roles mapping for each of my web applications. I would like to configure a specific
    security realm per application in my weblogic server 7.0 . Is it possible ?
    I try to specify the realm-name of the login-config tag from the web-xml deployement
    descriptor but it doesn't make any difference. The default realm is always used.
    I also would like to tell the Weblogic server to use the default realm in case
    the realm isn't specified or isn't found. For example, the default would contains
    my admin users.
    Thanks a lot for your answer.
    Iz

    I thik this is a common mistake the ralm-name tag in the deployment descriptor is used
    just by the browser for display purposes (when it opens the basic auth dialog box) so as
    of now there is only 1 active realm which can have multiple providers as Kevin pointed
    out
    Kevin Lewis wrote:
    WebLogic 7 now ignores the realm-name tag (I found that out yesterday).
    My understanding is that there is only one realm active at a time for a domain
    (I would be interested in being contradicted in this).
    However, you can have multiple providers in each category of a realm: authentication,
    authorization, etc. Therefore, what you can do is key authentication, et al,
    off of some other information. We have our users enter their company, for example,
    and use the TextInputCallback to get it. You could also encode something in the
    initial page, based on the URL they hit, or whatever, and get that back in your
    callback.
    You can store that information in your own Principal implementation, and key off
    of that in your authorization provider, going to a different database as appropriate,
    or abstaining when a specific provider doesn’t have anything to say about a subject.
    Anyway, there should be a way to do it, even if it's more complex than you would
    have hoped.
    --Kevin

  • Problem with flush=true in the jsp:include tag

    Hello
    I have deployed a JSP based application , based on the apache struts framework. The web server is Sun One Webserver 6 Service Pack4, on a windows 2000 machine
    The same application was tried on SunONE application server 7, and it works without any problem. However in this case the following error , on the page
    javax:servlet.jspexception:Illegal to flush within a custom tag
    Does this mean flush="true" is not allowed within custom tags
    Or is there a workaround for this
    Any help is appreciated
    thanks
    - Aniruddha

    Hi,
    This is a known problem, ��flush before you include�� limitation in JSP 1.1.
    As a result, you have to state flush="true" every time you include a jsp using <jsp:include> tag if you are using JSP1.1.
    Fortunately, it is fixed in JSP1.2. The flush attribute controls flushing. If true, then, if the page output is buffered and the flush attribute is given a ��true�� value, then the buffer is flushed prior to the inclusion, otherwise the buffer is not flushed. The default value for the flush attribute is ��false��.
    Gary Wang
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • Understanding targetNamespace attribute of the service ant tag

    I am using the servicegen and clientgen ant tasks provided by bea to generate the webservices rpc code for a bean client. Nested in the servicegen task, in the service tag is a targetNamespace attribute that is required
    http://e-docs.bea.com/wls/docs81/webserv/anttasks.html#1080062
    I have garbage in there now and things seem to work. What should I have this value set to. I guess a description of the targetNamespace would really help.
    Thank,
    -Fazle

    in short targetNameSpace of servicegen and autotype should be the one you defined in your schema or wsdl

  • Output of netui:anchor - 1563

    Hello,
    I have a requirement, where I need to pass the output generated by netui:anchor
    to a javascript. Basically I need to capture an portlet action url along with
    the portal desktop and sendit to mailto functionality. I tried using the id attribute
    of the netui:anchor tag and unfortunately it is not working. The id is set to
    null by the tag.
    Is there a way to capture a porlet's action url?
    Thanks for your help.
    Senthil Kumar.S

    Nevermind. I solved it.
    Thanks
    Kunal
    "Kunal Mittal" <[email protected]> wrote:
    >
    I have my WebLogic Server running on port 7110. There are several places
    where
    I use the netui:anchor tag to generate links and form submit. However,
    the url
    that gets generated in the html output (I did a view source in IE to
    see this),
    all have 7001 as the port instead of 7110.
    Thanks
    Kunal

  • Netui:anchor generates port as 7001 instead of another port

    Hi...
    I have my WebLogic Server running on port 7110. There are several places where
    I use the netui:anchor tag to generate links and form submit. However, the url
    that gets generated in the html output (I did a view source in IE to see this),
    all have 7001 as the port instead of 7110.
    Any clues?
    Thanks
    Kunal

    There should be an xml file in your web-apps WEB-INF dir called something like
    url-template-config.xml which has server settings like port number etc. I believe
    this is used to generate URLs for page flows etc.
    "Troy Hamsher" <[email protected]> wrote:
    >
    So... how did you figure this out?
    "Kunal Mittal" <[email protected]> wrote:
    Never mind. I figured this out.
    Kunal
    "Kunal Mittal" <[email protected]> wrote:
    Hi...
    I have my WebLogic Server running on port 7110. There are several places
    where
    I use the netui:anchor tag to generate links and form submit. However,
    the url
    that gets generated in the html output (I did a view source in IE to
    see this),
    all have 7001 as the port instead of 7110.
    Thanks
    Kunal

  • Title attribute for netui:anchor

    Does anybody know how to set an title on a <netui:anchor> tag? I can't see anyway
    of doing this from the documentation.
    As of Oct 04 this will be illegal in Europe when the Disability Discrimaination
    Act legislation comes into effect.
    Many Thanks
    Tony

    There's not a way to do that currently. This is a bug that will be fixed in
    the next version.
    Rich
    "Tony Cromarty" <[email protected]> wrote in message
    news:400c0e2a$[email protected]..
    >
    Does anybody know how to set an title on a <netui:anchor> tag? I can't seeanyway
    of doing this from the documentation.
    As of Oct 04 this will be illegal in Europe when the DisabilityDiscrimaination
    Act legislation comes into effect.
    Many Thanks
    Tony

Maybe you are looking for

  • Video Ipod 80G 5th generation not being recognized by computer or  itunes.

    My ipod is not being recognized by my computer or itunes at all. I bought a new cable and nothing happens as well. however when i connect it in my car it works fine. did any resolve this issue? I am not sure if its the new software that has the issue

  • How to create a directory in application server

    Hi all, How to create a directory in application server through Progaram?? eg:\tmp - is already existing I want to create \tmp\fi  Within \tmp\fi - i should able to store my file,,, Kindly help me urgent...

  • Deploying ejb-jar when DataSource is defined

    Hi, I have an application that I have been deoploying to ear/ejb-jar/war files for some time. But I have found when I added a DataSource for CMP entity beans deployment of the ejb-jar failes with the following error; WARNING: Skipping deployment step

  • Is there a fix for "ebay" listing "duration" problem?

    This is what happens "every time" I list a new item for sale on Ebay and get to the choice of "listing duration". You normally have a choice of days (1,3,5,7,10). It's always set on one of them before I attempt to change it. It is usually on 3 days,

  • Infotype Log report: RPUAUD00

    Hi, RPUAUD00 is not supporting for some Infotypes. I have configured tables V_T585A, V_T585B and V_T585C, still issue is same. So, Is there any other things need to be configured? Thanks SK