Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

More Button in Subform Challenges

Post Reply
dotburn
Posts: 2
Joined: Fri Oct 23, 2015 4:18 pm

More Button in Subform Challenges

Unread post by dotburn »

My problem also includes the need to continue to nest subforms to subforms (ie parent object has n number of child objects. Each Child Object has number of children. I was hoping place a button in the subform which then takes you to the browse screen for the third level.

When I include the form for the Button Object of the subform. when I click it opens the edit window and not the browse. I have yet to fix the passed in Record ID of the parent object
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: More Button in Subform Challenges

Unread post by admin »

dotburn,

The way to do this is update a field on the Edit Form with the Child's id on the button's onfocus event (before the browse opens).

Then set the button's Default Filter for Browse.
button1.PNG

Code: Select all


function set_child_filter(t){
    
    var p = t.getAttribute('data-prefix');
    var v = $('#'+p+'_nuPrimaryKey').val();
    
    if(v == ''){
        alert('This child has not been saved');
        $('#the_id').val('______________');   //-- filters everything 
    }else{
        $('#the_id').val(v);
    }
}

button2.PNG
Capture3.PNG
Getting this..
Capture2.PNG
Steven
You do not have the required permissions to view the files attached to this post.
dotburn
Posts: 2
Joined: Fri Oct 23, 2015 4:18 pm

Re: More Button in Subform Challenges

Unread post by dotburn »

OK, I am quite new at this so bear with me please.
Not sure how to post screen shots either...

I added the java code for the function on the form hosting the first subform. Should data-prefix be substituted with the element name for the primary key driving the first subform? Currently this system assigned key is not in the first displayed subform.

I added the event to the button object displayed in the first subform as well as setting the default browse to #the_id# as directed.

The behavior upon clicking the button is to now bring up the browse version of the second child as desired, but the display is empty not showing the children for the selected parent.

Thanks for the help so far.
Post Reply