Problem with commandButton in a custom DataTable

I am trying to write a cutom DataTable and am having some trouble. I don't think that the DataTable that gets shipped has the flexibility that we need for our pages. That's why I'm trying to write my own.
What I have is a commandButton in one of the column headers for the table. It is bound to a method in a backing bean. The page seems to render correctly. But when I click on the button, it seems to make a trip to the server, but the method doesn't get invoked.
I figure that I'm missing something in my custom component, but I just can't figure it out. Does anyone have any ideas?
If you would like for me to post some/all of the code just let me know. I didn't what might be helpful.
Thanks,
Ray

Thank you for your response.
I already had a messages tag on my page and no messages come out. I've looked in the log and don't see anything in their either. I put in a phaseListener and all of the phases are being processed.
Here is my output. It is the same whether I press the button that is inside my custom dataTable or press a button that is outside my custom dataTable.
beforePhase RESTORE_VIEW 1
afterPhase RESTORE_VIEW 1
beforePhase APPLY_REQUEST_VALUES 2
afterPhase APPLY_REQUEST_VALUES 2
beforePhase PROCESS_VALIDATIONS 3
afterPhase PROCESS_VALIDATIONS 3
beforePhase UPDATE_MODEL_VALUES 4
afterPhase UPDATE_MODEL_VALUES 4
beforePhase INVOKE_APPLICATION 5
afterPhase INVOKE_APPLICATION 5
beforePhase RENDER_RESPONSE 6
afterPhase RENDER_RESPONSE 6
The problem is, when I press the button that is inside my custom dataTable the method for the button doesn't get invoked. So I believe that I have something wrong in my custom dataTable that isn't building the component tree correctly. Does anyone have any ideas for this?
Here is the class that renders my col tag. That tag puts out the <th> that the button is in.
* Created on Dec 19, 2004
package com.monsanto.ag_it.fieldops.aim.tblmaint.renderer;
import java.io.IOException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.Renderer;
import com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableCol;
import com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableColHdr;
* @author rcclark
* Renderer for the RptTableTag
public class RptTableColRenderer extends Renderer {
     private String tagType = null;
     public void encodeBegin(FacesContext context, UIComponent rptTableCol)
               throws IOException {
          // First determine if this is a th or td cell
          Object rptTblSection = rptTableCol.getParent().getParent();
          tagType = "td";
          if (rptTblSection instanceof UIRptTableColHdr) {
               tagType = "th";
          ResponseWriter writer = context.getResponseWriter();
          UIRptTableCol rptTblCol = (UIRptTableCol) rptTableCol;
          writer.write("\t\t\t");
          writer.startElement(tagType, rptTableCol);
//System.out.println("col id=" + (String) rptTableCol.getAttributes().get("id"));
//          if (!rptTblCol.getId().substring(0, 3).equals("_id")) {
               writer.writeAttribute("id", rptTblCol.getClientId(context), null);
          String colClass = (String) rptTableCol.getAttributes().get("colClass");
          if (colClass != null) {
               writer.writeAttribute("class", colClass, null);
          String colSpan = (String) rptTableCol.getAttributes().get("colSpan");
          if (colSpan != null) {
               writer.writeAttribute("colSpan", colSpan, null);
          String rowSpan = (String) rptTableCol.getAttributes().get("rowSpan");
          if (rowSpan != null) {
               writer.writeAttribute("rowSpan", rowSpan, null);
     public void encodeEnd(FacesContext context, UIComponent rptTableCol)
               throws IOException {
          ResponseWriter writer = context.getResponseWriter();
          writer.endElement(tagType);
          writer.write("\r\n");
     public boolean getRendersChildren() {
          return true;
}Thanks,
Ray

Similar Messages

  • Problem with iChat changing my custom away message after 30 minutes

    Lately, I've been having a big problem with iChat changing any custom away message that I put up to "Away" after 30 minutes or so. Is there anything I can do to make it stop? Another issue I'm having is that sometimes when people on my buddy list change their away message, it doesn't show up on iChat unless I go offline and then sign back on. Any idea why it's doing that, and what I can do to get it to stop?
    Thanks.
    - Danielle
    G3 iMac   Mac OS X (10.3.9)  

    Hi ienjoyanime,
    Go to the General Section of iChat Preferences.
    Does it say you are set to Go to Away when you log off/QUit iChat ?
    is the computer going to Sleep at this point ?
    10:59 PM Saturday; April 1, 2006

  • 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

  • Having a problem with commandButton attribute when i am using it under tabl

    Having a problem with {color:#800000}commandButton {color}{color:#339966}attribute {color}when i am using it under{color:#ff0000} table{color}
    I am using a command button under a table.
    here is the example
    <h:dataTable value="#{wlmHandler.plexes.plexes}" var="{color:#ff0000}onePlex{color}" border="0" cellspacing="0" cellpadding="0" width="100%" border="0">
    <h:column>
    <h:panelGrid border="0" cellpadding="0" cellspacing="0" columns="5">
    <h:commandButton action="" styleClass="tixbutton" value="#{labels.ADD}" onclick="#{onePlex.tran}"/>
    <f:verbatim> </f:verbatim>
    <h:commandButton action="#{createTransaction.transactionCommand}" styleClass="tixbutton"
    value="#{labels.SUBMIT}" actionListener="#{createTransaction.processAction}">
    <f:attribute name="dbName" value="#{wlmHandler.dbName}"/>
    <f:attribute name="plexName" value="{color:#ff9900}#{onePlex.name}"{color}/>
    </h:commandButton>
    </h:panelGrid>
    <h:/column>
    </h:dataTable >
    when i am using this plex name atribute it is giving nullPointerException
    {color:#ff9900}this value #{onePlex.name} i cant able to access inside the command button{color}

    balu i have tried by seeing u r blog.
    this is my structure of tables
    plexes (if i iterate plexes table gives plex object)
    |
    ------ plex (plex table gives transaction object)
    |
    ------transactions(transactions table gives transaction table)
    |
    here i will have a command link to this link i have to pass the plex name which
    will come from
    i tried in this command action with HTMLDataTable getRowData()
    i am not getting the selected row data .i am downcasting this getRowData() to plex.

  • Problem with commandButton action listener! Help

    I have a problem with the following and its driving me crazy!!
    I'm getting a java.lang.NoSuchMethodException for RoomHandler.flipBoard. It seems to render the button correctly with its value. But I can't see why It can't find that method, because its definetly in the bean...
    please see below
    My view:
    <f:view>
         <h:form id="room">
              <h:commandButton id="flipBoard" type="submit" value="#{room.flipBoardText}" actionListener="#{room.flipBoard}" />
              <h:messages />
         </h:form>
    </f:view>
    ...and My Bean:
    public class RoomHandler
         public RoomHandler()
         public String getFlipBoardText()
                 String text = "";
                 if (getWhiteOnBottom())
                   text = "White";
                 else
                          text = "Black";
                 text += " on bottom";
                 return text;
         public void flipBoard(ActionEvent e)
              System.out.println("Hello");
    My Facesconfig..
    <managed-bean>
         <managed-bean-name>room</managed-bean-name>
         <managed-bean-class>uk.RoomHandler</managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>Any ideas?

    Sorted! I think...
    Must have been a problem with myEclipse not deploying the correct class. (i think anyway)

  • Swc problem with flex from my custom fla

    I have an fla which has several library items with a class linkage to a GenericButton.as file. I am exporting this fla as an swc file, and linking that swc into flex.
    My problem is that when flex builds the code for GenericButton it gets undefined property for anything it tries to reference that is part of the library item.
    Example:
    GenericButton.as does libLabel.text = "something"; where libLabel is a textfield, instantiated in the library clip which is bound to GenericButton in it's class linkage.
    The field exists in the clip, but when I compile in Flex with the swc in there, it cant find it. It says libLabel doesnt exist, undefined property.
    What am I missing here? I want to allow the fla author to bind some of his items to low-level component classes like that, and it's his job to ensure that all the necessary items are part of it. So if he makes a new button, he must just ensure he has a libLabel textfield somewhere in the clip.
    Why cant flex see that the items it's trying to compile have a libLabel in there? Is there a work around?

    Thx for the reply Greg, but no, that's not the problem.  If you re-read my post you'll probably see my problem is a little more involved than that.
    I have symbols exported for actionscript and I can instantiate them in Flex, that's not a problem.  The problem is symbols that are exported for actionscript and bound to a base class that contains custom code.  That custom code, when it uses it to type-check in flex builder (during the swc link stage), causes undefined properties.
    For some reason Flex is not seeing that the exported library item has the things the .as file is looking for.
    Does that make sense?
    I could probalby put together a simple example project but I'd have to find somewhere to upload it so that others could see.
    This problem is hard to describe, you have to read what I'm saying very carefully.

  • LSMW problem with Partner functions in Customer Master

    Hi All,
    Requirement is to load the Customer Master Data using LSMW.
    Loading General data is ok, But when I am planning to load the
    partner function using the recording method in LSMW, How do I upload
    more than '1' Ship to party partners and more than '1'
    Bill to party partners using LSMW.
    Normally in table control there is a "+" button at the end of the
    table control which when pressed enters one line in table control,In
    Partner function screen , there is no such button available, so how
    can I determine which line am I supposed to enter data using LSMW.
    One partner can have multiple no of BP and SH partners like more than 10
    of both types. How do I upload these partner functions in SAP using LSMW?
    Regards,
    Ajay

    That a customer master has several business partners is just usual, a customer can have as well several company codes and sales areas. So where exactly is the problem?
    Most problems come with recordings, recordings should be the last option, not the first.
    What import method do you use?

  • Problem with role mapping in custom login module

    Hi all,
    I have developed custom login modules. They don't use the default user store but own data tables holding the necessary user information.
    Login works fine. But there is one big problem: Only those users that exist with the same user-id in the default user store get roles assigned to it. Whicht leads to 403-errors in my web application.
    Now, this is weired because a user with id 'Susi' has completely different passwords in my custom tables and in the user store, therefore it shouldn't be possible to authenticate 'Susi' against the default user management.
    Next thing is, I don't use the default login modules at all. So why does the application validates against the user store?
    I thought a source of the  problem might be that I don't set the roles correctly. I set the roles as a principal to the subject. I have chosen the role based mapping  in the web-engine.xml and mapped all my custom roles to the server role 'guests'.
    Could anybody think of a solution to this problem ?
    Thanks,  Astrid

    Astrid,
    Sorry to go off-topic on your post...but I have a question in relation to how you deploy your login module. Do you deploy the login module with your application ? I've developed a login module that I would like to deploy by itself, I currently deploy it with the calculator example and it works fine like this, but I need to deploy it by itself. Any tips you can give would be greatly appreciated.
    I've tried to use the deploytool and deploy the module as a library...but I get a "cannot  load a login module" in the logs when authenticating a user.

  • Problem with Collaboration Navigation in Custom Framework (Tasks)

    Hi,
    I developed a custom frameworkpage with DTN using the Navigation Taglibrary. (Navigation-Method: byURL)
    I also included the navigation within collaboration rooms.
    My problem is now:
    When I navigate to "Tasks" and then click on one of the tasks related to that room, the task appears, but the navigation context is gone (empty DTN, none of the Top-Level nodes is selected..)
    Even when I try to add the navigationContext of the "Task"-Node to the url, it does not work. (a navigation context is only displayed if the context points to a non-collaboration navigation node)
    Does anyone have the same problem and solved this somehow?
    Greetings,
    Michael Baginski

    Hi Mike,
    If you create a custom component then nothing is working "out-of-the-box"
    But the following links could help you in building your own custom nav module with support for Nav-Zoom:
    http://help.sap.com/saphelp_nw70/helpdata/EN/46/996c0ff1cf15ece10000000a114a6b/frameset.htm
    Generic Tag Lib:
    http://help.sap.com/saphelp_nw70/helpdata/EN/42/f35146a7203255e10000000a1553f7/frameset.htm
    You can take the sap portal light dtn and start 'stripping' it until you have something you can work with.
    This helps you to figure how the tag-libs work and can help you create your custom module from scratch eventual.
    Ofcours you should never overwrite SAP components so if you redeploy do it in your customer namespace (com.<customername>.<application>).
    Good Luck,
    Benjamin Houttuin

  • Problem with CRM business package- Customer iViews throws runtime error

    Hi all,
    We have installed EP6.0 SP11 Patch3 on windows machine.
    Also we have uploaded CRM business package with all required systems (e.g. SAP_CRM,SAP_BW etc.)
    All the iviews are working fine except which are under Customer and Customer Admin Role. These iViews throws following exception :
    Portal Runtime Error
    An exception occurred while processing a request for :
    iView : pcd:portal_content/com.sap.portal.migrated/ep_5.0/roles/com.sap.pct.crm.Customer/customer/Home/com.sap.pct.crm.channelmgmt.specialoffers
    Component Name : com.sap.pct.crm.ChannelMgmtComponents.GenericISAComponent
    Has anybody face this problem earlier....???? If so plz help.....
    With regards,
    Amol.

    hi,
      i didnt configure customer and customer administrator roles...however i was dealign with other roels of CRM business package.. I can jsut give you a asuggestion ..i.e. i see that there is a property cateogry "ISA" after you create the system..so i think these properties need to be filled up.
    Thanks

  • Design problem with dynamically added row in datatable

    Hello all,
    I have a dataTable and have developped a method that dynamically adds rows to the dataTable. Each row is made up of two form controls. The problem I have now is that I don't know how to retrieve the values from the mutiple rows. Ideally I would need the values to be stored into a list.
    Can anyone help?
    Thanks in advance,
    Julien.
    Here is my code:
    <h:dataTable var="line" binding="#{TradeClientsAndQuantitiesBean.clientsAndQuantities}"  value="#{TradeClientsAndQuantitiesBean.listOfMiddleFormHelpers}">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="S�lectionnez un client"/>
                    </f:facet>
                    <h:selectOneMenu value="#{TradeClientsAndQuantitiesHelperBean.selectedClientTemp}">
                        <f:selectItems value="#{TradeClientsAndQuantitiesHelperBean.concatenatedLabelMap}"/>
                    </h:selectOneMenu>
                </h:column>   
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Renseignez une quantit�"/>
                    </f:facet>
                    <h:inputText value=""/>
                </h:column>   
            </h:dataTable>

    The values will just be put in the same row object you added to TradeClientsAndQuantitiesBean.listOfMiddleFormHelpers.
    It might be worth to read this article: http://balusc.xs4all.nl/srv/dev-jep-dat.html

  • Strange problem with AAM, Alerts, and custom app

    Hello
    We have a custom app written by an outside vendor. There is a function of the app called merge that basically takes a template in a document library and is supposed to make a copy for editing. The function only works if the Default AAM is the internal server
    name http://server1. However the alerts email links show the same thing so they do not work from outside of the network. If the default AAM is changed to the Internet URL http://sharepoint.domain.com the merge fails with error "error is The remote server
    returned an error: (401) Unauthorized., url is http://sharepoint.domain.com/prm/Document Library/Templates/Test co.docx." And the alerts are correct. 
    Of course the vendor says it is not their issue. Anyone able to give me some ideas? Can the Alert Template be changed to come from other than the default AAM value?
    Thanks

    the error ("401 unauthorized") is likely due to a LoopbackCheck.
    You cannot change the email message, alerts always use default AAM.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Problems with upgrading interfaces of custom step types

    This question is about configuration management of custom step types.
    Here at Cummins, we have defined our own custom step types (CSTs) using MyTypes.ini. People all over the company use these CSTs in their seq files.
    All these CSTs are calls to individual sequences in a seq file (for simplicity, we'll call this file "Source.seq"). An example CST would be MyStep which calls the sequence MyStep_sequence in the file Source.seq.
    What we want to do going forward is: add one more parameter to the interface of this CST. That means, we will add one more parameter to the sequence MyStep_sequence and then upgrade the definition of the step in MyTypes.ini. We don't want to break existing users, and want the future users of this CST to be able to use this new parameter for newer functionality (ofcourse I did think about creating a new CST all together, but that seemed more maintenance in the future).
    In order to achieve this, my idea was to check mark the box "Use Default" in MyTypes.ini for the new parameter (I propose this because very few of the new users will want to care about this new parameter). At the same time, increment the version number of the step. So now, when an old file is brought up that was using this step, it should be usable just as is without any modifications (ofcourse it will need to be re-saved). When this step is used now by a new person, he will be able to see the new parameter and either not care about it (leave it checked as "Use Default") or pass a desired input to it.
    First question :, does this sound like a good long term approach for maintaining backward compatibility and CM control? Or are there any percieved issues with doing this due to which its recommended to just go ahead and create a new step?
    Second question: this seems to work only if the new parameter is added as a the last parameter in the sequence. if I move things around, (for ex: make this new parameter the first parameter of the sequence), it seems to mess things up. I am okay with making the new interface parameter the last one, but just wanted to throw out this observation I made and see if people had any comments..
    Third question: to make things a little more complex, some of the other sequences in Source.seq also USE MyStep. But I've realized that the only implication this has is, I'll have to open up Source.seq and re-save it beofore I send it out to the users..?

    Hi Anuj,
    Answer 1: Yes, this is a good long term approach in regard to compatibility, maintenance, and control.
    Answer 2: Yes, as of TestStand 4.0 this is expected behavior, as the programmatic reordering of prototypes is not a supported code generation teqnique.
    Answer 3: In short, yes you much open and save every sequence that contains your new CST. Be sure to save your step type first, making sure to increment your version number. This method will ensure that the step type conflict is automatically resolved in files that load this new type. If you forget to increment your version number you will have to manually resolve this conflict.
    Thanks
    Evan Prothro
    RF Systems Engineer | NI

  • Problem with XMLDecoder and a custom ClassLoader

    NOTE: Posted over in Serialization forum as more appropriate there, sorry for the crosspost but didn't notice that forum at first. Please direct any replies there.
    I am implementing an application based around Java Plugin Framework (jpf.sourceforge.net). In short one consequence of this framework is that each plugin uses its own classloader with scope of that plugins classes.
    One plugin I am using requires the ability to deserialize objects from a javabean xml file. I am using XMLDecoder to do this, and I used the constructor to pass the current plugin ClassLoader to it.
    This however only partially seems to work, this is a shortened extract from an example xml
    <java version="1.5.0" class="java.beans.XMLDecoder">
    <object class="usermanager.javabeans.BeanUser">
      <string>drftpd</string>
      <void property="downloadedBytes">
       <long>737132544</long>
      </void>
      <void property="hostMaskCollection">
       <void method="add">
        <object class="usermanager.HostMask">
         <string>*@*</string>
        </object>
       </void>
      </void>
       <void property="keyedMap">
       <void method="put">
        <object class="dynamicdata.Key">
         <class>commands.UserManagement</class>
         <string>slots</string>
         <class>java.lang.Integer</class>
        </object>
        <int>0</int>
       </void>
    etc...Now without passing XMLDecoder a ClassLoader as would be expected I get a ClassNotFoundException for the first <object>.
    However if I pass XMLDecoder the correct ClassLoader it reads the xml fine until it reaches <class>commands.UserManagement</class> at which point again I get a ClassNotFoundException.
    Here is the stacktrace from that exception:
    java.lang.ClassNotFoundException: commands.UserManagement
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:242)
         at com.sun.beans.ObjectHandler.classForName(ObjectHandler.java:67)
         at com.sun.beans.ObjectHandler.classForName(ObjectHandler.java:54)
         at java.beans.Statement.invoke(Statement.java:140)
         at java.beans.Expression.getValue(Expression.java:98)
         at com.sun.beans.MutableExpression.getValue(ObjectHandler.java:400)
         at com.sun.beans.ObjectHandler.getValue(ObjectHandler.java:106)
         at com.sun.beans.ObjectHandler.endElement(ObjectHandler.java:327)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:625)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1241)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:344)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:120)
         at java.beans.XMLDecoder.readObject(XMLDecoder.java:205)
         at usermanager.javabeans.BeanUserManager.loadUser(BeanUserManager.java:128)
    Now after looking through some of the source it appears to me at least that XMLDecoder when processing an <object> uses an ObjectHandler with the ClassLoader as a parameter, however a class contained within a <class> element gets handled by Statement.invoke() which uses an ObjectHandler without a ClassLoader specified thus using the standard ClassLoader.
    I've managed to work around it for now by setting the contextClassLoader to the correct one before calling readObject() in XMLDecoder and then reverting it back immediately after, but this feels like somewhat of a hack to me.
    I would've expected it to have been properly handled when passing the ClassLoader to XMLDecoder rather than like it is.
    Anyone know if this is intended behaviour or a bug? and if the former is there any recommended way to deal with this other than the one I'm currently using.
    NOTE: Posted over in Serialization forum as more appropriate there, sorry for the crosspost but didn't notice that forum at first. Please direct any replies there.
    Message was edited by:
    djb61
    NOTE: Reposting to Serialization

    You can provide a cell renderer to the JTree to paint the checkBox.
    The following code checks or unchecks the box with each click also:
    _tree.setCellRenderer(new DefaultTreeCellRenderer()
      private JCheckBox checkBox = null;
      public Component getTreeCellRendererComponent(JTree tree,
                                                    Object value,
                                                    boolean selected,
                                                    boolean expanded,
                                                    boolean leaf,
                                                    int row,
                                                    boolean hasFocus)
        // Each node will be drawn as a check box
        if (checkBox == null)
          checkBox  = new JCheckBox();
          checkBox .setBackground(tree.getBackground());
        DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
        checkBox.setText(node.getUserObject().toString());
        checkBox.setSelected(selected);
        return checkBox;
    });

  • Facing a problem with standard text in custom program

    Hi,
    As per my requirement i need to create a standard text (transaction code s010 ) in custom program using below code. But when click save button then it needs to be come out of the screen without click back button.
    CALL FUNCTION 'CREATE_TEXT'
        EXPORTING
          FID         = G_THEAD-TDID
          FLANGUAGE   = G_THEAD-TDSPRAS
          FNAME       = G_THEAD-TDNAME
          FOBJECT     = G_THEAD-TDOBJECT
          SAVE_DIRECT = 'X'
          FFORMAT     = '*'
        TABLES
          FLINES      = I_TLINE
        EXCEPTIONS
          NO_INIT     = 1
          NO_SAVE     = 2
          OTHERS      = 3.
      IF SY-SUBRC <> 0.
      ELSE.
        CALL FUNCTION 'EDIT_TEXT'
          EXPORTING
            HEADER        = G_THEAD
            SAVE          = 'X'
          TABLES
            LINES         = I_TLINE
          EXCEPTIONS
            ID            = 1
            LANGUAGE      = 2
            LINESIZE      = 3
            NAME          = 4
            OBJECT        = 5
            TEXTFORMAT    = 6
            COMMUNICATION = 7
            OTHERS        = 8.
        IF SY-SUBRC <> 0.
        ENDIF.
      ENDIF.
    Can you please help me how to do this
    Regards
    nag

    But when click save button then it needs to be come out of the screen without click back button.
    can you explain me, what do you mean by that.
    ~satya

Maybe you are looking for