HtmlCommandLink in a custom component

Hi everybody,
seems like I got stuck with this Problem here: I am trying to create HtmlCommandLink within my custom component that points to a method via method binding. My code looks as follows:
ResponseWriter writer = context.getResponseWriter();
HtmlForm htmlForm = new HtmlForm();
htmlForm.encodeBegin(getFacesContext());
HtmlCommandLink htmlCommandLink = new HtmlCommandLink();
htmlCommandLink.setParent(htmlForm);
MethodBinding methodBinding = getFacesContext().getApplication().createMethodBinding("#{TestAction.defaultAction}", null);
htmlCommandLink.setAction(methodBinding);
htmlCommandLink.encodeBegin(getFacesContext());
writer.write("Link");
htmlCommandLink.encodeEnd(getFacesContext());
htmlForm.encodeEnd(getFacesContext());
The Link is created in the page and I can click on it but the method is not invoked. I can invoke it in the code manually which means the reference to the method is working. Am I missing something here?
Any help appreciated
Florian

thanks for your help, and i change the code as :
@Override
     public void encodeBegin(FacesContext context) throws IOException {
          if (context == null) {
               throw new NullPointerException();
          ResponseWriter writer = context.getResponseWriter();
          ExpressionFactory expressionFactory = context.getCurrentInstance().getApplication().getExpressionFactory();
          ELContext elContext = context.getCurrentInstance().getELContext();
          MethodExpression actionExpression = expressionFactory.createMethodExpression(elContext,
                    "#{UserManager.actionLoad}",null, new Class[] {ActionEvent.class});
          UIParameter parameter = (UIParameter)context.getCurrentInstance().getApplication().createComponent(UIParameter.COMPONENT_TYPE);
          parameter.setId("addId");
          parameter.setTransient(false);
          parameter.setName("id2");
          parameter.setValue(34);
          HtmlCommandLink link = (HtmlCommandLink) context.getApplication().createComponent(HtmlCommandLink.COMPONENT_TYPE);
          HtmlForm form = new HtmlForm();
          form.setId("pageForm");
          link.setTransient(true);
          link.setValue("Create");
          link.setActionExpression(actionExpression);
          link.getChildren().add(parameter);
          this.getParent().getChildren().add(link);
          form.encodeBegin(context);
          link.encodeBegin(context);
          link.encodeEnd(context);
          form.encodeEnd(context);
I can click on it but the method is not invoked.
Any help appreciated.

Similar Messages

  • Creating an HtmlCommandLink in a Custom Component

    Hi,
    A simplified version of my problem is as follows: I have created a custom component that delegates to a renderer. Within the renderer I create an instance of the HtmlCommandLink class to which I want to assign an action with the setAction method. However, when I try doing this with the line:
    link.setAction(Util.createConstantMethodBinding("success"));
    The page renders but the link does not work.
    or:
    MethodBinding vb = context.getApplication().createMethodBinding("success", null);
    link.setAction(vb);
    I get an exception.
    I have set the navigation rule in my faces-config file for "success".
    I am new to JSF and so I might be doing something stupid or missing the point somehow but I want to be able to create HtmlCommandLinks within a custom class rather than from a tag on the page.
    Any help appreciated,
    Barney

    can you please post your exception as well as your JSP page.
    Thanks
    -Jayashri

  • HtmlCommandLink generation within custom component

    Hey everybody, I had a previous post similar to this, but after solving the one problem I was having another one arose that I'm not sure how to fix either. I've been scouring google and the forums for a definite answer on this to no avail. So, here's my problem again:
    I've created a menuBar component that consists of images, tomahawk swap images, and command links. I use the component this way in my pages:
    <or:menuBar pageClass="#{menuBarBean.PAGECLASS_HOME}" msg="foo!" />In my renderer for this component, I have set up HtmlCommandLinks which are supposed to invoke navigation methods in my MenuBarBean. However, when you click on one of the links, it seems as if the MethodBinding is never invoked, because the page just refreshes and never goes into the corresponding backing bean method. Strangely enough, if you provide an erroneous method name for the method binding such as "#{menuBarBean.FakeMethod}", faces doesn't even give a warning.
    All the piping seems to be working for the tag and the component.. meaning the "pageClass" and "msg" attributes get set and rendered properly on the menuBar. Also the thing renders correctly, but I have a feeling that I'm not setting the MethodBinding correctly for the "Action" property of the CommandLink, or I'm not setting it in the right place. Here's an abbreviated version of the code behind the component:
    In my 'MenuBar.java' class:
    public void setHomeBinding(MethodBinding mb)
    { homeBinding = mb; }
    public MethodBinding getHomeBinding()
    { return homeBinding; }There is also code in this class for stat management that saves and restores the values of the menuBar. I found that if I didn't do this, the "msg" attribute was cleared on refresh.
    In the 'setProperties' method of my 'MenuBarTag.java' class:
    MethodBinding mb = getFacesContext().getApplication().createMethodBinding("#{menuBarBean.gotoHome}", null);
    menuBar.setHomeBinding(mb);In the 'encodeEnd' method of 'MenuBarRenderer.java' (Here's where I create the link and set the Action to the MethodBinding)
    // If is this class, show a selected tab
    if(menuBar.getPageClass().equals(MenuBarBean.PAGECLASS_HOME))
         HtmlGraphicImage homeButton = (HtmlGraphicImage)application.createComponent(HtmlGraphicImage.COMPONENT_TYPE);
         homeButton.setUrl(IMG_HOME_SRC_SELECTED);
         menuBar.getChildren().add(homeButton);
    // else Render the button
    else
         HtmlSwapImage homeSwapImg = (HtmlSwapImage)application.createComponent(HtmlSwapImage.COMPONENT_TYPE);
         homeSwapImg.setUrl(IMG_HOME_SRC_IDLE);
         homeSwapImg.setSwapImageUrl(IMG_HOME_SRC_OVER);
         homeSwapImg.setStyleClass("menuBarButton");
         HtmlCommandLink homeButton = (HtmlCommandLink)application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
         homeButton.setAction(menuBar.getHomeBinding());
         homeButton.setId("homeButton");
         homeButton.getChildren().add(homeSwapImg);
         menuBar.getChildren().add(homeButton);
    menuBar.getChildren().add(spacer);
    RendererUtils.renderChildren(facesContext, menuBar);
    menuBar.getChildren().removeAll(menuBar.getChildren());And finally, in my MenuBar backing bean 'MenuBarBean.java'
    public String gotoHome()
    { return("goto-home"); }
    public String getPAGECLASS_HOME()
    { return PAGECLASS_HOME; }So that's pretty much it. Like I said, the thing appears to be rendered correctly and looks like I want it to look. Unfortunately, the buttons don't do anything because I guess I'm not creating the HtmlCommandLinks properly, or I'm just leaving something out. Does anybody have any idea as to why the links aren't working based the on the above code? There are no exceptions being thrown or any warnings coming up in the console at all, so unfortunately there's no more information I can give you of what's happening within the framework.

    I really don't know what the problem is, but I'm willing to take a few wild guesses. At least this post should give you a few things to try...
    I found funny things start happening with CommandLinks when they are attached as children to any component except UIViewRoot. I don't know why. I would suggest you do not add the commandLink as a child of menuBar. Try just adding it to UIViewRoot. Maybe it'll work. Another option might be to try and find a creative way to use outputLink.
    When I ran into problems with my CommandLink, I eventually found a way to do it with outputLink instead. However, that was far from an ideal solution.
    Another guess would be to make sure you menuBarBean is in Session scope.
    Try surrounding everything in the encodeEnd method in a try-catch block and see if you are throwing any exceptions.
    Also, maybe moving the code from encodeEnd to encodeBegin might make a difference. It's worth a try.
    And lastly, always make sure you have an h:messages tag on your JSP. There may be messages there that can shed some light on the situation.
    Sorry I can't give you a more definitive answer! Hope this helps though.
    CowKing

  • How to construct the component tree in my custom component?Help!

    Hi, i am writing a custom component like this:
    public class HtmlCategory extends HtmlPanelGrid
         public void processRestoreState(javax.faces.context.FacesContext context,
                java.lang.Object state)
              setColumns(1);
              HtmlCommandLink link=new HtmlCommandLink();
              link.setValue("Let's Bingo");
              MyUtil.setActionListener(context,link,"#{temp.mytest}");
              UIParameter param=new UIParameter();
              param.setName("name");
              param.setValue("Robin!");
              link.getChildren().add(param);
              param.setParent(link);
              getChildren().add(link);
              link.setParent(this);
              super.processRestoreState(context,state);
    }         you see, i want to construct the compont tree at Restore View phase this way,because the structure of the component tree will always be the same, so i don't the user to write extra code.
    But the children of the component are not rendered,the renderer of the HtmlCategory component just extends the HtmlGridRenderer(myfaces) directly,and always calls the "super" methods in the encode methods of the renderer.
    I got a message from the console:
    Wrong columns attribute for PanelGrid id0:id4: -2147483648
    but i have set the columns attribute in the code above, so what's happening? or please give some advice about how to render the component tree by myself in Restore View with the tree constructing code in the custom component class code,just lke the code above.
    Best Regards:)
    Robin

    Well, i don't know if i have got my question clear.
    usually, according to the tags you use in the jsf page, a component tree will be created at the Restore View phase,for example:
    <f:form>
      <h:panelGrid ...........>                         
              <h:dataTable ................>
              </h:dataTable>
       </h:panelGrid>
    </f:form>but because i am writing a component for my web app, all the child components and their attributes are not likely to change. so i want to reduce the tags into one custom tag, and construct the component tree internally by myself.But it is not the case of backing bean.So i wrote the the code in the method:
    public void processRestoreState(javax.faces.context.FacesContext context,java.lang.Object state)as it is shown in my orginal message.But it seems that it is not right way to construct my component tree.So where should i put the code that construct the component tree?Overriding the method :
    public void processRestoreState(javax.faces.context.FacesContext context,java.lang.Object state)is not the right way?
    Best Regards:)
    Robin

  • Create complex custom component

    Hi everyone!
    I'm trying to create my own custom component in JSF. However I have several questions :
    - It is not mandatory to create a renderer class, right ? the component can draw itself ?
    - How can I create a custom component which would have several "values" inside ? for example let us supppose I want to create a custom JSF component to enter a IBAN. The IBAN is divided into several parts : BBAN, country code, key, Bank adresse,... but any tutorial I've found explain how to create a input component with only one simple value (for example the classical "CreditCardInputComponent").
    Josselin

    Hi,
    did you find a solution for your "composite" component problem?
    I am also trying to create a custom component that contains several standard jsf components such as HtmlCommandLink and HtmlInputText.
    I build all the standard components within my component programmatically using things like:
    HtmlCommandLink link = (HtmlCommandLink) application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
    Also at the beginning of the encodeBegin I clear all children from my custom component using getChildren().clear()
    and rerender the component based on my new internal model which I updated during the previous decoding of my component.
    As a simple jsf custom tag it works ok, however, I am facing deep problems with action events as soon as I use the component within a jsf HtmlDataTable tag.
    Am I missing something here?
    Any ideas? Help is really really appreciated. This different behavior in different contexts is slowly but constantly driving me nuts.
    cheers
    hans

  • Complex custom component

    I'm tring to create a custom component that implements browse control.
    the component is composed of a input box that holds the browse result a dialog with data table and a button that cause the dialog to open.
    I have some implementation issuses :
    1. the datatable needs to get it's input from the database, normally I would create a value binding to a managed bean but I don't know where to put it in this case. (there can be more then component in a page so managed bean won't work)
    2. when the browse button is pressed I need to change the dialog display property so it would appear. how can I get hold of it's backing bean in the decode() method ? getting it through the context.getViewRoot().getChildren();isn't good enough since the component hierarchy changes from one page to another.

    Hi,
    did you find a solution for your "composite" component problem?
    I am also trying to create a custom component that contains several standard jsf components such as HtmlCommandLink and HtmlInputText.
    I build all the standard components within my component programmatically using things like:
    HtmlCommandLink link = (HtmlCommandLink) application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
    Also at the beginning of the encodeBegin I clear all children from my custom component using getChildren().clear()
    and rerender the component based on my new internal model which I updated during the previous decoding of my component.
    As a simple jsf custom tag it works ok, however, I am facing deep problems with action events as soon as I use the component within a jsf HtmlDataTable tag.
    Am I missing something here?
    Any ideas? Help is really really appreciated. This different behavior in different contexts is slowly but constantly driving me nuts.
    cheers
    hans

  • Problem with inputText in my custom component

    Hi, I have a custom dataTable component that I'm trying to get to work. It has to be a custom component because dataTable doesn't support rowspan, colspan, multi line headers, and a rendered attribute for rows. The problem is, that when I wrap the column tag inside my row tag then the method for the inputText tag never gets called in the UPDATE_MODEL_VALUES phase.
    I'm starting to think that JSF doesn't support 2 levels of tags between the inputText and dataTable. I'm hoping that someone can tell me what I have wrong with my components.
    Here is the JSP snippet.
    <cjsf:rptTable>
         <cjsf:data id="dataTable1" value="#{allAuthUser.tableRows}" var="myTableRow1">
              <cjsf:row>
                   <cjsf:col>
                        <h:inputText id="tableTestFld" value="#{myTableRow1.testFld}" size="5" maxlength="5"/>
                   </cjsf:col>
              </cjsf:row>
         </cjsf:data>
    </cjsf:rptTable>Here is what it renders. It looks to me like everything renders fine. So I'm guessing that there is something in a component that is causing JSF during the life cycle to not be able to process correctly.
    <table>
         <tbody>
              <tr>
                   <td><input id="tblmaintForm:body:dataTable1_0:tableTestFld" name="tblmaintForm:body:dataTable1_0:tableTestFld" type="text" value="" maxlength="5" size="5"/></td>
              </tr>
              <tr>
                   <td><input id="tblmaintForm:body:dataTable1_1:tableTestFld" name="tblmaintForm:body:dataTable1_1:tableTestFld" type="text" value="" maxlength="5" size="5"/></td>
              </tr>
              <tr>
                   <td><input id="tblmaintForm:body:dataTable1_2:tableTestFld" name="tblmaintForm:body:dataTable1_2:tableTestFld" type="text" value="" maxlength="5" size="5"/></td>
              </tr>
         </tbody>
    </table>Note: If I leave off the row tag it renders the same way except of course the <tr> and </tr> tags are missing. If I do this, then the backing method for the inputText tag is called and everything works fine. Why doesn't it work with the row tag in place?
    Here are the components:
    public class UIRptTable extends UIComponentBase {
         public UIRptTable() {
              setRendererType("tblmaint.rptTableRenderer");
         public String getFamily() {
              return "javax.faces.Output";
    public class UIRptTableData extends HtmlDataTable {
         public UIRptTableData() {
              setRendererType("tblmaint.rptTableDataRenderer");
         public String getFamily() {
              return "javax.faces.Data";
    public class UIRptTableRow extends UIOutput {
         public UIRptTableRow() {
              setRendererType("tblmaint.rptTableRowRenderer");
         public String getFamily() {
              return "javax.faces.Output";
    public class UIRptTableCol extends UIColumn {
         public UIRptTableCol() {
              setRendererType("tblmaint.rptTableColRenderer");
         public String getFamily() {
              return "javax.faces.Column";
    }Here is part of the faces-config file in case you need it.
    <!-- Components -->
    <component>
         <component-type>tblmaint.rptTable</component-type>
         <component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTable</component-class>
    </component>
    <component>
         <component-type>tblmaint.rptTableData</component-type>
         <component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableData</component-class>
    </component>
    <component>
         <component-type>tblmaint.rptTableRow</component-type>
         <component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableRow</component-class>
    </component>
    <component>
         <component-type>tblmaint.rptTableCol</component-type>
         <component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableCol</component-class>
    </component>
    <!-- Render Kits -->
    <render-kit>
         <renderer>
              <component-family>javax.faces.Output</component-family>
              <renderer-type>tblmaint.rptTableRenderer</renderer-type>
              <renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableRenderer</renderer-class>
         </renderer>
    </render-kit>
    <render-kit>
         <renderer>
              <component-family>javax.faces.Data</component-family>
              <renderer-type>tblmaint.rptTableDataRenderer</renderer-type>
              <renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableDataRenderer</renderer-class>
         </renderer>
    </render-kit>
    <render-kit>
         <renderer>
              <component-family>javax.faces.Output</component-family>
              <renderer-type>tblmaint.rptTableRowRenderer</renderer-type>
              <renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableRowRenderer</renderer-class>
         </renderer>
    </render-kit>
    <render-kit>
         <renderer>
              <component-family>javax.faces.Column</component-family>
              <renderer-type>tblmaint.rptTableColRenderer</renderer-type>
              <renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableColRenderer</renderer-class>
         </renderer>
    </render-kit>I sure hope that someone can help me out. Please let me know if you need any additional information.
    Thanks,
    Ray

    Hi, Ray!
    1) I was trying to put a button in the column header (for sorting) and I couldn't get that to work. That involved the >colhdr tag. I got that to work but I don't remember the fix. I'll look it up and reply back with that when I can.Dealing the first part of your trouble, you need NOT a custom component.
    I have looked through the implementation of RepeaterRenderer, as you advised me, and found that the multi-header possibility is included in the implementation of dataTable control.
    The code below is the part of source of repeater.jsp with only change:
    <d:data_repeater> &#61664; <h:dataTable>
    And it works fine.
    <h:dataTable id="table"
    binding="#{RepeaterBean.data}"
         rows="5"
    value="#{RepeaterBean.customers}"
    var="customer">
    <f:facet name="header">
    <h:outputText value="Customer List"/>               <!� First Header row -- >
    </f:facet>
    <h:column>
    <%-- Visible checkbox for selection --%>
    <h:selectBooleanCheckbox
    id="checked"
    binding="#{RepeaterBean.checked}"/>
    <%-- Invisible checkbox for "created" flag --%>
    <h:selectBooleanCheckbox
    id="created"
    binding="#{RepeaterBean.created}"
    rendered="false"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Account Id"/>               <!�Second Header row -- >
    </f:facet>
    <h:inputText id="accountId"
    binding="#{RepeaterBean.accountId}"
    required="true"
    size="6"
    value="#{customer.accountId}">
    </h:inputText>
    <h:message for="accountId"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Customer Name"/>               <!�Second Header row -- >
    </f:facet>
    <h:inputText id="name"
    required="true"
    size="50"
    value="#{customer.name}">
    </h:inputText>
    <h:message for="name"/>
    </h:column>
    <h:column>
    <f:facet name="header">                    <!�Second Header row -- >
    <h:outputText value="Symbol"/>
    </f:facet>
    <h:inputText id="symbol"
    required="true"
    size="6"
    value="#{customer.symbol}">
    <f:validateLength
    maximum="6"
    minimum="2"/>
    </h:inputText>
    <h:message for="symbol"/>
    </h:column>
    <h:column>
    <f:facet name="header">                    <!�Second Header row -- >
    <h:outputText value="Total Sales"/>
    </f:facet>
    <h:outputText id="totalSales"
    value="#{customer.totalSales}">
    <f:convertNumber
    type="currency"/>
    </h:outputText>
    </h:column>
    <h:column>
    <f:facet name="header">                    <!�Second Header row -- >
    <h:outputText value="Commands"/>
    </f:facet>
    <h:commandButton id="press"
    action="#{RepeaterBean.press}"
    immediate="true"
    value="#{RepeaterBean.pressLabel}"
    type="SUBMIT"/>
    <h:commandLink id="click"
    action="#{RepeaterBean.click}"
    immediate="true">
    <h:outputText
    value="Click"/>
    </h:commandLink>
    </h:column>
    </h:dataTable>
    You may have a look at HTML source to prove that dataTable is already what you need:
    <table id="myform:table">
    <thead>
    <tr><th colspan="6" scope="colgroup">Customer List</th></tr>
    <tr>
    <th scope="col"></th>
    <th scope="col">Account Id</th>
    <th scope="col">Customer Name</th>
    <th scope="col">Symbol</th>
    <th scope="col">Total Sales</th>
    <th scope="col">Commands</th>
    </tr>
    </thead>
    <tbody>
    2.) The second trouble is still unsettled as previously. Right now I have different task at my job, and I can�t continue investigation of this problem.
    But when you find smth., please let me know. I�ll be very grateful.
    Regards,
    Oleksa Stelmakh

  • Unable to Edit the View in Custom Component

    Hi Experts,
    Please help me to resolve this issue !
    I am unable to lock the BOL Entity in my custom component using BTAdminH. I have written the below code in the Edit event Handler for Edit Button. The lr_entity->lock( ) condition statement is getting false and it is skipping the "set_view_editable( me )." code statement. Why??
    This is code excerpt that I have taken from edit button of the BP_HEAD/AccountViewSet and altered to my component/View
    DATA: lr_entity     TYPE REF TO cl_crm_bol_entity,
            lr_controller TYPE REF TO cl_ZVKH8_bspwdcomponent_impl.
      TRY.
          lr_controller ?= me->comp_controller.
          lr_entity ?= lr_controller->typed_context->btadminh->collection_wrapper->get_current( ).
    IF lr_entity IS BOUND.
      IF lr_entity->IS_LOCKED EQ abap_false.
        IF le_entity->IS_CHANGEABLE EQ abap_true.
           IF lr_entity->lock( ) EQ abap_true.
            me->view_group_context->set_view_editable( me ).
           ENDIF.
        ENDIF.
      ENDIF.
    ENDIF.
    and when I directly executed the below code in the Edit event Handler for Edit Button I am receiving the dereferencing NULL value exception. Why in my custom component in many places this happening??
      me->view_group_context->set_view_editable( me ).
    Exception Details
    CX_SY_REF_IS_INITIAL - Dereferencing of the NULL reference
    Method: ZL_ZVKH8_DETAILSEF_IMPL=>EH_ONBACK
    Thanks,
    Bujji

    Hi Summit & NishaNC,
    Thanks for your responses !
    As suggested, I have debugged the code for ->lock( ) method and there are exceptions raised from some methods.
    Method GET_LOCK () -> Method GET_ROOT () ->Method GET_PARENT ()
    At GET_ROOT( ) method i have received an exception
    "Root entity BTAdminH could not be determined" and one more "Entity BTAdminH could not be locked"
    Later when I have checked in MODEL Browser, I found that the BOL object "BTAdminH" for my view is an Access object and not the Root Object.
    Hence, I have a question? Does the locking can be done only for ROOT Objects?
    If this is TRUE then I think this is the major problem with my custom component where even the cross component navigation is also not happening and in many places I am receiving "Dereferencing NULL Value" information.
    Also I have gone through some of the Threads and one information that I found from Sumit Mittal
    1. An access object is an independent entity, has primary keys of its own.
    2. A root object is a special access object that is at the top of the hierarchy based on business rules.
    3. A dependent object's primary keys are supplied by access objects and it's lifetime is bound to them. If the parent object is destroyed, the dependent object is also destroyed.
    4. Search objects are query objects useful for querying root objects
    5. Search result objects - Search objects return the results in the form of a result object together with a relation pointing to the root object.
    6. View objects - ?
    7. Dynamic search objects - Used in advanced search, supports ranges and operators
    Could you please specify in which scenarios we have to go for Access Objects and Root Objects
    Thanks,
    Bujji

  • How do you reference a valueObject located in main to a custom component created in Catalyst?

    Hello,
    I have been working with the Catalyst Beta 2 / Flash Builder beta trying to create a photogallery and have hit a little bit of a snag, try as I might I can't seem to find the answer anywhere. I am still new to Flex so please excuse me if this is a basic question, I have been trying to understand more about Flex to make my designs in Catalyst better.
    I found this video on Adobe TV: http://tv.adobe.com/watch/rich-internet-applications-101/ria-stepbystep-16-binding-a-data- service-to-flash-builder-components/
    It's wonderful and I have the datalist I created in Catalyst working with the XML file I generated but I designed my little photogallery a bit diffrent, I created a Custom Component in Catalyst so that when you click an item on the DataList it pop's up a little screen with a larger photo in on it, rather then having an image in the main application. Now my problem seems to be that I can't refrence the valueObject I created with the wizard as it's in my Main.mxml file, is there a way to refrence it from my Custom Component so the larger image will display? Is there a way to let the component know which item on the dataList in the main application is selected and display the correct image?
    I should also say I really enjoy working with the Beta for both Flash Builder / Catalyst, thanks for the hard work!
    Thanks for the help,
    Chris

    I am afraid you cannot bind to static properties in Windows Store Apps. It is simply not supported.
    You could create a proxy class that exposes the static command property and bind to this property of an instance of the proxy object:
    http://stackoverflow.com/questions/14186175/bind-to-a-static-field-in-windows-8-xaml
    http://stackoverflow.com/questions/4708711/how-can-i-use-the-xstatic-extension-for-phone7-silverlight-apps
    You will of course have to create an instance of the proxy object. There is no way around this.
    Please remember to mark helpful posts as answer to close your threads and then start a new thread if you have a new question.

  • How to handle custom component data on overviewset save button CRM UI

    Hi,
    I have added a custom component to a standard view which is enchanted.
    I can handle any data with my buttons on the component but after editing data
    i need the save the data when the save button on the overview(top) is pressed.
    I have redefined save button of overview but i cant get my data.
    My node name is Root. I think i couldnt bind it to overview.
    How can i do that?
    Thank you

    Probably it can be done by
    http://wiki.sdn.sap.com/wiki/display/CRM/CRMWebUITechnical-CreatingTableViewInWebUI
    i am trying
    Thank you

  • Custom Component UI not displaying in 11G

    Hi All,
       We have a custom component in 10G where we have added new link in the UCM Home Page, it will be displayed beside Administration tab with name Edit Tables, under this we have sub links Alldistr_RVS, Distprod, Distuser, Prdstate, Products_RVS, State_RVS, Stateusr. When we deployed this code in 11G it is not working. Could any one please provide me code to make it work in 11G instace. Appreciate your help on this.
    Below is the code used in 10G in resource file
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>
    ampfRVSEditTables htmlIncludeOrString
    </title>
    </head>
    <body>
    <@dynamichtml custom_finish_layout_init@>
    <$include super.custom_finish_layout_init$>
      <$include how_to_components_menu$>
      <$include vbis_edit_tables_link$>
    <@end@>
      <@dynamichtml how_to_components_menu@>
      <$if not how_to_components_menu_included$>
      //add a drop-down menu, or a tray to the UI
      navBuilder.addChildNodeTo('NAVTREE', 'collection', 'id==EDIT_Tables', 'label==Edit Tables');
      if (navBuilder.menuB)
      navBuilder.menuB.addTopLevelNode("EDIT_Tables");
      else if (navBuilder.trayA)
      navBuilder.trayA.addTopLevelNode("EDIT_Tables");
      <$EDIT_Tables_menu_included=1$>
      <$endif$>
      <@end@>
    <@dynamichtml vbis_edit_tables_link@>
    navBuilder.addChildNodeTo('EDIT_Tables', 'item', 'id==ALLDISTR_RVS',
    'label==Alldistr_RVS', 'url==<$HttpCgiPath$>?IdcService=GET_ALLDISTR_RVS_PAGE');
    navBuilder.addChildNodeTo('EDIT_Tables', 'item', 'id==DISTPROD',
    'label==Distprod', 'url==<$HttpCgiPath$>?IdcService=GET_DISTPROD_PAGE');
    navBuilder.addChildNodeTo('EDIT_Tables', 'item', 'id==DISTUSER',
    'label==Distuser', 'url==<$HttpCgiPath$>?IdcService=GET_DISTUSER_PAGE');
    navBuilder.addChildNodeTo('EDIT_Tables', 'item', 'id==PRDSTATE',
    'label==Prdstate', 'url==<$HttpCgiPath$>?IdcService=GET_PRDSTATE_PAGE');
    navBuilder.addChildNodeTo('EDIT_Tables', 'item', 'id==PRODUCTS_RVS',
    'label==Products_RVS', 'url==<$HttpCgiPath$>?IdcService=GET_PRODUCTS_RVS_PAGE');
    navBuilder.addChildNodeTo('EDIT_Tables', 'item', 'id==STATE_RVS',
    'label==State_RVS', 'url==<$HttpCgiPath$>?IdcService=GET_STATE_RVS_PAGE');
    navBuilder.addChildNodeTo('EDIT_Tables', 'item', 'id==STATEUSR',
    'label==Stateusr', 'url==<$HttpCgiPath$>?IdcService=GET_STATEUSR_PAGE');
    <@end@>
    </body>
      </html>
    Thanks.
    Ashok

    Hi Jiri,
       I from the sample example I tried to develop component to display HOW_TO_COMPONENTS as Menu item under which there is sub item Annuity_Dispname_Mapping, but it is not displaying. I am afraid where it went wrong. Below is the code i used, please help me to fix this. Thank you
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>
    MenuExample htmlIncludeOrString
    </title>
    </head>
    <body>
    <@dynamicdata CoreMenuItems@>
    id,           label,       linkType, linkData
    HOW_TO_COMPONENTS, How To Components, YuiDev,
    ANNUITY_DISPNAME_MAPPING, Annuity_Dispname_Mapping, YuiDev, <$HttpCgiPath$>?IdcService=GET_DATA_ACCESS_PAGE
    <@end@>
    <@dynamicdata CoreMenuItemRelationships@>
    <?commatable mergeKey="primaryKey"?>
    parentId,    id,           loadOrder
    MENU_A,      HOW_TO_COMPONENTS,  1000
    HOW_TO_COMPONENTS, ANNUITY_DISPNAME_MAPPING, 10
    <@end@>
    <@dynamicdata CoreMenuItemsFlags@>
    id,           flags
    HOW_TO_COMPONENTS, isLoggedIn
    ANNUITY_DISPNAME_MAPPING, isLoggedIn
    <@end@>
    <@dynamicdata CoreMenuItemsImages@>
    id,           image,                imageOpen
    HOW_TO_COMPONENTS,     ScsPageItem.gif,
    ANNUITY_DISPNAME_MAPPING,     ScsPageItem.gif,
    <@end@>
    <@dynamicdata ampcustom_menu_items_template_data@>
    <?commatable indexedColumns="id"?>
    id,                  parentId,    linkType,        flags
    HOW_TO_COMPONENTS_LINK_TEMPLATE, HOW_TO_COMPONENTS, external,
    <@end@>
    <@dynamichtml custom_navigation_menu_items@>
    <$include super.custom_navigation_menu_items$>
      <$urlCount = 0$>
      <$if utLoadResultSet("pne_portal", "PersonalURLS")$>
      <$if rsFirst("PersonalURLS")$>
      <$loop PersonalURLS$>
      <$ddAppendIndexedColumnResultSet("ampcustom_menu_items_template_data", "NavigationMenuItems", "id", "HOW_TO_COMPONENTS_LINK_TEMPLATE")$>
      <$rsLast("NavigationMenuItems")$>
      <$NavigationMenuItems.id = "HOW_TO_COMPONENTS_" & urlCount$>
      <$NavigationMenuItems.label = js(title)$>
      <$NavigationMenuItems.linkData = js(website)$>
      <$NavigationMenuItems.loadOrder = urlCount$>
      <$urlCount = urlCount + 1$>
      <$endloop$>
      <$endif$>
    <$endif$>
    <@end@>
    </body>
    </html>
    Thanks

  • Decode-method for custom component isn't called

    Hi,
    i have writen a custom component which gets some information by command-link. To make the data from the link accessible, i wrote a decode method in my renderer and in me component. But both method are not called from the faces framework.
    Dows anybody knows what i made wrong???
    Thanks, Sebastian

    Hi,
    thank you for your reply.
    Unfortunately the processDecodes(...) of my component is also not called from the framework. Does anybody knows what i'm making wrong???
    Thanks!

  • Problem with attributes in custom component

    Hi All,
    I am creating a simple jsf PanelGrid custom component....in that component I am adding two new attributes....
    when I use that tag in my jsf application it is rendering fine in the client side....but the parent class that is PanelGrid component's attributes are not inheriting to my custom panelgrid....
    can any one tell me how can I use the attributes of the super class PanelGrid??
    Thanks...

    Have you configured the attributes in the tag library descriptor?

  • I want to add DataGrid in my custom component as a child component,

    I want to add DataGrid in my custom component as a child component, can we ?? or should i generate HTML for table creation in my custom component's renderer ?

    I did that:
    for example, if i want to add a Button control in my custom control:
    public void encodeChildren( FacesContext context ) throws IOException
             super.encodeChildren( context );
            //createComponent raises exception.... invalid component type     
            //UIComponent field = FacesContext.getCurrentInstance().getApplication().createComponent( javax.faces.component.html.HtmlInputText.class.getName() );
             HtmlInputText input = new HtmlInputText();
            getChildren().add( input );
        public boolean getRendersChildren()
            return true;
        }Can you give me any example, i want to add child components at run time basically..

  • Can I use axis.jar in my custom component

    Can I use axis.jar in my custom component.
    Is there any license need to user this jar ??
    Thanks

    In our UCM setup axis has been implemented in a custom component to consume webservices. As Axis falls under the Apache license you can freely import it in your custom java classes.

Maybe you are looking for