1. Rômulo Sorato
  2. PowerBuilder
  3. Wednesday, 2 October 2019 18:07 PM UTC

I have two drop down that if i selected one value in the first the second drop down retrieve his rows .

I made to be optional, for example , if i selected one value in the first i don't need to select a value on the second.

The problem is that when i get the selected row on the second, the method always return the value 1 even if i don't select any row. 

Here´s the code

 

 

llrowEstado = dw_dd_estado.getRow()
lsid = dw_dd_estado.getItemString(llrowEstado,"nome")
llIdEstado = Long(lsid)

dw_dd_cidade.GetChild('nome', city_child)
city_child.SetTransObject(SQLCA)
llRowCidade = city_child.getSelectedrow(0)

parent.of_retrieve_pessoas()

if(llrowEstado > 0) then
	llIdCidade = city_child.getItemNumber(llRowCidade,"id")
if(llIdCidade > 0) then
	dw_listagem_pessoas.SetFilter("estados_estados_id = " + lsid + " and pessoas_cidade_id = " + string(llIdCidade) +" ")
	dw_listagem_pessoas.Filter()
else
	dw_listagem_pessoas.SetFilter("estados_estados_id = "+ lsid +" ")
	dw_listagem_pessoas.Filter()	

end if
end if

In this line llRowCidade = city_child.getSelectedrow(0) 

the method getSelectedrow always return 1.

So i want to know if is a way to check if user really selected a value on the second dropdow.

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 2 October 2019 18:50 PM UTC
  2. PowerBuilder
  3. # 1

Hi Rômulo;

   FWIW: I would use the ItemChanged event and an instance variable to track if both DDDW#1 and DDDW#2 were changed.

Regards ... Chris

Comment
  1. Rômulo Sorato
  2. Wednesday, 2 October 2019 18:59 PM UTC
Thanks for the solution
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 2 October 2019 21:02 PM UTC
  2. PowerBuilder
  3. # 2

Check to see if there are duplicates in the drop-down. It always returns the row number of the first occurrence if the selected row is a duplicate, even if you actually selected the second one.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.