ADF: selectOneChoices carrying value selected

Forum sobre a ferramenta Oracle JDeveloper, ADF, OAF, etc. (Não é destinado ao aprendeziado da Linguagem Java em geral)
Post Reply
rohling
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 20
Joined: Wed, 26 Aug 2009 7:43 pm
Location: PR

I have a simple example of 2 seletonechoice one of a UF another city, which when in the insert function selecting the UF in the Valuechangelistener event lists the cities of that UF, the problem is when making a change of the registration where UF and cities come to already selected according to the bank; And in the city's selector show only the cities of the respective UF. Where can I put the operation of my AM to run before the form is presented?

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

The value attribute of your cities selector has to receive the amount equal to the bank and then it will be selected.

UF and city referring to some right register?!. . You can link with a VL your UF and use another vl for linking your cities and then when you open your registration it (ADF BC) will already bring the UF and city for that registration
rohling
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 20
Joined: Wed, 26 Aug 2009 7:43 pm
Location: PR

Yes, it would be all right, but I would like the combo of the cities to present only the cities of that UF. Because I believe that doing so will present all cities. We would have to do a procedure to get the UF ID already registered and run the operation of my city where an IDUF paramatrian is the same as UF. My biggest problem is where can I run is operation before loading the form?

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

You can make a method in the AM with this implementation that filters the combos ..

Create a Methodaction in Pagedef and create an InvokeAction for this methodaction that you created and call that form
Refreshcondition = "# {adffacescontext.postback == True}"
rohling
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 20
Joined: Wed, 26 Aug 2009 7:43 pm
Location: PR

I did this now, but when 1st time the registration form is loaded, the AM medode is not executed is run when I register the registration with the Next, Previous or Submit, there it runs 2 times: one with the value of the IDUF of the registration previous and other with corresponding value and when you run the combo is not selected and the following log message:

Select all

 
<FacesCtrlListBinding><getInputValue> ADFv: Não foi possível encontrar o item selecionado correspondente ao valor 1503201 do tipo: oracle.jbo.domain.Number na lista de valores. 
My InvokeAction:

Select all

 
<invokeAction id="invokeExecuteWithParams" Binds="procuraciade" 
                  Refresh="ifNeeded" 
                  RefreshCondition="#{adfFacesContext.postback == true}"/> 
Sincerely,
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

I'm getting forgotten about things rsrsrs ...

changes from true to false .. or then denies your current expression
rohling
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 20
Joined: Wed, 26 Aug 2009 7:43 pm
Location: PR

Yes it is now running but however when you run the method in AM I set the parameter:

Select all

  
getUfcidade1View1().setNamedWhereClauseParam("idufp",iduf); 
The cities are filtered but the combo is not selected and the log message:

Select all

 
<FacesCtrlListBinding><getInputValue> ADFv: Não foi possível encontrar o item selecionado correspondente ao valor 1503201 do tipo: oracle.jbo.domain.Number na lista de valores.  
[[99]
I think it's some bug, because if I set the value of the parameter there even in vo it brings the selected value, also if I send list all cities without using condition where it selects the combo perfectly but without the filter.
We have a solution for this .....
Thanks,

[/ Code]
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

So ..

Send your full-screen components.
What is the type of attribute in VO?
rohling
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 20
Joined: Wed, 26 Aug 2009 7:43 pm
Location: PR

Then if I do the combo as below filters the cities and select the city but select the wrong city, as it selects according to the sequence of combo, example registered city 3 selects the 4 field of combo because it begins with 0.
99]]

Select all

 
<af:selectOneChoice value="#{bindings.Cidadeid1.inputValue}" 
                                  label="#{bindings.Ufcidade1View1.label}" 
                                  shortDesc="#{bindings.Ufcidade1View1.hints.tooltip}" 
                                  binding="#{backingBeanScope.backing_teste.soc3}" 
                                  id="soc3" partialTriggers="cb3"> 
                <f:selectItems value="#{bindings.Ufcidade1View1.items}" 
                               binding="#{backingBeanScope.backing_teste.si4}" 
                               id="si4"/> 
              </af:selectOneChoice> 
 
No Def 
 
	      <list IterBinding="Ufcidade1View1Iterator" ListOperMode="navigation" 
          ListIter="Ufcidade1View1Iterator" id="Ufcidade1View1" 
          DTSupportsMRU="true"> 
      <AttrNames> 
        <Item Value="Nomecidade"/> 
      </AttrNames> 
    </list> 
 
If I do through a FOREAC as below the combo filtrates and is not selected and I see by the generated HTML code is with sequence value starting from 0 the id.

Error:

Select all

 
<FacesCtrlListBinding><getInputValue> ADFv: Não foi possível encontrar o item selecionado correspondente ao valor 5 do tipo: oracle.jbo.domain.Number na lista de valores. 
<SimpleSelectOneRenderer><_getSelectedIndex> Could not find selected item matching value "5" in RichSelectOneChoice[UIXEditableFacesBeanImpl, id=soc4] 
Code:

Select all

 
 
