Show hide fields

Posted by ionacaerex on 01-Jul-2016 00:40

I am new to Rollbase and have been trying to get this to work for days. Any ideas much appreciated.

Code sample below. Trying to make the property type field a condition on showing or hiding another field i.e. property-purchase-value.

Am I missing something - its also added to the 'on change' action for the view.

Thanks

<script>

var Product = rbf_getpicklistcode("property_type");

if (Product == "Flat") {
$("#rbi_L_property_purchase_value").show();
$("#rbi_F_property_purchase_value").show();
} else {
$("#rbi_L_property_purchase_value").hide();
$("#rbi_F_property_purchase_value").hide();
}

</script>

All Replies

Posted by Chandrasekhar Gontla on 01-Jul-2016 01:24

Hi ionacarex,

We have in built client side api to show or hide field.

Could you try rbf_showOrHideField(fieldName, showField, doNotHideResponsiveColumn) instead of using jquery to show or hide field

For details, please refer the following doc link

documentation.progress.com/.../

Thanks and Regards,

Chandu.

Posted by ionacaerex on 01-Jul-2016 11:52

Ive tried it again...

Here is the new code...included in  a script section at the very top of my page (which includes tabs)

Still not working :

<script>

rbf_showOrHideField(advanced_amount, false):

</script>

Posted by ionacaerex on 01-Jul-2016 12:23

FYI, I dont seem to be able to get any event handlers to activate - at field or page level - is there a generic problem or setting issue maybe?

Thanks

Posted by Ruben Dröge on 02-Jul-2016 01:30

Probably just a typo in this forum, but it should be a semi-colon instead?

Posted by ionacaerex on 02-Jul-2016 03:25

Thanks but still no joy :(.

This must be a setting somewhere. I have also changed to ie from Chrome but no joy again...

The script is in a script section at the top of the page and within the 'on load' section of the view page .

This is very frustrating and holding up any further progress with the tool.......HELP....

Its my objective to crack it today - any help and advice much appreciated......

Posted by satyanarayana sunku on 02-Jul-2016 03:28

Hi ionacarex,

Please modify the code in below way. and invoke showOrHide() function in events of field.

<script>

function showOrHide()

{

rbf_showOrHideField(advanced_amount, false);

}

</script>

Posted by ionacaerex on 02-Jul-2016 03:40

Thanks - but guess what - still not happening :(

When you say invoke showOrHide in the events field, do you mean cut and paste the above code?

Thanks

Posted by satyanarayana sunku on 02-Jul-2016 04:38

No. Just place the showOrHide() in Field Events. It will call the showOrHide() function in script component and hide the respective field.

Posted by ionacaerex on 02-Jul-2016 04:51

Sorry to be stupid here but I am a non techie...can you clarify what you mean by field events - is this adding it to the Onload of the page or adding it to the events element of the field itself - if the field on what event type?

Thanks

Posted by satyanarayana sunku on 02-Jul-2016 05:08

Hi,

I have attached one sample application. After Import please click on "New DemoObj:. Notice that one growl message occur and also notice that 'startDate' field is hidden. 

I have placed the code in "Design this Page-->script component. And invoked functionin onLoad of the "New DemoObj" page.

Hope this helps.[View:/cfs-file/__key/communityserver-discussions-components-files/25/DemoApp_5F00_v2.xml:320:240]

Posted by ionacaerex on 02-Jul-2016 06:02

Hi  satyanarayana/sunku

I appreciate all your help and patience on this.

It is now very frustrating as I have imported your demo app and it works perfectly.

My thoughts are now that my application is not set-up e.g. have I turned scripting/event off by mistake or something.

The only other difference to your app is that I am using tabs on the screen I am trying to apply the script to and that it is an enquiry screen rather than an edit screen - would this make any difference.

I have copied script and placed in same place within the page design. I have not set up any event handlers as I checked your demo app and couldn't find any - please advise if IO should and where?

Thanks again ....

Posted by ionacaerex on 02-Jul-2016 06:30

HI ITS WORKING :)

I just re read your instructions and added the onload function and bingo.

Next on to conditioning the field based on the value of a drop down field - any info/posts on how to do this much appreciated.

Thanks and speak soon :)

Posted by Santosh Patel on 02-Jul-2016 08:54

Dependent picklists might be of help, based on what I understood from your statement.

documentation.progress.com/.../index.html

Can you elaborate on what kind of conditioning you are looking for?

This thread is closed