I have a situation where I need to show a secondary combobox masked with a dropdown select (basically populating the 2nd combo box with a filter of the picked option of the first combo).

The problem is when I do this and I make the 2nd combo, again, masked with a dropdown select to show up, via an Ajax Refresh I al ways get an error of sorts :" An exception has occured in the client script. Error: Cannot read property 'hasAttribute' of null".

Has anyone went trough similar issues?

I tried Running a javascript with something to just .show() or .hide() the wrapper containing the 2nd combo but that way it won't be populated with the options

Bernardo Pinheiro wrote:

I have a situation where I need to show a secondary combobox masked with a dropdown select (basically populating the 2nd combo box with a filter of the picked option of the first combo).

The problem is when I do this and I make the 2nd combo, again, masked with a dropdown select to show up, via an Ajax Refresh I al ways get an error of sorts :" An exception has occured in the client script. Error: Cannot read property 'hasAttribute' of null".

Has anyone went trough similar issues?

I tried Running a javascript with something to just .show() or .hide() the wrapper containing the 2nd combo but that way it won't be populated with the options

Hi Bernando,

Last month I was facing a similiar problem and found a way to work around this by creating 2 aggregates in preparation from the same data and connect them with 2 different forms (so 2 different variables), in combination with ajax refresh if one combobox changes.

I hope this helps for you.


Best wishes,


Khadija


khadija wrote:

Bernardo Pinheiro wrote:

I have a situation where I need to show a secondary combobox masked with a dropdown select (basically populating the 2nd combo box with a filter of the picked option of the first combo).

The problem is when I do this and I make the 2nd combo, again, masked with a dropdown select to show up, via an Ajax Refresh I al ways get an error of sorts :" An exception has occured in the client script. Error: Cannot read property 'hasAttribute' of null".

Has anyone went trough similar issues?

I tried Running a javascript with something to just .show() or .hide() the wrapper containing the 2nd combo but that way it won't be populated with the options

Hi Bernando,

Last month I was facing a similiar problem and found a way to work around this by creating 2 aggregates in preparation from the same data and connect them with 2 different forms (so 2 different variables), in combination with ajax refresh if one combobox changes.

I hope this helps for you.


Best wishes,


Khadija


Hi Khadija,

Any chance you can supply with visual aid or maybe the oml with example? Got confused there !


Bernardo Pinheiro wrote:

khadija wrote:

Bernardo Pinheiro wrote:

I have a situation where I need to show a secondary combobox masked with a dropdown select (basically populating the 2nd combo box with a filter of the picked option of the first combo).

The problem is when I do this and I make the 2nd combo, again, masked with a dropdown select to show up, via an Ajax Refresh I al ways get an error of sorts :" An exception has occured in the client script. Error: Cannot read property 'hasAttribute' of null".

Has anyone went trough similar issues?

I tried Running a javascript with something to just .show() or .hide() the wrapper containing the 2nd combo but that way it won't be populated with the options

Hi Bernando,

Last month I was facing a similiar problem and found a way to work around this by creating 2 aggregates in preparation from the same data and connect them with 2 different forms (so 2 different variables), in combination with ajax refresh if one combobox changes.

I hope this helps for you.


Best wishes,


Khadija


Hi Khadija,

Any chance you can supply with visual aid or maybe the oml with example? Got confused there !


Hi Bernando,

Could you give an example of what you exactly did (how is the entitity you are filling build up?), maybe I can explain it a bit easier in more in detail with that.


Best wishes,


Khadija


khadija wrote:

Bernardo Pinheiro wrote:

khadija wrote:

Bernardo Pinheiro wrote:

I have a situation where I need to show a secondary combobox masked with a dropdown select (basically populating the 2nd combo box with a filter of the picked option of the first combo).

The problem is when I do this and I make the 2nd combo, again, masked with a dropdown select to show up, via an Ajax Refresh I al ways get an error of sorts :" An exception has occured in the client script. Error: Cannot read property 'hasAttribute' of null".

Has anyone went trough similar issues?

I tried Running a javascript with something to just .show() or .hide() the wrapper containing the 2nd combo but that way it won't be populated with the options

Hi Bernando,

Last month I was facing a similiar problem and found a way to work around this by creating 2 aggregates in preparation from the same data and connect them with 2 different forms (so 2 different variables), in combination with ajax refresh if one combobox changes.

I hope this helps for you.


Best wishes,


Khadija


Hi Khadija,

Any chance you can supply with visual aid or maybe the oml with example? Got confused there !


Hi Bernando,

Could you give an example of what you exactly did (how is the entitity you are filling build up?), maybe I can explain it a bit easier in more in detail with that.


Best wishes,


Khadija



Lets say we Have an Entity A filled with subjects, by picking one I then proceed to make the 2nd combo (fed by ENtity B , which consists of all the subthemes, filtered by the Theme.id picked on combo1). I first refresh the data from Entity B aggregate and then the Widgets with Ajax Refresh. I need to this with in multiple situations but the idea is 99% this.

Nuno Gonçalo Pereira wrote:

See it: https://www.outsystems.com/forums/discussion/45289/how-to-create-cascading-combo-boxes/

Best Regards,

Nuno Pereira

Hi Nuno, Thanks for answering but my problem isn't filtering it just using the comboxes. I'm using dropdown selects widgets as masks for my combobox. like select2 on SilkUI


Bernardo Pinheiro wrote:

khadija wrote:

Bernardo Pinheiro wrote:

khadija wrote:

Bernardo Pinheiro wrote:

I have a situation where I need to show a secondary combobox masked with a dropdown select (basically populating the 2nd combo box with a filter of the picked option of the first combo).

The problem is when I do this and I make the 2nd combo, again, masked with a dropdown select to show up, via an Ajax Refresh I al ways get an error of sorts :" An exception has occured in the client script. Error: Cannot read property 'hasAttribute' of null".

Has anyone went trough similar issues?

I tried Running a javascript with something to just .show() or .hide() the wrapper containing the 2nd combo but that way it won't be populated with the options

Hi Bernando,

Last month I was facing a similiar problem and found a way to work around this by creating 2 aggregates in preparation from the same data and connect them with 2 different forms (so 2 different variables), in combination with ajax refresh if one combobox changes.

I hope this helps for you.


Best wishes,


Khadija


Hi Khadija,

Any chance you can supply with visual aid or maybe the oml with example? Got confused there !


Hi Bernando,

Could you give an example of what you exactly did (how is the entitity you are filling build up?), maybe I can explain it a bit easier in more in detail with that.


Best wishes,


Khadija



Lets say we Have an Entity A filled with subjects, by picking one I then proceed to make the 2nd combo (fed by ENtity B , which consists of all the subthemes, filtered by the Theme.id picked on combo1). I first refresh the data from Entity B aggregate and then the Widgets with Ajax Refresh. I need to this with in multiple situations but the idea is 99% this.

Hi Bernando,


Could it be you are ajax refreshing the first widget that you used to select a value as well? Or do you only refresh the second combobox? the select2 tool shouldn't change the it, if you use it with a working combobox. 


Hi Bernardo,

Can you replicate that error in a small example and post it here so we can check it?

Regards,

Marcelo