Ajax Refresh is preventing a button to show

Hi all,


I'm a beginner here, working my way on the Assignment for web applications, the Bookings Assignment which I guess most of you know.


So, I'm trying to do an Ajax Refresh on a button that should display one expression and another button called "Book Room".


Both the expression and the Book Room button have an If assignment, so that they are only visible when the RoomId is not Nullidentifier.


Removing the If from the expression and setting it's visible property solves the problem.


But, removing the If from the Book Room button still doesn't solve my problem. There's no way I can make this button appear on my screen! :'(


I'm pretty sure I'm missing something really basic here, but can't get to it so far.


Any ideas, please?

Thanks

Hi,

Is the button that does not show maybe not s child from the widget for which you do the Ajax refresh? 

Regards,

Dsniel

Solution

Hi Ana, 

Book Room button must be visible only if:

A) you are doing a NEW booking. 

B) you already chose a room. 

Só, the first condition is easy. What tells you, in BookingDetail page, if you are doing a booking or not, is the BookingId input parameter. If its value is equal to NullIdentifier(), it is a new booking. 

The second is trickier, as it will depend on where are you storing the Room.Id returned by the query executed in the screen action called by the button Get Available Room. 

As you need the room I'd to be set in the record used to create a booking (the booking needs to have a connection with the room being booked), you can do like this:

When you execute the the Get Available Room Screen Action, you can use an assign to save the Room.Id returned in the SQL into the BookingForm.Record.Booking.RoomId. 

Now, you can use BookingForm.Record.Booking.RoomId to identify if you already choose a room, as it will be NullIdentifier() before choosing. 

The book room button must have its visible set to true, and the IF around it must have a name, and the following condition:

BookingForm.Record.Booking.RoomId <> NullIdentifier() and BookingId = NullIdentifier()

Now you just use an AjaxRefresh inside the Get Available Room screen action, as a last node before end. 

Hope this will help you solve the issue. 

If you need help to understand something, please, just say it. 

Cheers 

Solution

Hi,


Thanks for your replies.


Apparently was only missing a second Ajax Refresh for the Book Room to show again :)


Now I'm starting a new battle, but will try to solve it on my own for now :D