• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Input row select on data table does not get called

 
Greenhorn
Posts: 13
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I spent 2 weeks to try to figure out why the input row select on a data table does not work. I still trying to find out and have no clue. The problem is the method setSelected() never get called in the managed bean eventhough i select the row on the data table. If you happen to know the problem, please show me. I have the jsf as follow
==========================================================
<h:form styleClass="form" id="form1"><p><h:dataTable border="0"
cellpadding="2" cellspacing="0" columnClasses="columnClass1"
headerClass="headerClass" footerClass="footerClass"
rowClasses="rowClass1" styleClass="dataTable" id="table1" value="#{pc_OrderSearch2.orderResponse.orderErrorAsArray}" var="varorderErrorAsArray">
<h:column id="column7">
<hx:inputRowSelect styleClass="inputRowSelect" id="rowSelect1"
value="#{pc_OrderSearch2.selected}"></hx:inputRowSelect>
<f:facet name="header"></f:facet>
</h:column>
<h:column id="column2" >
<f:facet name="header">
<h:outputText styleClass="outputText" value="PatFirstName" id="text2"></h:outputText>
</f:facet>
<h:outputText id="text3" value="#{varorderErrorAsArray.patFirstName}" styleClass="outputText" >
</h:outputText></h:column>
<h:column id="column3" >
<f:facet name="header">
<h:outputText styleClass="outputText" value="PatEMPI" id="text4"></h:outputText>
</f:facet>
<h:outputText id="text5" value="#{varorderErrorAsArray.patEMPI}" styleClass="outputText" >
</h:outputText></h:column>
<h:column id="column4" >
<f:facet name="header">
<h:outputText styleClass="outputText" value="PatLastName" id="text6"></h:outputText>
</f:facet>
<h:outputText id="text7" value="#{varorderErrorAsArray.patLastName}" styleClass="outputText" >
</h:outputText></h:column>
<h:column id="column5" >
<f:facet name="header">
<h:outputText styleClass="outputText" value="PatMiddleName" id="text8"></h:outputText>
</f:facet>
<h:outputText id="text9" value="#{varorderErrorAsArray.patMiddleName}" styleClass="outputText" >
</h:outputText></h:column>
<h:column id="column6" >
<f:facet name="header">
<h:outputText styleClass="outputText" value="OrderErrorId" id="text10"></h:outputText>
</f:facet>
<h:outputText id="text11" value="#{varorderErrorAsArray.orderErrorId}" styleClass="outputText" >
</h:outputText></h:column>
<h:column id="column1">
<f:facet name="header">
<h:outputText id="text1" styleClass="outputText"
value="Column 1"></h:outputText>
</f:facet>
</h:column>
</h:dataTable><hx:commandExButton type="submit" value="Submit"
styleClass="commandExButton" id="button1" action="#{pc_OrderSearch2.doButton1Action}"></hx:commandExButton></p></h:form>
===========================================================================

The managed bean as follow

==========================================================================
boolean selected[] = new boolean[50];

public void setSelected(boolean[] selected)
{
log.debug("Set selected !!!");
this.selected = selected;
}


public boolean[] getSelected()
{
return selected;
}
public String doButton1Action() {
// Type Java code that runs when the component is clicked
boolean[] result = getSelected();

// TODO: Return outcome that corresponds to a navigation rule
for (int i = 0; i < result.length; i ++)
{
log.debug("selectd values " + result[i]);
}


//log.debug ("Select row is " + selectedRow.getIntRows());
return "detail";
}

========================================================================
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic