How to use h:selectOneRadio tag  inside h:dataTable tag

Hi All,
Can any one tell me how to use <h:selectOneRadio> tag inside <h:dataTable> tag and how to get selected radio button value in bean ?

JSF<h:selectOneMenu value="#{myBean.selectedItem}">
    <f:selectItems value="#{myBean.selectItems}" />
</h:selectOneMenu>MyBeanprivate String selectedItem;
public String getSelectedItem() {
    return selectedItem;
public void setSelectedItem(String selectedItem) {
    this.selectedItem = selectedItem;
public List getSelectItems() {
    List selectItems = new ArrayList();
    selectItems.add(new SelectItem("key1", "value1"));
    selectItems.add(new SelectItem("key2", "value2"));
    selectItems.add(new SelectItem("key3", "value3"));
    return selectItems;
}String selectedItem should contain the key (key1, key2 or key3) when selected. The values (value1, value2 and value3) are the options as shown in the list.

Similar Messages

  • Problem using jsp:include from inside a custom tag

    Hi, All !
              I have a problem using <jsp:include> from inside a custom tag. Exception is:
              "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
              Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
              could not do this. Is it a bug, since in the 1.1 spec is said: "The
              BodyContent is a subclass of JspWriter that can be used to process body
              evaluations so they can retrieved later on."
              My code is:
              <wfmklist:items>
              <jsp:include page="item.jsp" flush="true"/>
              </wfmklist:items>
              

    This is an area of contention with WL. It is not so tolerant with regards to
              the spec. I spent several days recently trying to convince it to accept the
              specification in regards to bodies and includes and it appears to have
              successfully rebuffed my efforts.
              Frankly, this is very disappointing. It appears that some shortcuts were
              taken on the way to JSP 1.1 support, and the result is a very hard-coded,
              inflexible implementation. As I have not seen the implementation myself, I
              hate to assume this, however one could posit that the term "interface" was a
              foreign concept during the implementation, other than as some annoying
              intermediary reference requiring an immediate cast to a specific Weblogic
              class, which in turn is apparently required to be final or have many final
              methods, as if being optimized for a JDK 1.02 JIT.
              I am sorry that I don't have any positive suggestions other than to use a
              URL object to come back in an execute the necessary "include" directly. You
              lose all context (other than session) and that can cause its own problems.
              However, you can generally get the URL approach to work, and you will
              hopefully avoid further frustration.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              Tangosol: How Weblogic applications are customized
              "Denis" <[email protected]> wrote in message
              news:[email protected]...
              > Hi, All !
              > I have a problem using <jsp:include> from inside a custom tag. Exception
              is:
              > "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
              >
              > Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
              > could not do this. Is it a bug, since in the 1.1 spec is said: "The
              > BodyContent is a subclass of JspWriter that can be used to process body
              > evaluations so they can retrieved later on."
              >
              > My code is:
              > ...
              > <wfmklist:items>
              > <jsp:include page="item.jsp" flush="true"/>
              > </wfmklist:items>
              > ...
              

  • Why would someone use the meta utf-8 tag inside the script tag?

    I have run into a number of sites that use the <meta utf-8> tag inside the <script> tag what is the use of it.
    How dose one write the utf-8 inside the script tag?

    csteinola wrote:
    > If I CFINCLUDE that cache file, the characters come out
    munged (non-utf-8
    > encoded).
    try prepending a <cfprocessingdirective
    pageencoding="utf-8"> to the file.

  • How to do a jsp:include inside a noscript tag??

    I am new to JSP and I need help to do a <jsp:include page="pageName" /> inside a <noscript> tag. My goal is to include another jsp if the user has javascript disabled on its browser.
    I am using a JSP template that retrieves content from the Database, so I need to pass a parameter also, like:
    <noscript>
    <jsp:include page="/include/template.jsp" flush="true"/>
         <jsp:param name="pageName" value="holidays_onboard_html"/>
    </noscript>
    My code doesn't seem to work. I found an explanation that says that the noscript tag is interpreted after the servlet already tried to compose the original page, so I can't use a <jsp:include> tag inside the noscript tag. Is it true? Is there any other solution for what I am trying to accomplish?
    Thanks a lot!

    Java indeed runs at the server side, not at the client side. Java runs at the server side and produces a HTML page. HTML only runs at the client side.
    The <noscript> tag is not a Java/JSP tag, it is a HTML tag. What you want is only possible when you checked in Java if the client has JS enabled, e.g. using a request parameter, or by loading the page template using a HTML tag, e.g. <iframe>.

  • How to get the column index inside a dataTable

    Hello,
    before I get staked, there are multiple threads handling familiar topics to the one I'm questioning about but none gives an anwer. If there is one, I'm propably to less skilled to see it.
    So here is my Problem: I've build a web-interface to a time-recording system. The hours worked on a certain project are displayed in a dataTable component which is generated out of a mySQL Query. Each entry (column/row) contains a inputText component to display and edit the specific value.
    Editing one of these inputText elements now fires a valueChangeEvent which reads the new value and stores it in the database. For that cause I need to know the row- and column-index of the inputText component that fired the event.
    Using the getClientId method from the valueChangeEvent I get some Information which makes it possible to calculate the row/column index. A typical clientID looks like "form_table:mainTable:0:_id14". "form_table" is the ID of the form the dataTable is in. "mainTable" is the id of the dataTable component. "0" is the row the component is in. And finally "_id14" stands for the id randomly given to the inputText component by JSF.
    My Problem is now, that though I can calculate the column out of the[i] "_id14", this calculation is hardcoded. So everytime I add a component in before the dataTable, the calculation needs to be adjusted in the code.
    The Questions:
    - How to force a sensefull id indicating a column-index for the inputText components inside the columns of a dataTable?
    - Nicer since no workaround: How to get the column-index inside the dataTable on a natural way? (e.g. out of the valueChangeEvent the specific inputText component fires)
    After some investigation here on the board and on the net I know multiple ways to get the row index, (Things like component-binding and so on) but I can't find a answer on how to get the column-index.
    Thanks to all answers and/or links to things my eyes missed while searching for one.

    ...then index 0 becomes index 1 and my program doesn't work properlyThe program works properly, just not as you expect it to.
    As you've noticed the table gives you the flexibility to move columns around. So if you move column 0 to column 1, why would you expect to still use 0 as the index? The table manages the reordering of columns for you to make sure the data being displayed in each table column comes from the correct column in the data model.
    You can manage this yourself using one of the following methods (I forget which one):
    table.convertColumnIndexToModel(int viewColumnIndex)
    table.convertColumnIndexToView(int modelColumnIndex)
    Or, you can get data from the data model directly:
    table.getModel().getValueAt(row, 0);

  • How to use Direct Access URL in the FORM tag

    I want to substitute the pageid url (/servlet/page?_pageid=161&_dad=portal30&_schema=PORTAL30) with the direct access urls (pls/portal30/url/page/my_page) to address the pageid conflict between development server and production server.
    It works perfectly fine in the redirection code such as:
    self.location.href="/pls/portal30/url/page/next_page". But I got "Page can not be found" error message when I use it in the <FORM> tag:
    <FORM ACTION="/pls/portal30/url/page/next_page" METHOD="POST" NAME="my_form">
    Does anyone out there know how to use the direct access url inside the <FORM> tag? I am trying not to write a bunch of code just to retrieve and insert the pageid at the run time.
    Thanks in advance.
    Arthur

    Use condition. If you are validating a record, just out the desired check in the condition field for that specific item.
    Thanks
    Nagamohan

  • How to use Google fonts not in an H tag?

    How do you do it?
    I ask this because Im under the impression h tags have attributes that come along with it to make it like a paragraph, right?
    Im looking at making a few word a Google font and a caption. How would I apply this to a div? Inline? Or a new css rule? Both?
    Im not good at handcoding CSS, so this is why I ask.
    I have the Google font in my CSS and call a few HTML headers h1,h2,h2 to it fine. How do I make text not in an H tag the Google font?
    (yes, I think it's a super easy answer, but not too knowledgeable about it)
    Also, does CS5 DW have some sort of support to make the Google font a selectable from the dropdown?

    Use CSS classes.
    .google {
         google font rules go here...
    HTML:
    <p class="google">This paragraph uses google font</p>
    <h1 class="google">This heading uses google font</h1>
    <h1>This heading uses standard font</h1>
    <p>This paragraph uses standard font</p>
    CSS classes appear in the drop-list on your properties panel.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • How to use one hash table inside another hash table

    Hi everyone,
    Any example of hash table inside another hash table.
    Can one here help me how to write one hash table inside another with repeating keys for the first hash table.
    Thanks,
    kanty.

    Do you mean you want the 'value' entries in a hash table to themselves be hash tables? Easy but this often indicates a design flaw.
    Hashtable<String,<Hashtable<String,Value>> fred = new Hashtable<String,<Hashtable<String,Value>> ();But what do you mean by "with repeating keys for the first hash table"?
    Edited by: sabre150 on Jul 2, 2010 10:11 PM
    Looks like you have already handled the declaration side in your other thread. I suspect you should be writing your own beans that hold the information and these beans would then be stored in a Map. The problem I have is that your description is too vague so I can't be certain.

  • Is possible to write a custom tag inside another custom tag ??

    Hi
    I�m trying to reduce the time needed to code mi app presentation layer, it uses some custom tags with certain configuration, i would like to know if its possible to do something like this inside my custom tag doAfterBody().
    public int doAfterBody() throws JspException {
              JspWriter writer=bodyContent.getEnclosingWriter();
              try {
                   writer.print("<customTag:myAnotherTag someEspecificConfigurationParams="someEspecificValues"/>");
              } catch (IOException e) {
                   pageContext.getServletContext().log("Error: "+e.getMessage());
              }return SKIP_BODY;
         }The goal is to simplify the jsp code because the configuration params for the custom tags (css styles and similar) are allways the same.
    That don�t work, it simply prints <customTag:myAnotherTag/> in screen but the tag is not evaluated, i�ve tried too something like
    public int doAfterBody() throws JspException {
              if (repeat) {
                   JspWriter writer = bodyContent.getEnclosingWriter();
                   try {
                        writer.print("<customTag:myAnotherTag/>");
                   } catch (IOException e) {
                        pageContext.getServletContext().log("Error: " + e.getMessage());
                   repeat = false;
                   return EVAL_BODY_AGAIN;
              return SKIP_BODY;
         }And it doesn�t worked worked. Maybe using the taghandler classes and calls to the doAfterBody could make it work, but when you need to nest tags it could be a little hell of coupling calls, so before doing it i would like to know if what i want is possible. After reading some books i tought it could work because the stack of out objects, but i can�t make it work.
    Another idea is to inherit from tagHandler and override some properties in the tags, but i don�t like the idea to much.
    So, can anyone help me??
    Thanks.

    You cannot do that and I have listed out the reason and a possible solution in this post http://forum.java.sun.com/thread.jspa?threadID=697243 from yesterday.
    cheers,
    ram.

  • JSF tag inside another JSF tag

    Hi,
    Note: It's a bit of a long post but I will try to cut to the point without leaving behind any pertinent details.
    I've created some simple custom JSF tags in the past. The tags usually consisted of one or two attributes that would be beans. The tags would then print out the data for those beans or process them and then output the results.
    What I am trying to do now is a bit more complicated for me. I have a JSP page with a scriplet on it. It iterates over a bean containing a list of items. The loop adds those items to an HTML select menu one at a time. The outline of the code looks similar to this,
    <% extract data List from the bean and store it in variable called dataList %>
    <select>
    <%
      for (int i=0; i<dataList.size(); i++;){
        ListItem item = dataList.get(i);
        String name = item.getName();
        String value = item.getValue();
    %>
    <option value="<%=value%>">
      <%=name%>
    </option>
    <%}%>
    </select>
    <h:commandButton id="gobtn" action="go_to_page" actionListener="#{action.fetch}" value="Go"/>What I want to do is take all the above code and put it into a custom JSF tag. This tag would contain all the scriplet code, output the HTML code and also the commandButton code at the end.
    All of that is pretty easy except for the commandButton part. I am not sure how to output a commandButton from a custom JSF tag. How do I pass it the action.fetch part for the actionListener attribute? Can I create a commandButton object in my custom JSF tag and pass it this information?
    I've followed a tutorial at this site in the past but it doesn't go into too much detail
    http://www.exadel.com/tutorial/jsf/jsftutorial-customcomponents.html
    Any help is appreciated,
    Nick

    I guess I missed some information. The dataList in the bean is stored in a HashMap. So some work has to be done with the bean before hand to determine what list to pull out and then "massage" it a bit for viewer consumption. This is not easily accomplished with the standard JSF html tags, hence my going with a custom tag approach.
    Processing this bean and getting a list from the Hashmap in the bean before displaying it is easy, so is outputting the HTML. The hard part is rendering the commandButton with all the attributes I listed previously.
    Is there a way in general to have other JSF tags nested inside a custom JSF tag?

  • How do I center an image inside a div tag using fluid grid layout?

    where do I find and what do i use the image properties position when using the fluid grid layout. I'd like to center the image in the mobile page versus th left position in the desktop.

    This is what my css codes looks like where the image is in the div tag:
    #logo_links {
        clear: both;
        float: left;
        margin-left: 0;
        width: 32.2033%;
        display: block;
    This is the html code where the image is:
      </div>
        <div id="logo_links">
          <div align="center">
            <p><img src="../fluidgrid/images/3_7x2logo.jpg" alt="" width="236" height="110" align="left"></p>
          </div>
        </div>
    I'm going to need more detail where to insert the suggested code as I am a newby!
    Thanks

  • How to use a variable made inside a movie clip from outside

    I have been searching for ages and just cant find out how to do this!
    i have set a boolean variable inside a movieclip and would like something to change outside the movieclip, using an if statement, depending on whether the variable is true or false, but cant find out how to do it anywhere!
    this may be a nob question but any help will be greatly appreciated

    Your movieclip will need to have an instance name assigned to it (via the Properties panel).  Then you should be able to use that name to target the variable...
    mcName.boolVar = etc....

  • How to use form name in struts html:form tag

    Hi,
    I want to validate text box value, if it is ordinary html form I would have done like this <form name="myform" action="xxxx.jsp" onsubmit="return validate()">
    But am using struts html:form tags. In this case how can I use/specify name for a form.
    Can any one help me.
    Thanks

    The name of the form comes from the actionForm you have defined backing it.
    View source on the generated page to see what HTML it constructs.
    You are able to use the onsubmit event with the <html:form> tag just like the standard one, so if all you want to do is that:
    <html:form action="/saveUser" onsubmit="return validate()">
    ...You can also give it a styleId, which will generate an id in the HTML.
    See the tag documentation for details: http://struts.apache.org/1.2.x/userGuide/struts-html.html#form

  • How to use bean write in  struts html:text tag

    hi,
    i'm new to struts concepts.here i'm trying to write a value in html struts tag using <bean:write>
    my current tag is
    <html:text property="empname" value='<bean:write name="employee" property="empid">' />
    but it gives same tag in the text box.how i can solve this.

    what am I doing wrong?You will notice above that I mentioned
    YOU CAN'T USE CUSTOM TAGS AS ATTRIBUTES TO OTHER CUSTOM TAGS
    (was that loud enough for you to notice this time)?
    Try
    <html:text styleId="instruction" styleClass="text" size="50" name="instruction" property="value"/>
    //or
    <html:text styleId="instruction" styleClass="text" size="50" property="instruction" value="<%= instruction.getValue() %>"/>
    better alternative: populate your formbean with your action and just have:
    <html:text styleId="instruction" styleClass="text" size="50" property="instruction"/>
    If you set the "instruction" property of your formBean in the action, the value will be automagically reflected here.
    Cheers,
    evnafets

  • How to use file upload component inside a portlet

    Hi
    Thank you for reading my post.
    does file upload works inside portlets ?
    can some one help me with a sample code , does it need some tricks ?
    Thank you

    any help is welcomeLegolas,
    You could try your own implementation. Someone was able to implement a file upload with Creator 2004Q4 and the O'Reilly Servlet. See http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=50186.
    You will have to configure O'Reilly Servlet's "MultiPart Filter" in your application. Creator 2 uses a same approach (a filter) to accomplish this. Given that the file upload component is not supported on portlets, this leads me to the following: I don't know anything about portlets and portlet containers, but I'd check first for some architechtural restriction in the portlet subsystem that avoids the use of a filter for a file upload. If think this could be the only thing that will restrict you to implement your own file upload.
    Hope this helps.
    Antonio

Maybe you are looking for

  • How to transfer the content in a StringBuffer into a InputStream

    I need append the comment to the buttom of each file. I read the file into the stringbuffer first, appending the comments. After completed, how can I send the content in the StringBuffer back into a InputString in order to continue with some other fi

  • IPad 1st Generation not syncing!

    I have an Ipad 1st generation. It is as upgraded as possible for it's generation. Whenever connected to my computer I am unable to update existing apps. I have also not been able to add new apps. It will allow me to remove whatever I want. 

  • Java runtime hangs - need help!

    I have a batch process that is getting totally hung up. Not sure if it is an application problem or a JVM problem. Here is the dump of the threads: Can anyone help me interpret this??? This runs on Solaris 8. Full thread dump Java HotSpot(TM) Client

  • Dead Pixel on İphone6?

    Hi, I have bought an iphone 6 from Turkcell on 17/11/2014 from Turkey. After three weeks, there appeared a dead pixel (white shiny pixel) on the top of my screen. I send the screen photo in attachment. I phoned to Apple Support Turkey and they said "

  • Using ipages how to make

    using ipages where are instructions on creating & printing labels???  Tx  don