reactive web : How can I make it work that the form is only seen if I press the new

Hello, 


IM stuck at this point.
I use now the null - indentifier as a switch to or a detail screen is seen or not. 

Now I have this in mind.that I want to show the input form only if someone pressed the new customer.

Otherwise if nothing is chosen , the message must be shown that someone should choose a person ior if a person is chosen , the details for that person is shown.


Can this be done with the current setup ? 


Roelof


HI Roelof,

Just one clarification , you want to use the same detail block for adding new customer and updating existing one ?

What i see is you only have update action available for employees in detail block. You use bootstrap to upload employee data and there is no screen to add new customer here .


Regards,

-PJ- 


HI Roelof,

you need to take one input parameter when click on items and remove some condtion on action.

i have update your oml. check this 


Regards

Rahul Sahu

yes.  

if it is possible I could use the same  block but I do not see how I can make the difference between a edit one or a add one. 


Normally you would use a nullidentifier but that one is already used to make the difference between if a user is selected or not.  And I tried  to use a number so something like  selected = 1  but then I see a type error. 


Edit 1 : 

What im looking for is pseudo code is this: 

- did the new client button is clicked.

- if so, show the input form 

- if not. check if selectedItem is not the null identifier.

- if so, show the details block

- if not so, show a message that the user needs to select a person or click the button to enter a new customer. 


Roelof


I do not want to look impatience.But is there nobody who can help me to make this idea work or  think what is a better way to make this work without using multiple screens for adding and editing if that is possible

Processing Upload...

Hi Roelof,

I made few changes in your module , please run and check if this is something you are looking for ?


Regards,

-PJ-

Hi Roelof,

create a new boolean local variable

Wrap the block inside an if widget that checks that variable or the selectedemployeeid 


When clicking the button set that variable to True.

Is something like this what you are looking for?


Cheers,

Tiago Simões





Tiago Simões wrote:

Hi Roelof,

create a new boolean local variable

Wrap the block inside an if widget that checks that variable or the selectedemployeeid 


When clicking the button set that variable to True.

Is something like this what you are looking for?


Cheers,

Tiago Simões






HI Tiago,

I followed the similar approach in the oml and is working as expected ! I hope that will help him !


Regards,

-PJ-

@Pramod Jain


I want to look at your changes but on some wierd ways I still see processsing upload instead of a oml file 

Yeah i just realize , it is still showing Processing upload to me , trying to upload once again here.


Regards,

-PJ-

Solution

I can see it uploaded now , please download and see if it is any help for you.

Its 12:35 AM my time and i may not reply you after this until tomorrow my morning ,but hoping the changes i made will help you achieving your goal.

Regards,

-PJ-

Solution

Thanks a lot and no problem but it seems that your approach is what am looking for the whole day. 

So I make you last post as mark as solution

Great that I can be your help !


Regards,

-PJ-

one question.


Am I correct that if I make a new customer I still need to implement the save action. 

When I try it , I do not see it saved

Hi Roelof,

Yes i saw your code and there is nothing to create a new customer , you have to keep the logic there  for creating a customer and you can use same code to create or update the customer (by using CreateOrUpdate action instead of just the Update action which is currently there).

One more thing even in edit mode you are not showing customer name which will be require in case of creating new customer. 


Regards,

-PJ-


Oke, 


and it is correct that the name  cannot be entered right now. 

IM experimenting with a idea and have some work to do on making things work properly. 

Thanks for the help.


Edit1 : I found a  bug in our code.

When you click two times on a name. The screen appears where a new customer can be added.

That looks not good.   Hopefully I or we both can find it and solve it otherwise this idea is not workable.



Found it and tried another idea  that I have.

But I think this is not maintainable anymore so I think I have to look for another way to make this work without using the list and form way of displaying things. 


Roelof


Hi Roelof,

Let me have look on the oml and i will try to provide you the best approach .


Regards,

-PJ-

HI Roelof,

Please find attached the latest oml , i have created another block EmployeeDetail2 and used in the Employees page .You can create new employee or edit existing employee from the same block.

I kept all the fields of the entity for edit and new case.


Regards,

-PJ-

Thanks, 

I begin to wonder if I really need a reactive website for this.
When its ready it can be used to make invoices, where I have in mind that if you choose the person and the item all the other things like totalprice per llne and totalprice and total tax will be automatically calculated and updated. 


or is in your opion this app still a reactive app?

Oops, still a bug somewhere : 


when are you getting this error while adding a new customer or updating the old one? I am looking into the oml also.


Regards,

-PJ-

quick answer. IM getting this when I want to add a new customer. 

Chancing a customer is not a problem.

Roelof Wobben wrote:

Thanks, 

I begin to wonder if I really need a reactive website for this.
When its ready it can be used to make invoices, where I have in mind that if you choose the person and the item all the other things like totalprice per llne and totalprice and total tax will be automatically calculated and updated. 


or is in your opion this app still a reactive app?

Hi Roelof,

Reactive web are the need of the time and whatever web application we are building from Outsystems are  now will be the reactive web app until you have very strong reason to choose traditional web app.

Regards,

-PJ-


oke


Maybe then this idea to use something like this is not workable.

I get more and more the feeling we need to use a lot of workarounds to make things work.


If you had to make a invoice app how would you do this.

Just use a list to display all the customers and a screen for adding and editing users.

I then wonder if this  is then still reactive


Edit 1: 


I was doing some surfing and I liked this idea of a show/edit screen 



I only have to think how I can make that work for adding a customer and how I then can show all customers.