In Custom Tag how to add h:commandbutton with action

Hi, I created a custom tag in facelets (& Seam), below is the code snippet
<tag>
<tag-name>customdiv</tag-name>
<component>
<component-type>customtag.MyCustomTag</component-type>
<component-class>com.mydomain.testing.customtag.MyCustomTag</component-class>
</component>
</tag>
In this class I am using ResponseWriter to generate the content.
I am trying to add a button and associate action to it but it doesn't provide me any option to associate action to the commandbutton
"<h:commandButton action="#{childdiv.addChildDiv}" value="add div"></h:commandButton>"
Also the XHTML doesn't even recognize the h:commandbutton tag
"HtmlCommandButton htmlCommandButton = new HtmlCommandButton();
writer.startElement("h:commandButton", htmlCommandButton);
writer.writeAttribute("value", "add div", "");
writer.endElement("h:commandButton");"
Please suggest

JSF<h:form>
    <h:dataTable value="#{myBean.dataList}" var="dataItem">
        <h:column>
            <h:selectManyListbox value="#{dataItem.selectedItems}">
                <f:selectItems value="#{myBean.selectItems}" />
                <%-- Or use value="#{dataItem.selectItems}" if it does depend per row. --%>
            </h:selectManyListbox>
        </h:column>
    </h:dataTable>
    <h:commandButton value="add" action="#{myBean.add}" />
    <h:commandButton value="save" action="#{myBean.save}" />
