Using df_display with insertFromBarCode.html

A place for users and developers of the Xataface to discuss and receive support.

Postby siainmi » Fri Aug 10, 2007 6:52 am

Hi,
It possible to use df_display with insertFromBarCode.html? For example:

$mioPar= array('relationship'=>'Somministrazioni','table' => 'anagrafica','IDAssistito' => $_POST['assistito'],'cursor'=>1 );
df_display($mioPar,"insertFromBarCode.html");

This get me an error, is correct? I can do it?

Thx for help!
siainmi
 
Posts: 30
Joined: Wed Dec 31, 1969 5:00 pm

Postby siainmi » Fri Aug 10, 2007 6:56 am

Sorry, I using my template name.

the code is:
$mioPar= array('relationship'=>'Somministrazioni','table' => 'anagrafica','IDAssistito' => $_POST['assistito'],'cursor'=>1 );

df_display($mioPar,"Dataface_Related_Records_List.html");

or if I using template, code of template insertFromBarCode.html:

{use_macro file="Dataface_Related_Records_List.html"}
{/use_macro}

Apologise for my mistake
siainmi
 
Posts: 30
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Mon Aug 13, 2007 8:53 am

It would help if you let me know what errors it gave you.

The first option would work (df_display($mioPar,"insertFromBarCode.html");) as long as you have your insertFromBarCode.html file in your application's templates folder.

The second option you mentioned is a little bit more sketchy, because you have to make sure that you are passing the correct inputs to the Dataface_Related_List.html template - and I don't recall off the top of my head what those might be .Ê You would need a little bit of trial and error.Ê

What are you trying to achieve here?

-Steve

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby siainmi » Tue Aug 14, 2007 2:04 am

Hi!
the file action.ini is:
[insertFromBarCode]
template=insertFromBarCode.html

The file insertFromBarCode.html in templates folder is:
{use_macro file="Dataface_Related_Records_List.html"}
{/use_macro}

The code that I'm using to load insertFromBarCode.html
$mioPar= array('relationship'=>'Somministrazioni','table' => 'anagrafica','IDAssistito' => $_POST['assistito'],'cursor'=>1 );
df_display($mioPar,"insertFromBarCode.html");

The error msg is:
Fatal error: No relationship specified for related list.On line 764 of file E:\Programmi\OCS Inventory NG\xampp\htdocs\dataface\Dataface\SkinTool.php in function printStackTrace()
On line 12 of file E:\Programmi\OCS Inventory NG\xampp\htdocs\dataface\Dataface\templates_c\dataface\%%4F^4F5^4F541920%%Dataface_Related_Records_List.html.php in function related_list(array(),Dataface_SkinTool Object)
On line 1251 of file E:\Programmi\OCS Inventory NG\xampp\htdocs\dataface\lib\Smarty\Smarty.class.php in function include(E:\Programmi\OCS Inventory NG\xampp\htdocs\dataface\Dataface\templates_c\dataface\%%4F^4F5^4F541920%)
On line 1101 of file E:\Programmi\OCS Inventory NG\xampp\htdocs\dataface\lib\Smarty\Smarty.class.php in function fetch(Dataface_Related_Records_List.html,,,1)
On line 265 of file E:\Programmi\OCS Inventory NG\xampp\htdocs\dataface\Dataface\SkinTool.php in function display(Dataface_Related_Records_List.html)
On line 626 of file E:\Programmi\OCS Inventory NG\xampp\htdocs\dataface\Dataface\SkinTo in E:\Programmi\OCS Inventory NG\xampp\htdocs\dataface\Dataface\SkinTool.php on line 764

thx for all, Apologise for my English !!
siainmi
 
Posts: 30
Joined: Wed Dec 31, 1969 5:00 pm

Postby siainmi » Tue Aug 14, 2007 2:07 am

Sorry, missing file relationship.ini here is it:

[Somministrazioni]
__sql__="select * from somministrazioni where Assistito='$IDAnagrafica'"
actions:addexisting=0
action:permission=edit
siainmi
 
Posts: 30
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Tue Aug 14, 2007 9:15 am

Unfortunately what yoiu are trying to do is not really a recommended approach.Ê Using the Dataface_RelatedRecordsList.html template for an action other thanÊ the Dataface relationship view may have complications (and appears to have complications judging by your error message).

What are you trying to achieve?

Are you trying to make a new action that shows the same thing as the related list?

if so, why not just use the existing related list action?

Or are you trying to do something else?

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby siainmi » Thu Sep 13, 2007 1:17 am

Hi, I have create an action for insert into relative table some record, it works, but I want to return
to RelatibeRecordsList view for see imediatly the records that was append into relative table.

Thank for help!
siainmi
 
Posts: 30
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Thu Sep 13, 2007 9:21 am

In your action you should be able to forward directly to the page that you want... you just have to tell it the URL to the related record page.

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 9 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved