CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [Resolved] Change text link to button

Print topic Send  topic

Author Message
raknuth


Posts: 67
Posted: 01/05/2011, 8:03 PM

Hi. I built a page using the Application Builder. Two pages are built - a _list page and a _maint page. On the _list page, at the bottom of the Grid, there is a text link for creating a new record (it redirects the user to the _maint page).

I wish to change that text link to a button link. If I leave the text link in place and create a button with an onclick() event that performs a window.location.href, the button works. But once I delete the text link, the supporting code appears to vanish and the button ceases to work.

Is there a way to convert the text link to a button link?

Thank you.
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 01/06/2011, 3:27 AM

I Think I know what you mean, that link is kind of weird, donīt you? Well i havenīt tried to change it to a button because the reason than you told when you change it to a button itīs stop working, maybe a possible solution would be create the button as you said and hide the link so this way the button will keep working, by hide the link you can do it via Javascript.

Try to append this to the html link code ---> style="display: none;"
_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
andy


Posts: 183
Posted: 01/06/2011, 7:04 AM

I got it to work in one of my applications, but it was a bit of a workaround and didn't work consistently so I ended up reverting to using a text link.

However, you can always create an Image link. Create a button image in the same style as your other buttons and use that as your button. It probably won't have button down/ button up behaviour like a real button but more importantly you will have access to the link's Href Source properties and Parameters.

_________________
Andy

RAD tools for rich UI controls:
http://www.koolphptools.com
View profile  Send private message
raknuth


Posts: 67
Posted: 01/06/2011, 2:54 PM

Thanks for the responses. Here is my solution:

The 'Add New' text link is tied to supporting PHP code. I tried (and failed) to track down all of the related code. Since I could not risk deleting the 'Add New' link, I decided to hide it in this manner:

1 - switch to the HTML view.
2 - find the HTML that creates the 'Add New' text link.
3 - find the 'id' parameter and copy its value into the clipboard.
4 - switch back to the Design view.
5 - place the insertion point to the right of the 'Add New' link.
6 - on the HTML tab of the Toolbox, click on 'Button'.
7 - click on the new button.
8 - change the following button properties:
* class = Button
* id = (the value that you copied into the clipboard in step 3)
* name = btnAddNewRecord
* value = Add New Record
* onclick = window.location.href='{tablename_Insert_Src}' (where 'tablename' = the name of the table upon which the form is based)
9 - switch to the HTML view
10 - find the HTML that creates the 'Add New' hyperlink. Remark it out so that it does not render when the page is presented in the browser.
11 - save, publish and test the page.
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 01/07/2011, 11:06 AM

Iīll try it, is a good thing to customize the pages instead of the standard version.

Quote raknuth:
Thanks for the responses. Here is my solution:

The 'Add New' text link is tied to supporting PHP code. I tried (and failed) to track down all of the related code. Since I could not risk deleting the 'Add New' link, I decided to hide it in this manner:

1 - switch to the HTML view.
2 - find the HTML that creates the 'Add New' text link.
3 - find the 'id' parameter and copy its value into the clipboard.
4 - switch back to the Design view.
5 - place the insertion point to the right of the 'Add New' link.
6 - on the HTML tab of the Toolbox, click on 'Button'.
7 - click on the new button.
8 - change the following button properties:
* class = Button
* id = (the value that you copied into the clipboard in step 3)
* name = btnAddNewRecord
* value = Add New Record
* onclick = window.location.href='{tablename_Insert_Src}' (where 'tablename' = the name of the table upon which the form is based)
9 - switch to the HTML view
10 - find the HTML that creates the 'Add New' hyperlink. Remark it out so that it does not render when the page is presented in the browser.
11 - save, publish and test the page.

_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 04/29/2011, 3:14 AM

Hi Raknuth,

Iīve been checking out this thread, on one of the pages, thereīs a grid with a link called "new record" I think iīm gonna change it to a button, Iīve release than this link is just a tag with an href source, on this href source is loaded the current page, so this means than when the user
clicks on new record the current page is re-loaded and ready to fill a new record, what I donīt really know if than the fact of changing this link afects to the insertion process of new records.






_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 04/29/2011, 3:39 AM

As I though this link has no connection to the php code server, so itīs possible to delete it and create a button add new record which reloads the current page, but ŋWhat happen with the grid links placed on the left side?
_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
raknuth


Posts: 67
Posted: 04/29/2011, 8:35 AM

Good morning, CodeChargeMVP. To which grid links are you referring?

If you use the Application Builder to build a Search form, Grid, and Record form, the Search and Grid are placed on a page named tablename_list and the Record form is placed on tablename_maint. These pages are 'joined at the hip' by PHP code.

The original 'Add New' text link on the tablename_list page contains a hyperlink to {tablename_Insert_Src}. This PHP variable resolves to tablename_maint. The 'Add New' text link also contains an ID and Name that are referenced in PHP code.

Now my routine is pretty simple and easily replicable:
* click into HTML view.
* remark the text link.
* create the HTML button (not a Form button).
* edit the ID, Name, Class and Value properties to match those of the text link.
* create an onclick event as follows: onclick="window.location.href='{opportunities_Insert_Src}'"
* delete the text link.

All of the supporting PHP appears to work and the button functions as expected. It does not affect anything else on either page.
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 05/05/2011, 12:15 PM

Iīve also change the link than appear on the left side of the grid by a button which makes the same behaviour showing the id unique row value.

Quote CodeChargeMVP:
As I though this link has no connection to the php code server, so itīs possible to delete it and create a button add new record which reloads the current page, but ŋWhat happen with the grid links placed on the left side?

_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 05/06/2011, 5:15 AM

Hello raknuth,

What I was meaning was somenthing like this link:

http://examples.codecharge.com/ExamplePack/MultiColumnP...nPrimaryKey.php

I changed the "add new text link" and the "primary key link" by buttons,in my project the primary keys are autonumerics so this way seems more professional I think.

Quote raknuth:
Good morning, CodeChargeMVP. To which grid links are you referring?

If you use the Application Builder to build a Search form, Grid, and Record form, the Search and Grid are placed on a page named tablename_list and the Record form is placed on tablename_maint. These pages are 'joined at the hip' by PHP code.

The original 'Add New' text link on the tablename_list page contains a hyperlink to {tablename_Insert_Src}. This PHP variable resolves to tablename_maint. The 'Add New' text link also contains an ID and Name that are referenced in PHP code.

Now my routine is pretty simple and easily replicable:
* click into HTML view.
* remark the text link.
* create the HTML button (not a Form button).
* edit the ID, Name, Class and Value properties to match those of the text link.
* create an onclick event as follows: onclick="window.location.href='{opportunities_Insert_Src}'"
* delete the text link.

All of the supporting PHP appears to work and the button functions as expected. It does not affect anything else on either page.

_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright Đ 2003-2004 by UltraApps.com  and YesSoftware, Inc.