</h:form>MyBean (session scoped)private List<DataItem> dataList; // +getter
private List<SelectItem> selectItems; // +getter
public MyBean() {
    dataList = new ArrayList<DataItem>();
    // Do your thing. It is just a stub example.
    selectItems = new ArrayList<SelectItem>();
    selectItems.add(new SelectItem("value1", "label1"));
    selectItems.add(new SelectItem("value2", "label2"));
    selectItems.add(new SelectItem("value3", "label3"));
public void add() {
    dataList.add(new DataItem());
public void save() {
    // Do your thing to save the dataList. All values are already set in there.
    // Just doing a sysout here to prove it.
    System.out.println("Saved: " + dataList);
}DataItemprivate List<String> selectedItems; // +getter +setter
// Just for convenience so that it is readable in the sysout.
public String toString() {
    return "DataItem[" + selectedItems + "]";
}For more about datatables you may find this article useful: [http://balusc.blogspot.com/2006/06/using-datatables.html].

Similar Messages

  • How to add Excise item with out chapter id

    Dear all,
    How to add Excise item with out chapter id?
    Chapter id of purchae items will be known only after receiving Invoice/gate pass/delivery  chalan from supplier/vendor
    To send a purchase order we need to create that particular item in the master, but with out assigning chapter id system is  not allowing to save without chapter id.
    How to solve this?
    I am with SAP 8.8 and PL 10
    Thanks in advance
    regards,
    Kumar

    Hi Kumar,
    Refer the book of chapter ID or find out on internet you will get the chapter ID.
    Still if you not able to get  the chapter id then consult with excise advisory.
    But you can add Excise PO until you have the excise details in Item master.
    Regards,
    Datta Kharat

  • Need detailed procedure on how to add an item with Item Style Check Box in

    Need detailed procedure on how to add an item with Item Style Check Box in Framework.

    The view instance should be the same as the view instance (view object) specified for your region.
    If the View Attribute already that you need already exists in the View Object then you can use it.
    Otherwise you have to extend the View Object and add the new attribute to it.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to create an rule with action to subtract from the event log of Ips manager express console?

    how to create an rule with action to subtract from the event log of Ips manager express console?, some knows of has an guide?.
    Thank you.
    Sent from Cisco Technical Support iPad App

    Hi,
    http://www.cisco.com/en/US/products/sw/secursw/ps2113/products_tech_note09186a0080bc7910.shtml
    HTH
    Luis Silva
    "If you need PDI (Planning, Design, Implement) assistance feel free to reach us"
    http://www.cisco.com/web/partners/tools/pdihd.html

  • Custom Tag - how to use tag value= %=jsp% / ?

    Hello friends,
    I am new to custom tags. I have written simple tags that handle value="some hard-coded stuff">.
    But cannot not implement jsp-supplied values? Could you please help with advice?
    Basically, how to implement a custom tag that would allow:
    <mylib:mytag value=<%=somejsp%> />
    Thank you!

    Just define it in your .tld ...
    Example:
    <attribute>
    <name>comments</name>
    <required>false</required>
    //IF this is set to true, u can add your jsp stuff... in your value
    <rtexprvalue>true</rtexprvalue>
    <type>String</type>
    </attibute>
    Usually, the .tld goes in WEB-INF/lib ... some people just put it in WEB-INF/

  • Html tags - how to add a blank line

    Hi there,
    can anyone tell me how to add a blank line into a page using one of the html tags ?
    thanks,
    Malcolm.

    You can use the <br> tag for a line break. Also   for space.
    Regards,
    Arun

  • How to add a Link with children in the SuiteLink bar?

    Hello,
    I have developed a code to add a new link in the SuiteLink bar using delegate control that works as expected. Now I want to include a new link
    but with children, I have tried many options in my code but with not luck.
    What I need in the SuiteLink bar is something like:
    My Services   Newsfeed  OneDrive  Sites
        Service 1
        Service 2
        Service 3
    Any idea on how to achieve this?
    Thanks,
    Daniel
    Daniel Villacis

    Hi,
    According to your post, my understanding is that you want to add sublink in the top navigation bar.
    There is an article about this issue, it contains the steps about how to create a link with sublink in the top navigation bar, you can have a look at it.
    http://www.helpmeonsharepoint.com/2012/03/custom-sharepoint-top-menu-and.html
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • Adobe Reader - how to add page numbers with the free version?

    Hey guys,
    Imagine I've got a PDF file and I want to create a new one by selecting some pages out of it. I know this is simply possible by using the PDFcreator but I want to add page numbers. As far as I know this is not possible with the free version of Adobe unless I would add the page number on every single page by using a text box. I want to make different catalogs from the PDF so the page numbers are really necessary. Have you got any idea how to solve that issue? You know that's pretty much the only thing I need to add which means it's not worth buying the Pro version. Unfortunately I only got the PDF and I can't work on it e.g. with MS word before I export it. Do you know if there is a way to add page numbers with a free version? There might be an additional free software which allows that?
    Thanks for your support! 

    Thanks for your quick replies.
    I know how to add text page by page. But obviously it's hard to place the numbers on the very same position, is it?

  • How to add a button with Javascript to Library

    Hi
    I am using Captivate 5.5 to create a template.
    In the files which will be created using this template, we will be adding a button which executes a Javascript. Now, my question is, since this button will be used on multiple slides in the file, can I add this button (with the Javascript) to the library? Currently, we create it manually everytime.
    We don't have a programmer in our team, so we can't create widget. Is there an alternative way?
    Thanks for your help.
    Sreekanth

    Thanks for that reply.
    I now have a blank slide with the button (including the javascript) on it which solves the problem of importing it manually.
    However, when we use this template to import PowerPoint presentations, when we publish the file, the first slide (the one on which I have this button) will be blank and has to be manually deleted.
    Is there a way to eliminate this manual work? I tried hiding and using some actions. But it was not of any use.

  • How to add parametes in the action calss

    hello friends
    Iwant to add parametes in the action cladd
    <action
    path="/QuickSearch"
    type="app.struts.QuickSearchAction"
    name="quickSearchForm"
    scope="request"
    input="quickSearch.jsp"
    validate="true">
    <forward name="success" path="/jsp/appController.jsp"/>
    I need url like that "appController.jsp?name=namevalue&old=oldvalue"
    public class QuickSearchAction extends Action
        public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
            return mapping.findForward("success");
    }thanks
    </action>

    I try with
    public class QuickSearchAction extends Action
        public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
                ActionForward Myorward = mapping.findForward("success")
                Myorward.setPath("/jsp/appController.jsp?name=namevalue&old=oldvalue");
            return Myforward;
    }but it work not !!!!!!! please help me
    thanks

  • HT5839 i deleted some default tags, how to add them back?

    How do I add tags after deleting them?

    Just Tag a document with them and you will re-create them. You'll have to go into Finder Preferences, Tags, to add the desired color.

  • Document Search - how to add new document with link to ALL

    CRM 5.0,  can easily add documents in the ICWC under the Document Search or gui t-code CRM_KW but the linkage is to me.   How can I change or create the link to to "ALL" so all users can find them in the search.

    Hi Glenn,
    Just to clarify for other readers, I assume you are referring to the document search functionality in the Interaction Center that uses Content Management to search for documents and link them to the current business transaction, the current account (business partner) or the current agent/user?
    I am not aware of any out of the box method for linking a document to all CRM users or agents. But if you want to have a look around at the code, I think the class and methods you might want to start with class CL_CRM_IC_CUCOCM_IMPL method REGISTER_*.
    Maybe someone else has an idea how to link multiple users/agents (e.g. all users belonging to a particular org unit or profile) at once, instead of only linking the current user/agent?
    Warm regards,
    John

  • How to add Portal iViews with Web Page Composer

    Hi,
    We are working with Web Page Composer in EP7.0 SP13.
    We are creating web pages and we would need to add Portal iViews into. When we try to add an iView, we cannot select it from Web Content Browser to drop into the web page container.
    How can we add iViews into our web pages?
    Helpful answers will be rewarded!!
    Thanks in advance,
    Samantha.

    Hi,
    See these:
    [http://help.sap.com/saphelp_nw70/helpdata/en/06/4776399abf4b73945acb8fb4f41473/frameset.htm]
    [/message/4414263#4414263 [original link is broken];
    Best regards,
    Avishai Zamir

  • How to add Currency field with dropdown on screen layout (module pool)

    I need to add a field called <b>Currency( field label )</b> with <b>dropdown (like SKB1-WAERS). </b>
    The <b>field label</b> and <b>input output field </b> should default as being hidden and
    sould be visible only when other field value ( on the same screen ) should match with the value in the database table . 
    Could you please suggest me how to create dropdown
    and give this functionality with coding ?
    Thanks in advance.

    Hi,
    In the field attributes of the SKB1-WAERS..in the group attributes..give a group name G1..Add the same G1 for the field lable also.
    Then in the PBO of the screen..
    ***Check the conditions..when other field value (on the same screen) matches
    ***with the value in the database table.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'G1'.
        SCREEN-INPUT = '0'.
        SCREEN-INVISIBLE = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
    Thanks,
    Naren

  • How to add a UDF with picture data type by using metadata object?

    Hi guys,
    does anybody have a clue on how to code user fields metadata object (via VB6) in order to add a picture type field? I can't find the enum number for this data type in the DI help file.
    Best Regards,
    Oki

    Hi,
    The field type should be BoFieldTypes.db_Alpha , and the subtype BoFldSubTypes.st_Image .
    And it is in the DI documentation (look at the SubType property).
    Regards,
    Ibai Peñ

Maybe you are looking for

  • How do I get the esc key to work without having to use shift esc?

    Just got a new iMac and migrated everything from my old iMac but one thing is not working. I use to be able to use the esc key to back out of full screen mode or deselect items. It only works now if I use shift and esc. I would like to set it so I ca

  • Help needed in logic problem

    HI, I am trying to implement one marketing application, where the goods will be dispatched via some transportation. The receipt name is lr number or lrno. Some times for same lr no., 2-3 goods will be dispatched. Now, I am developing one application,

  • Aging Statements for Accounts Recievables

    Hi list, This is really not a Numbers-only question, but a financial formula one; I use spreadsheets to do my small business accounting, and have just realized that my interest on late payments from clients has not been compounded, just simple. So, I

  • Urgent help: ERROR: STARTING J2EE 1.3.1

    Here is the message: Dear Sir or Madam: There is no way I get it run J2E1.3.1. I need it so desperately. THE OS is Windows XP Professional. Message is: C:\j2sdkee1.3.1\bin> j2ee -verbose Exception in thread "main" java.lang.NoClassDefFoundError: C:\j

  • My movies which were bought from iTunes play way too dark in iTunes.

    My movies play way too dark in iTunes.  This is only the case when I connect my Mac Mini to my TV through HDMI.  What's strange is that when the subtitles in the movies come up the picture goes to the correct brightness.  Normally, however it is diff