NetTalk Central

Author Topic: Redirect to page after drop list  (Read 4508 times)

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Redirect to page after drop list
« on: September 10, 2012, 09:49:10 AM »
Hi,

How to redirect to a page after drop list

At.
Walter - SOFTVALE

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Redirect to page after drop list
« Reply #1 on: September 10, 2012, 05:43:20 PM »
try something like this embedded

p_web.Script(p_web.WindowOpen('HomePage','_self'))

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: Redirect to page after drop list
« Reply #2 on: September 11, 2012, 06:14:19 AM »
Hi Kevin,

I´ve put it into routines/validade/mydropfield and nothing happened.

That drop field is "standalone", it is on form that dont have OK button, so i want to validade it just after select my option. It is Immediate validation Yes

Thanks
Walter - SOFTVALE

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Redirect to page after drop list
« Reply #3 on: September 11, 2012, 06:50:41 AM »
Hi Walter,

I think you need to explain a bit more of what you're really trying to do.
Redirecting on a drop-down is a very ugly navigation method.
But do-able. But you'll need to explain what you have in mind.

cheers
Bruce

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: Redirect to page after drop list
« Reply #4 on: September 11, 2012, 12:07:52 PM »
Right,

Try it here.

http://extranet.softvale.com.br:1238

Identificador: 73371106934
Senha: walter

First
====

you can see drop list on right side of header. let´s call header drop field.
on left menu choose PAGADORIA/Pagamentos

it is data for that company. change header drop field for another company. what i want is go to start page or refresh after change company.

Second
======

you also can give me some direction for another thing using drop field in this same application.
on left menu choose PAGADORIA/Apontamentos
on drop field COMPETENCIA choose 01/2012 and on table APURAÇÕES you will see one record with CALCULO 253. nice
choose COMPETENCIA for 12/2012. now APURAÇÕES has 2 records, click each one
now, choose COMPETENCIA for 01/2012 again. you can see APURAÇÕES don´t refresh
click PAGADORIA/Apontamentos to recall form.

thanks
Walter - SOFTVALE

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Redirect to page after drop list
« Reply #5 on: September 11, 2012, 10:47:11 PM »
>>Second
>>======
>> now, choose COMPETENCIA for 01/2012 again. you can see APURAÇÕES don´t refresh

it did refresh for me. maybe you fixed this yesterday? but it seems to be working ok here...

>> what i want is go to start page or refresh after change company.

ok, what you're wanting to do is change something in the header, an have it refresh something on the screen. This is possible, very possible, but tricky. I suppose your approach of just refreshing the whole page is one way to do it, but even then you need to know what page you are currently on...

In other words, when you are on Pagamentos the Url is /CompetenciaForm and when you are on Apontamentos the url is /ApuracaoForm. So apart from anything else, if you changed the company in the header you;d need to know what URL you actually wanted to refresh.

but wait, it gets worse. There are many features you may use later on (I'm thinking about Content-Body, Popups, things like that) where refreshing the whole page would actually be a problem. Indeed what you really want to do is just refresh the browse, but again the root question there becomes "which browse".

Personally I think you're making it hard for yourself. It'll be hard to setup, and even harder to maintain. Rather place the drop onto each form - like where you have Competência: on the ApuracaoForm form.

Or, alternativly have a "select company" option in the menu, which let's them change the company (on a form) and then that form take you to some "fixed" page (like say the index page.)

which brings us back to Kevin's suggestion;
In the Validate::loc:SelecionaEmpresa routine try adding;

p_web.Script(p_web.WindowOpen('IndexPage','_self'))

Cheers
Bruce









walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: Redirect to page after drop list
« Reply #6 on: September 12, 2012, 05:05:14 AM »
Hi Bruce,

Thanks for your time. So, about "Second" i don´t know, but i´ll try other approach.

About redirect issue i´ve already try:

p_web.Script(p_web.WindowOpen('IndexPage','_self'))
and
p_web.Script('window.location.href=window.location.href;')

also i´ve put a message('hi'). the problem is, i´ve never get the "hi" window on server.
i´ll do more tests and try a specific form to choose company.

thanks a lot
Walter
Walter - SOFTVALE