how to show a column when we choose one value
Question

Hi All,

I make a web traditional application. So, i have an editable table. in there, there is a dropdown widget. In the dropdown value, there is a value called others. if we choose others in that dropdown list, I want to show 1 column (called others)automatically that at first this column is in hide mode, so we can input it in free text. how to make like that? how to show that 1 column automatically when we choose others from the dropdown list? for default, the column called others is hide.

Thanks


Regards,

RKT

mvp_badge
MVP

Hi Riestra,

If your user case is to show or hide a column depending on a condition you can always use the extended properties of your table cell.

See here:

If I set this style property I can define if my column you appear or not using inline CSS.

Remember to apply this style in both, Header and Cell, of your table.

This way toggling the show columns option in the right top corner you can have this behavior:


However, if you are using a table that will not always have this column for all cells.
I recommend you to use an 'IF widget' linked to the option selected in dropdown to show or not a input.

Something like this:

This way if you select show in the drop down a field will appear for you to type whatever you want:


I'm attaching the .oml sample that I used for the prints.
Hope it can help you.

Let me know if you don't understand any part of the code, and I can explain in more details.

Cheers and Regards,

RR :)

ShowHideColumnDependOnCondition.oml

Hi Raphael Ranieri,

In your sample, u are using table record, right? and you use local variabel to be the data source. Can I make the same way in editable table with using aggregate for the data source ? Because when I did with the same way like you tell me about using if widget for not show in all of the cell, that can not work. that can work if I already save it and do the refresh page. 

Thanks

Regards,

RKT


Sure, you can. It doesn't make any differences.

The style in table record is correct implementation, if widget is just applied to the data cell, not header cell

Hi Shingo Lam,

Hmm
But it can't work. it can work if I refresh the page first.

Do you know why?

Thanks

Regards,

RKT


mvp_badge
MVP

Hi Riestra,

Maybe you are using in your 'If ' condition the value of your agreggate and not the one from your table records. When you set an agreggas a source of a editable table, when in expression editor you can select the records from the table.

Hi Raphael Ranieri,

I'm using the value from my table record. But, it's not work. Here's I give some screen capture of my code. for the ajax refersh, I already try to refresh the IF Widget, but it still can't work. I already try to refresh the text field that hide at first, it's still can't work too, I already try to put container for the IF Widget, but it still can't too.


Thanks

Regards,

RKT

mvp_badge
MVP

Riesta I think you shouldn't have this if inside your action, because if you are changing an item from POS_0045 to another one, you should also refresh the IF to hide the Input.

The code seems correct anyway. Just make sure this action is on the OnChange of the dropdown.

What can be happening is the ID is not POS_0045. 

Did you try to Debug?

Is the Ajax Refreshed really triggered?

Hi Raphael Ranieri,

at first I didn't use the IF in that action. but it can not work too. and the onChange action I put it in the dropdown too. Here I attach the OML. in screen OnlyOneFieldInsideSameCell2.

Thanks

Regards,

RKT


ShowHideColumnDependOnCondition.oml

Hi Riesta,

After filling in the Name attributes in the productsolution Static Entity, it works. Nothing else was changed. I attached the working OML for you.

ShowHideColumnDependOnConditionmodified.oml

Hi Monique de Vos,

I already make the same way to my original code. and I already make like from OML that u sent. But it's not work too. In my original code, the product solution is not using static entity, but only entity. 

But in my original code, I already make it like this, like in that OML. But, it can not work. 

Is there any wrong code ?



This is the logic action that I put in the combo box destination


Thanks

Regards,

RKT

Hi Riesta,

Since you're working with a Traditional Web application, you'll need to add a Screen Action to make it work. Set the OnChange of the dropdown to that Screen Action. In the Screen Action, check if the selected value (of the Current record) is 'Other' (if False, End). If the selected value was 'Other', use Ajax Refresh to refresh your table (or at least refresh the Hide column).

Hi Monique de Vos,

I already make like what u told me, but it can not show directly. It can be show if I refresh the page first.

Thanks

Regards,

RKT


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.