ADF: Table with SelectBoolAncheckBox

Forum sobre a ferramenta Oracle JDeveloper, ADF, OAF, etc. (Não é destinado ao aprendeziado da Linguagem Java em geral)
Post Reply
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Hi everyone ....

I have the following problem ...

I have an ADF: Table that I believe from my viewObject. .. and I added to it a corecolumn (no binding none) ... and in this column I put a selectbooleancheckbox ....

I wanted to know the following ... how do I know if the user checked or not each table line? .... ie how do I get the value of each line of a certain column ..?

I own in my view object ,,, I did not have problems ... I did the following:

Select all

 
 FacesContext fc = FacesContext.getCurrentInstance(); 
       ValueBinding vb = fc.getApplication().createValueBinding("#{bindings}"); 
       DCBindingContainer bc = (DCBindingContainer) vb.getValue(fc); 
 
       DCIteratorBinding dcIter = (DCIteratorBinding)bc.get("TipoTapeView1Iterator"); 
       dcIter .setRangeSize(-1); //ALL ROWS 
 
       Row[] rows = dcIter.getAllRowsInRange(); 
 
       for(int i=0; i<rows.length; i++) { 
       Row r = rows[i]; 
       JOptionPane.showMessageDialog(null,r.getAttribute("IdTape"));  
       } 
Now I want to know .. how do I do this for the column that I do not have an equivalent attribute, in my viewobjcet ...

I do not know if you gave to understand ..: Wink:

Any suggestion It will be very welcome ...
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Your adf is flowing huh
: D

I do not understand what you want !!!

:(
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Hehe .... Well ... now things are "less' difficult hehe ... I learned a lot, ... and the forum has already helped me a lot !!, ...: D

Good .. It's the following ... I have the following table:

Select all

 
<af:table value="#{bindings[\'Tipo_de_TapesView1\'].collectionModel}" 
                  var="row" rows="#{bindings[\'Tipo_de_TapesView1\'].rangeSize}" 
                  first="#{bindings[\'Tipo_de_TapesView1\'].rangeStart}" 
                  emptyText="#{bindings[\'Tipo_de_TapesView1\'].viewable ? \'No rows yet.\' : \'Access Denied.\'}" 
                  binding="#{backing_untitled1.table2}" id="table2"> 
          <af:column sortProperty="IdTape" sortable="false" 
                     headerText="#{bindings[\'Tipo_de_TapesView1\'].labels.IdTape}" 
                     binding="#{backing_untitled1.column9}" id="column9"> 
            <af:outputText value="#{row.IdTape}" 
                           binding="#{backing_untitled1.outputText9}" 
                           id="outputText9"/> 
          </af:column> 
          <af:column sortProperty="Teste" sortable="false" 
                     binding="#{backing_untitled1.column16}" id="column16"> 
            <af:selectBooleanCheckbox 
                                      binding="#{backing_untitled1.selectBooleanCheckbox1}" 
                                      id="selectBooleanCheckbox1"/> 
          </af:column> 
        </af:table> 
This is my table ... the first column. . It is resulting from a view ... I simply dragged ...
The second column ... I put manually .. and inside this column I put a checkbox ... The question is: how to access each Of these Checkbox ...
ie how to know which one is checked or not? .....
I need to make a kind of table of questions and answers (with yes or no ... In this case checked or not) .. in the bank I have a table of questions ... and have another table that are stored the answers of each user for a particular question ...

I tried Work with Corecolumn .. but I did not have much success
I could understand: Wink: ... if you also have a suggestion to solve this otherwise ... any idea is welcome. .
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Well .. let's see if I understood ..: D

Select all

 
<af:selectBooleanCheckbox  
      binding="#{backing_untitled1.selectBooleanCheckbox1}"  
      id="selectBooleanCheckbox1"/>  

I will not even tell you that in managed bean backing_untitled1 you can access your component through the object selectboolecheckbox1 because you sure must know then I assume that you are wanting to access it in your application module ..
you can create a transient field on your vo, or a field that will not have a correspondent in query and can you have control of him

would that be?!?!
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

hehe ... I know in parts ....

Well I know I can access the SelectBoolAncheckBox1 on backing_untitled1 .. I know I can make a condition like this:

Select all

 
if(getSelectBooleanCheckbox1().isSelected()) 
To know if he is selected or not ... or still, give a getValue ..... but .. this selectbooleCheckbox1 is inside a column ....
For example .. If this column has 5 line ... How do I access, the 5 SelectBoolAncheckBox, who will be inside this column? .. This is my doubt ... !!!

I had already thought of doing this way ... with a transient column .... I created a transient column of Boolean type, but when I create the table .... and change The column outputtext by a SelectBoolAncheckBox ... it is disabled .... without letting

Select all

 
<af:column sortProperty="Teste" sortable="true" 
                     headerText="#{bindings[\'Tipo_de_TapesView1\'].labels.Teste}" 
                     binding="#{backing_untitled1.column19}" id="column19"> 
            <af:selectBooleanCheckbox 
                                      binding="#{backing_untitled1.selectBooleanCheckbox3}" 
                                      id="selectBooleanCheckbox3" 
                                      value="#{row.Teste}" 
                                      required="#{bindings[\'Tipo_de_TapesView1\'].attrDefs.Teste.mandatory}"/> 
</af:column> 
But the question even ... is how to access The SelectBoolAncheckBox inside a column ... get all the lines ....
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

In JS you can do something of the type

Select all

 
function marcarTodos(idForm, idGrid)  
{ 
    var filial = document.forms[idForm].elements[idGrid]; 
 
    var intSelectedFilial = document.forms[idForm].elements[idGrid].options.length; 
 
    for( i = 0; i < intSelectedFilial; i++ )  
    { 
      document.forms[idForm].elements[idGrid].options[i].selected = true; 
    } 
     
    return false; 
} 
now that you are wanting ...
has to be done with the transient field and interible on the rows of the vo la ..
he is only unchecked because you did not put it as updatable always
for this just double-click on your vo
in the window that will open, You must expand the attributes
DAI Look for your transient attribute and mark the Updatable Always option
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

I got it !!!!!!!!!!!!! ........: -The


once again valeu for the great help Victor .. ..

I only changed even for Updatable Always ... and then I was able to access .. with that code that I posted first ..... and check if it's true or false ... ...


valeu ....: D
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

and that I always try to send you the max of possible information
but good that you have achieved with your solution

is in peace and success
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests