Forums Register Login

inputRowSelect problem

+Pie Number of slices to send: Send
Hello.
In my application I am trying to show the search result in dataTable. The difficulty is that the inputRowSelect should be disabled or hidden if InSelectedList column value equals 1. I tried to use render condition, but in this case I couldn't get the rows selected values.
Maybe, you could suggest me any solution?
Thanks in advance.
Ina Bumstein
+Pie Number of slices to send: Send
The easiest way is to not display ineligible data. The way you do that is to take into account that the GUI datamodel isn't necessarily the same things as the persistent datamodel and only include the rows from the persistent datamodel that you actually want displayed.

This is, of course, that you're talking about data coming back as row objects from a database, but the principle's the same regardless of the origin of your display data, so for simplicity's sake, I'll use that as an example.

The brute-force way is simply to create a new list object, and enumerate the original data, adding only the rows that are eligible for display. If you have lots of data, limit the display model to only the data for the current page display and handle data scrolling manually to reduce overhead.

Alternatively, for a DBMS ORM system, it might be easier in some cases to simply formulate a query that pre-filters the data and use the results of that instead.
+Pie Number of slices to send: Send
Thanks for reply Tim.
I think that you misunderstand the question. I need to show all result, but those that InSelectedList=1 shouldn't have inputRowSelect column active or shown. For example:

inputRowSelect column 1 column2 InSelectedList
active word1 word2 0
not active word1 word2 1

Maybe you know how to do that?
Ina
+Pie Number of slices to send: Send
Unfortunately I couldn't understand you Bob. This is my sample code.
What I should change here that rowSelect1 would be shown only if varsearchrez.c3=1? Just usage of the rendered tag for hx:inputRowSelect coses that the hx:inputRowSelect is not working properly.

<h:dataTable id="tableSRez" value="#{SearchRezult.searchrez}" var="varsearchrez" styleClass="dataTable" headerClass="headerClass" footerClass="footerClass" rowClasses="rowClass1, rowClass2" columnClasses="columnClass1" border="0" cellpadding="0"cellspacing="2" rows="10" width="100%">
<h:column id="columnRowSelect">
<hx:inputRowSelect id="rowSelect1" styleClass="inputRowSelect"value="#{SearchRezult.selected}">
<f:param name="chsavid" id="param1" value="#{varsearchrez.savid}"></f:param>
</hx:inputRowSelect>
<f:facet name="header"></f:facet>
</h:column>
<h:column id="column0">
<f:facet name="header"><h:outputText value="Column1"></h:outputText>
</f:facet>
<h:outputText value="#{varsearchrez.c1}"></h:outputText>
</h:column>
<h:column id="column1">
<f:facet name="header"><h:outputText value="Column2"></h:outputText>
</f:facet>
<h:outputText value="#{varsearchrez.c2}"></h:outputText>
</h:column>
</h:dataTable>
+Pie Number of slices to send: Send
Change SearchRezult.searchrez class (whatever class you put in the List, add a method



then

<hx:inputRowSelect rendered="#{varsearchrez.showWithLink}" id="rowSelect1" styleClass="inputRowSelect" value="#{SearchRezult.selected}">

[ January 30, 2008: Message edited by: Bob Good ]
[ January 30, 2008: Message edited by: Bob Good ]
+Pie Number of slices to send: Send
Hello Bob,
As I mentioned in the beginning I tried to do exactly the same as you suggested, but using this method I couldn't get the rows selected. The param1 value is empty.
May be you know any other solution?
Thanks. Ina
+Pie Number of slices to send: Send
My solution was to the original statement:


the inputRowSelect should be disabled or hidden if InSelectedList column value equals 1


Your new problem:


but using this method I couldn't get the rows selected. The param1 value is empty.


Some miscommunication perhaps here.

To get the rows selected, in your acton method to handle the form submit button, iterate through the list:



Forget the f:param.


Also change this:

<hx:inputRowSelect rendered="#{varsearchrez.showWithLink}" id="rowSelect1" styleClass="inputRowSelect" value="#{varsearchrez.selected}">
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3298 times.
Similar Threads
inputRowSelect show only if column value = 1
scope problem with simple search page
DHTMLXGrid multiple header colspan issue.
Ideas, @DataModel + <rich:dataTable>
DataTable Primefaces
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 06:48:27.