<af:selectOneChoice value="#{bindings.Cidadeid1.inputValue}" 
                                label="#{bindings.Ufcidade1View1.label}" 
                                shortDesc="#{bindings.Ufcidade1View1.hints.tooltip}" 
                                binding="#{backingBeanScope.backing_teste.soc4}" 
                                id="soc4" partialTriggers="cb3"> 
              <af:forEach items="#{bindings.Ufcidade1View11.rangeSet}" 
                          var="row"> 
                <af:selectItem label="#{row.Nomecidade}" id="si14" 
                               value="#{rowa.Idibge}"/> 
              </af:forEach> 
            </af:selectOneChoice> 
No Def: 
 
<table IterBinding="Ufcidade1View1Iterator" id="Ufcidade1View11"> 
      <AttrNames> 
        <Item Value="Idibge"/> 
        <Item Value="Nomecidade"/> 
      </AttrNames> 
    </table> 
Thanks ,
[/ Code]
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

I do not understand ... it explains better its structure


would have two forms:

You have a registration screen with n information for be saved
2 of them are uf and city .. in this case when opening the record you would not need to filter the second combo because the record once saved would be displayed on the screen

you said ...
The problem is when making a change in the registration in which I need UF and cities already selected according to the bank
The main entity of the screen of this registration?

Type like this ..
Student -> Name, registration, UF and city

A student has a city .. soon you need to have to have a field in the table student to save the city .. so what you should do .. create a table for cities and then build a vo for this table ...

in your screen component you will use the value of the city of student of student .. and in your foreach you will use the listing of the citiesvo

I think you will not have problems like this ..

99] If you continue in doubt .. Communicate me that I do an example project for you ..
rohling
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 20
Joined: Wed, 26 Aug 2009 7:43 pm
Location: PR

You say:
You say:
You have a screen of registration with n information to be saved
2 of them are UF and city .. If you open the registry you would not need to filter the second combo because the record once saved would be displayed on the screen
yes agree will list all cities in the combo because I really have a table City that refers to my person registration and if for example open the person's registration I can select a non-corresponding state city. And if I run the AM method to filter it does not bring the values ??in the combo.
You say:
Student -> Name, Matricula, UF and City

A student has a city .. soon you You need to have a field on the student table to save the city .. So what you should do .. Create a table for cities and then build a VO for this table ...
I really have all this and also a UF table with your VO that also saves the IDUF on my student registration in case.

You say:
In your screen component you will use the VALUE OF THE FIELD CITY OF THE PUPPING VO .. AND IN YOUR FOREAC YOU will use the listing of the citiesvo
yes in my examples I use this, now in my foreach what I created in my def to be your item value of my foreach tala component ? a table or list or iterator, etc.
Thanks,
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

I do not understand by the following

if this .. in your foreach

Select all

value="#{rowa.Idibge}"
is equal to this .. in your selectionCame [[1 ]

should it open set with the value of the bank

tended ??

===========

Writing the above post saw the following error:

Select all

rowa.Idibge
the variable for each line that you defined and row and row

See if it goes funcionar
rohling
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 20
Joined: Wed, 26 Aug 2009 7:43 pm
Location: PR

Victor:
Really in my Foreach was with the wrong amount now I only changed and thanks work, another error that was doing in some tests was also that in value = "# {bindings.cidadeid1.inputvalue}" where city1. InputValue was a list that was generated when I dragged the components and not the value of the reference of the city city.

Very thank you very much, I owe you more this ... stay in peace.

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

The interesting thing of this feature to drag the direct component of the model flap and the creation of the components in the paidedef but on the screen you can not open hand to program ..

I and I thank you for your participation .

stays in peace Brother
rohling
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 20
Joined: Wed, 26 Aug 2009 7:43 pm
Location: PR

My selected component saga continues .... now is with a SelectManycheckBox that can have multiple selected objects. List all selection options of a Tipodeficiency table, I realize the filters in an associative table where it has the person ID and the ID of the tipodeficiency. But I do not know which value to use for the value attribute = from the AF: SelectManyCheckbox from my presentation to stay the selected items .... does anyone have any light?

Select all

 
<af:selectManyCheckbox value=???? Aqui list, table, etc. do meu def.. 
                                   label="#{bindings.TipodeficienciaView1_1.label}" 
                                   binding="#{backingBeanScope.backing_cadastro_beneficiario.smc1}" 
                                   id="smc1"> 
              <af:forEach items="#{bindings.TipodeficienciaView1_11.rangeSet}" 
                          var="row"> 
                <af:selectItem label="#{row.Tipodeficiencia}" id="si13" 
                               value="#{row.Idtipodeficiencia}"/> 
              </af:forEach> 
            </af:selectManyCheckbox> 
Sincerely,
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

I never worked with this component ..

Select all

 
<af:selectManyCheckbox value="#{bean.aValue}" required="yes"> 
  <f:selectItem itemLabel="Option1" itemValue="1"/> 
  <f:selectItem itemLabel="Option2" itemValue="2"/> 
  <f:selectItem itemLabel="Option3" itemValue="3"/> 
  <f:selectItem itemLabel="Option4" itemValue="4"/> 
</af:selectManyCheckbox> 
do not afford it in your bean like this ..

Select all

 
//Coloca dentro do seu getAValue() 
List aValue = new ArrayList(); 
aValue.add("1"); 
aValue.add("3"); 
]
this and to find out how the component works ne .. has to know what he expects .. hence and only you popular in your way dynamically
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests